-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Expand file tree
/
Copy pathts.snap
More file actions
346 lines (296 loc) · 7.31 KB
/
Copy pathts.snap
File metadata and controls
346 lines (296 loc) · 7.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
---
source: crates/oxc_codegen/tests/integration/main.rs
---
########## 0
let x: string = `\x01`;
----------
let x: string = `\x01`;
########## 1
function foo<T extends string>(x: T, y: string, ...restOfParams: Omit<T, 'x'>): T {
return x;
}
----------
function foo<T extends string>(x: T, y: string, ...restOfParams: Omit<T, 'x'>): T {
return x;
}
########## 2
let x: string[] = ['abc', 'def', 'ghi'];
----------
let x: string[] = [
'abc',
'def',
'ghi'
];
########## 3
let x: Array<string> = ['abc', 'def', 'ghi',];
----------
let x: Array<string> = [
'abc',
'def',
'ghi'
];
########## 4
let x: [string, number] = ['abc', 123];
----------
let x: [string, number] = ['abc', 123];
########## 5
let x: string | number = 'abc';
----------
let x: string | number = 'abc';
########## 6
let x: string & number = 'abc';
----------
let x: string & number = 'abc';
########## 7
let x: typeof String = 'string';
----------
let x: typeof String = 'string';
########## 8
let x: keyof string = 'length';
----------
let x: keyof string = 'length';
########## 9
let x: keyof typeof String = 'length';
----------
let x: keyof typeof String = 'length';
########## 10
let x: string['length'] = 123;
----------
let x: string['length'] = 123;
########## 11
function isString(value: unknown): asserts value is string {
if (typeof value !== 'string') {
throw new Error('Not a string');
}
}
----------
function isString(value: unknown): asserts value is string {
if (typeof value !== 'string') {
throw new Error('Not a string');
}
}
########## 12
import type { Foo } from 'foo';
----------
import type { Foo } from 'foo';
########## 13
import { Foo, type Bar } from 'foo';
----------
import { Foo, type Bar } from 'foo';
########## 14
export { Foo, type Bar } from 'foo';
----------
export { Foo, type Bar } from 'foo';
########## 15
type A<T> = { [K in keyof T as K extends string ? B<K> : K ]: T[K] }
----------
type A<T> = { [K in keyof T as K extends string ? B<K> : K] : T[K] };
########## 16
class A {readonly type = 'frame'}
----------
class A {
readonly type = 'frame';
}
########## 17
let foo: { <T>(t: T): void }
----------
let foo: {
<T>(t: T): void
};
########## 18
let foo: { new <T>(t: T): void }
----------
let foo: {
new <T>(t: T): void
};
########## 19
function <const T>(){}
----------
function<const T>() {}
########## 20
class A {m?(): void}
----------
class A {
m?(): void;
}
########## 21
class A {constructor(public readonly a: number) {}}
----------
class A {
constructor(public readonly a: number) {}
}
########## 22
abstract class A {private abstract static m() {}}
----------
abstract class A {
private abstract static m() {}
}
########## 23
abstract class A {private abstract static readonly prop: string}
----------
abstract class A {
private abstract static readonly prop: string;
}
########## 24
interface A { a: string, 'b': number, 'c'(): void }
----------
interface A {
a: string;
'b': number;
'c'(): void;
}
########## 25
enum A { a, 'b' }
----------
enum A {
a,
'b'
}
########## 26
module 'a'
----------
module 'a';
########## 27
declare module 'a'
----------
declare module 'a';
########## 28
a = x!;
----------
a = x!;
########## 29
b = (x as y);
----------
b = x as y;
########## 30
c = foo<string>;
----------
c = foo<string>;
########## 31
d = x satisfies y;
----------
d = ((x) satisfies y);
########## 32
export @x declare abstract class C {}
----------
export @x declare abstract class C {}
########## 33
div<T>``
----------
div<T>``;
########## 34
export type Component<Props = any> = Foo;
----------
export type Component<Props = any> = Foo;
########## 35
export type Component<
Props = any,
RawBindings = any,
D = any,
C extends ComputedOptions = ComputedOptions,
M extends MethodOptions = MethodOptions,
E extends EmitsOptions | Record<string, any[]> = {},
S extends Record<string, any> = any,
> =
| ConcreteComponent<Props, RawBindings, D, C, M, E, S>
| ComponentPublicInstanceConstructor<Props>
----------
export type Component<
Props = any,
RawBindings = any,
D = any,
C extends ComputedOptions = ComputedOptions,
M extends MethodOptions = MethodOptions,
E extends EmitsOptions | Record<string, any[]> = {},
S extends Record<string, any> = any
> = ConcreteComponent<Props, RawBindings, D, C, M, E, S> | ComponentPublicInstanceConstructor<Props>;
########## 36
(a || b) as any
----------
(a || b) as any;
########## 37
(a ** b) as any
----------
(a ** b) as any;
########## 38
(function g() {}) as any
----------
(function g() {}) as any;
########## 39
import defaultExport from "module-name";
import * as name from "module-name";
import { export1 } from "module-name";
import { export1 as alias1 } from "module-name";
import { default as alias } from "module-name";
import { export1, export2 } from "module-name";
import { export1, export2 as alias2, /* … */ } from "module-name";
import { "string name" as alias } from "module-name";
import defaultExport, { export1, /* … */ } from "module-name";
import defaultExport, * as name from "module-name";
import "module-name";
import {} from 'mod';
export let name1, name2/*, … */; // also var
export const name3 = 1, name4 = 2/*, … */; // also var, let
export function functionName() { /* … */ }
export class ClassName { /* … */ }
export function* generatorFunctionName() { /* … */ }
export const { name5, name2: bar } = o;
export const [ name6, name7 ] = array;
export { name8, /* …, */ name81 };
export { variable1 as name9, variable2 as name10, /* …, */ name82 };
export { variable1 as "string name" };
export { name1 as default1 /*, … */ };
export * from "module-name";
export * as name11 from "module-name";
export { name12, /* …, */ nameN } from "module-name";
export { import1 as name13, import2 as name14, /* …, */ name15 } from "module-name";
export { default, /* …, */ } from "module-name";
export { default as name16 } from "module-name";
----------
import defaultExport from 'module-name';
import * as name from 'module-name';
import { export1 } from 'module-name';
import { export1 as alias1 } from 'module-name';
import { default as alias } from 'module-name';
import { export1, export2 } from 'module-name';
import { export1, export2 as alias2 } from 'module-name';
import { 'string name' as alias } from 'module-name';
import defaultExport, { export1 } from 'module-name';
import defaultExport, * as name from 'module-name';
import 'module-name';
import {} from "mod";
export let name1, name2;
export const name3 = 1, name4 = 2;
export function functionName() {/* … */}
export class ClassName {}
export function* generatorFunctionName() {/* … */}
export const { name5, name2: bar } = o;
export const [name6, name7] = array;
export { name8, name81 };
export { variable1 as name9, variable2 as name10, name82 };
export { variable1 as 'string name' };
export { name1 as default1 };
export * from 'module-name';
export * as name11 from 'module-name';
export { name12, nameN } from 'module-name';
export { import1 as name13, import2 as name14, name15 } from 'module-name';
export { default } from 'module-name';
export { default as name16 } from 'module-name';
########## 40
import a = require("a");
export import b = require("b");
----------
import a = require('a');
export import b = require('b');
########## 41
class C {
static
static
static
bar() {}
}
----------
class C {
static static;
static bar() {}
}