flow-api-translator 0.36.1 → 0.37.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/TSDefToFlowDef.js +38 -55
- package/dist/TSDefToFlowDef.js.flow +54 -31
- package/dist/flowDefToTSDef.js +88 -453
- package/dist/flowDefToTSDef.js.flow +104 -89
- package/dist/flowImportTo.js +0 -9
- package/dist/flowImportTo.js.flow +1 -1
- package/dist/flowToFlowDef.js +83 -47
- package/dist/flowToFlowDef.js.flow +91 -15
- package/dist/flowToJS.js +0 -9
- package/dist/index.js +1 -23
- package/dist/src/TSDefToFlowDef.js +38 -55
- package/dist/src/flowDefToTSDef.js +88 -453
- package/dist/src/flowImportTo.js +0 -9
- package/dist/src/flowToFlowDef.js +83 -47
- package/dist/src/flowToJS.js +0 -9
- package/dist/src/index.js +1 -23
- package/dist/src/utils/DocblockUtils.js +0 -10
- package/dist/src/utils/ErrorUtils.js +1 -22
- package/dist/src/utils/FlowAnalyze.js +3 -12
- package/dist/src/utils/TSNodeUtils.js +68 -0
- package/dist/src/utils/TranslationUtils.js +0 -9
- package/dist/src/utils/ts-estree-ast-types.js +0 -29
- package/dist/utils/DocblockUtils.js +0 -10
- package/dist/utils/ErrorUtils.js +1 -22
- package/dist/utils/ErrorUtils.js.flow +3 -3
- package/dist/utils/FlowAnalyze.js +3 -12
- package/dist/utils/FlowAnalyze.js.flow +6 -1
- package/dist/utils/TSNodeUtils.js +68 -0
- package/dist/utils/TSNodeUtils.js.flow +74 -0
- package/dist/utils/TranslationUtils.js +0 -9
- package/dist/utils/ts-estree-ast-types.js +0 -29
- package/dist/utils/ts-estree-ast-types.js.flow +697 -740
- package/package.json +8 -7
|
@@ -35,35 +35,35 @@ interface NodeOrTokenData {
|
|
|
35
35
|
}
|
|
36
36
|
interface BaseNode extends NodeOrTokenData {}
|
|
37
37
|
interface BaseToken extends NodeOrTokenData {
|
|
38
|
-
|
|
38
|
+
readonly value: string;
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
export type Accessibility = 'private' | 'protected' | 'public';
|
|
42
42
|
export interface ArrayExpression extends BaseNode {
|
|
43
|
-
|
|
44
|
-
|
|
43
|
+
readonly type: 'ArrayExpression';
|
|
44
|
+
readonly elements: ReadonlyArray<Expression | SpreadElement>;
|
|
45
45
|
}
|
|
46
46
|
export interface ArrayPattern extends BaseNode {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
47
|
+
readonly type: 'ArrayPattern';
|
|
48
|
+
readonly elements: ReadonlyArray<DestructuringPattern | null>;
|
|
49
|
+
readonly typeAnnotation?: TSTypeAnnotation;
|
|
50
|
+
readonly optional?: boolean;
|
|
51
|
+
readonly decorators?: ReadonlyArray<Decorator>;
|
|
52
52
|
}
|
|
53
53
|
export interface ArrowFunctionExpression extends BaseNode {
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
54
|
+
readonly type: 'ArrowFunctionExpression';
|
|
55
|
+
readonly generator: boolean;
|
|
56
|
+
readonly id: null;
|
|
57
|
+
readonly params: ReadonlyArray<Parameter>;
|
|
58
|
+
readonly body: BlockStatement | Expression;
|
|
59
|
+
readonly async: boolean;
|
|
60
|
+
readonly expression: boolean;
|
|
61
|
+
readonly returnType?: TSTypeAnnotation;
|
|
62
|
+
readonly typeParameters?: TSTypeParameterDeclaration;
|
|
63
63
|
}
|
|
64
64
|
export interface AssignmentExpression extends BaseNode {
|
|
65
|
-
|
|
66
|
-
|
|
65
|
+
readonly type: 'AssignmentExpression';
|
|
66
|
+
readonly operator:
|
|
67
67
|
| '='
|
|
68
68
|
| '+='
|
|
69
69
|
| '-='
|
|
@@ -80,73 +80,71 @@ export interface AssignmentExpression extends BaseNode {
|
|
|
80
80
|
| '&&='
|
|
81
81
|
| '??='
|
|
82
82
|
| '^=';
|
|
83
|
-
|
|
84
|
-
|
|
83
|
+
readonly left: Expression;
|
|
84
|
+
readonly right: Expression;
|
|
85
85
|
}
|
|
86
86
|
export interface AssignmentPattern extends BaseNode {
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
87
|
+
readonly type: 'AssignmentPattern';
|
|
88
|
+
readonly left: BindingName;
|
|
89
|
+
readonly right: Expression;
|
|
90
|
+
readonly typeAnnotation?: TSTypeAnnotation;
|
|
91
|
+
readonly optional?: boolean;
|
|
92
|
+
readonly decorators?: ReadonlyArray<Decorator>;
|
|
93
93
|
}
|
|
94
94
|
export interface AwaitExpression extends BaseNode {
|
|
95
|
-
|
|
96
|
-
|
|
95
|
+
readonly type: 'AwaitExpression';
|
|
96
|
+
readonly argument: Expression;
|
|
97
97
|
}
|
|
98
98
|
export interface BigIntLiteral extends LiteralBase {
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
99
|
+
readonly type: 'Literal';
|
|
100
|
+
readonly value: bigint;
|
|
101
|
+
readonly bigint: string;
|
|
102
102
|
}
|
|
103
103
|
export interface BinaryExpression extends BaseNode {
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
104
|
+
readonly type: 'BinaryExpression';
|
|
105
|
+
readonly operator: string;
|
|
106
|
+
readonly left: Expression | PrivateIdentifier;
|
|
107
|
+
readonly right: Expression;
|
|
108
108
|
}
|
|
109
109
|
export type BindingName = BindingPattern | Identifier;
|
|
110
110
|
export type BindingPattern = ArrayPattern | ObjectPattern;
|
|
111
111
|
export interface BlockComment extends BaseToken {
|
|
112
|
-
|
|
112
|
+
readonly type: 'Block';
|
|
113
113
|
}
|
|
114
114
|
export interface BlockStatement extends BaseNode {
|
|
115
|
-
|
|
116
|
-
|
|
115
|
+
readonly type: 'BlockStatement';
|
|
116
|
+
readonly body: ReadonlyArray<Statement>;
|
|
117
117
|
}
|
|
118
118
|
export interface BooleanLiteral extends LiteralBase {
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
119
|
+
readonly type: 'Literal';
|
|
120
|
+
readonly value: boolean;
|
|
121
|
+
readonly raw: 'false' | 'true';
|
|
122
122
|
}
|
|
123
123
|
export interface BooleanToken extends BaseToken {
|
|
124
|
-
|
|
124
|
+
readonly type: 'Boolean';
|
|
125
125
|
}
|
|
126
126
|
export interface BreakStatement extends BaseNode {
|
|
127
|
-
|
|
128
|
-
|
|
127
|
+
readonly type: 'BreakStatement';
|
|
128
|
+
readonly label: Identifier | null;
|
|
129
129
|
}
|
|
130
130
|
export interface CallExpression extends BaseNode {
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
131
|
+
readonly type: 'CallExpression';
|
|
132
|
+
readonly callee: LeftHandSideExpression;
|
|
133
|
+
readonly arguments: ReadonlyArray<CallExpressionArgument>;
|
|
134
|
+
readonly typeArguments?: TSTypeParameterInstantiation;
|
|
135
|
+
readonly optional: boolean;
|
|
136
136
|
}
|
|
137
137
|
export type CallExpressionArgument = Expression | SpreadElement;
|
|
138
138
|
export interface CatchClause extends BaseNode {
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
139
|
+
readonly type: 'CatchClause';
|
|
140
|
+
readonly param: BindingName | null;
|
|
141
|
+
readonly body: BlockStatement;
|
|
142
142
|
}
|
|
143
143
|
export type ChainElement =
|
|
144
|
-
|
|
|
145
|
-
| MemberExpression
|
|
146
|
-
| TSNonNullExpression;
|
|
144
|
+
CallExpression | MemberExpression | TSNonNullExpression;
|
|
147
145
|
export interface ChainExpression extends BaseNode {
|
|
148
|
-
|
|
149
|
-
|
|
146
|
+
readonly type: 'ChainExpression';
|
|
147
|
+
readonly expression: ChainElement;
|
|
150
148
|
}
|
|
151
149
|
interface ClassBase extends BaseNode {
|
|
152
150
|
/**
|
|
@@ -156,11 +154,11 @@ interface ClassBase extends BaseNode {
|
|
|
156
154
|
* ```
|
|
157
155
|
* This is always `undefined` for `ClassExpression`.
|
|
158
156
|
*/
|
|
159
|
-
|
|
157
|
+
readonly abstract?: boolean;
|
|
160
158
|
/**
|
|
161
159
|
* The class body.
|
|
162
160
|
*/
|
|
163
|
-
|
|
161
|
+
readonly body: ClassBody;
|
|
164
162
|
/**
|
|
165
163
|
* Whether the class has been `declare`d:
|
|
166
164
|
* ```
|
|
@@ -168,7 +166,7 @@ interface ClassBase extends BaseNode {
|
|
|
168
166
|
* ```
|
|
169
167
|
* This is always `undefined` for `ClassExpression`.
|
|
170
168
|
*/
|
|
171
|
-
|
|
169
|
+
readonly declare?: boolean;
|
|
172
170
|
/**
|
|
173
171
|
* The decorators declared for the class.
|
|
174
172
|
* This is `undefined` if there are no decorators.
|
|
@@ -178,51 +176,50 @@ interface ClassBase extends BaseNode {
|
|
|
178
176
|
* ```
|
|
179
177
|
* This is always `undefined` for `ClassExpression`.
|
|
180
178
|
*/
|
|
181
|
-
|
|
179
|
+
readonly decorators?: ReadonlyArray<Decorator>;
|
|
182
180
|
/**
|
|
183
181
|
* The class's name.
|
|
184
182
|
* - For a `ClassExpression` this may be `null` if the name is omitted.
|
|
185
183
|
* - For a `ClassDeclaration` this may be `null` if and only if the parent is
|
|
186
184
|
* an `ExportDefaultDeclaration`.
|
|
187
185
|
*/
|
|
188
|
-
|
|
186
|
+
readonly id: Identifier | null;
|
|
189
187
|
/**
|
|
190
188
|
* The implemented interfaces for the class.
|
|
191
189
|
* This is `undefined` if there are no implemented interfaces.
|
|
192
190
|
*/
|
|
193
|
-
|
|
191
|
+
readonly implements?: ReadonlyArray<TSClassImplements>;
|
|
194
192
|
/**
|
|
195
193
|
* The super class this class extends.
|
|
196
194
|
*/
|
|
197
|
-
|
|
195
|
+
readonly superClass: LeftHandSideExpression | null;
|
|
198
196
|
/**
|
|
199
197
|
* The generic type parameters passed to the superClass.
|
|
200
198
|
* This is `undefined` if there are no generic type parameters passed.
|
|
201
199
|
*/
|
|
202
|
-
|
|
200
|
+
readonly superTypeArguments?: TSTypeParameterInstantiation;
|
|
203
201
|
/**
|
|
204
202
|
* The generic type parameters declared for the class.
|
|
205
203
|
* This is `undefined` if there are no generic type parameters declared.
|
|
206
204
|
*/
|
|
207
|
-
|
|
205
|
+
readonly typeParameters?: TSTypeParameterDeclaration;
|
|
208
206
|
}
|
|
209
207
|
export interface ClassBody extends BaseNode {
|
|
210
|
-
|
|
211
|
-
|
|
208
|
+
readonly type: 'ClassBody';
|
|
209
|
+
readonly body: ReadonlyArray<ClassElement>;
|
|
212
210
|
}
|
|
213
211
|
export type ClassDeclaration =
|
|
214
|
-
|
|
|
215
|
-
| ClassDeclarationWithOptionalName;
|
|
212
|
+
ClassDeclarationWithName | ClassDeclarationWithOptionalName;
|
|
216
213
|
interface ClassDeclarationBase extends ClassBase {
|
|
217
|
-
|
|
214
|
+
readonly type: 'ClassDeclaration';
|
|
218
215
|
}
|
|
219
216
|
export interface ClassDeclarationWithName extends ClassDeclarationBase {
|
|
220
|
-
|
|
221
|
-
|
|
217
|
+
readonly type: 'ClassDeclaration';
|
|
218
|
+
readonly id: Identifier;
|
|
222
219
|
}
|
|
223
220
|
export interface ClassDeclarationWithOptionalName extends ClassDeclarationBase {
|
|
224
|
-
|
|
225
|
-
|
|
221
|
+
readonly type: 'ClassDeclaration';
|
|
222
|
+
readonly id: Identifier | null;
|
|
226
223
|
}
|
|
227
224
|
export type ClassElement =
|
|
228
225
|
| MethodDefinition
|
|
@@ -234,39 +231,36 @@ export type ClassElement =
|
|
|
234
231
|
| TSAbstractPropertyDefinition
|
|
235
232
|
| TSIndexSignature;
|
|
236
233
|
export interface ClassExpression extends ClassBase {
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
}
|
|
242
|
-
interface ClassMethodDefinitionNonComputedNameBase
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
+key: ClassPropertyNameNonComputed;
|
|
252
|
-
+computed: false;
|
|
234
|
+
readonly type: 'ClassExpression';
|
|
235
|
+
readonly abstract?: void;
|
|
236
|
+
readonly declare?: void;
|
|
237
|
+
readonly decorators?: void;
|
|
238
|
+
}
|
|
239
|
+
interface ClassMethodDefinitionNonComputedNameBase extends MethodDefinitionBase {
|
|
240
|
+
readonly type: 'MethodDefinition';
|
|
241
|
+
readonly key: ClassPropertyNameNonComputed;
|
|
242
|
+
readonly computed: false;
|
|
243
|
+
}
|
|
244
|
+
interface ClassPropertyDefinitionNonComputedNameBase extends PropertyDefinitionBase {
|
|
245
|
+
readonly type: 'PropertyDefinition';
|
|
246
|
+
readonly key: ClassPropertyNameNonComputed;
|
|
247
|
+
readonly computed: false;
|
|
253
248
|
}
|
|
254
249
|
export type ClassPropertyNameNonComputed =
|
|
255
|
-
|
|
|
256
|
-
| PropertyNameNonComputed;
|
|
250
|
+
PrivateIdentifier | PropertyNameNonComputed;
|
|
257
251
|
export type Comment = BlockComment | LineComment;
|
|
258
252
|
export interface ConditionalExpression extends BaseNode {
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
253
|
+
readonly type: 'ConditionalExpression';
|
|
254
|
+
readonly test: Expression;
|
|
255
|
+
readonly consequent: Expression;
|
|
256
|
+
readonly alternate: Expression;
|
|
263
257
|
}
|
|
264
258
|
export interface ContinueStatement extends BaseNode {
|
|
265
|
-
|
|
266
|
-
|
|
259
|
+
readonly type: 'ContinueStatement';
|
|
260
|
+
readonly label: Identifier | null;
|
|
267
261
|
}
|
|
268
262
|
export interface DebuggerStatement extends BaseNode {
|
|
269
|
-
|
|
263
|
+
readonly type: 'DebuggerStatement';
|
|
270
264
|
}
|
|
271
265
|
export type DeclarationStatement =
|
|
272
266
|
| ClassDeclaration
|
|
@@ -283,8 +277,8 @@ export type DeclarationStatement =
|
|
|
283
277
|
| TSNamespaceExportDeclaration
|
|
284
278
|
| TSTypeAliasDeclaration;
|
|
285
279
|
export interface Decorator extends BaseNode {
|
|
286
|
-
|
|
287
|
-
|
|
280
|
+
readonly type: 'Decorator';
|
|
281
|
+
readonly expression: LeftHandSideExpression;
|
|
288
282
|
}
|
|
289
283
|
export type DefaultExportDeclarations =
|
|
290
284
|
| ClassDeclarationWithOptionalName
|
|
@@ -305,50 +299,49 @@ export type DestructuringPattern =
|
|
|
305
299
|
| ObjectPattern
|
|
306
300
|
| RestElement;
|
|
307
301
|
export interface DoWhileStatement extends BaseNode {
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
302
|
+
readonly type: 'DoWhileStatement';
|
|
303
|
+
readonly test: Expression;
|
|
304
|
+
readonly body: Statement;
|
|
311
305
|
}
|
|
312
306
|
export interface EmptyStatement extends BaseNode {
|
|
313
|
-
|
|
307
|
+
readonly type: 'EmptyStatement';
|
|
314
308
|
}
|
|
315
309
|
export type EntityName = Identifier | ThisExpression | TSQualifiedName;
|
|
316
310
|
export interface ExportAllDeclaration extends BaseNode {
|
|
317
|
-
|
|
311
|
+
readonly type: 'ExportAllDeclaration';
|
|
318
312
|
/**
|
|
319
313
|
* The assertions declared for the export.
|
|
320
314
|
* ```
|
|
321
315
|
* export * from 'mod' assert { type: 'json' };
|
|
322
316
|
* ```
|
|
323
317
|
*/
|
|
324
|
-
|
|
318
|
+
readonly assertions: ReadonlyArray<ImportAttribute>;
|
|
325
319
|
/**
|
|
326
320
|
* The name for the exported items. `null` if no name is assigned.
|
|
327
321
|
*/
|
|
328
|
-
|
|
322
|
+
readonly exported: Identifier | null;
|
|
329
323
|
/**
|
|
330
324
|
* The kind of the export.
|
|
331
325
|
*/
|
|
332
|
-
|
|
326
|
+
readonly exportKind: ExportKind;
|
|
333
327
|
/**
|
|
334
328
|
* The source module being exported from.
|
|
335
329
|
*/
|
|
336
|
-
|
|
330
|
+
readonly source: StringLiteral;
|
|
337
331
|
}
|
|
338
332
|
type ExportAndImportKind = 'type' | 'value';
|
|
339
333
|
export type ExportDeclaration =
|
|
340
|
-
|
|
|
341
|
-
| NamedExportDeclarations;
|
|
334
|
+
DefaultExportDeclarations | NamedExportDeclarations;
|
|
342
335
|
export interface ExportDefaultDeclaration extends BaseNode {
|
|
343
|
-
|
|
336
|
+
readonly type: 'ExportDefaultDeclaration';
|
|
344
337
|
/**
|
|
345
338
|
* The declaration being exported.
|
|
346
339
|
*/
|
|
347
|
-
|
|
340
|
+
readonly declaration: DefaultExportDeclarations;
|
|
348
341
|
/**
|
|
349
342
|
* The kind of the export.
|
|
350
343
|
*/
|
|
351
|
-
|
|
344
|
+
readonly exportKind: ExportKind;
|
|
352
345
|
}
|
|
353
346
|
export type ExportKind = ExportAndImportKind;
|
|
354
347
|
export type ExportNamedDeclaration =
|
|
@@ -356,7 +349,7 @@ export type ExportNamedDeclaration =
|
|
|
356
349
|
| ExportNamedDeclarationWithoutSourceWithSingle
|
|
357
350
|
| ExportNamedDeclarationWithSource;
|
|
358
351
|
interface ExportNamedDeclarationBase extends BaseNode {
|
|
359
|
-
|
|
352
|
+
readonly type: 'ExportNamedDeclaration';
|
|
360
353
|
/**
|
|
361
354
|
* The assertions declared for the export.
|
|
362
355
|
* ```
|
|
@@ -364,7 +357,7 @@ interface ExportNamedDeclarationBase extends BaseNode {
|
|
|
364
357
|
* ```
|
|
365
358
|
* This will be an empty array if `source` is `null`
|
|
366
359
|
*/
|
|
367
|
-
|
|
360
|
+
readonly assertions: ReadonlyArray<ImportAttribute>;
|
|
368
361
|
/**
|
|
369
362
|
* The exported declaration.
|
|
370
363
|
* ```
|
|
@@ -372,15 +365,15 @@ interface ExportNamedDeclarationBase extends BaseNode {
|
|
|
372
365
|
* ```
|
|
373
366
|
* This will be `null` if `source` is not `null`, or if there are `specifiers`
|
|
374
367
|
*/
|
|
375
|
-
|
|
368
|
+
readonly declaration: NamedExportDeclarations | null;
|
|
376
369
|
/**
|
|
377
370
|
* The kind of the export.
|
|
378
371
|
*/
|
|
379
|
-
|
|
372
|
+
readonly exportKind: ExportKind;
|
|
380
373
|
/**
|
|
381
374
|
* The source module being exported from.
|
|
382
375
|
*/
|
|
383
|
-
|
|
376
|
+
readonly source: StringLiteral | null;
|
|
384
377
|
/**
|
|
385
378
|
* The specifiers being exported.
|
|
386
379
|
* ```
|
|
@@ -388,41 +381,37 @@ interface ExportNamedDeclarationBase extends BaseNode {
|
|
|
388
381
|
* ```
|
|
389
382
|
* This will be an empty array if `declaration` is not `null`
|
|
390
383
|
*/
|
|
391
|
-
|
|
392
|
-
}
|
|
393
|
-
export interface ExportNamedDeclarationAmbiguous
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
+assertions: $ReadOnlyArray<ImportAttribute>;
|
|
417
|
-
+declaration: null;
|
|
418
|
-
+source: StringLiteral;
|
|
419
|
-
+specifiers: $ReadOnlyArray<ExportSpecifier>;
|
|
384
|
+
readonly specifiers: ReadonlyArray<ExportSpecifier>;
|
|
385
|
+
}
|
|
386
|
+
export interface ExportNamedDeclarationAmbiguous extends ExportNamedDeclarationBase {
|
|
387
|
+
readonly type: 'ExportNamedDeclaration';
|
|
388
|
+
}
|
|
389
|
+
export interface ExportNamedDeclarationWithoutSourceWithSingle extends ExportNamedDeclarationBase {
|
|
390
|
+
readonly type: 'ExportNamedDeclaration';
|
|
391
|
+
readonly assertions: ReadonlyArray<ImportAttribute>;
|
|
392
|
+
readonly declaration: NamedExportDeclarations;
|
|
393
|
+
readonly source: null;
|
|
394
|
+
readonly specifiers: [];
|
|
395
|
+
}
|
|
396
|
+
export interface ExportNamedDeclarationWithoutSourceWithMultiple extends ExportNamedDeclarationBase {
|
|
397
|
+
readonly type: 'ExportNamedDeclaration';
|
|
398
|
+
readonly assertions: ReadonlyArray<ImportAttribute>;
|
|
399
|
+
readonly declaration: null;
|
|
400
|
+
readonly source: null;
|
|
401
|
+
readonly specifiers: ReadonlyArray<ExportSpecifier>;
|
|
402
|
+
}
|
|
403
|
+
export interface ExportNamedDeclarationWithSource extends ExportNamedDeclarationBase {
|
|
404
|
+
readonly type: 'ExportNamedDeclaration';
|
|
405
|
+
readonly assertions: ReadonlyArray<ImportAttribute>;
|
|
406
|
+
readonly declaration: null;
|
|
407
|
+
readonly source: StringLiteral;
|
|
408
|
+
readonly specifiers: ReadonlyArray<ExportSpecifier>;
|
|
420
409
|
}
|
|
421
410
|
export interface ExportSpecifier extends BaseNode {
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
411
|
+
readonly type: 'ExportSpecifier';
|
|
412
|
+
readonly local: Identifier;
|
|
413
|
+
readonly exported: Identifier;
|
|
414
|
+
readonly exportKind: ExportKind;
|
|
426
415
|
}
|
|
427
416
|
export type Expression =
|
|
428
417
|
| ArrayExpression
|
|
@@ -461,30 +450,30 @@ export type Expression =
|
|
|
461
450
|
| UpdateExpression
|
|
462
451
|
| YieldExpression;
|
|
463
452
|
export interface ExpressionStatement extends BaseNode {
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
453
|
+
readonly type: 'ExpressionStatement';
|
|
454
|
+
readonly expression: Expression;
|
|
455
|
+
readonly directive?: string;
|
|
467
456
|
}
|
|
468
457
|
export type ForInitialiser = Expression | VariableDeclaration;
|
|
469
458
|
export interface ForInStatement extends BaseNode {
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
459
|
+
readonly type: 'ForInStatement';
|
|
460
|
+
readonly left: ForInitialiser;
|
|
461
|
+
readonly right: Expression;
|
|
462
|
+
readonly body: Statement;
|
|
474
463
|
}
|
|
475
464
|
export interface ForOfStatement extends BaseNode {
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
465
|
+
readonly type: 'ForOfStatement';
|
|
466
|
+
readonly left: ForInitialiser;
|
|
467
|
+
readonly right: Expression;
|
|
468
|
+
readonly body: Statement;
|
|
469
|
+
readonly await: boolean;
|
|
481
470
|
}
|
|
482
471
|
export interface ForStatement extends BaseNode {
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
472
|
+
readonly type: 'ForStatement';
|
|
473
|
+
readonly init: Expression | ForInitialiser | null;
|
|
474
|
+
readonly test: Expression | null;
|
|
475
|
+
readonly update: Expression | null;
|
|
476
|
+
readonly body: Statement;
|
|
488
477
|
}
|
|
489
478
|
interface FunctionBase extends BaseNode {
|
|
490
479
|
/**
|
|
@@ -495,7 +484,7 @@ interface FunctionBase extends BaseNode {
|
|
|
495
484
|
* const x = async (...) => {...}
|
|
496
485
|
* ```
|
|
497
486
|
*/
|
|
498
|
-
|
|
487
|
+
readonly async: boolean;
|
|
499
488
|
/**
|
|
500
489
|
* The body of the function.
|
|
501
490
|
* - For an `ArrowFunctionExpression` this may be an `Expression` or `BlockStatement`.
|
|
@@ -503,14 +492,14 @@ interface FunctionBase extends BaseNode {
|
|
|
503
492
|
* - For a `TSDeclareFunction` this is always `undefined`.
|
|
504
493
|
* - For a `TSEmptyBodyFunctionExpression` this is always `null`.
|
|
505
494
|
*/
|
|
506
|
-
|
|
495
|
+
readonly body?: BlockStatement | Expression | null;
|
|
507
496
|
/**
|
|
508
497
|
* This is only `true` if and only if the node is a `TSDeclareFunction` and it has `declare`:
|
|
509
498
|
* ```
|
|
510
499
|
* declare function foo(...) {...}
|
|
511
500
|
* ```
|
|
512
501
|
*/
|
|
513
|
-
|
|
502
|
+
readonly declare?: boolean;
|
|
514
503
|
/**
|
|
515
504
|
* This is only ever `true` if and only the node is an `ArrowFunctionExpression` and the body
|
|
516
505
|
* is an expression:
|
|
@@ -518,7 +507,7 @@ interface FunctionBase extends BaseNode {
|
|
|
518
507
|
* (() => 1)
|
|
519
508
|
* ```
|
|
520
509
|
*/
|
|
521
|
-
|
|
510
|
+
readonly expression: boolean;
|
|
522
511
|
/**
|
|
523
512
|
* Whether the function is a generator function:
|
|
524
513
|
* ```
|
|
@@ -527,7 +516,7 @@ interface FunctionBase extends BaseNode {
|
|
|
527
516
|
* ```
|
|
528
517
|
* This is always `false` for arrow functions as they cannot be generators.
|
|
529
518
|
*/
|
|
530
|
-
|
|
519
|
+
readonly generator: boolean;
|
|
531
520
|
/**
|
|
532
521
|
* The function's name.
|
|
533
522
|
* - For an `ArrowFunctionExpression` this is always `null`.
|
|
@@ -535,44 +524,42 @@ interface FunctionBase extends BaseNode {
|
|
|
535
524
|
* - For a `FunctionDeclaration` or `TSDeclareFunction` this may be `null` if
|
|
536
525
|
* and only if the parent is an `ExportDefaultDeclaration`.
|
|
537
526
|
*/
|
|
538
|
-
|
|
527
|
+
readonly id: Identifier | null;
|
|
539
528
|
/**
|
|
540
529
|
* The list of parameters declared for the function.
|
|
541
530
|
*/
|
|
542
|
-
|
|
531
|
+
readonly params: ReadonlyArray<Parameter>;
|
|
543
532
|
/**
|
|
544
533
|
* The return type annotation for the function.
|
|
545
534
|
* This is `undefined` if there is no return type declared.
|
|
546
535
|
*/
|
|
547
|
-
|
|
536
|
+
readonly returnType?: TSTypeAnnotation;
|
|
548
537
|
/**
|
|
549
538
|
* The generic type parameter declaration for the function.
|
|
550
539
|
* This is `undefined` if there are no generic type parameters declared.
|
|
551
540
|
*/
|
|
552
|
-
|
|
541
|
+
readonly typeParameters?: TSTypeParameterDeclaration;
|
|
553
542
|
}
|
|
554
543
|
export type FunctionDeclaration =
|
|
555
|
-
|
|
|
556
|
-
| FunctionDeclarationWithOptionalName;
|
|
544
|
+
FunctionDeclarationWithName | FunctionDeclarationWithOptionalName;
|
|
557
545
|
interface FunctionDeclarationBase extends FunctionBase {
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
546
|
+
readonly type: 'FunctionDeclaration';
|
|
547
|
+
readonly body: BlockStatement;
|
|
548
|
+
readonly declare?: false;
|
|
549
|
+
readonly expression: false;
|
|
562
550
|
}
|
|
563
551
|
export interface FunctionDeclarationWithName extends FunctionDeclarationBase {
|
|
564
|
-
|
|
565
|
-
|
|
552
|
+
readonly type: 'FunctionDeclaration';
|
|
553
|
+
readonly id: Identifier;
|
|
566
554
|
}
|
|
567
|
-
export interface FunctionDeclarationWithOptionalName
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
+id: Identifier | null;
|
|
555
|
+
export interface FunctionDeclarationWithOptionalName extends FunctionDeclarationBase {
|
|
556
|
+
readonly type: 'FunctionDeclaration';
|
|
557
|
+
readonly id: Identifier | null;
|
|
571
558
|
}
|
|
572
559
|
export interface FunctionExpression extends FunctionBase {
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
560
|
+
readonly type: 'FunctionExpression';
|
|
561
|
+
readonly body: BlockStatement;
|
|
562
|
+
readonly expression: false;
|
|
576
563
|
}
|
|
577
564
|
export type FunctionLike =
|
|
578
565
|
| ArrowFunctionExpression
|
|
@@ -581,47 +568,45 @@ export type FunctionLike =
|
|
|
581
568
|
| TSDeclareFunction
|
|
582
569
|
| TSEmptyBodyFunctionExpression;
|
|
583
570
|
export interface Identifier extends BaseNode {
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
571
|
+
readonly type: 'Identifier';
|
|
572
|
+
readonly name: string;
|
|
573
|
+
readonly typeAnnotation?: TSTypeAnnotation;
|
|
574
|
+
readonly optional?: boolean;
|
|
575
|
+
readonly decorators?: ReadonlyArray<Decorator>;
|
|
589
576
|
}
|
|
590
577
|
export interface IdentifierToken extends BaseToken {
|
|
591
|
-
|
|
578
|
+
readonly type: 'Identifier';
|
|
592
579
|
}
|
|
593
580
|
export interface IfStatement extends BaseNode {
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
581
|
+
readonly type: 'IfStatement';
|
|
582
|
+
readonly test: Expression;
|
|
583
|
+
readonly consequent: Statement;
|
|
584
|
+
readonly alternate: Statement | null;
|
|
598
585
|
}
|
|
599
586
|
export interface ImportAttribute extends BaseNode {
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
587
|
+
readonly type: 'ImportAttribute';
|
|
588
|
+
readonly key: Identifier | Literal;
|
|
589
|
+
readonly value: Literal;
|
|
603
590
|
}
|
|
604
591
|
export type ImportClause =
|
|
605
|
-
|
|
|
606
|
-
| ImportNamespaceSpecifier
|
|
607
|
-
| ImportSpecifier;
|
|
592
|
+
ImportDefaultSpecifier | ImportNamespaceSpecifier | ImportSpecifier;
|
|
608
593
|
export interface ImportDeclaration extends BaseNode {
|
|
609
|
-
|
|
594
|
+
readonly type: 'ImportDeclaration';
|
|
610
595
|
/**
|
|
611
596
|
* The assertions declared for the export.
|
|
612
597
|
* ```
|
|
613
598
|
* import * from 'mod' assert { type: 'json' };
|
|
614
599
|
* ```
|
|
615
600
|
*/
|
|
616
|
-
|
|
601
|
+
readonly assertions: ReadonlyArray<ImportAttribute>;
|
|
617
602
|
/**
|
|
618
603
|
* The kind of the import.
|
|
619
604
|
*/
|
|
620
|
-
|
|
605
|
+
readonly importKind: ImportKind;
|
|
621
606
|
/**
|
|
622
607
|
* The source module being imported from.
|
|
623
608
|
*/
|
|
624
|
-
|
|
609
|
+
readonly source: StringLiteral;
|
|
625
610
|
/**
|
|
626
611
|
* The specifiers being imported.
|
|
627
612
|
* If this is an empty array then either there are no specifiers:
|
|
@@ -633,27 +618,27 @@ export interface ImportDeclaration extends BaseNode {
|
|
|
633
618
|
* import 'mod';
|
|
634
619
|
* ```
|
|
635
620
|
*/
|
|
636
|
-
|
|
621
|
+
readonly specifiers: ReadonlyArray<ImportClause>;
|
|
637
622
|
}
|
|
638
623
|
export interface ImportDefaultSpecifier extends BaseNode {
|
|
639
|
-
|
|
640
|
-
|
|
624
|
+
readonly type: 'ImportDefaultSpecifier';
|
|
625
|
+
readonly local: Identifier;
|
|
641
626
|
}
|
|
642
627
|
export interface ImportExpression extends BaseNode {
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
628
|
+
readonly type: 'ImportExpression';
|
|
629
|
+
readonly source: Expression;
|
|
630
|
+
readonly attributes: Expression | null;
|
|
646
631
|
}
|
|
647
632
|
type ImportKind = ExportAndImportKind;
|
|
648
633
|
export interface ImportNamespaceSpecifier extends BaseNode {
|
|
649
|
-
|
|
650
|
-
|
|
634
|
+
readonly type: 'ImportNamespaceSpecifier';
|
|
635
|
+
readonly local: Identifier;
|
|
651
636
|
}
|
|
652
637
|
export interface ImportSpecifier extends BaseNode {
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
638
|
+
readonly type: 'ImportSpecifier';
|
|
639
|
+
readonly local: Identifier;
|
|
640
|
+
readonly imported: Identifier;
|
|
641
|
+
readonly importKind: ?ImportKind;
|
|
657
642
|
}
|
|
658
643
|
export type IterationStatement =
|
|
659
644
|
| DoWhileStatement
|
|
@@ -662,95 +647,91 @@ export type IterationStatement =
|
|
|
662
647
|
| ForStatement
|
|
663
648
|
| WhileStatement;
|
|
664
649
|
export interface JSXAttribute extends BaseNode {
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
650
|
+
readonly type: 'JSXAttribute';
|
|
651
|
+
readonly name: JSXIdentifier | JSXNamespacedName;
|
|
652
|
+
readonly value: JSXExpression | Literal | null;
|
|
668
653
|
}
|
|
669
654
|
export type JSXChild = JSXElement | JSXExpression | JSXFragment | JSXText;
|
|
670
655
|
export interface JSXClosingElement extends BaseNode {
|
|
671
|
-
|
|
672
|
-
|
|
656
|
+
readonly type: 'JSXClosingElement';
|
|
657
|
+
readonly name: JSXTagNameExpression;
|
|
673
658
|
}
|
|
674
659
|
export interface JSXClosingFragment extends BaseNode {
|
|
675
|
-
|
|
660
|
+
readonly type: 'JSXClosingFragment';
|
|
676
661
|
}
|
|
677
662
|
export interface JSXElement extends BaseNode {
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
663
|
+
readonly type: 'JSXElement';
|
|
664
|
+
readonly openingElement: JSXOpeningElement;
|
|
665
|
+
readonly closingElement: JSXClosingElement | null;
|
|
666
|
+
readonly children: ReadonlyArray<JSXChild>;
|
|
682
667
|
}
|
|
683
668
|
export interface JSXEmptyExpression extends BaseNode {
|
|
684
|
-
|
|
669
|
+
readonly type: 'JSXEmptyExpression';
|
|
685
670
|
}
|
|
686
671
|
export type JSXExpression =
|
|
687
|
-
|
|
|
688
|
-
| JSXExpressionContainer
|
|
689
|
-
| JSXSpreadChild;
|
|
672
|
+
JSXEmptyExpression | JSXExpressionContainer | JSXSpreadChild;
|
|
690
673
|
export interface JSXExpressionContainer extends BaseNode {
|
|
691
|
-
|
|
692
|
-
|
|
674
|
+
readonly type: 'JSXExpressionContainer';
|
|
675
|
+
readonly expression: Expression | JSXEmptyExpression;
|
|
693
676
|
}
|
|
694
677
|
export interface JSXFragment extends BaseNode {
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
678
|
+
readonly type: 'JSXFragment';
|
|
679
|
+
readonly openingFragment: JSXOpeningFragment;
|
|
680
|
+
readonly closingFragment: JSXClosingFragment;
|
|
681
|
+
readonly children: ReadonlyArray<JSXChild>;
|
|
699
682
|
}
|
|
700
683
|
export interface JSXIdentifier extends BaseNode {
|
|
701
|
-
|
|
702
|
-
|
|
684
|
+
readonly type: 'JSXIdentifier';
|
|
685
|
+
readonly name: string;
|
|
703
686
|
}
|
|
704
687
|
export interface JSXIdentifierToken extends BaseToken {
|
|
705
|
-
|
|
688
|
+
readonly type: 'JSXIdentifier';
|
|
706
689
|
}
|
|
707
690
|
export interface JSXMemberExpression extends BaseNode {
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
691
|
+
readonly type: 'JSXMemberExpression';
|
|
692
|
+
readonly object: JSXTagNameExpression;
|
|
693
|
+
readonly property: JSXIdentifier;
|
|
711
694
|
}
|
|
712
695
|
export interface JSXNamespacedName extends BaseNode {
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
696
|
+
readonly type: 'JSXNamespacedName';
|
|
697
|
+
readonly namespace: JSXIdentifier;
|
|
698
|
+
readonly name: JSXIdentifier;
|
|
716
699
|
}
|
|
717
700
|
export interface JSXOpeningElement extends BaseNode {
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
701
|
+
readonly type: 'JSXOpeningElement';
|
|
702
|
+
readonly typeParameters?: TSTypeParameterInstantiation;
|
|
703
|
+
readonly selfClosing: boolean;
|
|
704
|
+
readonly name: JSXTagNameExpression;
|
|
705
|
+
readonly attributes: ReadonlyArray<JSXAttribute | JSXSpreadAttribute>;
|
|
723
706
|
}
|
|
724
707
|
export interface JSXOpeningFragment extends BaseNode {
|
|
725
|
-
|
|
708
|
+
readonly type: 'JSXOpeningFragment';
|
|
726
709
|
}
|
|
727
710
|
export interface JSXSpreadAttribute extends BaseNode {
|
|
728
|
-
|
|
729
|
-
|
|
711
|
+
readonly type: 'JSXSpreadAttribute';
|
|
712
|
+
readonly argument: Expression;
|
|
730
713
|
}
|
|
731
714
|
export interface JSXSpreadChild extends BaseNode {
|
|
732
|
-
|
|
733
|
-
|
|
715
|
+
readonly type: 'JSXSpreadChild';
|
|
716
|
+
readonly expression: Expression | JSXEmptyExpression;
|
|
734
717
|
}
|
|
735
718
|
export type JSXTagNameExpression =
|
|
736
|
-
|
|
|
737
|
-
| JSXMemberExpression
|
|
738
|
-
| JSXNamespacedName;
|
|
719
|
+
JSXIdentifier | JSXMemberExpression | JSXNamespacedName;
|
|
739
720
|
export interface JSXText extends BaseNode {
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
721
|
+
readonly type: 'JSXText';
|
|
722
|
+
readonly value: string;
|
|
723
|
+
readonly raw: string;
|
|
743
724
|
}
|
|
744
725
|
export interface JSXTextToken extends BaseToken {
|
|
745
|
-
|
|
726
|
+
readonly type: 'JSXText';
|
|
746
727
|
}
|
|
747
728
|
export interface KeywordToken extends BaseToken {
|
|
748
|
-
|
|
729
|
+
readonly type: 'Keyword';
|
|
749
730
|
}
|
|
750
731
|
export interface LabeledStatement extends BaseNode {
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
732
|
+
readonly type: 'LabeledStatement';
|
|
733
|
+
readonly label: Identifier;
|
|
734
|
+
readonly body: Statement;
|
|
754
735
|
}
|
|
755
736
|
export type LeftHandSideExpression =
|
|
756
737
|
| ArrayExpression
|
|
@@ -776,7 +757,7 @@ export type LeftHandSideExpression =
|
|
|
776
757
|
| TSQualifiedName
|
|
777
758
|
| TSTypeAssertion;
|
|
778
759
|
export interface LineComment extends BaseToken {
|
|
779
|
-
|
|
760
|
+
readonly type: 'Line';
|
|
780
761
|
}
|
|
781
762
|
export type Literal =
|
|
782
763
|
| BigIntLiteral
|
|
@@ -786,77 +767,73 @@ export type Literal =
|
|
|
786
767
|
| RegExpLiteral
|
|
787
768
|
| StringLiteral;
|
|
788
769
|
interface LiteralBase extends BaseNode {
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
770
|
+
readonly type: 'Literal';
|
|
771
|
+
readonly raw: string;
|
|
772
|
+
readonly value: RegExp | bigint | boolean | number | string | null;
|
|
792
773
|
}
|
|
793
774
|
export type LiteralExpression = Literal | TemplateLiteral;
|
|
794
775
|
export interface LogicalExpression extends BaseNode {
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
776
|
+
readonly type: 'LogicalExpression';
|
|
777
|
+
readonly operator: '??' | '&&' | '||';
|
|
778
|
+
readonly left: Expression;
|
|
779
|
+
readonly right: Expression;
|
|
799
780
|
}
|
|
800
781
|
export type MemberExpression =
|
|
801
|
-
|
|
|
802
|
-
| MemberExpressionNonComputedName;
|
|
782
|
+
MemberExpressionComputedName | MemberExpressionNonComputedName;
|
|
803
783
|
interface MemberExpressionBase extends BaseNode {
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
784
|
+
readonly object: LeftHandSideExpression;
|
|
785
|
+
readonly property: Expression | Identifier | PrivateIdentifier;
|
|
786
|
+
readonly computed: boolean;
|
|
787
|
+
readonly optional: boolean;
|
|
808
788
|
}
|
|
809
789
|
export interface MemberExpressionComputedName extends MemberExpressionBase {
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
790
|
+
readonly type: 'MemberExpression';
|
|
791
|
+
readonly property: Expression;
|
|
792
|
+
readonly computed: true;
|
|
813
793
|
}
|
|
814
794
|
export interface MemberExpressionNonComputedName extends MemberExpressionBase {
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
795
|
+
readonly type: 'MemberExpression';
|
|
796
|
+
readonly property: Identifier | PrivateIdentifier;
|
|
797
|
+
readonly computed: false;
|
|
818
798
|
}
|
|
819
799
|
export interface MetaProperty extends BaseNode {
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
800
|
+
readonly type: 'MetaProperty';
|
|
801
|
+
readonly meta: Identifier;
|
|
802
|
+
readonly property: Identifier;
|
|
823
803
|
}
|
|
824
804
|
export type MethodDefinition =
|
|
825
|
-
|
|
|
826
|
-
| MethodDefinitionNonComputedName;
|
|
805
|
+
MethodDefinitionComputedName | MethodDefinitionNonComputedName;
|
|
827
806
|
/** this should not be directly used - instead use MethodDefinitionComputedNameBase or MethodDefinitionNonComputedNameBase */
|
|
828
807
|
interface MethodDefinitionBase extends BaseNode {
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
808
|
+
readonly accessibility?: Accessibility;
|
|
809
|
+
readonly computed: boolean;
|
|
810
|
+
readonly decorators?: ReadonlyArray<Decorator>;
|
|
811
|
+
readonly key: PropertyName;
|
|
812
|
+
readonly kind: 'constructor' | 'get' | 'method' | 'set';
|
|
813
|
+
readonly optional?: boolean;
|
|
814
|
+
readonly override?: boolean;
|
|
815
|
+
readonly static: boolean;
|
|
816
|
+
readonly typeParameters?: TSTypeParameterDeclaration;
|
|
817
|
+
readonly value: FunctionExpression | TSEmptyBodyFunctionExpression;
|
|
839
818
|
}
|
|
840
819
|
export interface MethodDefinitionAmbiguous extends MethodDefinitionBase {
|
|
841
820
|
type: 'MethodDefinition';
|
|
842
821
|
}
|
|
843
|
-
export interface MethodDefinitionComputedName
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
+computed: true;
|
|
822
|
+
export interface MethodDefinitionComputedName extends MethodDefinitionComputedNameBase {
|
|
823
|
+
readonly type: 'MethodDefinition';
|
|
824
|
+
readonly computed: true;
|
|
847
825
|
}
|
|
848
826
|
interface MethodDefinitionComputedNameBase extends MethodDefinitionBase {
|
|
849
|
-
|
|
850
|
-
|
|
827
|
+
readonly key: PropertyNameComputed;
|
|
828
|
+
readonly computed: true;
|
|
851
829
|
}
|
|
852
|
-
export interface MethodDefinitionNonComputedName
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
+computed: false;
|
|
830
|
+
export interface MethodDefinitionNonComputedName extends ClassMethodDefinitionNonComputedNameBase {
|
|
831
|
+
readonly type: 'MethodDefinition';
|
|
832
|
+
readonly computed: false;
|
|
856
833
|
}
|
|
857
834
|
interface MethodDefinitionNonComputedNameBase extends MethodDefinitionBase {
|
|
858
|
-
|
|
859
|
-
|
|
835
|
+
readonly key: PropertyNameNonComputed;
|
|
836
|
+
readonly computed: false;
|
|
860
837
|
}
|
|
861
838
|
export type Modifier =
|
|
862
839
|
| TSAbstractKeyword
|
|
@@ -878,10 +855,10 @@ export type NamedExportDeclarations =
|
|
|
878
855
|
| TSTypeAliasDeclaration
|
|
879
856
|
| VariableDeclaration;
|
|
880
857
|
export interface NewExpression extends BaseNode {
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
858
|
+
readonly type: 'NewExpression';
|
|
859
|
+
readonly callee: LeftHandSideExpression;
|
|
860
|
+
readonly arguments: ReadonlyArray<CallExpressionArgument>;
|
|
861
|
+
readonly typeParameters?: TSTypeParameterInstantiation;
|
|
885
862
|
}
|
|
886
863
|
export type Node =
|
|
887
864
|
| ArrayExpression
|
|
@@ -1051,32 +1028,32 @@ export type Node =
|
|
|
1051
1028
|
// new "ambiguous" nodes
|
|
1052
1029
|
| ExportNamedDeclarationAmbiguous;
|
|
1053
1030
|
export interface NullLiteral extends LiteralBase {
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1031
|
+
readonly type: 'Literal';
|
|
1032
|
+
readonly value: null;
|
|
1033
|
+
readonly raw: 'null';
|
|
1057
1034
|
}
|
|
1058
1035
|
export interface NullToken extends BaseToken {
|
|
1059
|
-
|
|
1036
|
+
readonly type: 'Null';
|
|
1060
1037
|
}
|
|
1061
1038
|
export interface NumberLiteral extends LiteralBase {
|
|
1062
|
-
|
|
1063
|
-
|
|
1039
|
+
readonly type: 'Literal';
|
|
1040
|
+
readonly value: number;
|
|
1064
1041
|
}
|
|
1065
1042
|
export interface NumericToken extends BaseToken {
|
|
1066
|
-
|
|
1043
|
+
readonly type: 'Numeric';
|
|
1067
1044
|
}
|
|
1068
1045
|
export interface ObjectExpression extends BaseNode {
|
|
1069
|
-
|
|
1070
|
-
|
|
1046
|
+
readonly type: 'ObjectExpression';
|
|
1047
|
+
readonly properties: ReadonlyArray<ObjectLiteralElement>;
|
|
1071
1048
|
}
|
|
1072
1049
|
export type ObjectLiteralElement = MethodDefinition | Property | SpreadElement;
|
|
1073
1050
|
export type ObjectLiteralElementLike = ObjectLiteralElement;
|
|
1074
1051
|
export interface ObjectPattern extends BaseNode {
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1052
|
+
readonly type: 'ObjectPattern';
|
|
1053
|
+
readonly properties: ReadonlyArray<Property | RestElement>;
|
|
1054
|
+
readonly typeAnnotation?: TSTypeAnnotation;
|
|
1055
|
+
readonly optional?: boolean;
|
|
1056
|
+
readonly decorators?: ReadonlyArray<Decorator>;
|
|
1080
1057
|
}
|
|
1081
1058
|
export type Parameter =
|
|
1082
1059
|
| ArrayPattern
|
|
@@ -1089,11 +1066,11 @@ export interface Position {
|
|
|
1089
1066
|
/**
|
|
1090
1067
|
* Line number (1-indexed)
|
|
1091
1068
|
*/
|
|
1092
|
-
|
|
1069
|
+
readonly line: number;
|
|
1093
1070
|
/**
|
|
1094
1071
|
* Column number on the line (0-indexed)
|
|
1095
1072
|
*/
|
|
1096
|
-
|
|
1073
|
+
readonly column: number;
|
|
1097
1074
|
}
|
|
1098
1075
|
export type PrimaryExpression =
|
|
1099
1076
|
| ArrayExpression
|
|
@@ -1113,15 +1090,15 @@ export type PrimaryExpression =
|
|
|
1113
1090
|
| ThisExpression
|
|
1114
1091
|
| TSNullKeyword;
|
|
1115
1092
|
export interface PrivateIdentifier extends BaseNode {
|
|
1116
|
-
|
|
1117
|
-
|
|
1093
|
+
readonly type: 'PrivateIdentifier';
|
|
1094
|
+
readonly name: string;
|
|
1118
1095
|
}
|
|
1119
1096
|
export interface Program extends BaseNode {
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1097
|
+
readonly type: 'Program';
|
|
1098
|
+
readonly body: ReadonlyArray<ProgramStatement>;
|
|
1099
|
+
readonly sourceType: 'module' | 'script';
|
|
1100
|
+
readonly comments?: ReadonlyArray<Comment>;
|
|
1101
|
+
readonly tokens?: ReadonlyArray<Token>;
|
|
1125
1102
|
}
|
|
1126
1103
|
export type ProgramStatement =
|
|
1127
1104
|
| ExportAllDeclaration
|
|
@@ -1133,79 +1110,72 @@ export type ProgramStatement =
|
|
|
1133
1110
|
| TSNamespaceExportDeclaration;
|
|
1134
1111
|
export type Property = PropertyComputedName | PropertyNonComputedName;
|
|
1135
1112
|
interface PropertyBase extends BaseNode {
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1113
|
+
readonly type: 'Property';
|
|
1114
|
+
readonly key: PropertyName;
|
|
1115
|
+
readonly value:
|
|
1139
1116
|
| AssignmentPattern
|
|
1140
1117
|
| BindingName
|
|
1141
1118
|
| Expression
|
|
1142
1119
|
| TSEmptyBodyFunctionExpression;
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1120
|
+
readonly computed: boolean;
|
|
1121
|
+
readonly method: boolean;
|
|
1122
|
+
readonly shorthand: boolean;
|
|
1123
|
+
readonly optional?: boolean;
|
|
1124
|
+
readonly kind: 'get' | 'init' | 'set';
|
|
1148
1125
|
}
|
|
1149
1126
|
export interface PropertyComputedName extends PropertyBase {
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1127
|
+
readonly type: 'Property';
|
|
1128
|
+
readonly key: PropertyNameComputed;
|
|
1129
|
+
readonly computed: true;
|
|
1153
1130
|
}
|
|
1154
1131
|
export type PropertyDefinition =
|
|
1155
|
-
|
|
|
1156
|
-
| PropertyDefinitionNonComputedName;
|
|
1132
|
+
PropertyDefinitionComputedName | PropertyDefinitionNonComputedName;
|
|
1157
1133
|
interface PropertyDefinitionBase extends BaseNode {
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1134
|
+
readonly accessibility?: Accessibility;
|
|
1135
|
+
readonly computed: boolean;
|
|
1136
|
+
readonly declare: boolean;
|
|
1137
|
+
readonly decorators?: ReadonlyArray<Decorator>;
|
|
1138
|
+
readonly definite?: boolean;
|
|
1139
|
+
readonly key: PropertyName;
|
|
1140
|
+
readonly optional?: boolean;
|
|
1141
|
+
readonly override?: boolean;
|
|
1142
|
+
readonly readonly?: boolean;
|
|
1143
|
+
readonly static: boolean;
|
|
1144
|
+
readonly typeAnnotation?: TSTypeAnnotation;
|
|
1145
|
+
readonly value: Expression | null;
|
|
1170
1146
|
}
|
|
1171
1147
|
export interface PropertyDefinitionAmbiguous extends PropertyDefinitionBase {
|
|
1172
1148
|
type: 'PropertyDefinition';
|
|
1173
1149
|
}
|
|
1174
|
-
export interface PropertyDefinitionComputedName
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
+computed: true;
|
|
1150
|
+
export interface PropertyDefinitionComputedName extends PropertyDefinitionComputedNameBase {
|
|
1151
|
+
readonly type: 'PropertyDefinition';
|
|
1152
|
+
readonly computed: true;
|
|
1178
1153
|
}
|
|
1179
1154
|
interface PropertyDefinitionComputedNameBase extends PropertyDefinitionBase {
|
|
1180
|
-
|
|
1181
|
-
|
|
1155
|
+
readonly key: PropertyNameComputed;
|
|
1156
|
+
readonly computed: true;
|
|
1182
1157
|
}
|
|
1183
|
-
export interface PropertyDefinitionNonComputedName
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
+computed: false;
|
|
1158
|
+
export interface PropertyDefinitionNonComputedName extends ClassPropertyDefinitionNonComputedNameBase {
|
|
1159
|
+
readonly type: 'PropertyDefinition';
|
|
1160
|
+
readonly computed: false;
|
|
1187
1161
|
}
|
|
1188
1162
|
interface PropertyDefinitionNonComputedNameBase extends PropertyDefinitionBase {
|
|
1189
|
-
|
|
1190
|
-
|
|
1163
|
+
readonly key: PropertyNameNonComputed;
|
|
1164
|
+
readonly computed: false;
|
|
1191
1165
|
}
|
|
1192
1166
|
export type PropertyName =
|
|
1193
|
-
|
|
|
1194
|
-
| PropertyNameComputed
|
|
1195
|
-
| PropertyNameNonComputed;
|
|
1167
|
+
ClassPropertyNameNonComputed | PropertyNameComputed | PropertyNameNonComputed;
|
|
1196
1168
|
export type PropertyNameComputed = Expression;
|
|
1197
1169
|
export type PropertyNameNonComputed =
|
|
1198
|
-
|
|
|
1199
|
-
| NumberLiteral
|
|
1200
|
-
| StringLiteral;
|
|
1170
|
+
Identifier | NumberLiteral | StringLiteral;
|
|
1201
1171
|
export interface PropertyNonComputedName extends PropertyBase {
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1172
|
+
readonly type: 'Property';
|
|
1173
|
+
readonly key: PropertyNameNonComputed;
|
|
1174
|
+
readonly computed: false;
|
|
1205
1175
|
}
|
|
1206
1176
|
export interface PunctuatorToken extends BaseToken {
|
|
1207
|
-
|
|
1208
|
-
|
|
1177
|
+
readonly type: 'Punctuator';
|
|
1178
|
+
readonly value:
|
|
1209
1179
|
| '{'
|
|
1210
1180
|
| '}'
|
|
1211
1181
|
| '('
|
|
@@ -1259,49 +1229,49 @@ export interface PunctuatorToken extends BaseToken {
|
|
|
1259
1229
|
*/
|
|
1260
1230
|
export type Range = [number, number];
|
|
1261
1231
|
export interface RegExpLiteral extends LiteralBase {
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1232
|
+
readonly type: 'Literal';
|
|
1233
|
+
readonly value: RegExp | null;
|
|
1234
|
+
readonly regex: {
|
|
1235
|
+
readonly pattern: string,
|
|
1236
|
+
readonly flags: string,
|
|
1267
1237
|
};
|
|
1268
1238
|
}
|
|
1269
1239
|
export interface RegularExpressionToken extends BaseToken {
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1240
|
+
readonly type: 'RegularExpression';
|
|
1241
|
+
readonly regex: {
|
|
1242
|
+
readonly pattern: string,
|
|
1243
|
+
readonly flags: string,
|
|
1274
1244
|
};
|
|
1275
1245
|
}
|
|
1276
1246
|
export interface RestElement extends BaseNode {
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1247
|
+
readonly type: 'RestElement';
|
|
1248
|
+
readonly argument: DestructuringPattern;
|
|
1249
|
+
readonly typeAnnotation?: TSTypeAnnotation;
|
|
1250
|
+
readonly optional?: boolean;
|
|
1251
|
+
readonly value?: AssignmentPattern;
|
|
1252
|
+
readonly decorators?: ReadonlyArray<Decorator>;
|
|
1283
1253
|
}
|
|
1284
1254
|
export interface ReturnStatement extends BaseNode {
|
|
1285
|
-
|
|
1286
|
-
|
|
1255
|
+
readonly type: 'ReturnStatement';
|
|
1256
|
+
readonly argument: Expression | null;
|
|
1287
1257
|
}
|
|
1288
1258
|
export interface SequenceExpression extends BaseNode {
|
|
1289
|
-
|
|
1290
|
-
|
|
1259
|
+
readonly type: 'SequenceExpression';
|
|
1260
|
+
readonly expressions: ReadonlyArray<Expression>;
|
|
1291
1261
|
}
|
|
1292
1262
|
export interface SourceLocation {
|
|
1293
1263
|
/**
|
|
1294
1264
|
* The position of the first character of the parsed source region
|
|
1295
1265
|
*/
|
|
1296
|
-
|
|
1266
|
+
readonly start: Position;
|
|
1297
1267
|
/**
|
|
1298
1268
|
* The position of the first character after the parsed source region
|
|
1299
1269
|
*/
|
|
1300
|
-
|
|
1270
|
+
readonly end: Position;
|
|
1301
1271
|
}
|
|
1302
1272
|
export interface SpreadElement extends BaseNode {
|
|
1303
|
-
|
|
1304
|
-
|
|
1273
|
+
readonly type: 'SpreadElement';
|
|
1274
|
+
readonly argument: Expression;
|
|
1305
1275
|
}
|
|
1306
1276
|
export type Statement =
|
|
1307
1277
|
| BlockStatement
|
|
@@ -1337,57 +1307,57 @@ export type Statement =
|
|
|
1337
1307
|
| WhileStatement
|
|
1338
1308
|
| WithStatement;
|
|
1339
1309
|
export interface StaticBlock extends BaseNode {
|
|
1340
|
-
|
|
1341
|
-
|
|
1310
|
+
readonly type: 'StaticBlock';
|
|
1311
|
+
readonly body: ReadonlyArray<Statement>;
|
|
1342
1312
|
}
|
|
1343
1313
|
export interface StringLiteral extends LiteralBase {
|
|
1344
|
-
|
|
1345
|
-
|
|
1314
|
+
readonly type: 'Literal';
|
|
1315
|
+
readonly value: string;
|
|
1346
1316
|
}
|
|
1347
1317
|
export interface StringToken extends BaseToken {
|
|
1348
|
-
|
|
1318
|
+
readonly type: 'String';
|
|
1349
1319
|
}
|
|
1350
1320
|
export interface Super extends BaseNode {
|
|
1351
|
-
|
|
1321
|
+
readonly type: 'Super';
|
|
1352
1322
|
}
|
|
1353
1323
|
export interface SwitchCase extends BaseNode {
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1324
|
+
readonly type: 'SwitchCase';
|
|
1325
|
+
readonly test: Expression | null;
|
|
1326
|
+
readonly consequent: ReadonlyArray<Statement>;
|
|
1357
1327
|
}
|
|
1358
1328
|
export interface SwitchStatement extends BaseNode {
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1329
|
+
readonly type: 'SwitchStatement';
|
|
1330
|
+
readonly discriminant: Expression;
|
|
1331
|
+
readonly cases: ReadonlyArray<SwitchCase>;
|
|
1362
1332
|
}
|
|
1363
1333
|
export interface TaggedTemplateExpression extends BaseNode {
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1334
|
+
readonly type: 'TaggedTemplateExpression';
|
|
1335
|
+
readonly typeParameters?: TSTypeParameterInstantiation;
|
|
1336
|
+
readonly tag: LeftHandSideExpression;
|
|
1337
|
+
readonly quasi: TemplateLiteral;
|
|
1368
1338
|
}
|
|
1369
1339
|
export interface TemplateElement extends BaseNode {
|
|
1370
|
-
|
|
1371
|
-
|
|
1340
|
+
readonly type: 'TemplateElement';
|
|
1341
|
+
readonly value: {
|
|
1372
1342
|
raw: string,
|
|
1373
1343
|
cooked: string,
|
|
1374
1344
|
};
|
|
1375
|
-
|
|
1345
|
+
readonly tail: boolean;
|
|
1376
1346
|
}
|
|
1377
1347
|
export interface TemplateLiteral extends BaseNode {
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1348
|
+
readonly type: 'TemplateLiteral';
|
|
1349
|
+
readonly quasis: ReadonlyArray<TemplateElement>;
|
|
1350
|
+
readonly expressions: ReadonlyArray<Expression>;
|
|
1381
1351
|
}
|
|
1382
1352
|
export interface TemplateToken extends BaseToken {
|
|
1383
|
-
|
|
1353
|
+
readonly type: 'Template';
|
|
1384
1354
|
}
|
|
1385
1355
|
export interface ThisExpression extends BaseNode {
|
|
1386
|
-
|
|
1356
|
+
readonly type: 'ThisExpression';
|
|
1387
1357
|
}
|
|
1388
1358
|
export interface ThrowStatement extends BaseNode {
|
|
1389
|
-
|
|
1390
|
-
|
|
1359
|
+
readonly type: 'ThrowStatement';
|
|
1360
|
+
readonly argument: Statement | TSAsExpression | null;
|
|
1391
1361
|
}
|
|
1392
1362
|
export type Token =
|
|
1393
1363
|
| BooleanToken
|
|
@@ -1403,132 +1373,126 @@ export type Token =
|
|
|
1403
1373
|
| StringToken
|
|
1404
1374
|
| TemplateToken;
|
|
1405
1375
|
export interface TryStatement extends BaseNode {
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1376
|
+
readonly type: 'TryStatement';
|
|
1377
|
+
readonly block: BlockStatement;
|
|
1378
|
+
readonly handler: CatchClause | null;
|
|
1379
|
+
readonly finalizer: BlockStatement | null;
|
|
1410
1380
|
}
|
|
1411
1381
|
export interface TSAbstractKeyword extends BaseNode {
|
|
1412
|
-
|
|
1382
|
+
readonly type: 'TSAbstractKeyword';
|
|
1413
1383
|
}
|
|
1414
1384
|
export type TSAbstractMethodDefinition =
|
|
1415
1385
|
| TSAbstractMethodDefinitionComputedName
|
|
1416
1386
|
| TSAbstractMethodDefinitionNonComputedName;
|
|
1417
|
-
export interface TSAbstractMethodDefinitionComputedName
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
+computed: true;
|
|
1387
|
+
export interface TSAbstractMethodDefinitionComputedName extends MethodDefinitionComputedNameBase {
|
|
1388
|
+
readonly type: 'TSAbstractMethodDefinition';
|
|
1389
|
+
readonly computed: true;
|
|
1421
1390
|
}
|
|
1422
|
-
export interface TSAbstractMethodDefinitionNonComputedName
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
+computed: false;
|
|
1391
|
+
export interface TSAbstractMethodDefinitionNonComputedName extends MethodDefinitionNonComputedNameBase {
|
|
1392
|
+
readonly type: 'TSAbstractMethodDefinition';
|
|
1393
|
+
readonly computed: false;
|
|
1426
1394
|
}
|
|
1427
1395
|
export type TSAbstractPropertyDefinition =
|
|
1428
1396
|
| TSAbstractPropertyDefinitionComputedName
|
|
1429
1397
|
| TSAbstractPropertyDefinitionNonComputedName;
|
|
1430
|
-
export interface TSAbstractPropertyDefinitionComputedName
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
+computed: false;
|
|
1440
|
-
+value: null;
|
|
1398
|
+
export interface TSAbstractPropertyDefinitionComputedName extends PropertyDefinitionComputedNameBase {
|
|
1399
|
+
readonly computed: true;
|
|
1400
|
+
readonly type: 'TSAbstractPropertyDefinition';
|
|
1401
|
+
readonly value: null;
|
|
1402
|
+
}
|
|
1403
|
+
export interface TSAbstractPropertyDefinitionNonComputedName extends PropertyDefinitionNonComputedNameBase {
|
|
1404
|
+
readonly type: 'TSAbstractPropertyDefinition';
|
|
1405
|
+
readonly computed: false;
|
|
1406
|
+
readonly value: null;
|
|
1441
1407
|
}
|
|
1442
1408
|
export interface TSAnyKeyword extends BaseNode {
|
|
1443
|
-
|
|
1409
|
+
readonly type: 'TSAnyKeyword';
|
|
1444
1410
|
}
|
|
1445
1411
|
export interface TSArrayType extends BaseNode {
|
|
1446
|
-
|
|
1447
|
-
|
|
1412
|
+
readonly type: 'TSArrayType';
|
|
1413
|
+
readonly elementType: TypeNode;
|
|
1448
1414
|
}
|
|
1449
1415
|
export interface TSAsExpression extends BaseNode {
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1416
|
+
readonly type: 'TSAsExpression';
|
|
1417
|
+
readonly expression: Expression;
|
|
1418
|
+
readonly typeAnnotation: TypeNode;
|
|
1453
1419
|
}
|
|
1454
1420
|
export interface TSAsyncKeyword extends BaseNode {
|
|
1455
|
-
|
|
1421
|
+
readonly type: 'TSAsyncKeyword';
|
|
1456
1422
|
}
|
|
1457
1423
|
export interface TSBigIntKeyword extends BaseNode {
|
|
1458
|
-
|
|
1424
|
+
readonly type: 'TSBigIntKeyword';
|
|
1459
1425
|
}
|
|
1460
1426
|
export interface TSBooleanKeyword extends BaseNode {
|
|
1461
|
-
|
|
1427
|
+
readonly type: 'TSBooleanKeyword';
|
|
1462
1428
|
}
|
|
1463
1429
|
export interface TSCallSignatureDeclaration extends TSFunctionSignatureBase {
|
|
1464
|
-
|
|
1430
|
+
readonly type: 'TSCallSignatureDeclaration';
|
|
1465
1431
|
}
|
|
1466
1432
|
export interface TSClassImplements extends TSHeritageBase {
|
|
1467
|
-
|
|
1433
|
+
readonly type: 'TSClassImplements';
|
|
1468
1434
|
}
|
|
1469
1435
|
export interface TSConditionalType extends BaseNode {
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1436
|
+
readonly type: 'TSConditionalType';
|
|
1437
|
+
readonly checkType: TypeNode;
|
|
1438
|
+
readonly extendsType: TypeNode;
|
|
1439
|
+
readonly trueType: TypeNode;
|
|
1440
|
+
readonly falseType: TypeNode;
|
|
1475
1441
|
}
|
|
1476
1442
|
export interface TSConstructorType extends TSFunctionSignatureBase {
|
|
1477
|
-
|
|
1478
|
-
|
|
1443
|
+
readonly type: 'TSConstructorType';
|
|
1444
|
+
readonly abstract: boolean;
|
|
1479
1445
|
}
|
|
1480
|
-
export interface TSConstructSignatureDeclaration
|
|
1481
|
-
|
|
1482
|
-
+type: 'TSConstructSignatureDeclaration';
|
|
1446
|
+
export interface TSConstructSignatureDeclaration extends TSFunctionSignatureBase {
|
|
1447
|
+
readonly type: 'TSConstructSignatureDeclaration';
|
|
1483
1448
|
}
|
|
1484
1449
|
export interface TSDeclareFunction extends FunctionBase {
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1450
|
+
readonly type: 'TSDeclareFunction';
|
|
1451
|
+
readonly body?: BlockStatement;
|
|
1452
|
+
readonly declare?: boolean;
|
|
1453
|
+
readonly expression: false;
|
|
1489
1454
|
}
|
|
1490
1455
|
export interface TSDeclareKeyword extends BaseNode {
|
|
1491
|
-
|
|
1456
|
+
readonly type: 'TSDeclareKeyword';
|
|
1492
1457
|
}
|
|
1493
1458
|
export interface TSEmptyBodyFunctionExpression extends FunctionBase {
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1459
|
+
readonly type: 'TSEmptyBodyFunctionExpression';
|
|
1460
|
+
readonly body: null;
|
|
1461
|
+
readonly id: null;
|
|
1497
1462
|
}
|
|
1498
1463
|
export interface TSEnumDeclaration extends BaseNode {
|
|
1499
|
-
|
|
1464
|
+
readonly type: 'TSEnumDeclaration';
|
|
1500
1465
|
/**
|
|
1501
1466
|
* Whether this is a `const` enum.
|
|
1502
1467
|
* ```
|
|
1503
1468
|
* const enum Foo {...}
|
|
1504
1469
|
* ```
|
|
1505
1470
|
*/
|
|
1506
|
-
|
|
1471
|
+
readonly const?: boolean;
|
|
1507
1472
|
/**
|
|
1508
1473
|
* Whether this is a `declare`d enum.
|
|
1509
1474
|
* ```
|
|
1510
1475
|
* declare enum Foo {...}
|
|
1511
1476
|
* ```
|
|
1512
1477
|
*/
|
|
1513
|
-
|
|
1478
|
+
readonly declare?: boolean;
|
|
1514
1479
|
/**
|
|
1515
1480
|
* The enum name.
|
|
1516
1481
|
*/
|
|
1517
|
-
|
|
1482
|
+
readonly id: Identifier;
|
|
1518
1483
|
/**
|
|
1519
1484
|
* The enum members.
|
|
1520
1485
|
*/
|
|
1521
|
-
|
|
1522
|
-
|
|
1486
|
+
readonly members: ReadonlyArray<TSEnumMember>;
|
|
1487
|
+
readonly modifiers?: ReadonlyArray<Modifier>;
|
|
1523
1488
|
}
|
|
1524
1489
|
export type TSEnumMember =
|
|
1525
|
-
|
|
|
1526
|
-
| TSEnumMemberNonComputedName;
|
|
1490
|
+
TSEnumMemberComputedName | TSEnumMemberNonComputedName;
|
|
1527
1491
|
interface TSEnumMemberBase extends BaseNode {
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1492
|
+
readonly type: 'TSEnumMember';
|
|
1493
|
+
readonly id: PropertyNameComputed | PropertyNameNonComputed;
|
|
1494
|
+
readonly initializer?: Expression;
|
|
1495
|
+
readonly computed?: boolean;
|
|
1532
1496
|
}
|
|
1533
1497
|
/**
|
|
1534
1498
|
* this should only really happen in semantically invalid code (errors 1164 and 2452)
|
|
@@ -1542,44 +1506,44 @@ interface TSEnumMemberBase extends BaseNode {
|
|
|
1542
1506
|
* enum Bar { ['a' + 'b'] }
|
|
1543
1507
|
*/
|
|
1544
1508
|
export interface TSEnumMemberComputedName extends TSEnumMemberBase {
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1509
|
+
readonly type: 'TSEnumMember';
|
|
1510
|
+
readonly id: PropertyNameComputed;
|
|
1511
|
+
readonly computed: true;
|
|
1548
1512
|
}
|
|
1549
1513
|
export interface TSEnumMemberNonComputedName extends TSEnumMemberBase {
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1514
|
+
readonly type: 'TSEnumMember';
|
|
1515
|
+
readonly id: PropertyNameNonComputed;
|
|
1516
|
+
readonly computed?: false;
|
|
1553
1517
|
}
|
|
1554
1518
|
export interface TSExportAssignment extends BaseNode {
|
|
1555
|
-
|
|
1556
|
-
|
|
1519
|
+
readonly type: 'TSExportAssignment';
|
|
1520
|
+
readonly expression: Expression;
|
|
1557
1521
|
}
|
|
1558
1522
|
export interface TSExportKeyword extends BaseNode {
|
|
1559
|
-
|
|
1523
|
+
readonly type: 'TSExportKeyword';
|
|
1560
1524
|
}
|
|
1561
1525
|
export interface TSExternalModuleReference extends BaseNode {
|
|
1562
|
-
|
|
1563
|
-
|
|
1526
|
+
readonly type: 'TSExternalModuleReference';
|
|
1527
|
+
readonly expression: Expression;
|
|
1564
1528
|
}
|
|
1565
1529
|
interface TSFunctionSignatureBase extends BaseNode {
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1530
|
+
readonly params: ReadonlyArray<Parameter>;
|
|
1531
|
+
readonly returnType?: TSTypeAnnotation;
|
|
1532
|
+
readonly typeParameters?: TSTypeParameterDeclaration;
|
|
1569
1533
|
}
|
|
1570
1534
|
export interface TSFunctionType extends TSFunctionSignatureBase {
|
|
1571
|
-
|
|
1535
|
+
readonly type: 'TSFunctionType';
|
|
1572
1536
|
}
|
|
1573
1537
|
interface TSHeritageBase extends BaseNode {
|
|
1574
|
-
|
|
1575
|
-
|
|
1538
|
+
readonly expression: Expression;
|
|
1539
|
+
readonly typeArguments?: TSTypeParameterInstantiation;
|
|
1576
1540
|
}
|
|
1577
1541
|
export interface TSImportEqualsDeclaration extends BaseNode {
|
|
1578
|
-
|
|
1542
|
+
readonly type: 'TSImportEqualsDeclaration';
|
|
1579
1543
|
/**
|
|
1580
1544
|
* The locally imported name
|
|
1581
1545
|
*/
|
|
1582
|
-
|
|
1546
|
+
readonly id: Identifier;
|
|
1583
1547
|
/**
|
|
1584
1548
|
* The value being aliased.
|
|
1585
1549
|
* ```
|
|
@@ -1588,132 +1552,131 @@ export interface TSImportEqualsDeclaration extends BaseNode {
|
|
|
1588
1552
|
* import F3 = require('mod');
|
|
1589
1553
|
* ```
|
|
1590
1554
|
*/
|
|
1591
|
-
|
|
1592
|
-
|
|
1555
|
+
readonly moduleReference: EntityName | TSExternalModuleReference;
|
|
1556
|
+
readonly importKind: ImportKind;
|
|
1593
1557
|
/**
|
|
1594
1558
|
* Whether this is immediately exported
|
|
1595
1559
|
* ```
|
|
1596
1560
|
* export import F = A;
|
|
1597
1561
|
* ```
|
|
1598
1562
|
*/
|
|
1599
|
-
|
|
1563
|
+
readonly isExport: boolean;
|
|
1600
1564
|
}
|
|
1601
1565
|
export interface TSImportType extends BaseNode {
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1566
|
+
readonly type: 'TSImportType';
|
|
1567
|
+
readonly argument?: TypeNode;
|
|
1568
|
+
readonly options: ObjectExpression | null;
|
|
1569
|
+
readonly qualifier: EntityName | null;
|
|
1570
|
+
readonly source?: StringLiteral;
|
|
1571
|
+
readonly typeArguments: TSTypeParameterInstantiation | null;
|
|
1607
1572
|
}
|
|
1608
1573
|
export interface TSIndexedAccessType extends BaseNode {
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1574
|
+
readonly type: 'TSIndexedAccessType';
|
|
1575
|
+
readonly objectType: TypeNode;
|
|
1576
|
+
readonly indexType: TypeNode;
|
|
1612
1577
|
}
|
|
1613
1578
|
export interface TSIndexSignature extends BaseNode {
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1579
|
+
readonly type: 'TSIndexSignature';
|
|
1580
|
+
readonly accessibility?: Accessibility;
|
|
1581
|
+
readonly export?: boolean;
|
|
1582
|
+
readonly parameters: ReadonlyArray<Parameter>;
|
|
1583
|
+
readonly readonly?: boolean;
|
|
1584
|
+
readonly static?: boolean;
|
|
1585
|
+
readonly typeAnnotation?: TSTypeAnnotation;
|
|
1621
1586
|
}
|
|
1622
1587
|
export interface TSInferType extends BaseNode {
|
|
1623
|
-
|
|
1624
|
-
|
|
1588
|
+
readonly type: 'TSInferType';
|
|
1589
|
+
readonly typeParameter: TSTypeParameter;
|
|
1625
1590
|
}
|
|
1626
1591
|
export interface TSInstantiationExpression extends BaseNode {
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1592
|
+
readonly type: 'TSInstantiationExpression';
|
|
1593
|
+
readonly expression: Expression;
|
|
1594
|
+
readonly typeArguments: TSTypeParameterInstantiation;
|
|
1630
1595
|
}
|
|
1631
1596
|
export interface TSInterfaceBody extends BaseNode {
|
|
1632
|
-
|
|
1633
|
-
|
|
1597
|
+
readonly type: 'TSInterfaceBody';
|
|
1598
|
+
readonly body: ReadonlyArray<TypeElement>;
|
|
1634
1599
|
}
|
|
1635
1600
|
export interface TSInterfaceDeclaration extends BaseNode {
|
|
1636
|
-
|
|
1637
|
-
|
|
1601
|
+
readonly type: 'TSInterfaceDeclaration';
|
|
1602
|
+
readonly abstract?: boolean;
|
|
1638
1603
|
/**
|
|
1639
1604
|
* The body of the interface
|
|
1640
1605
|
*/
|
|
1641
|
-
|
|
1606
|
+
readonly body: TSInterfaceBody;
|
|
1642
1607
|
/**
|
|
1643
1608
|
* Whether the interface was `declare`d, `undefined` otherwise
|
|
1644
1609
|
*/
|
|
1645
|
-
|
|
1610
|
+
readonly declare?: boolean;
|
|
1646
1611
|
/**
|
|
1647
1612
|
* The types this interface `extends`
|
|
1648
1613
|
*/
|
|
1649
|
-
|
|
1614
|
+
readonly extends?: ReadonlyArray<TSInterfaceHeritage>;
|
|
1650
1615
|
/**
|
|
1651
1616
|
* The name of this interface
|
|
1652
1617
|
*/
|
|
1653
|
-
|
|
1654
|
-
|
|
1618
|
+
readonly id: Identifier;
|
|
1619
|
+
readonly implements?: ReadonlyArray<TSInterfaceHeritage>;
|
|
1655
1620
|
/**
|
|
1656
1621
|
* The generic type parameters declared for the interface.
|
|
1657
1622
|
* This is `undefined` if there are no generic type parameters declared.
|
|
1658
1623
|
*/
|
|
1659
|
-
|
|
1624
|
+
readonly typeParameters?: TSTypeParameterDeclaration;
|
|
1660
1625
|
}
|
|
1661
1626
|
export interface TSInterfaceHeritage extends TSHeritageBase {
|
|
1662
|
-
|
|
1627
|
+
readonly type: 'TSInterfaceHeritage';
|
|
1663
1628
|
}
|
|
1664
1629
|
export interface TSIntersectionType extends BaseNode {
|
|
1665
|
-
|
|
1666
|
-
|
|
1630
|
+
readonly type: 'TSIntersectionType';
|
|
1631
|
+
readonly types: ReadonlyArray<TypeNode>;
|
|
1667
1632
|
}
|
|
1668
1633
|
export interface TSIntrinsicKeyword extends BaseNode {
|
|
1669
|
-
|
|
1634
|
+
readonly type: 'TSIntrinsicKeyword';
|
|
1670
1635
|
}
|
|
1671
1636
|
export interface TSLiteralType extends BaseNode {
|
|
1672
|
-
|
|
1673
|
-
|
|
1637
|
+
readonly type: 'TSLiteralType';
|
|
1638
|
+
readonly literal: LiteralExpression | UnaryExpression | UpdateExpression;
|
|
1674
1639
|
}
|
|
1675
1640
|
export interface TSMappedType extends BaseNode {
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1641
|
+
readonly type: 'TSMappedType';
|
|
1642
|
+
readonly typeParameter: TSTypeParameter;
|
|
1643
|
+
readonly readonly?: boolean | '-' | '+';
|
|
1644
|
+
readonly optional?: boolean | '-' | '+';
|
|
1645
|
+
readonly typeAnnotation?: TypeNode;
|
|
1646
|
+
readonly nameType: TypeNode | null;
|
|
1682
1647
|
}
|
|
1683
1648
|
export type TSMethodSignature =
|
|
1684
|
-
|
|
|
1685
|
-
| TSMethodSignatureNonComputedName;
|
|
1649
|
+
TSMethodSignatureComputedName | TSMethodSignatureNonComputedName;
|
|
1686
1650
|
interface TSMethodSignatureBase extends BaseNode {
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1651
|
+
readonly type: 'TSMethodSignature';
|
|
1652
|
+
readonly accessibility?: Accessibility;
|
|
1653
|
+
readonly computed: boolean;
|
|
1654
|
+
readonly export?: boolean;
|
|
1655
|
+
readonly key: PropertyName;
|
|
1656
|
+
readonly kind: 'get' | 'method' | 'set';
|
|
1657
|
+
readonly optional?: boolean;
|
|
1658
|
+
readonly params: ReadonlyArray<Parameter>;
|
|
1659
|
+
readonly readonly?: boolean;
|
|
1660
|
+
readonly returnType?: TSTypeAnnotation;
|
|
1661
|
+
readonly static?: boolean;
|
|
1662
|
+
readonly typeParameters?: TSTypeParameterDeclaration;
|
|
1699
1663
|
}
|
|
1700
1664
|
export interface TSMethodSignatureComputedName extends TSMethodSignatureBase {
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1665
|
+
readonly type: 'TSMethodSignature';
|
|
1666
|
+
readonly key: PropertyNameComputed;
|
|
1667
|
+
readonly computed: true;
|
|
1704
1668
|
}
|
|
1705
|
-
export interface TSMethodSignatureNonComputedName
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
+computed: false;
|
|
1669
|
+
export interface TSMethodSignatureNonComputedName extends TSMethodSignatureBase {
|
|
1670
|
+
readonly type: 'TSMethodSignature';
|
|
1671
|
+
readonly key: PropertyNameNonComputed;
|
|
1672
|
+
readonly computed: false;
|
|
1710
1673
|
}
|
|
1711
1674
|
export interface TSModuleBlock extends BaseNode {
|
|
1712
|
-
|
|
1713
|
-
|
|
1675
|
+
readonly type: 'TSModuleBlock';
|
|
1676
|
+
readonly body: ReadonlyArray<ProgramStatement>;
|
|
1714
1677
|
}
|
|
1715
1678
|
export interface TSModuleDeclaration extends BaseNode {
|
|
1716
|
-
|
|
1679
|
+
readonly type: 'TSModuleDeclaration';
|
|
1717
1680
|
/**
|
|
1718
1681
|
* The name of the module
|
|
1719
1682
|
* ```
|
|
@@ -1722,231 +1685,225 @@ export interface TSModuleDeclaration extends BaseNode {
|
|
|
1722
1685
|
* module 'a' {}
|
|
1723
1686
|
* ```
|
|
1724
1687
|
*/
|
|
1725
|
-
|
|
1688
|
+
readonly id: Identifier | Literal;
|
|
1726
1689
|
/**
|
|
1727
1690
|
* The body of the module.
|
|
1728
1691
|
* This can only be `undefined` for the code `declare module 'mod';`
|
|
1729
1692
|
* This will be a `TSModuleDeclaration` if the name is "nested" (`Foo.Bar`).
|
|
1730
1693
|
*/
|
|
1731
|
-
|
|
1694
|
+
readonly body?: TSModuleBlock | TSModuleDeclaration;
|
|
1732
1695
|
/**
|
|
1733
1696
|
* Whether this is a global declaration
|
|
1734
1697
|
* ```
|
|
1735
1698
|
* declare global {}
|
|
1736
1699
|
* ```
|
|
1737
1700
|
*/
|
|
1738
|
-
|
|
1701
|
+
readonly global?: boolean;
|
|
1739
1702
|
/**
|
|
1740
1703
|
* Whether the module is `declare`d
|
|
1741
1704
|
* ```
|
|
1742
1705
|
* declare namespace F {}
|
|
1743
1706
|
* ```
|
|
1744
1707
|
*/
|
|
1745
|
-
|
|
1746
|
-
|
|
1708
|
+
readonly declare?: boolean;
|
|
1709
|
+
readonly modifiers?: ReadonlyArray<Modifier>;
|
|
1747
1710
|
}
|
|
1748
1711
|
export interface TSNamedTupleMember extends BaseNode {
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1712
|
+
readonly type: 'TSNamedTupleMember';
|
|
1713
|
+
readonly elementType: TypeNode;
|
|
1714
|
+
readonly label: Identifier;
|
|
1715
|
+
readonly optional: boolean;
|
|
1753
1716
|
}
|
|
1754
1717
|
export interface TSNamespaceExportDeclaration extends BaseNode {
|
|
1755
|
-
|
|
1718
|
+
readonly type: 'TSNamespaceExportDeclaration';
|
|
1756
1719
|
/**
|
|
1757
1720
|
* The name the global variable being exported to
|
|
1758
1721
|
*/
|
|
1759
|
-
|
|
1722
|
+
readonly id: Identifier;
|
|
1760
1723
|
}
|
|
1761
1724
|
export interface TSNeverKeyword extends BaseNode {
|
|
1762
|
-
|
|
1725
|
+
readonly type: 'TSNeverKeyword';
|
|
1763
1726
|
}
|
|
1764
1727
|
export interface TSNonNullExpression extends BaseNode {
|
|
1765
|
-
|
|
1766
|
-
|
|
1728
|
+
readonly type: 'TSNonNullExpression';
|
|
1729
|
+
readonly expression: Expression;
|
|
1767
1730
|
}
|
|
1768
1731
|
export interface TSNullKeyword extends BaseNode {
|
|
1769
|
-
|
|
1732
|
+
readonly type: 'TSNullKeyword';
|
|
1770
1733
|
}
|
|
1771
1734
|
export interface TSNumberKeyword extends BaseNode {
|
|
1772
|
-
|
|
1735
|
+
readonly type: 'TSNumberKeyword';
|
|
1773
1736
|
}
|
|
1774
1737
|
export interface TSObjectKeyword extends BaseNode {
|
|
1775
|
-
|
|
1738
|
+
readonly type: 'TSObjectKeyword';
|
|
1776
1739
|
}
|
|
1777
1740
|
export interface TSOptionalType extends BaseNode {
|
|
1778
|
-
|
|
1779
|
-
|
|
1741
|
+
readonly type: 'TSOptionalType';
|
|
1742
|
+
readonly typeAnnotation: TypeNode;
|
|
1780
1743
|
}
|
|
1781
1744
|
export interface TSParameterProperty extends BaseNode {
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
|
|
1745
|
+
readonly type: 'TSParameterProperty';
|
|
1746
|
+
readonly accessibility?: Accessibility;
|
|
1747
|
+
readonly readonly?: boolean;
|
|
1748
|
+
readonly static?: boolean;
|
|
1749
|
+
readonly export?: boolean;
|
|
1750
|
+
readonly override?: boolean;
|
|
1751
|
+
readonly parameter: AssignmentPattern | BindingName | RestElement;
|
|
1752
|
+
readonly decorators?: ReadonlyArray<Decorator>;
|
|
1790
1753
|
}
|
|
1791
1754
|
export interface TSPrivateKeyword extends BaseNode {
|
|
1792
|
-
|
|
1755
|
+
readonly type: 'TSPrivateKeyword';
|
|
1793
1756
|
}
|
|
1794
1757
|
export type TSPropertySignature =
|
|
1795
|
-
|
|
|
1796
|
-
| TSPropertySignatureNonComputedName;
|
|
1758
|
+
TSPropertySignatureComputedName | TSPropertySignatureNonComputedName;
|
|
1797
1759
|
interface TSPropertySignatureBase extends BaseNode {
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
}
|
|
1809
|
-
export interface TSPropertySignatureComputedName
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
+key: PropertyNameNonComputed;
|
|
1819
|
-
+computed: false;
|
|
1760
|
+
readonly type: 'TSPropertySignature';
|
|
1761
|
+
readonly accessibility?: Accessibility;
|
|
1762
|
+
readonly computed: boolean;
|
|
1763
|
+
readonly export?: boolean;
|
|
1764
|
+
readonly initializer?: Expression;
|
|
1765
|
+
readonly key: PropertyName;
|
|
1766
|
+
readonly optional?: boolean;
|
|
1767
|
+
readonly readonly?: boolean;
|
|
1768
|
+
readonly static?: boolean;
|
|
1769
|
+
readonly typeAnnotation?: TSTypeAnnotation;
|
|
1770
|
+
}
|
|
1771
|
+
export interface TSPropertySignatureComputedName extends TSPropertySignatureBase {
|
|
1772
|
+
readonly type: 'TSPropertySignature';
|
|
1773
|
+
readonly key: PropertyNameComputed;
|
|
1774
|
+
readonly computed: true;
|
|
1775
|
+
}
|
|
1776
|
+
export interface TSPropertySignatureNonComputedName extends TSPropertySignatureBase {
|
|
1777
|
+
readonly type: 'TSPropertySignature';
|
|
1778
|
+
readonly key: PropertyNameNonComputed;
|
|
1779
|
+
readonly computed: false;
|
|
1820
1780
|
}
|
|
1821
1781
|
export interface TSProtectedKeyword extends BaseNode {
|
|
1822
|
-
|
|
1782
|
+
readonly type: 'TSProtectedKeyword';
|
|
1823
1783
|
}
|
|
1824
1784
|
export interface TSPublicKeyword extends BaseNode {
|
|
1825
|
-
|
|
1785
|
+
readonly type: 'TSPublicKeyword';
|
|
1826
1786
|
}
|
|
1827
1787
|
export interface TSQualifiedName extends BaseNode {
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
|
|
1788
|
+
readonly type: 'TSQualifiedName';
|
|
1789
|
+
readonly left: EntityName;
|
|
1790
|
+
readonly right: Identifier;
|
|
1831
1791
|
}
|
|
1832
1792
|
export interface TSReadonlyKeyword extends BaseNode {
|
|
1833
|
-
|
|
1793
|
+
readonly type: 'TSReadonlyKeyword';
|
|
1834
1794
|
}
|
|
1835
1795
|
export interface TSRestType extends BaseNode {
|
|
1836
|
-
|
|
1837
|
-
|
|
1796
|
+
readonly type: 'TSRestType';
|
|
1797
|
+
readonly typeAnnotation: TypeNode;
|
|
1838
1798
|
}
|
|
1839
1799
|
export interface TSStaticKeyword extends BaseNode {
|
|
1840
|
-
|
|
1800
|
+
readonly type: 'TSStaticKeyword';
|
|
1841
1801
|
}
|
|
1842
1802
|
export interface TSStringKeyword extends BaseNode {
|
|
1843
|
-
|
|
1803
|
+
readonly type: 'TSStringKeyword';
|
|
1844
1804
|
}
|
|
1845
1805
|
export interface TSSymbolKeyword extends BaseNode {
|
|
1846
|
-
|
|
1806
|
+
readonly type: 'TSSymbolKeyword';
|
|
1847
1807
|
}
|
|
1848
1808
|
export interface TSTemplateLiteralType extends BaseNode {
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1809
|
+
readonly type: 'TSTemplateLiteralType';
|
|
1810
|
+
readonly quasis: ReadonlyArray<TemplateElement>;
|
|
1811
|
+
readonly types: ReadonlyArray<TypeNode>;
|
|
1852
1812
|
}
|
|
1853
1813
|
export interface TSThisType extends BaseNode {
|
|
1854
|
-
|
|
1814
|
+
readonly type: 'TSThisType';
|
|
1855
1815
|
}
|
|
1856
1816
|
export interface TSTupleType extends BaseNode {
|
|
1857
|
-
|
|
1858
|
-
|
|
1817
|
+
readonly type: 'TSTupleType';
|
|
1818
|
+
readonly elementTypes: ReadonlyArray<TypeNode>;
|
|
1859
1819
|
}
|
|
1860
1820
|
export interface TSTypeAliasDeclaration extends BaseNode {
|
|
1861
|
-
|
|
1821
|
+
readonly type: 'TSTypeAliasDeclaration';
|
|
1862
1822
|
/**
|
|
1863
1823
|
* Whether the type was `declare`d.
|
|
1864
1824
|
* ```
|
|
1865
1825
|
* declare type T = 1;
|
|
1866
1826
|
* ```
|
|
1867
1827
|
*/
|
|
1868
|
-
|
|
1828
|
+
readonly declare?: boolean;
|
|
1869
1829
|
/**
|
|
1870
1830
|
* The name of the type.
|
|
1871
1831
|
*/
|
|
1872
|
-
|
|
1832
|
+
readonly id: Identifier;
|
|
1873
1833
|
/**
|
|
1874
1834
|
* The "value" (type) of the declaration
|
|
1875
1835
|
*/
|
|
1876
|
-
|
|
1836
|
+
readonly typeAnnotation: TypeNode;
|
|
1877
1837
|
/**
|
|
1878
1838
|
* The generic type parameters declared for the type.
|
|
1879
1839
|
* This is `undefined` if there are no generic type parameters declared.
|
|
1880
1840
|
*/
|
|
1881
|
-
|
|
1841
|
+
readonly typeParameters?: TSTypeParameterDeclaration;
|
|
1882
1842
|
}
|
|
1883
1843
|
export interface TSTypeAnnotation extends BaseNode {
|
|
1884
|
-
|
|
1885
|
-
|
|
1844
|
+
readonly type: 'TSTypeAnnotation';
|
|
1845
|
+
readonly typeAnnotation: TypeNode;
|
|
1886
1846
|
}
|
|
1887
1847
|
export interface TSTypeAssertion extends BaseNode {
|
|
1888
|
-
|
|
1889
|
-
|
|
1890
|
-
|
|
1848
|
+
readonly type: 'TSTypeAssertion';
|
|
1849
|
+
readonly typeAnnotation: TypeNode;
|
|
1850
|
+
readonly expression: Expression;
|
|
1891
1851
|
}
|
|
1892
1852
|
export interface TSTypeLiteral extends BaseNode {
|
|
1893
|
-
|
|
1894
|
-
|
|
1853
|
+
readonly type: 'TSTypeLiteral';
|
|
1854
|
+
readonly members: ReadonlyArray<TypeElement>;
|
|
1895
1855
|
}
|
|
1896
1856
|
export interface TSTypeOperator extends BaseNode {
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
|
|
1857
|
+
readonly type: 'TSTypeOperator';
|
|
1858
|
+
readonly operator: 'keyof' | 'readonly' | 'unique';
|
|
1859
|
+
readonly typeAnnotation?: TypeNode;
|
|
1900
1860
|
}
|
|
1901
1861
|
export interface TSTypeParameter extends BaseNode {
|
|
1902
|
-
|
|
1903
|
-
|
|
1904
|
-
|
|
1905
|
-
|
|
1906
|
-
|
|
1907
|
-
|
|
1862
|
+
readonly type: 'TSTypeParameter';
|
|
1863
|
+
readonly name: Identifier;
|
|
1864
|
+
readonly constraint?: TypeNode;
|
|
1865
|
+
readonly default?: TypeNode;
|
|
1866
|
+
readonly in: boolean;
|
|
1867
|
+
readonly out: boolean;
|
|
1908
1868
|
}
|
|
1909
1869
|
export interface TSTypeParameterDeclaration extends BaseNode {
|
|
1910
|
-
|
|
1911
|
-
|
|
1870
|
+
readonly type: 'TSTypeParameterDeclaration';
|
|
1871
|
+
readonly params: ReadonlyArray<TSTypeParameter>;
|
|
1912
1872
|
}
|
|
1913
1873
|
export interface TSTypeParameterInstantiation extends BaseNode {
|
|
1914
|
-
|
|
1915
|
-
|
|
1874
|
+
readonly type: 'TSTypeParameterInstantiation';
|
|
1875
|
+
readonly params: ReadonlyArray<TypeNode>;
|
|
1916
1876
|
}
|
|
1917
1877
|
export interface TSTypePredicate extends BaseNode {
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1878
|
+
readonly type: 'TSTypePredicate';
|
|
1879
|
+
readonly asserts: boolean;
|
|
1880
|
+
readonly parameterName: Identifier | TSThisType;
|
|
1881
|
+
readonly typeAnnotation: TSTypeAnnotation | null;
|
|
1922
1882
|
}
|
|
1923
1883
|
export interface TSTypeQuery extends BaseNode {
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
|
|
1884
|
+
readonly type: 'TSTypeQuery';
|
|
1885
|
+
readonly exprName: EntityName | TSImportType;
|
|
1886
|
+
readonly typeArguments?: TSTypeParameterInstantiation;
|
|
1927
1887
|
}
|
|
1928
1888
|
export interface TSTypeReference extends BaseNode {
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
|
|
1889
|
+
readonly type: 'TSTypeReference';
|
|
1890
|
+
readonly typeName: EntityName;
|
|
1891
|
+
readonly typeArguments?: TSTypeParameterInstantiation;
|
|
1932
1892
|
}
|
|
1933
1893
|
export type TSUnaryExpression =
|
|
1934
|
-
|
|
|
1935
|
-
| LeftHandSideExpression
|
|
1936
|
-
| UnaryExpression
|
|
1937
|
-
| UpdateExpression;
|
|
1894
|
+
AwaitExpression | LeftHandSideExpression | UnaryExpression | UpdateExpression;
|
|
1938
1895
|
export interface TSUndefinedKeyword extends BaseNode {
|
|
1939
|
-
|
|
1896
|
+
readonly type: 'TSUndefinedKeyword';
|
|
1940
1897
|
}
|
|
1941
1898
|
export interface TSUnionType extends BaseNode {
|
|
1942
|
-
|
|
1943
|
-
|
|
1899
|
+
readonly type: 'TSUnionType';
|
|
1900
|
+
readonly types: ReadonlyArray<TypeNode>;
|
|
1944
1901
|
}
|
|
1945
1902
|
export interface TSUnknownKeyword extends BaseNode {
|
|
1946
|
-
|
|
1903
|
+
readonly type: 'TSUnknownKeyword';
|
|
1947
1904
|
}
|
|
1948
1905
|
export interface TSVoidKeyword extends BaseNode {
|
|
1949
|
-
|
|
1906
|
+
readonly type: 'TSVoidKeyword';
|
|
1950
1907
|
}
|
|
1951
1908
|
export type TypeElement =
|
|
1952
1909
|
| TSCallSignatureDeclaration
|
|
@@ -2001,20 +1958,20 @@ export type TypeNode =
|
|
|
2001
1958
|
| TSUnknownKeyword
|
|
2002
1959
|
| TSVoidKeyword;
|
|
2003
1960
|
export interface UnaryExpression extends UnaryExpressionBase {
|
|
2004
|
-
|
|
2005
|
-
|
|
1961
|
+
readonly type: 'UnaryExpression';
|
|
1962
|
+
readonly operator: '-' | '!' | '+' | '~' | 'delete' | 'typeof' | 'void';
|
|
2006
1963
|
}
|
|
2007
1964
|
interface UnaryExpressionBase extends BaseNode {
|
|
2008
|
-
|
|
2009
|
-
|
|
2010
|
-
|
|
1965
|
+
readonly operator: string;
|
|
1966
|
+
readonly prefix: boolean;
|
|
1967
|
+
readonly argument: LeftHandSideExpression | Literal | UnaryExpression;
|
|
2011
1968
|
}
|
|
2012
1969
|
export interface UpdateExpression extends UnaryExpressionBase {
|
|
2013
|
-
|
|
2014
|
-
|
|
1970
|
+
readonly type: 'UpdateExpression';
|
|
1971
|
+
readonly operator: '--' | '++';
|
|
2015
1972
|
}
|
|
2016
1973
|
export interface VariableDeclaration extends BaseNode {
|
|
2017
|
-
|
|
1974
|
+
readonly type: 'VariableDeclaration';
|
|
2018
1975
|
/**
|
|
2019
1976
|
* The variables declared by this declaration.
|
|
2020
1977
|
* Note that there may be 0 declarations (i.e. `const;`).
|
|
@@ -2023,14 +1980,14 @@ export interface VariableDeclaration extends BaseNode {
|
|
|
2023
1980
|
* let y, z;
|
|
2024
1981
|
* ```
|
|
2025
1982
|
*/
|
|
2026
|
-
|
|
1983
|
+
readonly declarations: ReadonlyArray<VariableDeclarator>;
|
|
2027
1984
|
/**
|
|
2028
1985
|
* Whether the declaration is `declare`d
|
|
2029
1986
|
* ```
|
|
2030
1987
|
* declare const x = 1;
|
|
2031
1988
|
* ```
|
|
2032
1989
|
*/
|
|
2033
|
-
|
|
1990
|
+
readonly declare?: boolean;
|
|
2034
1991
|
/**
|
|
2035
1992
|
* The keyword used to declare the variable(s)
|
|
2036
1993
|
* ```
|
|
@@ -2039,26 +1996,26 @@ export interface VariableDeclaration extends BaseNode {
|
|
|
2039
1996
|
* var z = 3;
|
|
2040
1997
|
* ```
|
|
2041
1998
|
*/
|
|
2042
|
-
|
|
1999
|
+
readonly kind: 'const' | 'let' | 'var';
|
|
2043
2000
|
}
|
|
2044
2001
|
export interface VariableDeclarator extends BaseNode {
|
|
2045
|
-
|
|
2046
|
-
|
|
2047
|
-
|
|
2048
|
-
|
|
2002
|
+
readonly type: 'VariableDeclarator';
|
|
2003
|
+
readonly id: BindingName;
|
|
2004
|
+
readonly init: Expression | null;
|
|
2005
|
+
readonly definite?: boolean;
|
|
2049
2006
|
}
|
|
2050
2007
|
export interface WhileStatement extends BaseNode {
|
|
2051
|
-
|
|
2052
|
-
|
|
2053
|
-
|
|
2008
|
+
readonly type: 'WhileStatement';
|
|
2009
|
+
readonly test: Expression;
|
|
2010
|
+
readonly body: Statement;
|
|
2054
2011
|
}
|
|
2055
2012
|
export interface WithStatement extends BaseNode {
|
|
2056
|
-
|
|
2057
|
-
|
|
2058
|
-
|
|
2013
|
+
readonly type: 'WithStatement';
|
|
2014
|
+
readonly object: Expression;
|
|
2015
|
+
readonly body: Statement;
|
|
2059
2016
|
}
|
|
2060
2017
|
export interface YieldExpression extends BaseNode {
|
|
2061
|
-
|
|
2062
|
-
|
|
2063
|
-
|
|
2018
|
+
readonly type: 'YieldExpression';
|
|
2019
|
+
readonly delegate: boolean;
|
|
2020
|
+
readonly argument?: Expression;
|
|
2064
2021
|
}
|