hermes-estree 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/generated/HermesESTreeSelectorTypes.js.flow +2472 -1968
- package/dist/generated/predicates.js +2 -2
- package/dist/generated/predicates.js.flow +1 -1
- package/dist/index.js +1 -1
- package/dist/predicates.js +1 -1
- package/dist/selectors.js +1 -1
- package/dist/selectors.js.flow +1 -1
- package/dist/src/generated/predicates.js +2 -2
- package/dist/src/index.js +1 -1
- package/dist/src/predicates.js +1 -1
- package/dist/src/selectors.js +1 -1
- package/dist/src/types.js +51 -3
- package/dist/types.js +51 -3
- package/dist/types.js.flow +882 -924
- package/package.json +3 -2
package/dist/types.js.flow
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
*
|
|
15
15
|
* IMPORTANT NOTE
|
|
16
16
|
*
|
|
17
|
-
* This file intentionally uses interfaces and
|
|
17
|
+
* This file intentionally uses interfaces and `readonly` fields.
|
|
18
18
|
*
|
|
19
19
|
* - `$ReadOnly` is an "evaluated" utility type in flow; meaning that flow does
|
|
20
20
|
* not actually calculate the resulting type until it is used. This creates
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
* - but in this giant circular-referencing graph that is the AST types, this
|
|
25
25
|
* causes check times for consumers to be awful.
|
|
26
26
|
*
|
|
27
|
-
* Thus instead we manually annotate properties with
|
|
27
|
+
* Thus instead we manually annotate properties with `readonly` to avoid the `$ReadOnly` type.
|
|
28
28
|
*
|
|
29
29
|
* - `...Type` spreads do not preserve the readonly-ness of the properties. If
|
|
30
30
|
* we used object literal types then we would have to `$ReadOnly` all spreads
|
|
@@ -39,15 +39,15 @@
|
|
|
39
39
|
export type Range = [number, number];
|
|
40
40
|
|
|
41
41
|
export interface ObjectWithLoc {
|
|
42
|
-
|
|
42
|
+
readonly loc: SourceLocation;
|
|
43
43
|
}
|
|
44
44
|
export interface BaseToken extends ObjectWithLoc {
|
|
45
|
-
|
|
46
|
-
|
|
45
|
+
readonly loc: SourceLocation;
|
|
46
|
+
readonly range: Range;
|
|
47
47
|
}
|
|
48
48
|
export interface BaseNode extends BaseToken {
|
|
49
49
|
// this is added by ESLint and is not part of the ESTree spec
|
|
50
|
-
|
|
50
|
+
readonly parent: ESNode;
|
|
51
51
|
}
|
|
52
52
|
|
|
53
53
|
/*
|
|
@@ -59,7 +59,7 @@ export interface BaseNode extends BaseToken {
|
|
|
59
59
|
*/
|
|
60
60
|
|
|
61
61
|
export interface MostTokens extends BaseToken {
|
|
62
|
-
|
|
62
|
+
readonly type:
|
|
63
63
|
| 'Boolean'
|
|
64
64
|
| 'Identifier'
|
|
65
65
|
| 'JSXIdentifier'
|
|
@@ -75,37 +75,37 @@ export interface MostTokens extends BaseToken {
|
|
|
75
75
|
// comment types
|
|
76
76
|
| 'Block'
|
|
77
77
|
| 'Line';
|
|
78
|
-
|
|
78
|
+
readonly value: string;
|
|
79
79
|
}
|
|
80
80
|
export interface RegexToken extends BaseToken {
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
81
|
+
readonly type: 'RegularExpression';
|
|
82
|
+
readonly value: string;
|
|
83
|
+
readonly regex: {
|
|
84
|
+
readonly pattern: string,
|
|
85
|
+
readonly flags: string,
|
|
86
86
|
};
|
|
87
87
|
}
|
|
88
88
|
export interface LineComment extends BaseToken {
|
|
89
|
-
|
|
90
|
-
|
|
89
|
+
readonly type: 'Line';
|
|
90
|
+
readonly value: string;
|
|
91
91
|
}
|
|
92
92
|
export interface BlockComment extends BaseToken {
|
|
93
|
-
|
|
94
|
-
|
|
93
|
+
readonly type: 'Block';
|
|
94
|
+
readonly value: string;
|
|
95
95
|
}
|
|
96
96
|
export type Comment = LineComment | BlockComment;
|
|
97
97
|
export type Token = MostTokens | RegexToken | Comment;
|
|
98
98
|
|
|
99
99
|
export interface SourceLocation {
|
|
100
|
-
|
|
101
|
-
|
|
100
|
+
readonly start: Position;
|
|
101
|
+
readonly end: Position;
|
|
102
102
|
}
|
|
103
103
|
|
|
104
104
|
export interface Position {
|
|
105
105
|
/** >= 1 */
|
|
106
|
-
|
|
106
|
+
readonly line: number;
|
|
107
107
|
/** >= 0 */
|
|
108
|
-
|
|
108
|
+
readonly column: number;
|
|
109
109
|
}
|
|
110
110
|
|
|
111
111
|
// note: this is only ever present on Program.interpreter, never in the body
|
|
@@ -114,31 +114,31 @@ export interface InterpreterDirective extends BaseNode {
|
|
|
114
114
|
value: string;
|
|
115
115
|
}
|
|
116
116
|
|
|
117
|
-
export type DocblockDirectives =
|
|
117
|
+
export type DocblockDirectives = Readonly<{
|
|
118
118
|
// some well-known tags
|
|
119
|
-
flow?:
|
|
120
|
-
format?:
|
|
121
|
-
noflow?:
|
|
122
|
-
noformat?:
|
|
123
|
-
[string]:
|
|
119
|
+
flow?: ReadonlyArray<string> | void,
|
|
120
|
+
format?: ReadonlyArray<string> | void,
|
|
121
|
+
noflow?: ReadonlyArray<string> | void,
|
|
122
|
+
noformat?: ReadonlyArray<string> | void,
|
|
123
|
+
[string]: ReadonlyArray<string> | void,
|
|
124
124
|
}>;
|
|
125
125
|
|
|
126
|
-
export type DocblockMetadata =
|
|
126
|
+
export type DocblockMetadata = Readonly<{
|
|
127
127
|
directives: DocblockDirectives,
|
|
128
128
|
comment: BlockComment,
|
|
129
129
|
}>;
|
|
130
130
|
|
|
131
131
|
export interface Program extends BaseNode {
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
132
|
+
readonly type: 'Program';
|
|
133
|
+
readonly sourceType: 'script' | 'module';
|
|
134
|
+
readonly body: ReadonlyArray<Statement | ModuleDeclaration>;
|
|
135
|
+
readonly tokens: ReadonlyArray<Token>;
|
|
136
|
+
readonly comments: ReadonlyArray<Comment>;
|
|
137
|
+
readonly loc: SourceLocation;
|
|
138
|
+
readonly interpreter: null | InterpreterDirective;
|
|
139
|
+
readonly docblock: null | DocblockMetadata;
|
|
140
140
|
// program is the only node without a parent - but typing it as such is _super_ annoying and difficult
|
|
141
|
-
|
|
141
|
+
readonly parent: ESNode;
|
|
142
142
|
}
|
|
143
143
|
|
|
144
144
|
// Flow declares a "Node" type as part of its HTML typedefs.
|
|
@@ -226,24 +226,19 @@ export type BindingPattern = ArrayPattern | ObjectPattern;
|
|
|
226
226
|
export type RestElementPattern = AssignmentPattern | BindingName | RestElement;
|
|
227
227
|
export type FunctionParameter = AssignmentPattern | BindingName | RestElement;
|
|
228
228
|
export type DestructuringPattern =
|
|
229
|
-
|
|
|
230
|
-
| AssignmentPattern
|
|
231
|
-
| MemberExpression
|
|
232
|
-
| RestElement;
|
|
229
|
+
BindingName | AssignmentPattern | MemberExpression | RestElement;
|
|
233
230
|
|
|
234
231
|
interface BaseFunction extends BaseNode {
|
|
235
|
-
|
|
236
|
-
|
|
232
|
+
readonly params: ReadonlyArray<FunctionParameter>;
|
|
233
|
+
readonly async: boolean;
|
|
237
234
|
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
235
|
+
readonly predicate: null | InferredPredicate;
|
|
236
|
+
readonly returnType: null | TypeAnnotation;
|
|
237
|
+
readonly typeParameters: null | TypeParameterDeclaration;
|
|
241
238
|
}
|
|
242
239
|
|
|
243
240
|
export type AFunction =
|
|
244
|
-
|
|
|
245
|
-
| FunctionExpression
|
|
246
|
-
| ArrowFunctionExpression;
|
|
241
|
+
FunctionDeclaration | FunctionExpression | ArrowFunctionExpression;
|
|
247
242
|
|
|
248
243
|
export type Statement =
|
|
249
244
|
| BlockStatement
|
|
@@ -300,172 +295,169 @@ export type StatementParentSingle =
|
|
|
300
295
|
| ForOfStatement;
|
|
301
296
|
// nodes that can be the parent of a statement that store the statements in an array
|
|
302
297
|
export type StatementParentArray =
|
|
303
|
-
|
|
|
304
|
-
| Program
|
|
305
|
-
| BlockStatement
|
|
306
|
-
| StaticBlock;
|
|
298
|
+
SwitchCase | Program | BlockStatement | StaticBlock;
|
|
307
299
|
export type StatementParent = StatementParentSingle | StatementParentArray;
|
|
308
300
|
|
|
309
301
|
export interface EmptyStatement extends BaseNode {
|
|
310
|
-
|
|
302
|
+
readonly type: 'EmptyStatement';
|
|
311
303
|
}
|
|
312
304
|
|
|
313
305
|
export interface BlockStatement extends BaseNode {
|
|
314
|
-
|
|
315
|
-
|
|
306
|
+
readonly type: 'BlockStatement';
|
|
307
|
+
readonly body: ReadonlyArray<Statement>;
|
|
316
308
|
}
|
|
317
309
|
|
|
318
310
|
export interface StaticBlock extends BaseNode {
|
|
319
|
-
|
|
320
|
-
|
|
311
|
+
readonly type: 'StaticBlock';
|
|
312
|
+
readonly body: ReadonlyArray<Statement>;
|
|
321
313
|
}
|
|
322
314
|
|
|
323
315
|
export interface ExpressionStatement extends BaseNode {
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
316
|
+
readonly type: 'ExpressionStatement';
|
|
317
|
+
readonly expression: Expression;
|
|
318
|
+
readonly directive: string | null;
|
|
327
319
|
}
|
|
328
320
|
|
|
329
321
|
export interface IfStatement extends BaseNode {
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
322
|
+
readonly type: 'IfStatement';
|
|
323
|
+
readonly test: Expression;
|
|
324
|
+
readonly consequent: Statement;
|
|
325
|
+
readonly alternate?: Statement | null;
|
|
334
326
|
}
|
|
335
327
|
|
|
336
328
|
export interface LabeledStatement extends BaseNode {
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
329
|
+
readonly type: 'LabeledStatement';
|
|
330
|
+
readonly label: Identifier;
|
|
331
|
+
readonly body: Statement;
|
|
340
332
|
}
|
|
341
333
|
|
|
342
334
|
export interface BreakStatement extends BaseNode {
|
|
343
|
-
|
|
344
|
-
|
|
335
|
+
readonly type: 'BreakStatement';
|
|
336
|
+
readonly label?: Identifier | null;
|
|
345
337
|
}
|
|
346
338
|
|
|
347
339
|
export interface ContinueStatement extends BaseNode {
|
|
348
|
-
|
|
349
|
-
|
|
340
|
+
readonly type: 'ContinueStatement';
|
|
341
|
+
readonly label?: Identifier | null;
|
|
350
342
|
}
|
|
351
343
|
|
|
352
344
|
export interface WithStatement extends BaseNode {
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
345
|
+
readonly type: 'WithStatement';
|
|
346
|
+
readonly object: Expression;
|
|
347
|
+
readonly body: Statement;
|
|
356
348
|
}
|
|
357
349
|
|
|
358
350
|
export interface SwitchStatement extends BaseNode {
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
351
|
+
readonly type: 'SwitchStatement';
|
|
352
|
+
readonly discriminant: Expression;
|
|
353
|
+
readonly cases: ReadonlyArray<SwitchCase>;
|
|
362
354
|
}
|
|
363
355
|
|
|
364
356
|
export interface ReturnStatement extends BaseNode {
|
|
365
|
-
|
|
366
|
-
|
|
357
|
+
readonly type: 'ReturnStatement';
|
|
358
|
+
readonly argument?: Expression | null;
|
|
367
359
|
}
|
|
368
360
|
|
|
369
361
|
export interface ThrowStatement extends BaseNode {
|
|
370
|
-
|
|
371
|
-
|
|
362
|
+
readonly type: 'ThrowStatement';
|
|
363
|
+
readonly argument: Expression;
|
|
372
364
|
}
|
|
373
365
|
|
|
374
366
|
export interface TryStatement extends BaseNode {
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
367
|
+
readonly type: 'TryStatement';
|
|
368
|
+
readonly block: BlockStatement;
|
|
369
|
+
readonly handler?: CatchClause | null;
|
|
370
|
+
readonly finalizer?: BlockStatement | null;
|
|
379
371
|
}
|
|
380
372
|
|
|
381
373
|
export interface WhileStatement extends BaseNode {
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
374
|
+
readonly type: 'WhileStatement';
|
|
375
|
+
readonly test: Expression;
|
|
376
|
+
readonly body: Statement;
|
|
385
377
|
}
|
|
386
378
|
|
|
387
379
|
export interface DoWhileStatement extends BaseNode {
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
380
|
+
readonly type: 'DoWhileStatement';
|
|
381
|
+
readonly body: Statement;
|
|
382
|
+
readonly test: Expression;
|
|
391
383
|
}
|
|
392
384
|
|
|
393
385
|
export interface ForStatement extends BaseNode {
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
386
|
+
readonly type: 'ForStatement';
|
|
387
|
+
readonly init?: VariableDeclaration | Expression | null;
|
|
388
|
+
readonly test?: Expression | null;
|
|
389
|
+
readonly update?: Expression | null;
|
|
390
|
+
readonly body: Statement;
|
|
399
391
|
}
|
|
400
392
|
|
|
401
393
|
interface BaseForXStatement extends BaseNode {
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
394
|
+
readonly left: VariableDeclaration | BindingName | MemberExpression;
|
|
395
|
+
readonly right: Expression;
|
|
396
|
+
readonly body: Statement;
|
|
405
397
|
}
|
|
406
398
|
|
|
407
399
|
export interface ForInStatement extends BaseForXStatement {
|
|
408
|
-
|
|
400
|
+
readonly type: 'ForInStatement';
|
|
409
401
|
}
|
|
410
402
|
|
|
411
403
|
export interface ForOfStatement extends BaseForXStatement {
|
|
412
|
-
|
|
413
|
-
|
|
404
|
+
readonly type: 'ForOfStatement';
|
|
405
|
+
readonly await: boolean;
|
|
414
406
|
}
|
|
415
407
|
|
|
416
408
|
export interface DebuggerStatement extends BaseNode {
|
|
417
|
-
|
|
409
|
+
readonly type: 'DebuggerStatement';
|
|
418
410
|
}
|
|
419
411
|
|
|
420
412
|
type ComponentParameterAndRestElement = ComponentParameter | RestElement;
|
|
421
413
|
|
|
422
414
|
export interface ComponentParameter extends BaseNode {
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
415
|
+
readonly type: 'ComponentParameter';
|
|
416
|
+
readonly name: Identifier | StringLiteral;
|
|
417
|
+
readonly local: BindingName | AssignmentPattern;
|
|
418
|
+
readonly shorthand: boolean;
|
|
427
419
|
}
|
|
428
420
|
|
|
429
421
|
export interface ComponentDeclaration extends BaseNode {
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
422
|
+
readonly type: 'ComponentDeclaration';
|
|
423
|
+
readonly async: boolean;
|
|
424
|
+
readonly body: BlockStatement;
|
|
425
|
+
readonly id: Identifier;
|
|
426
|
+
readonly params: ReadonlyArray<ComponentParameterAndRestElement>;
|
|
427
|
+
readonly rendersType: null | RendersType;
|
|
428
|
+
readonly typeParameters: null | TypeParameterDeclaration;
|
|
437
429
|
}
|
|
438
430
|
|
|
439
431
|
export interface HookDeclaration extends BaseNode {
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
432
|
+
readonly type: 'HookDeclaration';
|
|
433
|
+
readonly async: boolean;
|
|
434
|
+
readonly id: Identifier;
|
|
435
|
+
readonly body: BlockStatement;
|
|
436
|
+
readonly params: ReadonlyArray<FunctionParameter>;
|
|
437
|
+
readonly returnType: null | TypeAnnotation;
|
|
438
|
+
readonly typeParameters: null | TypeParameterDeclaration;
|
|
447
439
|
}
|
|
448
440
|
|
|
449
441
|
export interface FunctionDeclaration extends BaseFunction {
|
|
450
|
-
|
|
442
|
+
readonly type: 'FunctionDeclaration';
|
|
451
443
|
/** It is null when a function declaration is a part of the `export default function` statement */
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
444
|
+
readonly id: Identifier | null;
|
|
445
|
+
readonly body: BlockStatement;
|
|
446
|
+
readonly generator: boolean;
|
|
455
447
|
}
|
|
456
448
|
|
|
457
449
|
export interface VariableDeclaration extends BaseNode {
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
450
|
+
readonly type: 'VariableDeclaration';
|
|
451
|
+
readonly declarations: ReadonlyArray<VariableDeclarator>;
|
|
452
|
+
readonly kind: 'var' | 'let' | 'const';
|
|
461
453
|
}
|
|
462
454
|
|
|
463
455
|
export interface VariableDeclarator extends BaseNode {
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
456
|
+
readonly type: 'VariableDeclarator';
|
|
457
|
+
readonly id: BindingName;
|
|
458
|
+
readonly init?: Expression | null;
|
|
467
459
|
|
|
468
|
-
|
|
460
|
+
readonly parent: VariableDeclaration;
|
|
469
461
|
}
|
|
470
462
|
|
|
471
463
|
export type Expression =
|
|
@@ -503,19 +495,19 @@ export type Expression =
|
|
|
503
495
|
| JSXElement;
|
|
504
496
|
|
|
505
497
|
export interface ThisExpression extends BaseNode {
|
|
506
|
-
|
|
498
|
+
readonly type: 'ThisExpression';
|
|
507
499
|
}
|
|
508
500
|
|
|
509
501
|
export interface ArrayExpression extends BaseNode {
|
|
510
|
-
|
|
511
|
-
|
|
502
|
+
readonly type: 'ArrayExpression';
|
|
503
|
+
readonly elements: ReadonlyArray<Expression | SpreadElement>;
|
|
512
504
|
// this is not part of the ESTree spec, but hermes emits it
|
|
513
|
-
|
|
505
|
+
readonly trailingComma: boolean;
|
|
514
506
|
}
|
|
515
507
|
|
|
516
508
|
export interface ObjectExpression extends BaseNode {
|
|
517
|
-
|
|
518
|
-
|
|
509
|
+
readonly type: 'ObjectExpression';
|
|
510
|
+
readonly properties: ReadonlyArray<ObjectProperty | SpreadElement>;
|
|
519
511
|
}
|
|
520
512
|
|
|
521
513
|
// This is the complete type of a "Property"
|
|
@@ -524,51 +516,47 @@ export interface ObjectExpression extends BaseNode {
|
|
|
524
516
|
export type Property = ObjectProperty | DestructuringObjectProperty;
|
|
525
517
|
|
|
526
518
|
export type ObjectPropertyKey =
|
|
527
|
-
|
|
|
528
|
-
| StringLiteral
|
|
529
|
-
| NumericLiteral
|
|
530
|
-
| BigIntLiteral;
|
|
519
|
+
Identifier | StringLiteral | NumericLiteral | BigIntLiteral;
|
|
531
520
|
|
|
532
521
|
export type ObjectProperty =
|
|
533
522
|
| ObjectPropertyWithNonShorthandStaticName
|
|
534
523
|
| ObjectPropertyWithShorthandStaticName
|
|
535
524
|
| ObjectPropertyWithComputedName;
|
|
536
525
|
interface ObjectPropertyBase extends BaseNode {
|
|
537
|
-
|
|
526
|
+
readonly parent:
|
|
527
|
+
ObjectExpression | ObjectPattern | RecordExpressionProperties;
|
|
538
528
|
}
|
|
539
|
-
export interface ObjectPropertyWithNonShorthandStaticName
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
+computed: false;
|
|
529
|
+
export interface ObjectPropertyWithNonShorthandStaticName extends ObjectPropertyBase {
|
|
530
|
+
readonly type: 'Property';
|
|
531
|
+
readonly computed: false;
|
|
543
532
|
// non-computed, non-shorthand names are constrained significantly
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
}
|
|
550
|
-
export interface ObjectPropertyWithShorthandStaticName
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
+computed: false;
|
|
533
|
+
readonly key: ObjectPropertyKey;
|
|
534
|
+
readonly value: Expression;
|
|
535
|
+
readonly kind: 'init' | 'get' | 'set';
|
|
536
|
+
readonly method: boolean;
|
|
537
|
+
readonly shorthand: false;
|
|
538
|
+
}
|
|
539
|
+
export interface ObjectPropertyWithShorthandStaticName extends ObjectPropertyBase {
|
|
540
|
+
readonly type: 'Property';
|
|
541
|
+
readonly computed: false;
|
|
554
542
|
// shorthand keys *must* be identifiers
|
|
555
|
-
|
|
543
|
+
readonly key: Identifier;
|
|
556
544
|
// shorthand values *must* be identifiers (that look the same as the key)
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
545
|
+
readonly value: Identifier;
|
|
546
|
+
readonly kind: 'init';
|
|
547
|
+
readonly method: false;
|
|
548
|
+
readonly shorthand: true;
|
|
561
549
|
}
|
|
562
550
|
export interface ObjectPropertyWithComputedName extends ObjectPropertyBase {
|
|
563
|
-
|
|
564
|
-
|
|
551
|
+
readonly type: 'Property';
|
|
552
|
+
readonly computed: true;
|
|
565
553
|
// computed names can be any expression
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
554
|
+
readonly key: Expression;
|
|
555
|
+
readonly value: Expression;
|
|
556
|
+
readonly kind: 'init' | 'get' | 'set';
|
|
557
|
+
readonly method: boolean;
|
|
570
558
|
// cannot have a shorthand computed name
|
|
571
|
-
|
|
559
|
+
readonly shorthand: false;
|
|
572
560
|
}
|
|
573
561
|
|
|
574
562
|
export type DestructuringObjectProperty =
|
|
@@ -577,171 +565,167 @@ export type DestructuringObjectProperty =
|
|
|
577
565
|
| DestructuringObjectPropertyWithComputedName;
|
|
578
566
|
interface DestructuringObjectPropertyBase extends BaseNode {
|
|
579
567
|
// destructuring properties cannot be methods
|
|
580
|
-
|
|
581
|
-
|
|
568
|
+
readonly kind: 'init';
|
|
569
|
+
readonly method: false;
|
|
582
570
|
|
|
583
|
-
|
|
571
|
+
readonly parent: ObjectExpression | ObjectPattern;
|
|
584
572
|
}
|
|
585
|
-
export interface DestructuringObjectPropertyWithNonShorthandStaticName
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
+computed: false;
|
|
573
|
+
export interface DestructuringObjectPropertyWithNonShorthandStaticName extends DestructuringObjectPropertyBase {
|
|
574
|
+
readonly type: 'Property';
|
|
575
|
+
readonly computed: false;
|
|
589
576
|
// non-computed, non-shorthand names are constrained significantly
|
|
590
|
-
|
|
577
|
+
readonly key: ObjectPropertyKey;
|
|
591
578
|
// destructuring properties cannot have any value
|
|
592
|
-
|
|
593
|
-
|
|
579
|
+
readonly value: DestructuringPattern;
|
|
580
|
+
readonly shorthand: false;
|
|
594
581
|
}
|
|
595
|
-
export interface DestructuringObjectPropertyWithShorthandStaticName
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
+computed: false;
|
|
582
|
+
export interface DestructuringObjectPropertyWithShorthandStaticName extends DestructuringObjectPropertyBase {
|
|
583
|
+
readonly type: 'Property';
|
|
584
|
+
readonly computed: false;
|
|
599
585
|
// shorthand keys *must* be identifiers
|
|
600
|
-
|
|
586
|
+
readonly key: Identifier;
|
|
601
587
|
// shorthand values *must* be identifiers or assignments (that look the same as the key)
|
|
602
|
-
|
|
603
|
-
|
|
588
|
+
readonly value: Identifier | AssignmentPattern;
|
|
589
|
+
readonly shorthand: true;
|
|
604
590
|
}
|
|
605
|
-
export interface DestructuringObjectPropertyWithComputedName
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
+computed: true;
|
|
591
|
+
export interface DestructuringObjectPropertyWithComputedName extends DestructuringObjectPropertyBase {
|
|
592
|
+
readonly type: 'Property';
|
|
593
|
+
readonly computed: true;
|
|
609
594
|
// computed names can be any expression
|
|
610
|
-
|
|
595
|
+
readonly key: Expression;
|
|
611
596
|
// destructuring properties cannot have any value
|
|
612
|
-
|
|
597
|
+
readonly value: DestructuringPattern;
|
|
613
598
|
// cannot have a shorthand computed name
|
|
614
|
-
|
|
599
|
+
readonly shorthand: false;
|
|
615
600
|
}
|
|
616
601
|
|
|
617
602
|
export interface FunctionExpression extends BaseFunction {
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
603
|
+
readonly id?: Identifier | null;
|
|
604
|
+
readonly type: 'FunctionExpression';
|
|
605
|
+
readonly body: BlockStatement;
|
|
606
|
+
readonly generator: boolean;
|
|
622
607
|
}
|
|
623
608
|
|
|
624
609
|
export interface SequenceExpression extends BaseNode {
|
|
625
|
-
|
|
626
|
-
|
|
610
|
+
readonly type: 'SequenceExpression';
|
|
611
|
+
readonly expressions: ReadonlyArray<Expression>;
|
|
627
612
|
}
|
|
628
613
|
|
|
629
614
|
export interface UnaryExpression extends BaseNode {
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
615
|
+
readonly type: 'UnaryExpression';
|
|
616
|
+
readonly operator: UnaryOperator;
|
|
617
|
+
readonly prefix: true;
|
|
618
|
+
readonly argument: Expression;
|
|
634
619
|
}
|
|
635
620
|
|
|
636
621
|
export interface BinaryExpressionWithoutIn extends BaseNode {
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
622
|
+
readonly type: 'BinaryExpression';
|
|
623
|
+
readonly operator: BinaryOperatorWithoutIn;
|
|
624
|
+
readonly left: Expression;
|
|
625
|
+
readonly right: Expression;
|
|
641
626
|
}
|
|
642
627
|
|
|
643
628
|
// Private brand checks (#foo in bar) are a special case
|
|
644
629
|
// other binary expressions do not allow PrivateIdentifier in the left
|
|
645
630
|
export interface BinaryExpressionIn extends BaseNode {
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
631
|
+
readonly type: 'BinaryExpression';
|
|
632
|
+
readonly operator: 'in';
|
|
633
|
+
readonly left: Expression | PrivateIdentifier;
|
|
634
|
+
readonly right: Expression;
|
|
650
635
|
}
|
|
651
636
|
|
|
652
637
|
export type BinaryExpression = BinaryExpressionWithoutIn | BinaryExpressionIn;
|
|
653
638
|
|
|
654
639
|
export interface AssignmentExpression extends BaseNode {
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
640
|
+
readonly type: 'AssignmentExpression';
|
|
641
|
+
readonly operator: AssignmentOperator;
|
|
642
|
+
readonly left: BindingName | MemberExpression;
|
|
643
|
+
readonly right: Expression;
|
|
659
644
|
}
|
|
660
645
|
|
|
661
646
|
export interface UpdateExpression extends BaseNode {
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
647
|
+
readonly type: 'UpdateExpression';
|
|
648
|
+
readonly operator: UpdateOperator;
|
|
649
|
+
readonly argument: Expression;
|
|
650
|
+
readonly prefix: boolean;
|
|
666
651
|
}
|
|
667
652
|
|
|
668
653
|
export interface LogicalExpression extends BaseNode {
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
654
|
+
readonly type: 'LogicalExpression';
|
|
655
|
+
readonly operator: LogicalOperator;
|
|
656
|
+
readonly left: Expression;
|
|
657
|
+
readonly right: Expression;
|
|
673
658
|
}
|
|
674
659
|
|
|
675
660
|
export interface ConditionalExpression extends BaseNode {
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
661
|
+
readonly type: 'ConditionalExpression';
|
|
662
|
+
readonly test: Expression;
|
|
663
|
+
readonly alternate: Expression;
|
|
664
|
+
readonly consequent: Expression;
|
|
680
665
|
}
|
|
681
666
|
|
|
682
667
|
interface BaseCallExpression extends BaseNode {
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
668
|
+
readonly callee: Expression | Super;
|
|
669
|
+
readonly arguments: ReadonlyArray<Expression | SpreadElement>;
|
|
670
|
+
readonly typeArguments: null | TypeParameterInstantiation;
|
|
686
671
|
}
|
|
687
672
|
export interface CallExpression extends BaseCallExpression {
|
|
688
|
-
|
|
689
|
-
|
|
673
|
+
readonly type: 'CallExpression';
|
|
674
|
+
readonly optional: boolean;
|
|
690
675
|
}
|
|
691
676
|
|
|
692
677
|
export interface NewExpression extends BaseCallExpression {
|
|
693
|
-
|
|
678
|
+
readonly type: 'NewExpression';
|
|
694
679
|
}
|
|
695
680
|
|
|
696
681
|
export type MemberExpression =
|
|
697
|
-
|
|
|
698
|
-
| MemberExpressionWithNonComputedName;
|
|
682
|
+
MemberExpressionWithComputedName | MemberExpressionWithNonComputedName;
|
|
699
683
|
export interface MemberExpressionWithComputedName extends BaseNode {
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
684
|
+
readonly type: 'MemberExpression';
|
|
685
|
+
readonly object: Expression | Super;
|
|
686
|
+
readonly property: Expression;
|
|
687
|
+
readonly computed: true;
|
|
688
|
+
readonly optional: boolean;
|
|
705
689
|
}
|
|
706
690
|
export interface MemberExpressionWithNonComputedName extends BaseNode {
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
691
|
+
readonly type: 'MemberExpression';
|
|
692
|
+
readonly object: Expression | Super;
|
|
693
|
+
readonly property: Identifier | PrivateIdentifier;
|
|
694
|
+
readonly computed: false;
|
|
695
|
+
readonly optional: boolean;
|
|
712
696
|
}
|
|
713
697
|
|
|
714
698
|
export type ChainElement = CallExpression | MemberExpression;
|
|
715
699
|
|
|
716
700
|
export interface ChainExpression extends BaseNode {
|
|
717
|
-
|
|
718
|
-
|
|
701
|
+
readonly type: 'ChainExpression';
|
|
702
|
+
readonly expression: ChainElement;
|
|
719
703
|
}
|
|
720
704
|
|
|
721
705
|
export interface SwitchCase extends BaseNode {
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
706
|
+
readonly type: 'SwitchCase';
|
|
707
|
+
readonly test?: Expression | null;
|
|
708
|
+
readonly consequent: ReadonlyArray<Statement>;
|
|
725
709
|
}
|
|
726
710
|
|
|
727
711
|
export interface CatchClause extends BaseNode {
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
712
|
+
readonly type: 'CatchClause';
|
|
713
|
+
readonly param: BindingName | null;
|
|
714
|
+
readonly body: BlockStatement;
|
|
731
715
|
}
|
|
732
716
|
|
|
733
717
|
export interface Identifier extends BaseNode {
|
|
734
|
-
|
|
735
|
-
|
|
718
|
+
readonly type: 'Identifier';
|
|
719
|
+
readonly name: string;
|
|
736
720
|
|
|
737
|
-
|
|
721
|
+
readonly typeAnnotation: TypeAnnotation | null;
|
|
738
722
|
// only applies to function arguments
|
|
739
|
-
|
|
723
|
+
readonly optional: boolean;
|
|
740
724
|
}
|
|
741
725
|
|
|
742
726
|
export interface PrivateIdentifier extends BaseNode {
|
|
743
|
-
|
|
744
|
-
|
|
727
|
+
readonly type: 'PrivateIdentifier';
|
|
728
|
+
readonly name: string;
|
|
745
729
|
}
|
|
746
730
|
|
|
747
731
|
export type Literal =
|
|
@@ -753,60 +737,54 @@ export type Literal =
|
|
|
753
737
|
| StringLiteral;
|
|
754
738
|
|
|
755
739
|
export interface BigIntLiteral extends BaseNode {
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
740
|
+
readonly type: 'Literal';
|
|
741
|
+
readonly value: bigint;
|
|
742
|
+
readonly bigint: string;
|
|
743
|
+
readonly raw: string;
|
|
744
|
+
readonly literalType: 'bigint';
|
|
761
745
|
}
|
|
762
746
|
|
|
763
747
|
export interface BooleanLiteral extends BaseNode {
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
748
|
+
readonly type: 'Literal';
|
|
749
|
+
readonly value: boolean;
|
|
750
|
+
readonly raw: 'true' | 'false';
|
|
751
|
+
readonly literalType: 'boolean';
|
|
768
752
|
}
|
|
769
753
|
|
|
770
754
|
export interface NullLiteral extends BaseNode {
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
755
|
+
readonly type: 'Literal';
|
|
756
|
+
readonly value: null;
|
|
757
|
+
readonly raw: 'null';
|
|
758
|
+
readonly literalType: 'null';
|
|
775
759
|
}
|
|
776
760
|
|
|
777
761
|
export interface NumericLiteral extends BaseNode {
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
762
|
+
readonly type: 'Literal';
|
|
763
|
+
readonly value: number;
|
|
764
|
+
readonly raw: string;
|
|
765
|
+
readonly literalType: 'numeric';
|
|
782
766
|
}
|
|
783
767
|
|
|
784
768
|
export interface RegExpLiteral extends BaseNode {
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
769
|
+
readonly type: 'Literal';
|
|
770
|
+
readonly value: RegExp | null;
|
|
771
|
+
readonly regex: interface {
|
|
772
|
+
readonly pattern: string,
|
|
773
|
+
readonly flags: string,
|
|
790
774
|
};
|
|
791
|
-
|
|
792
|
-
|
|
775
|
+
readonly raw: string;
|
|
776
|
+
readonly literalType: 'regexp';
|
|
793
777
|
}
|
|
794
778
|
|
|
795
779
|
export interface StringLiteral extends BaseNode {
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
780
|
+
readonly type: 'Literal';
|
|
781
|
+
readonly value: string;
|
|
782
|
+
readonly raw: string;
|
|
783
|
+
readonly literalType: 'string';
|
|
800
784
|
}
|
|
801
785
|
|
|
802
786
|
export type UnaryOperator =
|
|
803
|
-
| '
|
|
804
|
-
| '+'
|
|
805
|
-
| '!'
|
|
806
|
-
| '~'
|
|
807
|
-
| 'typeof'
|
|
808
|
-
| 'void'
|
|
809
|
-
| 'delete';
|
|
787
|
+
'-' | '+' | '!' | '~' | 'typeof' | 'void' | 'delete';
|
|
810
788
|
|
|
811
789
|
export type BinaryOperatorWithoutIn =
|
|
812
790
|
| '=='
|
|
@@ -857,94 +835,92 @@ export type AssignmentOperator =
|
|
|
857
835
|
export type UpdateOperator = '++' | '--';
|
|
858
836
|
|
|
859
837
|
export interface Super extends BaseNode {
|
|
860
|
-
|
|
838
|
+
readonly type: 'Super';
|
|
861
839
|
}
|
|
862
840
|
|
|
863
841
|
export interface SpreadElement extends BaseNode {
|
|
864
|
-
|
|
865
|
-
|
|
842
|
+
readonly type: 'SpreadElement';
|
|
843
|
+
readonly argument: Expression;
|
|
866
844
|
}
|
|
867
845
|
|
|
868
846
|
export interface ArrowFunctionExpression extends BaseFunction {
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
847
|
+
readonly type: 'ArrowFunctionExpression';
|
|
848
|
+
readonly expression: boolean;
|
|
849
|
+
readonly body: BlockStatement | Expression;
|
|
872
850
|
// hermes emits this - but it's always null
|
|
873
|
-
|
|
851
|
+
readonly id: null;
|
|
874
852
|
// note - arrow functions cannot be generators
|
|
875
853
|
}
|
|
876
854
|
|
|
877
855
|
export interface YieldExpression extends BaseNode {
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
856
|
+
readonly type: 'YieldExpression';
|
|
857
|
+
readonly argument?: Expression | null;
|
|
858
|
+
readonly delegate: boolean;
|
|
881
859
|
}
|
|
882
860
|
|
|
883
861
|
export interface TemplateLiteral extends BaseNode {
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
862
|
+
readonly type: 'TemplateLiteral';
|
|
863
|
+
readonly quasis: ReadonlyArray<TemplateElement>;
|
|
864
|
+
readonly expressions: ReadonlyArray<Expression>;
|
|
887
865
|
}
|
|
888
866
|
|
|
889
867
|
export interface TaggedTemplateExpression extends BaseNode {
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
868
|
+
readonly type: 'TaggedTemplateExpression';
|
|
869
|
+
readonly tag: Expression;
|
|
870
|
+
readonly quasi: TemplateLiteral;
|
|
893
871
|
}
|
|
894
872
|
|
|
895
873
|
export interface TemplateElement extends BaseNode {
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
874
|
+
readonly type: 'TemplateElement';
|
|
875
|
+
readonly tail: boolean;
|
|
876
|
+
readonly value: interface {
|
|
877
|
+
readonly cooked: string,
|
|
878
|
+
readonly raw: string,
|
|
901
879
|
};
|
|
902
880
|
}
|
|
903
881
|
|
|
904
882
|
export interface ObjectPattern extends BaseNode {
|
|
905
|
-
|
|
906
|
-
|
|
883
|
+
readonly type: 'ObjectPattern';
|
|
884
|
+
readonly properties: ReadonlyArray<DestructuringObjectProperty | RestElement>;
|
|
907
885
|
// if used as a VariableDeclarator.id
|
|
908
|
-
|
|
886
|
+
readonly typeAnnotation: TypeAnnotation | null;
|
|
909
887
|
}
|
|
910
888
|
|
|
911
889
|
export interface ArrayPattern extends BaseNode {
|
|
912
|
-
|
|
890
|
+
readonly type: 'ArrayPattern';
|
|
913
891
|
// an element will be null if the pattern contains a hole: `[a,,b]`
|
|
914
|
-
|
|
915
|
-
|
|
892
|
+
readonly elements: ReadonlyArray<?DestructuringPattern>;
|
|
893
|
+
readonly typeAnnotation: TypeAnnotation | null;
|
|
916
894
|
}
|
|
917
895
|
|
|
918
896
|
export interface RestElement extends BaseNode {
|
|
919
|
-
|
|
920
|
-
|
|
897
|
+
readonly type: 'RestElement';
|
|
898
|
+
readonly argument: RestElementPattern;
|
|
921
899
|
// the Pattern owns the typeAnnotation
|
|
922
900
|
}
|
|
923
901
|
|
|
924
902
|
export interface AssignmentPattern extends BaseNode {
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
903
|
+
readonly type: 'AssignmentPattern';
|
|
904
|
+
readonly left: BindingName;
|
|
905
|
+
readonly right: Expression;
|
|
928
906
|
}
|
|
929
907
|
|
|
930
908
|
export type AClass = ClassDeclaration | ClassExpression;
|
|
931
909
|
interface BaseClass extends BaseNode {
|
|
932
|
-
|
|
933
|
-
|
|
910
|
+
readonly superClass?: Expression | null;
|
|
911
|
+
readonly body: ClassBody;
|
|
934
912
|
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
913
|
+
readonly typeParameters: null | TypeParameterDeclaration;
|
|
914
|
+
readonly superTypeArguments: null | TypeParameterInstantiation;
|
|
915
|
+
readonly implements: ReadonlyArray<ClassImplements>;
|
|
916
|
+
readonly decorators: ReadonlyArray<Decorator>;
|
|
939
917
|
}
|
|
940
918
|
|
|
941
919
|
export type PropertyName =
|
|
942
|
-
|
|
|
943
|
-
| ClassPropertyNameNonComputed;
|
|
920
|
+
ClassPropertyNameComputed | ClassPropertyNameNonComputed;
|
|
944
921
|
export type ClassPropertyNameComputed = Expression;
|
|
945
922
|
export type ClassPropertyNameNonComputed =
|
|
946
|
-
|
|
|
947
|
-
| ObjectPropertyKey;
|
|
923
|
+
PrivateIdentifier | ObjectPropertyKey;
|
|
948
924
|
|
|
949
925
|
export type ClassMember = PropertyDefinition | MethodDefinition | StaticBlock;
|
|
950
926
|
export type ClassMemberWithNonComputedName =
|
|
@@ -952,10 +928,10 @@ export type ClassMemberWithNonComputedName =
|
|
|
952
928
|
| MethodDefinitionConstructor
|
|
953
929
|
| MethodDefinitionWithNonComputedName;
|
|
954
930
|
export interface ClassBody extends BaseNode {
|
|
955
|
-
|
|
956
|
-
|
|
931
|
+
readonly type: 'ClassBody';
|
|
932
|
+
readonly body: ReadonlyArray<ClassMember>;
|
|
957
933
|
|
|
958
|
-
|
|
934
|
+
readonly parent: AClass;
|
|
959
935
|
}
|
|
960
936
|
|
|
961
937
|
export type MethodDefinition =
|
|
@@ -963,80 +939,76 @@ export type MethodDefinition =
|
|
|
963
939
|
| MethodDefinitionWithComputedName
|
|
964
940
|
| MethodDefinitionWithNonComputedName;
|
|
965
941
|
interface MethodDefinitionBase extends BaseNode {
|
|
966
|
-
|
|
942
|
+
readonly value: FunctionExpression;
|
|
967
943
|
|
|
968
|
-
|
|
944
|
+
readonly parent: ClassBody;
|
|
969
945
|
}
|
|
970
946
|
export interface MethodDefinitionConstructor extends MethodDefinitionBase {
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
947
|
+
readonly type: 'MethodDefinition';
|
|
948
|
+
readonly key: Identifier | StringLiteral;
|
|
949
|
+
readonly kind: 'constructor';
|
|
950
|
+
readonly computed: false;
|
|
951
|
+
readonly static: false;
|
|
952
|
+
readonly decorators: ReadonlyArray<Decorator>;
|
|
977
953
|
}
|
|
978
954
|
export interface MethodDefinitionWithComputedName extends MethodDefinitionBase {
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
}
|
|
986
|
-
export interface MethodDefinitionWithNonComputedName
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
+decorators: $ReadOnlyArray<Decorator>;
|
|
955
|
+
readonly type: 'MethodDefinition';
|
|
956
|
+
readonly key: ClassPropertyNameComputed;
|
|
957
|
+
readonly kind: 'method' | 'get' | 'set';
|
|
958
|
+
readonly computed: true;
|
|
959
|
+
readonly static: boolean;
|
|
960
|
+
readonly decorators: ReadonlyArray<Decorator>;
|
|
961
|
+
}
|
|
962
|
+
export interface MethodDefinitionWithNonComputedName extends MethodDefinitionBase {
|
|
963
|
+
readonly type: 'MethodDefinition';
|
|
964
|
+
readonly key: ClassPropertyNameNonComputed;
|
|
965
|
+
readonly kind: 'method' | 'get' | 'set';
|
|
966
|
+
readonly computed: false;
|
|
967
|
+
readonly static: boolean;
|
|
968
|
+
readonly decorators: ReadonlyArray<Decorator>;
|
|
994
969
|
}
|
|
995
970
|
|
|
996
971
|
// `PropertyDefinition` is the new standard for all class properties
|
|
997
972
|
export type PropertyDefinition =
|
|
998
|
-
|
|
|
999
|
-
| PropertyDefinitionWithNonComputedName;
|
|
973
|
+
PropertyDefinitionWithComputedName | PropertyDefinitionWithNonComputedName;
|
|
1000
974
|
interface PropertyDefinitionBase extends BaseNode {
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
975
|
+
readonly value: null | Expression;
|
|
976
|
+
readonly typeAnnotation: null | TypeAnnotation;
|
|
977
|
+
readonly static: boolean;
|
|
978
|
+
readonly decorators: ReadonlyArray<Decorator>;
|
|
979
|
+
readonly variance: null | Variance;
|
|
980
|
+
readonly declare: boolean;
|
|
1007
981
|
// hermes always emit this as false
|
|
1008
|
-
|
|
982
|
+
readonly optional: false;
|
|
1009
983
|
|
|
1010
|
-
|
|
984
|
+
readonly parent: ClassBody;
|
|
1011
985
|
}
|
|
1012
|
-
export interface PropertyDefinitionWithComputedName
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
+computed: true;
|
|
986
|
+
export interface PropertyDefinitionWithComputedName extends PropertyDefinitionBase {
|
|
987
|
+
readonly type: 'PropertyDefinition';
|
|
988
|
+
readonly key: ClassPropertyNameComputed;
|
|
989
|
+
readonly computed: true;
|
|
1017
990
|
}
|
|
1018
|
-
export interface PropertyDefinitionWithNonComputedName
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
+computed: false;
|
|
991
|
+
export interface PropertyDefinitionWithNonComputedName extends PropertyDefinitionBase {
|
|
992
|
+
readonly type: 'PropertyDefinition';
|
|
993
|
+
readonly key: ClassPropertyNameNonComputed;
|
|
994
|
+
readonly computed: false;
|
|
1023
995
|
}
|
|
1024
996
|
|
|
1025
997
|
export interface ClassDeclaration extends BaseClass {
|
|
1026
|
-
|
|
998
|
+
readonly type: 'ClassDeclaration';
|
|
1027
999
|
/** It is null when a class declaration is a part of the `export default class` statement */
|
|
1028
|
-
|
|
1000
|
+
readonly id: Identifier | null;
|
|
1029
1001
|
}
|
|
1030
1002
|
|
|
1031
1003
|
export interface ClassExpression extends BaseClass {
|
|
1032
|
-
|
|
1033
|
-
|
|
1004
|
+
readonly type: 'ClassExpression';
|
|
1005
|
+
readonly id?: Identifier | null;
|
|
1034
1006
|
}
|
|
1035
1007
|
|
|
1036
1008
|
export interface MetaProperty extends BaseNode {
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1009
|
+
readonly type: 'MetaProperty';
|
|
1010
|
+
readonly meta: Identifier;
|
|
1011
|
+
readonly property: Identifier;
|
|
1040
1012
|
}
|
|
1041
1013
|
|
|
1042
1014
|
export type ModuleDeclaration =
|
|
@@ -1055,50 +1027,50 @@ export type ModuleSpecifier =
|
|
|
1055
1027
|
| ExportSpecifier;
|
|
1056
1028
|
|
|
1057
1029
|
export interface ImportDeclaration extends BaseNode {
|
|
1058
|
-
|
|
1059
|
-
|
|
1030
|
+
readonly type: 'ImportDeclaration';
|
|
1031
|
+
readonly specifiers: ReadonlyArray<
|
|
1060
1032
|
ImportSpecifier | ImportDefaultSpecifier | ImportNamespaceSpecifier,
|
|
1061
1033
|
>;
|
|
1062
|
-
|
|
1063
|
-
|
|
1034
|
+
readonly source: StringLiteral;
|
|
1035
|
+
readonly attributes: ReadonlyArray<ImportAttribute>;
|
|
1064
1036
|
|
|
1065
|
-
|
|
1037
|
+
readonly importKind: 'value' | 'type' | 'typeof';
|
|
1066
1038
|
}
|
|
1067
1039
|
export interface ImportAttribute extends BaseNode {
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1040
|
+
readonly type: 'ImportAttribute';
|
|
1041
|
+
readonly key: Identifier;
|
|
1042
|
+
readonly value: StringLiteral;
|
|
1071
1043
|
|
|
1072
|
-
|
|
1044
|
+
readonly parent: ImportDeclaration;
|
|
1073
1045
|
}
|
|
1074
1046
|
|
|
1075
1047
|
export interface ImportSpecifier extends BaseNode {
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1048
|
+
readonly type: 'ImportSpecifier';
|
|
1049
|
+
readonly imported: Identifier;
|
|
1050
|
+
readonly local: Identifier;
|
|
1051
|
+
readonly importKind: null | 'type' | 'typeof';
|
|
1080
1052
|
|
|
1081
|
-
|
|
1053
|
+
readonly parent: ImportDeclaration;
|
|
1082
1054
|
}
|
|
1083
1055
|
|
|
1084
1056
|
export interface ImportExpression extends BaseNode {
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1057
|
+
readonly type: 'ImportExpression';
|
|
1058
|
+
readonly source: Expression;
|
|
1059
|
+
readonly options: Expression | null;
|
|
1088
1060
|
}
|
|
1089
1061
|
|
|
1090
1062
|
export interface ImportDefaultSpecifier extends BaseNode {
|
|
1091
|
-
|
|
1092
|
-
|
|
1063
|
+
readonly type: 'ImportDefaultSpecifier';
|
|
1064
|
+
readonly local: Identifier;
|
|
1093
1065
|
|
|
1094
|
-
|
|
1066
|
+
readonly parent: ImportDeclaration;
|
|
1095
1067
|
}
|
|
1096
1068
|
|
|
1097
1069
|
export interface ImportNamespaceSpecifier extends BaseNode {
|
|
1098
|
-
|
|
1099
|
-
|
|
1070
|
+
readonly type: 'ImportNamespaceSpecifier';
|
|
1071
|
+
readonly local: Identifier;
|
|
1100
1072
|
|
|
1101
|
-
|
|
1073
|
+
readonly parent: ImportDeclaration;
|
|
1102
1074
|
}
|
|
1103
1075
|
|
|
1104
1076
|
export type DefaultDeclaration =
|
|
@@ -1116,51 +1088,48 @@ export type NamedDeclaration =
|
|
|
1116
1088
|
| RecordDeclaration;
|
|
1117
1089
|
|
|
1118
1090
|
interface ExportNamedDeclarationBase extends BaseNode {
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
}
|
|
1125
|
-
export interface ExportNamedDeclarationWithSpecifiers
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
+source: null;
|
|
1137
|
-
+specifiers: [];
|
|
1091
|
+
readonly type: 'ExportNamedDeclaration';
|
|
1092
|
+
readonly declaration?: NamedDeclaration | null;
|
|
1093
|
+
readonly specifiers: ReadonlyArray<ExportSpecifier>;
|
|
1094
|
+
readonly source?: StringLiteral | null;
|
|
1095
|
+
readonly exportKind: 'value' | 'type';
|
|
1096
|
+
}
|
|
1097
|
+
export interface ExportNamedDeclarationWithSpecifiers extends ExportNamedDeclarationBase {
|
|
1098
|
+
readonly type: 'ExportNamedDeclaration';
|
|
1099
|
+
readonly declaration: null;
|
|
1100
|
+
readonly source?: StringLiteral | null;
|
|
1101
|
+
readonly specifiers: ReadonlyArray<ExportSpecifier>;
|
|
1102
|
+
}
|
|
1103
|
+
export interface ExportNamedDeclarationWithDeclaration extends ExportNamedDeclarationBase {
|
|
1104
|
+
readonly type: 'ExportNamedDeclaration';
|
|
1105
|
+
readonly declaration: NamedDeclaration;
|
|
1106
|
+
readonly source: null;
|
|
1107
|
+
readonly specifiers: [];
|
|
1138
1108
|
}
|
|
1139
1109
|
export type ExportNamedDeclaration =
|
|
1140
|
-
|
|
|
1141
|
-
| ExportNamedDeclarationWithDeclaration;
|
|
1110
|
+
ExportNamedDeclarationWithSpecifiers | ExportNamedDeclarationWithDeclaration;
|
|
1142
1111
|
|
|
1143
1112
|
export interface ExportSpecifier extends BaseNode {
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1113
|
+
readonly type: 'ExportSpecifier';
|
|
1114
|
+
readonly exported: Identifier;
|
|
1115
|
+
readonly local: Identifier;
|
|
1147
1116
|
}
|
|
1148
1117
|
|
|
1149
1118
|
export interface ExportDefaultDeclaration extends BaseNode {
|
|
1150
|
-
|
|
1151
|
-
|
|
1119
|
+
readonly type: 'ExportDefaultDeclaration';
|
|
1120
|
+
readonly declaration: DefaultDeclaration | Expression;
|
|
1152
1121
|
}
|
|
1153
1122
|
|
|
1154
1123
|
export interface ExportAllDeclaration extends BaseNode {
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1124
|
+
readonly type: 'ExportAllDeclaration';
|
|
1125
|
+
readonly source: StringLiteral;
|
|
1126
|
+
readonly exportKind: 'value' | 'type';
|
|
1127
|
+
readonly exported?: Identifier | null;
|
|
1159
1128
|
}
|
|
1160
1129
|
|
|
1161
1130
|
export interface AwaitExpression extends BaseNode {
|
|
1162
|
-
|
|
1163
|
-
|
|
1131
|
+
readonly type: 'AwaitExpression';
|
|
1132
|
+
readonly argument: Expression;
|
|
1164
1133
|
}
|
|
1165
1134
|
|
|
1166
1135
|
/***********************
|
|
@@ -1212,326 +1181,322 @@ export type TypeAnnotationType =
|
|
|
1212
1181
|
| OptionalIndexedAccessType;
|
|
1213
1182
|
|
|
1214
1183
|
export interface Variance extends BaseNode {
|
|
1215
|
-
|
|
1216
|
-
|
|
1184
|
+
readonly type: 'Variance';
|
|
1185
|
+
readonly kind: 'plus' | 'minus' | 'readonly' | 'writeonly' | 'in' | 'out';
|
|
1217
1186
|
}
|
|
1218
1187
|
|
|
1219
1188
|
interface BaseTypeAlias extends BaseNode {
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1189
|
+
readonly id: Identifier;
|
|
1190
|
+
readonly typeParameters: null | TypeParameterDeclaration;
|
|
1191
|
+
readonly right: TypeAnnotationType;
|
|
1223
1192
|
}
|
|
1224
1193
|
|
|
1225
1194
|
export interface TypeAnnotation extends BaseNode {
|
|
1226
|
-
|
|
1227
|
-
|
|
1195
|
+
readonly type: 'TypeAnnotation';
|
|
1196
|
+
readonly typeAnnotation: TypeAnnotationType;
|
|
1228
1197
|
}
|
|
1229
1198
|
|
|
1230
1199
|
export interface TypeAlias extends BaseTypeAlias {
|
|
1231
|
-
|
|
1200
|
+
readonly type: 'TypeAlias';
|
|
1232
1201
|
}
|
|
1233
1202
|
|
|
1234
1203
|
interface BaseOpaqueType extends BaseNode {
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1204
|
+
readonly id: Identifier;
|
|
1205
|
+
readonly supertype: TypeAnnotationType | null;
|
|
1206
|
+
readonly lowerBound: TypeAnnotationType | null;
|
|
1207
|
+
readonly upperBound: TypeAnnotationType | null;
|
|
1208
|
+
readonly typeParameters: TypeParameterDeclaration | null;
|
|
1240
1209
|
}
|
|
1241
1210
|
export interface OpaqueType extends BaseOpaqueType {
|
|
1242
|
-
|
|
1243
|
-
|
|
1211
|
+
readonly type: 'OpaqueType';
|
|
1212
|
+
readonly impltype: TypeAnnotationType;
|
|
1244
1213
|
}
|
|
1245
1214
|
|
|
1246
1215
|
export interface NumberTypeAnnotation extends BaseNode {
|
|
1247
|
-
|
|
1216
|
+
readonly type: 'NumberTypeAnnotation';
|
|
1248
1217
|
}
|
|
1249
1218
|
export interface StringTypeAnnotation extends BaseNode {
|
|
1250
|
-
|
|
1219
|
+
readonly type: 'StringTypeAnnotation';
|
|
1251
1220
|
}
|
|
1252
1221
|
export interface BigIntTypeAnnotation extends BaseNode {
|
|
1253
|
-
|
|
1222
|
+
readonly type: 'BigIntTypeAnnotation';
|
|
1254
1223
|
}
|
|
1255
1224
|
export interface BooleanTypeAnnotation extends BaseNode {
|
|
1256
|
-
|
|
1225
|
+
readonly type: 'BooleanTypeAnnotation';
|
|
1257
1226
|
}
|
|
1258
1227
|
export interface NullLiteralTypeAnnotation extends BaseNode {
|
|
1259
|
-
|
|
1228
|
+
readonly type: 'NullLiteralTypeAnnotation';
|
|
1260
1229
|
}
|
|
1261
1230
|
export interface AnyTypeAnnotation extends BaseNode {
|
|
1262
|
-
|
|
1231
|
+
readonly type: 'AnyTypeAnnotation';
|
|
1263
1232
|
}
|
|
1264
1233
|
export interface EmptyTypeAnnotation extends BaseNode {
|
|
1265
|
-
|
|
1234
|
+
readonly type: 'EmptyTypeAnnotation';
|
|
1266
1235
|
}
|
|
1267
1236
|
export interface SymbolTypeAnnotation extends BaseNode {
|
|
1268
|
-
|
|
1237
|
+
readonly type: 'SymbolTypeAnnotation';
|
|
1269
1238
|
}
|
|
1270
1239
|
export interface ThisTypeAnnotation extends BaseNode {
|
|
1271
|
-
|
|
1240
|
+
readonly type: 'ThisTypeAnnotation';
|
|
1272
1241
|
}
|
|
1273
1242
|
export interface MixedTypeAnnotation extends BaseNode {
|
|
1274
|
-
|
|
1243
|
+
readonly type: 'MixedTypeAnnotation';
|
|
1275
1244
|
}
|
|
1276
1245
|
export interface VoidTypeAnnotation extends BaseNode {
|
|
1277
|
-
|
|
1246
|
+
readonly type: 'VoidTypeAnnotation';
|
|
1278
1247
|
}
|
|
1279
1248
|
export interface UnknownTypeAnnotation extends BaseNode {
|
|
1280
|
-
|
|
1249
|
+
readonly type: 'UnknownTypeAnnotation';
|
|
1281
1250
|
}
|
|
1282
1251
|
export interface NeverTypeAnnotation extends BaseNode {
|
|
1283
|
-
|
|
1252
|
+
readonly type: 'NeverTypeAnnotation';
|
|
1284
1253
|
}
|
|
1285
1254
|
export interface UndefinedTypeAnnotation extends BaseNode {
|
|
1286
|
-
|
|
1255
|
+
readonly type: 'UndefinedTypeAnnotation';
|
|
1287
1256
|
}
|
|
1288
1257
|
export interface StringLiteralTypeAnnotation extends BaseNode {
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1258
|
+
readonly type: 'StringLiteralTypeAnnotation';
|
|
1259
|
+
readonly value: string;
|
|
1260
|
+
readonly raw: string;
|
|
1292
1261
|
}
|
|
1293
1262
|
export interface NumberLiteralTypeAnnotation extends BaseNode {
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1263
|
+
readonly type: 'NumberLiteralTypeAnnotation';
|
|
1264
|
+
readonly value: number;
|
|
1265
|
+
readonly raw: string;
|
|
1297
1266
|
}
|
|
1298
1267
|
export interface BigIntLiteralTypeAnnotation extends BaseNode {
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1268
|
+
readonly type: 'BigIntLiteralTypeAnnotation';
|
|
1269
|
+
readonly bigint: string;
|
|
1270
|
+
readonly value: bigint;
|
|
1271
|
+
readonly raw: string;
|
|
1303
1272
|
}
|
|
1304
1273
|
export interface BooleanLiteralTypeAnnotation extends BaseNode {
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1274
|
+
readonly type: 'BooleanLiteralTypeAnnotation';
|
|
1275
|
+
readonly value: boolean;
|
|
1276
|
+
readonly raw: 'true' | 'false';
|
|
1308
1277
|
}
|
|
1309
1278
|
export interface ArrayTypeAnnotation extends BaseNode {
|
|
1310
|
-
|
|
1311
|
-
|
|
1279
|
+
readonly type: 'ArrayTypeAnnotation';
|
|
1280
|
+
readonly elementType: TypeAnnotationType;
|
|
1312
1281
|
}
|
|
1313
1282
|
export interface NullableTypeAnnotation extends BaseNode {
|
|
1314
|
-
|
|
1315
|
-
|
|
1283
|
+
readonly type: 'NullableTypeAnnotation';
|
|
1284
|
+
readonly typeAnnotation: TypeAnnotationType;
|
|
1316
1285
|
}
|
|
1317
1286
|
export interface ExistsTypeAnnotation extends BaseNode {
|
|
1318
|
-
|
|
1287
|
+
readonly type: 'ExistsTypeAnnotation';
|
|
1319
1288
|
}
|
|
1320
1289
|
export interface GenericTypeAnnotation extends BaseNode {
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1290
|
+
readonly type: 'GenericTypeAnnotation';
|
|
1291
|
+
readonly id: Identifier | QualifiedTypeIdentifier;
|
|
1292
|
+
readonly typeParameters: null | TypeParameterInstantiation;
|
|
1324
1293
|
}
|
|
1325
1294
|
export interface QualifiedTypeIdentifier extends BaseNode {
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1295
|
+
readonly type: 'QualifiedTypeIdentifier';
|
|
1296
|
+
readonly id: Identifier;
|
|
1297
|
+
readonly qualification: QualifiedTypeIdentifier | Identifier;
|
|
1329
1298
|
}
|
|
1330
1299
|
export interface QualifiedTypeofIdentifier extends BaseNode {
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1300
|
+
readonly type: 'QualifiedTypeofIdentifier';
|
|
1301
|
+
readonly id: Identifier;
|
|
1302
|
+
readonly qualification: QualifiedTypeofIdentifier | Identifier;
|
|
1334
1303
|
}
|
|
1335
1304
|
export interface TypeofTypeAnnotation extends BaseNode {
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1305
|
+
readonly type: 'TypeofTypeAnnotation';
|
|
1306
|
+
readonly argument: QualifiedTypeofIdentifier | Identifier;
|
|
1307
|
+
readonly typeArguments?: TypeParameterInstantiation;
|
|
1339
1308
|
}
|
|
1340
1309
|
export interface KeyofTypeAnnotation extends BaseNode {
|
|
1341
|
-
|
|
1342
|
-
|
|
1310
|
+
readonly type: 'KeyofTypeAnnotation';
|
|
1311
|
+
readonly argument: TypeAnnotationType;
|
|
1343
1312
|
}
|
|
1344
1313
|
export interface TupleTypeAnnotation extends BaseNode {
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1314
|
+
readonly type: 'TupleTypeAnnotation';
|
|
1315
|
+
readonly elementTypes: ReadonlyArray<TypeAnnotationType>;
|
|
1316
|
+
readonly inexact: boolean;
|
|
1348
1317
|
}
|
|
1349
1318
|
export interface TupleTypeSpreadElement extends BaseNode {
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1319
|
+
readonly type: 'TupleTypeSpreadElement';
|
|
1320
|
+
readonly label?: Identifier | null;
|
|
1321
|
+
readonly typeAnnotation: TypeAnnotationType;
|
|
1353
1322
|
}
|
|
1354
1323
|
export interface TupleTypeLabeledElement extends BaseNode {
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1324
|
+
readonly type: 'TupleTypeLabeledElement';
|
|
1325
|
+
readonly label: Identifier;
|
|
1326
|
+
readonly elementType: TypeAnnotationType;
|
|
1327
|
+
readonly optional: boolean;
|
|
1328
|
+
readonly variance: Variance | null;
|
|
1360
1329
|
}
|
|
1361
1330
|
|
|
1362
1331
|
export interface InferTypeAnnotation extends BaseNode {
|
|
1363
|
-
|
|
1364
|
-
|
|
1332
|
+
readonly type: 'InferTypeAnnotation';
|
|
1333
|
+
readonly typeParameter: TypeParameter;
|
|
1365
1334
|
}
|
|
1366
1335
|
|
|
1367
1336
|
// type T = { [[foo]]: number };
|
|
1368
1337
|
export interface ObjectTypeInternalSlot extends BaseNode {
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1338
|
+
readonly type: 'ObjectTypeInternalSlot';
|
|
1339
|
+
readonly id: Identifier;
|
|
1340
|
+
readonly optional: boolean;
|
|
1341
|
+
readonly static: boolean;
|
|
1342
|
+
readonly method: boolean;
|
|
1343
|
+
readonly value: TypeAnnotation;
|
|
1375
1344
|
|
|
1376
|
-
|
|
1345
|
+
readonly parent: ObjectTypeAnnotation;
|
|
1377
1346
|
}
|
|
1378
1347
|
|
|
1379
1348
|
export interface InterfaceTypeAnnotation extends BaseInterfaceNode {
|
|
1380
|
-
|
|
1349
|
+
readonly type: 'InterfaceTypeAnnotation';
|
|
1381
1350
|
}
|
|
1382
1351
|
|
|
1383
1352
|
export interface UnionTypeAnnotation extends BaseNode {
|
|
1384
|
-
|
|
1385
|
-
|
|
1353
|
+
readonly type: 'UnionTypeAnnotation';
|
|
1354
|
+
readonly types: ReadonlyArray<TypeAnnotationType>;
|
|
1386
1355
|
}
|
|
1387
1356
|
export interface IntersectionTypeAnnotation extends BaseNode {
|
|
1388
|
-
|
|
1389
|
-
|
|
1357
|
+
readonly type: 'IntersectionTypeAnnotation';
|
|
1358
|
+
readonly types: ReadonlyArray<TypeAnnotationType>;
|
|
1390
1359
|
}
|
|
1391
1360
|
|
|
1392
1361
|
export interface ConditionalTypeAnnotation extends BaseNode {
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1362
|
+
readonly type: 'ConditionalTypeAnnotation';
|
|
1363
|
+
readonly checkType: TypeAnnotationType;
|
|
1364
|
+
readonly extendsType: TypeAnnotationType;
|
|
1365
|
+
readonly trueType: TypeAnnotationType;
|
|
1366
|
+
readonly falseType: TypeAnnotationType;
|
|
1398
1367
|
}
|
|
1399
1368
|
|
|
1400
1369
|
export type TypeOperator =
|
|
1401
|
-
|
|
|
1402
|
-
| RendersStarTypeOperator
|
|
1403
|
-
| RendersQuestionTypeOperator;
|
|
1370
|
+
RendersTypeOperator | RendersStarTypeOperator | RendersQuestionTypeOperator;
|
|
1404
1371
|
|
|
1405
1372
|
export type RendersType =
|
|
1406
|
-
|
|
|
1407
|
-
| RendersStarTypeOperator
|
|
1408
|
-
| RendersQuestionTypeOperator;
|
|
1373
|
+
RendersTypeOperator | RendersStarTypeOperator | RendersQuestionTypeOperator;
|
|
1409
1374
|
|
|
1410
1375
|
interface TypeOperatorBase extends BaseNode {
|
|
1411
|
-
|
|
1412
|
-
|
|
1376
|
+
readonly type: 'TypeOperator';
|
|
1377
|
+
readonly typeAnnotation: TypeAnnotationType;
|
|
1413
1378
|
}
|
|
1414
1379
|
export interface RendersTypeOperator extends TypeOperatorBase {
|
|
1415
|
-
|
|
1416
|
-
|
|
1380
|
+
readonly type: 'TypeOperator';
|
|
1381
|
+
readonly operator: 'renders';
|
|
1417
1382
|
}
|
|
1418
1383
|
export interface RendersStarTypeOperator extends TypeOperatorBase {
|
|
1419
|
-
|
|
1420
|
-
|
|
1384
|
+
readonly type: 'TypeOperator';
|
|
1385
|
+
readonly operator: 'renders*';
|
|
1421
1386
|
}
|
|
1422
1387
|
export interface RendersQuestionTypeOperator extends TypeOperatorBase {
|
|
1423
|
-
|
|
1424
|
-
|
|
1388
|
+
readonly type: 'TypeOperator';
|
|
1389
|
+
readonly operator: 'renders?';
|
|
1425
1390
|
}
|
|
1426
1391
|
|
|
1427
1392
|
export interface TypePredicate extends BaseNode {
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1393
|
+
readonly type: 'TypePredicate';
|
|
1394
|
+
readonly parameterName: Identifier;
|
|
1395
|
+
readonly typeAnnotation: TypeAnnotationType | null;
|
|
1396
|
+
readonly kind: null | 'asserts' | 'implies';
|
|
1432
1397
|
}
|
|
1433
1398
|
|
|
1434
1399
|
export interface FunctionTypeAnnotation extends BaseNode {
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1400
|
+
readonly type: 'FunctionTypeAnnotation';
|
|
1401
|
+
readonly params: ReadonlyArray<FunctionTypeParam>;
|
|
1402
|
+
readonly returnType: TypeAnnotationType;
|
|
1403
|
+
readonly rest: null | FunctionTypeParam;
|
|
1404
|
+
readonly typeParameters: null | TypeParameterDeclaration;
|
|
1405
|
+
readonly this: FunctionTypeParam | null;
|
|
1441
1406
|
}
|
|
1442
1407
|
export interface FunctionTypeParam extends BaseNode {
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1408
|
+
readonly type: 'FunctionTypeParam';
|
|
1409
|
+
readonly name: Identifier | null;
|
|
1410
|
+
readonly typeAnnotation: TypeAnnotationType;
|
|
1411
|
+
readonly optional: boolean;
|
|
1447
1412
|
|
|
1448
|
-
|
|
1413
|
+
readonly parent: FunctionTypeAnnotation;
|
|
1449
1414
|
}
|
|
1450
1415
|
export interface HookTypeAnnotation extends BaseNode {
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1416
|
+
readonly type: 'HookTypeAnnotation';
|
|
1417
|
+
readonly params: ReadonlyArray<FunctionTypeParam>;
|
|
1418
|
+
readonly returnType: TypeAnnotationType;
|
|
1419
|
+
readonly rest: null | FunctionTypeParam;
|
|
1420
|
+
readonly typeParameters: null | TypeParameterDeclaration;
|
|
1456
1421
|
}
|
|
1457
1422
|
|
|
1458
1423
|
export interface ComponentTypeAnnotation extends BaseNode {
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1424
|
+
readonly type: 'ComponentTypeAnnotation';
|
|
1425
|
+
readonly params: ReadonlyArray<ComponentTypeParameter>;
|
|
1426
|
+
readonly rest: null | ComponentTypeParameter;
|
|
1427
|
+
readonly typeParameters: null | TypeParameterDeclaration;
|
|
1428
|
+
readonly rendersType: null | RendersType;
|
|
1464
1429
|
}
|
|
1465
1430
|
export interface ComponentTypeParameter extends BaseNode {
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1431
|
+
readonly type: 'ComponentTypeParameter';
|
|
1432
|
+
readonly name: Identifier | StringLiteral | null;
|
|
1433
|
+
readonly typeAnnotation: TypeAnnotationType;
|
|
1434
|
+
readonly optional: boolean;
|
|
1470
1435
|
|
|
1471
|
-
|
|
1436
|
+
readonly parent: ComponentTypeAnnotation | DeclareComponent;
|
|
1472
1437
|
}
|
|
1473
1438
|
|
|
1474
1439
|
export interface InferredPredicate extends BaseNode {
|
|
1475
|
-
|
|
1440
|
+
readonly type: 'InferredPredicate';
|
|
1476
1441
|
|
|
1477
|
-
|
|
1442
|
+
readonly parent: AFunction | DeclareFunction;
|
|
1478
1443
|
}
|
|
1479
1444
|
|
|
1480
1445
|
export interface ObjectTypeAnnotation extends BaseNode {
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1446
|
+
readonly type: 'ObjectTypeAnnotation';
|
|
1447
|
+
readonly inexact: boolean;
|
|
1448
|
+
readonly exact: boolean;
|
|
1449
|
+
readonly properties: ReadonlyArray<
|
|
1485
1450
|
| ObjectTypeProperty
|
|
1486
1451
|
| ObjectTypeSpreadProperty
|
|
1487
1452
|
| ObjectTypeMappedTypeProperty,
|
|
1488
1453
|
>;
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1454
|
+
readonly indexers: ReadonlyArray<ObjectTypeIndexer>;
|
|
1455
|
+
readonly callProperties: ReadonlyArray<ObjectTypeCallProperty>;
|
|
1456
|
+
readonly internalSlots: ReadonlyArray<ObjectTypeInternalSlot>;
|
|
1492
1457
|
}
|
|
1493
1458
|
interface ObjectTypePropertyBase extends BaseNode {
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1459
|
+
readonly type: 'ObjectTypeProperty';
|
|
1460
|
+
readonly key: ObjectPropertyKey;
|
|
1461
|
+
readonly value: TypeAnnotationType;
|
|
1462
|
+
readonly method: boolean;
|
|
1463
|
+
readonly optional: boolean;
|
|
1464
|
+
readonly static: boolean; // only applies to the "declare class" case
|
|
1465
|
+
readonly proto: boolean; // only applies to the "declare class" case
|
|
1466
|
+
readonly variance: Variance | null;
|
|
1467
|
+
readonly kind: 'init' | 'get' | 'set';
|
|
1468
|
+
|
|
1469
|
+
readonly parent: ObjectTypeAnnotation;
|
|
1505
1470
|
}
|
|
1506
1471
|
export interface ObjectTypeMethodSignature extends ObjectTypePropertyBase {
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1472
|
+
readonly type: 'ObjectTypeProperty';
|
|
1473
|
+
readonly value: FunctionTypeAnnotation;
|
|
1474
|
+
readonly method: true;
|
|
1475
|
+
readonly optional: false;
|
|
1476
|
+
readonly variance: null;
|
|
1477
|
+
readonly kind: 'init';
|
|
1513
1478
|
|
|
1514
|
-
|
|
1479
|
+
readonly parent: ObjectTypeAnnotation;
|
|
1515
1480
|
}
|
|
1516
1481
|
export interface ObjectTypePropertySignature extends ObjectTypePropertyBase {
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1482
|
+
readonly type: 'ObjectTypeProperty';
|
|
1483
|
+
readonly value: TypeAnnotationType;
|
|
1484
|
+
readonly method: false;
|
|
1485
|
+
readonly optional: boolean;
|
|
1486
|
+
readonly variance: Variance | null;
|
|
1487
|
+
readonly kind: 'init';
|
|
1523
1488
|
|
|
1524
|
-
|
|
1489
|
+
readonly parent: ObjectTypeAnnotation;
|
|
1525
1490
|
}
|
|
1526
1491
|
export interface ObjectTypeAccessorSignature extends ObjectTypePropertyBase {
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1492
|
+
readonly type: 'ObjectTypeProperty';
|
|
1493
|
+
readonly value: FunctionTypeAnnotation;
|
|
1494
|
+
readonly method: false;
|
|
1495
|
+
readonly optional: false;
|
|
1496
|
+
readonly variance: null;
|
|
1497
|
+
readonly kind: 'get' | 'set';
|
|
1533
1498
|
|
|
1534
|
-
|
|
1499
|
+
readonly parent: ObjectTypeAnnotation;
|
|
1535
1500
|
}
|
|
1536
1501
|
export type ObjectTypeProperty =
|
|
1537
1502
|
| ObjectTypeMethodSignature
|
|
@@ -1539,128 +1504,128 @@ export type ObjectTypeProperty =
|
|
|
1539
1504
|
| ObjectTypeAccessorSignature;
|
|
1540
1505
|
|
|
1541
1506
|
export interface ObjectTypeCallProperty extends BaseNode {
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1507
|
+
readonly type: 'ObjectTypeCallProperty';
|
|
1508
|
+
readonly value: FunctionTypeAnnotation;
|
|
1509
|
+
readonly static: boolean; // can only be static when defined on a declare class
|
|
1545
1510
|
|
|
1546
|
-
|
|
1511
|
+
readonly parent: ObjectTypeAnnotation;
|
|
1547
1512
|
}
|
|
1548
1513
|
export interface ObjectTypeIndexer extends BaseNode {
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1514
|
+
readonly type: 'ObjectTypeIndexer';
|
|
1515
|
+
readonly id: null | Identifier;
|
|
1516
|
+
readonly key: TypeAnnotationType;
|
|
1517
|
+
readonly value: TypeAnnotationType;
|
|
1518
|
+
readonly static: boolean; // can only be static when defined on a declare class
|
|
1519
|
+
readonly variance: null | Variance;
|
|
1555
1520
|
|
|
1556
|
-
|
|
1521
|
+
readonly parent: ObjectTypeAnnotation;
|
|
1557
1522
|
}
|
|
1558
1523
|
export interface ObjectTypeMappedTypeProperty extends BaseNode {
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1524
|
+
readonly type: 'ObjectTypeMappedTypeProperty';
|
|
1525
|
+
readonly keyTparam: TypeParameter;
|
|
1526
|
+
readonly propType: TypeAnnotationType;
|
|
1527
|
+
readonly sourceType: TypeAnnotationType;
|
|
1528
|
+
readonly variance: null | Variance;
|
|
1529
|
+
readonly optional: null | 'PlusOptional' | 'MinusOptional' | 'Optional';
|
|
1565
1530
|
|
|
1566
|
-
|
|
1531
|
+
readonly parent: ObjectTypeAnnotation;
|
|
1567
1532
|
}
|
|
1568
1533
|
|
|
1569
1534
|
export interface ObjectTypeSpreadProperty extends BaseNode {
|
|
1570
|
-
|
|
1571
|
-
|
|
1535
|
+
readonly type: 'ObjectTypeSpreadProperty';
|
|
1536
|
+
readonly argument: TypeAnnotationType;
|
|
1572
1537
|
|
|
1573
|
-
|
|
1538
|
+
readonly parent: ObjectTypeAnnotation;
|
|
1574
1539
|
}
|
|
1575
1540
|
|
|
1576
1541
|
export interface IndexedAccessType extends BaseNode {
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1542
|
+
readonly type: 'IndexedAccessType';
|
|
1543
|
+
readonly objectType: TypeAnnotationType;
|
|
1544
|
+
readonly indexType: TypeAnnotationType;
|
|
1580
1545
|
}
|
|
1581
1546
|
export interface OptionalIndexedAccessType extends BaseNode {
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1547
|
+
readonly type: 'OptionalIndexedAccessType';
|
|
1548
|
+
readonly objectType: TypeAnnotationType;
|
|
1549
|
+
readonly indexType: TypeAnnotationType;
|
|
1550
|
+
readonly optional: boolean;
|
|
1586
1551
|
}
|
|
1587
1552
|
|
|
1588
1553
|
export interface TypeCastExpression extends BaseNode {
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1554
|
+
readonly type: 'TypeCastExpression';
|
|
1555
|
+
readonly expression: Expression;
|
|
1556
|
+
readonly typeAnnotation: TypeAnnotation;
|
|
1592
1557
|
}
|
|
1593
1558
|
export interface AsExpression extends BaseNode {
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1559
|
+
readonly type: 'AsExpression';
|
|
1560
|
+
readonly expression: Expression;
|
|
1561
|
+
readonly typeAnnotation: TypeAnnotationType;
|
|
1597
1562
|
}
|
|
1598
1563
|
export interface AsConstExpression extends BaseNode {
|
|
1599
|
-
|
|
1600
|
-
|
|
1564
|
+
readonly type: 'AsConstExpression';
|
|
1565
|
+
readonly expression: Expression;
|
|
1601
1566
|
}
|
|
1602
1567
|
|
|
1603
1568
|
interface BaseInterfaceNode extends BaseNode {
|
|
1604
|
-
|
|
1605
|
-
|
|
1569
|
+
readonly body: ObjectTypeAnnotation;
|
|
1570
|
+
readonly extends: ReadonlyArray<InterfaceExtends>;
|
|
1606
1571
|
}
|
|
1607
1572
|
interface BaseInterfaceDeclaration extends BaseInterfaceNode {
|
|
1608
|
-
|
|
1609
|
-
|
|
1573
|
+
readonly id: Identifier;
|
|
1574
|
+
readonly typeParameters: null | TypeParameterDeclaration;
|
|
1610
1575
|
}
|
|
1611
1576
|
|
|
1612
1577
|
export interface InterfaceDeclaration extends BaseInterfaceDeclaration {
|
|
1613
|
-
|
|
1578
|
+
readonly type: 'InterfaceDeclaration';
|
|
1614
1579
|
}
|
|
1615
1580
|
|
|
1616
1581
|
export interface InterfaceExtends extends BaseNode {
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1582
|
+
readonly type: 'InterfaceExtends';
|
|
1583
|
+
readonly id: Identifier | QualifiedTypeIdentifier;
|
|
1584
|
+
readonly typeParameters: null | TypeParameterInstantiation;
|
|
1620
1585
|
|
|
1621
|
-
|
|
1586
|
+
readonly parent: InterfaceDeclaration | DeclareInterface;
|
|
1622
1587
|
}
|
|
1623
1588
|
|
|
1624
1589
|
export interface ClassImplements extends BaseNode {
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1590
|
+
readonly type: 'ClassImplements';
|
|
1591
|
+
readonly id: Identifier;
|
|
1592
|
+
readonly typeParameters: null | TypeParameterInstantiation;
|
|
1628
1593
|
|
|
1629
|
-
|
|
1594
|
+
readonly parent: AClass | DeclareClass;
|
|
1630
1595
|
}
|
|
1631
1596
|
|
|
1632
1597
|
export interface Decorator extends BaseNode {
|
|
1633
|
-
|
|
1634
|
-
|
|
1598
|
+
readonly type: 'Decorator';
|
|
1599
|
+
readonly expression: Expression;
|
|
1635
1600
|
|
|
1636
|
-
|
|
1601
|
+
readonly parent: AClass;
|
|
1637
1602
|
}
|
|
1638
1603
|
|
|
1639
1604
|
export interface TypeParameterDeclaration extends BaseNode {
|
|
1640
|
-
|
|
1641
|
-
|
|
1605
|
+
readonly type: 'TypeParameterDeclaration';
|
|
1606
|
+
readonly params: ReadonlyArray<TypeParameter>;
|
|
1642
1607
|
}
|
|
1643
1608
|
export interface TypeParameter extends BaseNode {
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1609
|
+
readonly type: 'TypeParameter';
|
|
1610
|
+
readonly name: string;
|
|
1611
|
+
readonly const: boolean;
|
|
1612
|
+
readonly bound: null | TypeAnnotation;
|
|
1613
|
+
readonly variance: null | Variance;
|
|
1614
|
+
readonly default: null | TypeAnnotationType;
|
|
1615
|
+
readonly usesExtendsBound: boolean;
|
|
1616
|
+
readonly parent: TypeParameterDeclaration;
|
|
1652
1617
|
}
|
|
1653
1618
|
export interface TypeParameterInstantiation extends BaseNode {
|
|
1654
|
-
|
|
1655
|
-
|
|
1619
|
+
readonly type: 'TypeParameterInstantiation';
|
|
1620
|
+
readonly params: ReadonlyArray<TypeAnnotationType>;
|
|
1656
1621
|
|
|
1657
|
-
|
|
1622
|
+
readonly parent: GenericTypeAnnotation | CallExpression | NewExpression;
|
|
1658
1623
|
}
|
|
1659
1624
|
|
|
1660
1625
|
export interface EnumDeclaration extends BaseNode {
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1626
|
+
readonly type: 'EnumDeclaration';
|
|
1627
|
+
readonly id: Identifier;
|
|
1628
|
+
readonly body:
|
|
1664
1629
|
| EnumNumberBody
|
|
1665
1630
|
| EnumBigIntBody
|
|
1666
1631
|
| EnumStringBody
|
|
@@ -1669,90 +1634,90 @@ export interface EnumDeclaration extends BaseNode {
|
|
|
1669
1634
|
}
|
|
1670
1635
|
|
|
1671
1636
|
interface BaseEnumBody extends BaseNode {
|
|
1672
|
-
|
|
1637
|
+
readonly hasUnknownMembers: boolean;
|
|
1673
1638
|
}
|
|
1674
1639
|
interface BaseInferrableEnumBody extends BaseEnumBody {
|
|
1675
|
-
|
|
1640
|
+
readonly explicitType: boolean;
|
|
1676
1641
|
}
|
|
1677
1642
|
|
|
1678
1643
|
export interface EnumNumberBody extends BaseInferrableEnumBody {
|
|
1679
|
-
|
|
1644
|
+
readonly type: 'EnumNumberBody';
|
|
1680
1645
|
// enum number members cannot be defaulted
|
|
1681
|
-
|
|
1682
|
-
|
|
1646
|
+
readonly members: ReadonlyArray<EnumNumberMember>;
|
|
1647
|
+
readonly explicitType: boolean;
|
|
1683
1648
|
|
|
1684
|
-
|
|
1649
|
+
readonly parent: EnumDeclaration;
|
|
1685
1650
|
}
|
|
1686
1651
|
|
|
1687
1652
|
export interface EnumNumberMember extends BaseNode {
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1653
|
+
readonly type: 'EnumNumberMember';
|
|
1654
|
+
readonly id: Identifier;
|
|
1655
|
+
readonly init: NumericLiteral;
|
|
1691
1656
|
|
|
1692
|
-
|
|
1657
|
+
readonly parent: EnumNumberBody;
|
|
1693
1658
|
}
|
|
1694
1659
|
|
|
1695
1660
|
export interface EnumBigIntBody extends BaseInferrableEnumBody {
|
|
1696
|
-
|
|
1661
|
+
readonly type: 'EnumBigIntBody';
|
|
1697
1662
|
// enum bigint members cannot be defaulted
|
|
1698
|
-
|
|
1699
|
-
|
|
1663
|
+
readonly members: ReadonlyArray<EnumBigIntMember>;
|
|
1664
|
+
readonly explicitType: boolean;
|
|
1700
1665
|
|
|
1701
|
-
|
|
1666
|
+
readonly parent: EnumDeclaration;
|
|
1702
1667
|
}
|
|
1703
1668
|
|
|
1704
1669
|
export interface EnumBigIntMember extends BaseNode {
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1670
|
+
readonly type: 'EnumBigIntMember';
|
|
1671
|
+
readonly id: Identifier;
|
|
1672
|
+
readonly init: BigIntLiteral;
|
|
1708
1673
|
|
|
1709
|
-
|
|
1674
|
+
readonly parent: EnumBigIntBody;
|
|
1710
1675
|
}
|
|
1711
1676
|
|
|
1712
1677
|
export interface EnumStringBody extends BaseInferrableEnumBody {
|
|
1713
|
-
|
|
1714
|
-
|
|
1678
|
+
readonly type: 'EnumStringBody';
|
|
1679
|
+
readonly members: ReadonlyArray<EnumStringMember | EnumDefaultedMember>;
|
|
1715
1680
|
|
|
1716
|
-
|
|
1681
|
+
readonly parent: EnumDeclaration;
|
|
1717
1682
|
}
|
|
1718
1683
|
|
|
1719
1684
|
export interface EnumStringMember extends BaseNode {
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1685
|
+
readonly type: 'EnumStringMember';
|
|
1686
|
+
readonly id: Identifier;
|
|
1687
|
+
readonly init: StringLiteral;
|
|
1723
1688
|
|
|
1724
|
-
|
|
1689
|
+
readonly parent: EnumStringBody;
|
|
1725
1690
|
}
|
|
1726
1691
|
|
|
1727
1692
|
export interface EnumBooleanBody extends BaseInferrableEnumBody {
|
|
1728
|
-
|
|
1693
|
+
readonly type: 'EnumBooleanBody';
|
|
1729
1694
|
// enum boolean members cannot be defaulted
|
|
1730
|
-
|
|
1695
|
+
readonly members: ReadonlyArray<EnumBooleanMember>;
|
|
1731
1696
|
|
|
1732
|
-
|
|
1697
|
+
readonly parent: EnumDeclaration;
|
|
1733
1698
|
}
|
|
1734
1699
|
|
|
1735
1700
|
export interface EnumBooleanMember extends BaseNode {
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1701
|
+
readonly type: 'EnumBooleanMember';
|
|
1702
|
+
readonly id: Identifier;
|
|
1703
|
+
readonly init: BooleanLiteral;
|
|
1739
1704
|
|
|
1740
|
-
|
|
1705
|
+
readonly parent: EnumBooleanBody;
|
|
1741
1706
|
}
|
|
1742
1707
|
|
|
1743
1708
|
export interface EnumSymbolBody extends BaseEnumBody {
|
|
1744
|
-
|
|
1709
|
+
readonly type: 'EnumSymbolBody';
|
|
1745
1710
|
// enum symbol members can only be defaulted
|
|
1746
|
-
|
|
1711
|
+
readonly members: ReadonlyArray<EnumDefaultedMember>;
|
|
1747
1712
|
|
|
1748
|
-
|
|
1713
|
+
readonly parent: EnumDeclaration;
|
|
1749
1714
|
}
|
|
1750
1715
|
|
|
1751
1716
|
export interface EnumDefaultedMember extends BaseNode {
|
|
1752
|
-
|
|
1753
|
-
|
|
1717
|
+
readonly type: 'EnumDefaultedMember';
|
|
1718
|
+
readonly id: Identifier;
|
|
1754
1719
|
|
|
1755
|
-
|
|
1720
|
+
readonly parent: EnumStringBody | EnumSymbolBody;
|
|
1756
1721
|
}
|
|
1757
1722
|
|
|
1758
1723
|
/*****************
|
|
@@ -1776,112 +1741,111 @@ export type DeclaredNode =
|
|
|
1776
1741
|
| DeclaredPredicate;
|
|
1777
1742
|
|
|
1778
1743
|
export interface DeclareClass extends BaseNode {
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1744
|
+
readonly type: 'DeclareClass';
|
|
1745
|
+
readonly id: Identifier;
|
|
1746
|
+
readonly typeParameters: null | TypeParameterDeclaration;
|
|
1747
|
+
readonly extends: ReadonlyArray<InterfaceExtends>;
|
|
1748
|
+
readonly implements: ReadonlyArray<ClassImplements>;
|
|
1749
|
+
readonly body: ObjectTypeAnnotation;
|
|
1750
|
+
readonly mixins: ReadonlyArray<InterfaceExtends>;
|
|
1786
1751
|
}
|
|
1787
1752
|
|
|
1788
1753
|
export interface DeclareComponent extends BaseNode {
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
|
|
1754
|
+
readonly type: 'DeclareComponent';
|
|
1755
|
+
readonly id: Identifier;
|
|
1756
|
+
readonly params: Array<ComponentTypeParameter>;
|
|
1757
|
+
readonly rest: null | ComponentTypeParameter;
|
|
1758
|
+
readonly typeParameters: null | TypeParameterDeclaration;
|
|
1759
|
+
readonly rendersType: null | RendersType;
|
|
1795
1760
|
}
|
|
1796
1761
|
|
|
1797
1762
|
export interface DeclareHook extends BaseNode {
|
|
1798
|
-
|
|
1763
|
+
readonly type: 'DeclareHook';
|
|
1799
1764
|
// the hook signature is stored as a type annotation on the ID
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
|
|
1765
|
+
readonly id: interface extends Identifier {
|
|
1766
|
+
readonly typeAnnotation: interface extends TypeAnnotation {
|
|
1767
|
+
readonly typeAnnotation: HookTypeAnnotation,
|
|
1803
1768
|
},
|
|
1804
1769
|
};
|
|
1805
1770
|
}
|
|
1806
1771
|
|
|
1807
1772
|
export interface DeclareVariable extends BaseNode {
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1773
|
+
readonly type: 'DeclareVariable';
|
|
1774
|
+
readonly id: Identifier;
|
|
1775
|
+
readonly kind: 'var' | 'let' | 'const';
|
|
1811
1776
|
}
|
|
1812
1777
|
|
|
1813
1778
|
export interface DeclareEnum extends BaseNode {
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
|
|
1779
|
+
readonly type: 'DeclareEnum';
|
|
1780
|
+
readonly id: Identifier;
|
|
1781
|
+
readonly body:
|
|
1782
|
+
EnumNumberBody | EnumStringBody | EnumBooleanBody | EnumSymbolBody;
|
|
1817
1783
|
}
|
|
1818
1784
|
|
|
1819
1785
|
export interface DeclareFunction extends BaseNode {
|
|
1820
|
-
|
|
1786
|
+
readonly type: 'DeclareFunction';
|
|
1821
1787
|
// the function signature is stored as a type annotation on the ID
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1788
|
+
readonly id: interface extends Identifier {
|
|
1789
|
+
readonly typeAnnotation: interface extends TypeAnnotation {
|
|
1790
|
+
readonly typeAnnotation: FunctionTypeAnnotation,
|
|
1825
1791
|
},
|
|
1826
1792
|
};
|
|
1827
|
-
|
|
1793
|
+
readonly predicate: InferredPredicate | DeclaredPredicate | null;
|
|
1828
1794
|
}
|
|
1829
1795
|
|
|
1830
1796
|
export interface DeclareModule extends BaseNode {
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
|
|
1797
|
+
readonly type: 'DeclareModule';
|
|
1798
|
+
readonly id: StringLiteral | Identifier;
|
|
1799
|
+
readonly body: BlockStatement;
|
|
1834
1800
|
}
|
|
1835
1801
|
|
|
1836
1802
|
export interface DeclareNamespace extends BaseNode {
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1803
|
+
readonly type: 'DeclareNamespace';
|
|
1804
|
+
readonly id: Identifier;
|
|
1805
|
+
readonly body: BlockStatement;
|
|
1840
1806
|
}
|
|
1841
1807
|
|
|
1842
1808
|
export interface DeclareInterface extends BaseInterfaceDeclaration {
|
|
1843
|
-
|
|
1809
|
+
readonly type: 'DeclareInterface';
|
|
1844
1810
|
}
|
|
1845
1811
|
|
|
1846
1812
|
export interface DeclareTypeAlias extends BaseTypeAlias {
|
|
1847
|
-
|
|
1813
|
+
readonly type: 'DeclareTypeAlias';
|
|
1848
1814
|
}
|
|
1849
1815
|
|
|
1850
1816
|
export interface DeclareOpaqueType extends BaseOpaqueType {
|
|
1851
|
-
|
|
1852
|
-
|
|
1817
|
+
readonly type: 'DeclareOpaqueType';
|
|
1818
|
+
readonly impltype: null;
|
|
1853
1819
|
}
|
|
1854
1820
|
|
|
1855
1821
|
export interface DeclareExportAllDeclaration extends BaseNode {
|
|
1856
|
-
|
|
1857
|
-
|
|
1822
|
+
readonly type: 'DeclareExportAllDeclaration';
|
|
1823
|
+
readonly source: StringLiteral;
|
|
1858
1824
|
}
|
|
1859
1825
|
|
|
1860
1826
|
interface DeclareExportDeclarationBase extends BaseNode {
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
}
|
|
1866
|
-
export interface DeclareExportDefaultDeclaration
|
|
1867
|
-
|
|
1868
|
-
|
|
1869
|
-
+declaration:
|
|
1827
|
+
readonly type: 'DeclareExportDeclaration';
|
|
1828
|
+
readonly specifiers: ReadonlyArray<ExportSpecifier>;
|
|
1829
|
+
readonly source: StringLiteral | null;
|
|
1830
|
+
readonly default: boolean;
|
|
1831
|
+
}
|
|
1832
|
+
export interface DeclareExportDefaultDeclaration extends DeclareExportDeclarationBase {
|
|
1833
|
+
readonly type: 'DeclareExportDeclaration';
|
|
1834
|
+
readonly declaration:
|
|
1870
1835
|
| DeclareClass
|
|
1871
1836
|
| DeclareFunction
|
|
1872
1837
|
| DeclareComponent
|
|
1873
1838
|
| DeclareHook
|
|
1874
1839
|
| TypeAnnotationType;
|
|
1875
|
-
|
|
1840
|
+
readonly default: true;
|
|
1876
1841
|
// default cannot have a source
|
|
1877
|
-
|
|
1842
|
+
readonly source: null;
|
|
1878
1843
|
// default cannot have specifiers
|
|
1879
|
-
|
|
1844
|
+
readonly specifiers: [];
|
|
1880
1845
|
}
|
|
1881
|
-
export interface DeclareExportDeclarationNamedWithDeclaration
|
|
1882
|
-
|
|
1883
|
-
|
|
1884
|
-
+declaration:
|
|
1846
|
+
export interface DeclareExportDeclarationNamedWithDeclaration extends DeclareExportDeclarationBase {
|
|
1847
|
+
readonly type: 'DeclareExportDeclaration';
|
|
1848
|
+
readonly declaration:
|
|
1885
1849
|
| DeclareClass
|
|
1886
1850
|
| DeclareFunction
|
|
1887
1851
|
| DeclareComponent
|
|
@@ -1890,19 +1854,18 @@ export interface DeclareExportDeclarationNamedWithDeclaration
|
|
|
1890
1854
|
| DeclareOpaqueType
|
|
1891
1855
|
| DeclareVariable
|
|
1892
1856
|
| DeclareEnum;
|
|
1893
|
-
|
|
1894
|
-
|
|
1857
|
+
readonly default: false;
|
|
1858
|
+
readonly source: null;
|
|
1895
1859
|
// default cannot have specifiers and a declaration
|
|
1896
|
-
|
|
1860
|
+
readonly specifiers: [];
|
|
1897
1861
|
}
|
|
1898
|
-
export interface DeclareExportDeclarationNamedWithSpecifiers
|
|
1899
|
-
|
|
1900
|
-
+type: 'DeclareExportDeclaration';
|
|
1862
|
+
export interface DeclareExportDeclarationNamedWithSpecifiers extends DeclareExportDeclarationBase {
|
|
1863
|
+
readonly type: 'DeclareExportDeclaration';
|
|
1901
1864
|
// with a source you can't have a declaration
|
|
1902
|
-
|
|
1903
|
-
|
|
1904
|
-
|
|
1905
|
-
|
|
1865
|
+
readonly declaration: null;
|
|
1866
|
+
readonly default: false;
|
|
1867
|
+
readonly source: StringLiteral;
|
|
1868
|
+
readonly specifiers: ReadonlyArray<ExportSpecifier>;
|
|
1906
1869
|
}
|
|
1907
1870
|
export type DeclareExportDeclaration =
|
|
1908
1871
|
| DeclareExportDefaultDeclaration
|
|
@@ -1910,13 +1873,13 @@ export type DeclareExportDeclaration =
|
|
|
1910
1873
|
| DeclareExportDeclarationNamedWithSpecifiers;
|
|
1911
1874
|
|
|
1912
1875
|
export interface DeclareModuleExports extends BaseNode {
|
|
1913
|
-
|
|
1914
|
-
|
|
1876
|
+
readonly type: 'DeclareModuleExports';
|
|
1877
|
+
readonly typeAnnotation: TypeAnnotation;
|
|
1915
1878
|
}
|
|
1916
1879
|
|
|
1917
1880
|
export interface DeclaredPredicate extends BaseNode {
|
|
1918
|
-
|
|
1919
|
-
|
|
1881
|
+
readonly type: 'DeclaredPredicate';
|
|
1882
|
+
readonly value: Expression;
|
|
1920
1883
|
}
|
|
1921
1884
|
|
|
1922
1885
|
/**********************
|
|
@@ -1924,16 +1887,10 @@ export interface DeclaredPredicate extends BaseNode {
|
|
|
1924
1887
|
**********************/
|
|
1925
1888
|
|
|
1926
1889
|
export type JSXChild =
|
|
1927
|
-
|
|
|
1928
|
-
| JSXExpression
|
|
1929
|
-
| JSXFragment
|
|
1930
|
-
| JSXText
|
|
1931
|
-
| JSXSpreadChild;
|
|
1890
|
+
JSXElement | JSXExpression | JSXFragment | JSXText | JSXSpreadChild;
|
|
1932
1891
|
export type JSXExpression = JSXEmptyExpression | JSXExpressionContainer;
|
|
1933
1892
|
export type JSXTagNameExpression =
|
|
1934
|
-
|
|
|
1935
|
-
| JSXMemberExpression
|
|
1936
|
-
| JSXNamespacedName;
|
|
1893
|
+
JSXIdentifier | JSXMemberExpression | JSXNamespacedName;
|
|
1937
1894
|
|
|
1938
1895
|
export type JSXNode =
|
|
1939
1896
|
| JSXAttribute
|
|
@@ -1953,98 +1910,98 @@ export type JSXNode =
|
|
|
1953
1910
|
| JSXSpreadChild;
|
|
1954
1911
|
|
|
1955
1912
|
export interface JSXAttribute extends BaseNode {
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
|
|
1913
|
+
readonly type: 'JSXAttribute';
|
|
1914
|
+
readonly name: JSXIdentifier;
|
|
1915
|
+
readonly value: Literal | JSXExpression | null;
|
|
1959
1916
|
|
|
1960
|
-
|
|
1917
|
+
readonly parent: JSXOpeningElement;
|
|
1961
1918
|
}
|
|
1962
1919
|
|
|
1963
1920
|
export interface JSXClosingElement extends BaseNode {
|
|
1964
|
-
|
|
1965
|
-
|
|
1921
|
+
readonly type: 'JSXClosingElement';
|
|
1922
|
+
readonly name: JSXTagNameExpression;
|
|
1966
1923
|
|
|
1967
|
-
|
|
1924
|
+
readonly parent: JSXElement;
|
|
1968
1925
|
}
|
|
1969
1926
|
|
|
1970
1927
|
export interface JSXClosingFragment extends BaseNode {
|
|
1971
|
-
|
|
1928
|
+
readonly type: 'JSXClosingFragment';
|
|
1972
1929
|
|
|
1973
|
-
|
|
1930
|
+
readonly parent: JSXFragment;
|
|
1974
1931
|
}
|
|
1975
1932
|
|
|
1976
1933
|
export interface JSXElement extends BaseNode {
|
|
1977
|
-
|
|
1978
|
-
|
|
1979
|
-
|
|
1980
|
-
|
|
1934
|
+
readonly type: 'JSXElement';
|
|
1935
|
+
readonly openingElement: JSXOpeningElement;
|
|
1936
|
+
readonly closingElement: JSXClosingElement | null;
|
|
1937
|
+
readonly children: ReadonlyArray<JSXChild>;
|
|
1981
1938
|
}
|
|
1982
1939
|
|
|
1983
1940
|
export interface JSXEmptyExpression extends BaseNode {
|
|
1984
|
-
|
|
1941
|
+
readonly type: 'JSXEmptyExpression';
|
|
1985
1942
|
}
|
|
1986
1943
|
|
|
1987
1944
|
export interface JSXExpressionContainer extends BaseNode {
|
|
1988
|
-
|
|
1989
|
-
|
|
1945
|
+
readonly type: 'JSXExpressionContainer';
|
|
1946
|
+
readonly expression: Expression | JSXEmptyExpression;
|
|
1990
1947
|
}
|
|
1991
1948
|
|
|
1992
1949
|
export interface JSXFragment extends BaseNode {
|
|
1993
|
-
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
|
-
|
|
1950
|
+
readonly type: 'JSXFragment';
|
|
1951
|
+
readonly openingFragment: JSXOpeningFragment;
|
|
1952
|
+
readonly closingFragment: JSXClosingFragment;
|
|
1953
|
+
readonly children: ReadonlyArray<JSXChild>;
|
|
1997
1954
|
}
|
|
1998
1955
|
|
|
1999
1956
|
export interface JSXIdentifier extends BaseNode {
|
|
2000
|
-
|
|
2001
|
-
|
|
1957
|
+
readonly type: 'JSXIdentifier';
|
|
1958
|
+
readonly name: string;
|
|
2002
1959
|
}
|
|
2003
1960
|
|
|
2004
1961
|
export interface JSXMemberExpression extends BaseNode {
|
|
2005
|
-
|
|
2006
|
-
|
|
2007
|
-
|
|
1962
|
+
readonly type: 'JSXMemberExpression';
|
|
1963
|
+
readonly object: JSXTagNameExpression;
|
|
1964
|
+
readonly property: JSXIdentifier;
|
|
2008
1965
|
}
|
|
2009
1966
|
|
|
2010
1967
|
export interface JSXNamespacedName extends BaseNode {
|
|
2011
|
-
|
|
2012
|
-
|
|
2013
|
-
|
|
1968
|
+
readonly type: 'JSXNamespacedName';
|
|
1969
|
+
readonly namespace: JSXIdentifier;
|
|
1970
|
+
readonly name: JSXIdentifier;
|
|
2014
1971
|
}
|
|
2015
1972
|
|
|
2016
1973
|
export interface JSXOpeningElement extends BaseNode {
|
|
2017
|
-
|
|
2018
|
-
|
|
2019
|
-
|
|
2020
|
-
|
|
2021
|
-
|
|
1974
|
+
readonly type: 'JSXOpeningElement';
|
|
1975
|
+
readonly selfClosing: boolean;
|
|
1976
|
+
readonly name: JSXTagNameExpression;
|
|
1977
|
+
readonly attributes: ReadonlyArray<JSXAttribute | JSXSpreadAttribute>;
|
|
1978
|
+
readonly typeArguments?: TypeParameterInstantiation | null;
|
|
2022
1979
|
|
|
2023
|
-
|
|
1980
|
+
readonly parent: JSXElement;
|
|
2024
1981
|
}
|
|
2025
1982
|
|
|
2026
1983
|
export interface JSXOpeningFragment extends BaseNode {
|
|
2027
|
-
|
|
1984
|
+
readonly type: 'JSXOpeningFragment';
|
|
2028
1985
|
|
|
2029
|
-
|
|
1986
|
+
readonly parent: JSXFragment;
|
|
2030
1987
|
}
|
|
2031
1988
|
|
|
2032
1989
|
export interface JSXSpreadAttribute extends BaseNode {
|
|
2033
|
-
|
|
2034
|
-
|
|
1990
|
+
readonly type: 'JSXSpreadAttribute';
|
|
1991
|
+
readonly argument: Expression;
|
|
2035
1992
|
|
|
2036
|
-
|
|
1993
|
+
readonly parent: JSXOpeningElement;
|
|
2037
1994
|
}
|
|
2038
1995
|
|
|
2039
1996
|
export interface JSXText extends BaseNode {
|
|
2040
|
-
|
|
2041
|
-
|
|
2042
|
-
|
|
1997
|
+
readonly type: 'JSXText';
|
|
1998
|
+
readonly value: string;
|
|
1999
|
+
readonly raw: string;
|
|
2043
2000
|
}
|
|
2044
2001
|
|
|
2045
2002
|
export interface JSXSpreadChild extends BaseNode {
|
|
2046
|
-
|
|
2047
|
-
|
|
2003
|
+
readonly type: 'JSXSpreadChild';
|
|
2004
|
+
readonly expression: Expression;
|
|
2048
2005
|
}
|
|
2049
2006
|
|
|
2050
2007
|
/************************************
|
|
@@ -2052,27 +2009,27 @@ export interface JSXSpreadChild extends BaseNode {
|
|
|
2052
2009
|
************************************/
|
|
2053
2010
|
|
|
2054
2011
|
export interface MatchExpression extends BaseNode {
|
|
2055
|
-
|
|
2056
|
-
|
|
2057
|
-
|
|
2012
|
+
readonly type: 'MatchExpression';
|
|
2013
|
+
readonly argument: Expression;
|
|
2014
|
+
readonly cases: ReadonlyArray<MatchExpressionCase>;
|
|
2058
2015
|
}
|
|
2059
2016
|
export interface MatchExpressionCase extends BaseNode {
|
|
2060
|
-
|
|
2061
|
-
|
|
2062
|
-
|
|
2063
|
-
|
|
2017
|
+
readonly type: 'MatchExpressionCase';
|
|
2018
|
+
readonly pattern: MatchPattern;
|
|
2019
|
+
readonly body: Expression;
|
|
2020
|
+
readonly guard: Expression | null;
|
|
2064
2021
|
}
|
|
2065
2022
|
|
|
2066
2023
|
export interface MatchStatement extends BaseNode {
|
|
2067
|
-
|
|
2068
|
-
|
|
2069
|
-
|
|
2024
|
+
readonly type: 'MatchStatement';
|
|
2025
|
+
readonly argument: Expression;
|
|
2026
|
+
readonly cases: ReadonlyArray<MatchStatementCase>;
|
|
2070
2027
|
}
|
|
2071
2028
|
export interface MatchStatementCase extends BaseNode {
|
|
2072
|
-
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
|
|
2029
|
+
readonly type: 'MatchStatementCase';
|
|
2030
|
+
readonly pattern: MatchPattern;
|
|
2031
|
+
readonly body: BlockStatement;
|
|
2032
|
+
readonly guard: Expression | null;
|
|
2076
2033
|
}
|
|
2077
2034
|
|
|
2078
2035
|
/******************
|
|
@@ -2093,91 +2050,92 @@ export type MatchPattern =
|
|
|
2093
2050
|
| MatchArrayPattern;
|
|
2094
2051
|
|
|
2095
2052
|
export interface MatchOrPattern extends BaseNode {
|
|
2096
|
-
|
|
2097
|
-
|
|
2053
|
+
readonly type: 'MatchOrPattern';
|
|
2054
|
+
readonly patterns: ReadonlyArray<MatchPattern>;
|
|
2098
2055
|
}
|
|
2099
2056
|
export interface MatchAsPattern extends BaseNode {
|
|
2100
|
-
|
|
2101
|
-
|
|
2102
|
-
|
|
2057
|
+
readonly type: 'MatchAsPattern';
|
|
2058
|
+
readonly pattern: MatchPattern;
|
|
2059
|
+
readonly target: Identifier | MatchBindingPattern;
|
|
2103
2060
|
}
|
|
2104
2061
|
export interface MatchWildcardPattern extends BaseNode {
|
|
2105
|
-
|
|
2062
|
+
readonly type: 'MatchWildcardPattern';
|
|
2106
2063
|
}
|
|
2107
2064
|
export interface MatchLiteralPattern extends BaseNode {
|
|
2108
|
-
|
|
2109
|
-
|
|
2065
|
+
readonly type: 'MatchLiteralPattern';
|
|
2066
|
+
readonly literal: Literal;
|
|
2110
2067
|
}
|
|
2111
2068
|
export interface MatchUnaryPattern extends BaseNode {
|
|
2112
|
-
|
|
2113
|
-
|
|
2114
|
-
|
|
2069
|
+
readonly type: 'MatchUnaryPattern';
|
|
2070
|
+
readonly argument: Literal;
|
|
2071
|
+
readonly operator: '-' | '+';
|
|
2115
2072
|
}
|
|
2116
2073
|
export interface MatchIdentifierPattern extends BaseNode {
|
|
2117
|
-
|
|
2118
|
-
|
|
2074
|
+
readonly type: 'MatchIdentifierPattern';
|
|
2075
|
+
readonly id: Identifier;
|
|
2119
2076
|
}
|
|
2120
2077
|
export interface MatchMemberPattern extends BaseNode {
|
|
2121
|
-
|
|
2122
|
-
|
|
2123
|
-
|
|
2078
|
+
readonly type: 'MatchMemberPattern';
|
|
2079
|
+
readonly base: MatchIdentifierPattern | MatchMemberPattern;
|
|
2080
|
+
readonly property:
|
|
2081
|
+
Identifier | StringLiteral | NumericLiteral | BigIntLiteral;
|
|
2124
2082
|
}
|
|
2125
2083
|
export interface MatchBindingPattern extends BaseNode {
|
|
2126
|
-
|
|
2127
|
-
|
|
2128
|
-
|
|
2084
|
+
readonly type: 'MatchBindingPattern';
|
|
2085
|
+
readonly id: Identifier;
|
|
2086
|
+
readonly kind: 'let' | 'const' | 'var';
|
|
2129
2087
|
}
|
|
2130
2088
|
export interface MatchObjectPattern extends BaseNode {
|
|
2131
|
-
|
|
2132
|
-
|
|
2133
|
-
|
|
2089
|
+
readonly type: 'MatchObjectPattern';
|
|
2090
|
+
readonly properties: ReadonlyArray<MatchObjectPatternProperty>;
|
|
2091
|
+
readonly rest: MatchRestPattern | null;
|
|
2134
2092
|
}
|
|
2135
2093
|
export interface MatchObjectPatternProperty extends BaseNode {
|
|
2136
|
-
|
|
2137
|
-
|
|
2138
|
-
|
|
2139
|
-
|
|
2094
|
+
readonly type: 'MatchObjectPatternProperty';
|
|
2095
|
+
readonly key: ObjectPropertyKey;
|
|
2096
|
+
readonly pattern: MatchPattern;
|
|
2097
|
+
readonly shorthand: boolean;
|
|
2140
2098
|
}
|
|
2141
2099
|
export interface MatchInstancePattern extends BaseNode {
|
|
2142
|
-
|
|
2143
|
-
|
|
2144
|
-
|
|
2100
|
+
readonly type: 'MatchInstancePattern';
|
|
2101
|
+
readonly targetConstructor: MatchIdentifierPattern | MatchMemberPattern;
|
|
2102
|
+
readonly properties: MatchInstanceObjectPattern;
|
|
2145
2103
|
}
|
|
2146
2104
|
export interface MatchInstanceObjectPattern extends BaseNode {
|
|
2147
|
-
|
|
2148
|
-
|
|
2149
|
-
|
|
2105
|
+
readonly type: 'MatchInstanceObjectPattern';
|
|
2106
|
+
readonly properties: ReadonlyArray<MatchObjectPatternProperty>;
|
|
2107
|
+
readonly rest: MatchRestPattern | null;
|
|
2150
2108
|
}
|
|
2151
2109
|
export interface MatchArrayPattern extends BaseNode {
|
|
2152
|
-
|
|
2153
|
-
|
|
2154
|
-
|
|
2110
|
+
readonly type: 'MatchArrayPattern';
|
|
2111
|
+
readonly elements: ReadonlyArray<MatchPattern>;
|
|
2112
|
+
readonly rest: MatchRestPattern | null;
|
|
2155
2113
|
}
|
|
2156
2114
|
export interface MatchRestPattern extends BaseNode {
|
|
2157
|
-
|
|
2158
|
-
|
|
2115
|
+
readonly type: 'MatchRestPattern';
|
|
2116
|
+
readonly argument: MatchBindingPattern | null;
|
|
2159
2117
|
}
|
|
2160
2118
|
|
|
2161
2119
|
/***********
|
|
2162
2120
|
* Records *
|
|
2163
2121
|
***********/
|
|
2164
2122
|
export interface RecordDeclaration extends BaseNode {
|
|
2165
|
-
|
|
2166
|
-
|
|
2167
|
-
|
|
2168
|
-
|
|
2169
|
-
|
|
2123
|
+
readonly type: 'RecordDeclaration';
|
|
2124
|
+
readonly id: Identifier;
|
|
2125
|
+
readonly typeParameters: TypeParameterDeclaration | null;
|
|
2126
|
+
readonly implements: ReadonlyArray<RecordDeclarationImplements>;
|
|
2127
|
+
readonly body: RecordDeclarationBody;
|
|
2170
2128
|
}
|
|
2171
2129
|
|
|
2172
2130
|
export interface RecordDeclarationImplements extends BaseNode {
|
|
2173
|
-
|
|
2174
|
-
|
|
2175
|
-
|
|
2131
|
+
readonly type: 'RecordDeclarationImplements';
|
|
2132
|
+
readonly id: Identifier;
|
|
2133
|
+
readonly typeArguments: TypeParameterInstantiation | null;
|
|
2176
2134
|
}
|
|
2177
2135
|
|
|
2178
2136
|
export interface RecordDeclarationBody extends BaseNode {
|
|
2179
|
-
|
|
2180
|
-
|
|
2137
|
+
readonly type: 'RecordDeclarationBody';
|
|
2138
|
+
readonly elements: ReadonlyArray<
|
|
2181
2139
|
| RecordDeclarationProperty
|
|
2182
2140
|
| RecordDeclarationStaticProperty
|
|
2183
2141
|
| MethodDefinition,
|
|
@@ -2185,29 +2143,29 @@ export interface RecordDeclarationBody extends BaseNode {
|
|
|
2185
2143
|
}
|
|
2186
2144
|
|
|
2187
2145
|
export interface RecordDeclarationProperty extends BaseNode {
|
|
2188
|
-
|
|
2189
|
-
|
|
2190
|
-
|
|
2191
|
-
|
|
2146
|
+
readonly type: 'RecordDeclarationProperty';
|
|
2147
|
+
readonly key: ObjectPropertyKey;
|
|
2148
|
+
readonly typeAnnotation: TypeAnnotation;
|
|
2149
|
+
readonly defaultValue: Expression | null;
|
|
2192
2150
|
}
|
|
2193
2151
|
|
|
2194
2152
|
export interface RecordDeclarationStaticProperty extends BaseNode {
|
|
2195
|
-
|
|
2196
|
-
|
|
2197
|
-
|
|
2198
|
-
|
|
2153
|
+
readonly type: 'RecordDeclarationStaticProperty';
|
|
2154
|
+
readonly key: ObjectPropertyKey;
|
|
2155
|
+
readonly typeAnnotation: TypeAnnotation;
|
|
2156
|
+
readonly value: Expression;
|
|
2199
2157
|
}
|
|
2200
2158
|
|
|
2201
2159
|
export interface RecordExpression extends BaseNode {
|
|
2202
|
-
|
|
2203
|
-
|
|
2204
|
-
|
|
2205
|
-
|
|
2160
|
+
readonly type: 'RecordExpression';
|
|
2161
|
+
readonly recordConstructor: Expression;
|
|
2162
|
+
readonly typeArguments: TypeParameterInstantiation | null;
|
|
2163
|
+
readonly properties: RecordExpressionProperties;
|
|
2206
2164
|
}
|
|
2207
2165
|
|
|
2208
2166
|
export interface RecordExpressionProperties extends BaseNode {
|
|
2209
|
-
|
|
2210
|
-
|
|
2167
|
+
readonly type: 'RecordExpressionProperties';
|
|
2168
|
+
readonly properties: ReadonlyArray<ObjectProperty | SpreadElement>;
|
|
2211
2169
|
}
|
|
2212
2170
|
|
|
2213
2171
|
/******************************************************
|