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.
@@ -14,7 +14,7 @@
14
14
  *
15
15
  * IMPORTANT NOTE
16
16
  *
17
- * This file intentionally uses interfaces and `+` for readonly.
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 `+` to avoid the `$ReadOnly` type.
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
- +loc: SourceLocation;
42
+ readonly loc: SourceLocation;
43
43
  }
44
44
  export interface BaseToken extends ObjectWithLoc {
45
- +loc: SourceLocation;
46
- +range: Range;
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
- +parent: ESNode;
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
- +type:
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
- +value: string;
78
+ readonly value: string;
79
79
  }
80
80
  export interface RegexToken extends BaseToken {
81
- +type: 'RegularExpression';
82
- +value: string;
83
- +regex: {
84
- +pattern: string,
85
- +flags: string,
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
- +type: 'Line';
90
- +value: string;
89
+ readonly type: 'Line';
90
+ readonly value: string;
91
91
  }
92
92
  export interface BlockComment extends BaseToken {
93
- +type: 'Block';
94
- +value: string;
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
- +start: Position;
101
- +end: Position;
100
+ readonly start: Position;
101
+ readonly end: Position;
102
102
  }
103
103
 
104
104
  export interface Position {
105
105
  /** >= 1 */
106
- +line: number;
106
+ readonly line: number;
107
107
  /** >= 0 */
108
- +column: number;
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 = $ReadOnly<{
117
+ export type DocblockDirectives = Readonly<{
118
118
  // some well-known tags
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,
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 = $ReadOnly<{
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
- +type: 'Program';
133
- +sourceType: 'script' | 'module';
134
- +body: $ReadOnlyArray<Statement | ModuleDeclaration>;
135
- +tokens: $ReadOnlyArray<Token>;
136
- +comments: $ReadOnlyArray<Comment>;
137
- +loc: SourceLocation;
138
- +interpreter: null | InterpreterDirective;
139
- +docblock: null | DocblockMetadata;
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
- +parent: ESNode;
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
- | BindingName
230
- | AssignmentPattern
231
- | MemberExpression
232
- | RestElement;
229
+ BindingName | AssignmentPattern | MemberExpression | RestElement;
233
230
 
234
231
  interface BaseFunction extends BaseNode {
235
- +params: $ReadOnlyArray<FunctionParameter>;
236
- +async: boolean;
232
+ readonly params: ReadonlyArray<FunctionParameter>;
233
+ readonly async: boolean;
237
234
 
238
- +predicate: null | InferredPredicate;
239
- +returnType: null | TypeAnnotation;
240
- +typeParameters: null | TypeParameterDeclaration;
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
- | FunctionDeclaration
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
- | SwitchCase
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
- +type: 'EmptyStatement';
302
+ readonly type: 'EmptyStatement';
311
303
  }
312
304
 
313
305
  export interface BlockStatement extends BaseNode {
314
- +type: 'BlockStatement';
315
- +body: $ReadOnlyArray<Statement>;
306
+ readonly type: 'BlockStatement';
307
+ readonly body: ReadonlyArray<Statement>;
316
308
  }
317
309
 
318
310
  export interface StaticBlock extends BaseNode {
319
- +type: 'StaticBlock';
320
- +body: $ReadOnlyArray<Statement>;
311
+ readonly type: 'StaticBlock';
312
+ readonly body: ReadonlyArray<Statement>;
321
313
  }
322
314
 
323
315
  export interface ExpressionStatement extends BaseNode {
324
- +type: 'ExpressionStatement';
325
- +expression: Expression;
326
- +directive: string | null;
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
- +type: 'IfStatement';
331
- +test: Expression;
332
- +consequent: Statement;
333
- +alternate?: Statement | null;
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
- +type: 'LabeledStatement';
338
- +label: Identifier;
339
- +body: Statement;
329
+ readonly type: 'LabeledStatement';
330
+ readonly label: Identifier;
331
+ readonly body: Statement;
340
332
  }
341
333
 
342
334
  export interface BreakStatement extends BaseNode {
343
- +type: 'BreakStatement';
344
- +label?: Identifier | null;
335
+ readonly type: 'BreakStatement';
336
+ readonly label?: Identifier | null;
345
337
  }
346
338
 
347
339
  export interface ContinueStatement extends BaseNode {
348
- +type: 'ContinueStatement';
349
- +label?: Identifier | null;
340
+ readonly type: 'ContinueStatement';
341
+ readonly label?: Identifier | null;
350
342
  }
351
343
 
352
344
  export interface WithStatement extends BaseNode {
353
- +type: 'WithStatement';
354
- +object: Expression;
355
- +body: Statement;
345
+ readonly type: 'WithStatement';
346
+ readonly object: Expression;
347
+ readonly body: Statement;
356
348
  }
357
349
 
358
350
  export interface SwitchStatement extends BaseNode {
359
- +type: 'SwitchStatement';
360
- +discriminant: Expression;
361
- +cases: $ReadOnlyArray<SwitchCase>;
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
- +type: 'ReturnStatement';
366
- +argument?: Expression | null;
357
+ readonly type: 'ReturnStatement';
358
+ readonly argument?: Expression | null;
367
359
  }
368
360
 
369
361
  export interface ThrowStatement extends BaseNode {
370
- +type: 'ThrowStatement';
371
- +argument: Expression;
362
+ readonly type: 'ThrowStatement';
363
+ readonly argument: Expression;
372
364
  }
373
365
 
374
366
  export interface TryStatement extends BaseNode {
375
- +type: 'TryStatement';
376
- +block: BlockStatement;
377
- +handler?: CatchClause | null;
378
- +finalizer?: BlockStatement | null;
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
- +type: 'WhileStatement';
383
- +test: Expression;
384
- +body: Statement;
374
+ readonly type: 'WhileStatement';
375
+ readonly test: Expression;
376
+ readonly body: Statement;
385
377
  }
386
378
 
387
379
  export interface DoWhileStatement extends BaseNode {
388
- +type: 'DoWhileStatement';
389
- +body: Statement;
390
- +test: Expression;
380
+ readonly type: 'DoWhileStatement';
381
+ readonly body: Statement;
382
+ readonly test: Expression;
391
383
  }
392
384
 
393
385
  export interface ForStatement extends BaseNode {
394
- +type: 'ForStatement';
395
- +init?: VariableDeclaration | Expression | null;
396
- +test?: Expression | null;
397
- +update?: Expression | null;
398
- +body: Statement;
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
- +left: VariableDeclaration | BindingName | MemberExpression;
403
- +right: Expression;
404
- +body: Statement;
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
- +type: 'ForInStatement';
400
+ readonly type: 'ForInStatement';
409
401
  }
410
402
 
411
403
  export interface ForOfStatement extends BaseForXStatement {
412
- +type: 'ForOfStatement';
413
- +await: boolean;
404
+ readonly type: 'ForOfStatement';
405
+ readonly await: boolean;
414
406
  }
415
407
 
416
408
  export interface DebuggerStatement extends BaseNode {
417
- +type: 'DebuggerStatement';
409
+ readonly type: 'DebuggerStatement';
418
410
  }
419
411
 
420
412
  type ComponentParameterAndRestElement = ComponentParameter | RestElement;
421
413
 
422
414
  export interface ComponentParameter extends BaseNode {
423
- +type: 'ComponentParameter';
424
- +name: Identifier | StringLiteral;
425
- +local: BindingName | AssignmentPattern;
426
- +shorthand: boolean;
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
- +type: 'ComponentDeclaration';
431
- +async: boolean;
432
- +body: BlockStatement;
433
- +id: Identifier;
434
- +params: $ReadOnlyArray<ComponentParameterAndRestElement>;
435
- +rendersType: null | RendersType;
436
- +typeParameters: null | TypeParameterDeclaration;
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
- +type: 'HookDeclaration';
441
- +async: boolean;
442
- +id: Identifier;
443
- +body: BlockStatement;
444
- +params: $ReadOnlyArray<FunctionParameter>;
445
- +returnType: null | TypeAnnotation;
446
- +typeParameters: null | TypeParameterDeclaration;
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
- +type: 'FunctionDeclaration';
442
+ readonly type: 'FunctionDeclaration';
451
443
  /** It is null when a function declaration is a part of the `export default function` statement */
452
- +id: Identifier | null;
453
- +body: BlockStatement;
454
- +generator: boolean;
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
- +type: 'VariableDeclaration';
459
- +declarations: $ReadOnlyArray<VariableDeclarator>;
460
- +kind: 'var' | 'let' | 'const';
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
- +type: 'VariableDeclarator';
465
- +id: BindingName;
466
- +init?: Expression | null;
456
+ readonly type: 'VariableDeclarator';
457
+ readonly id: BindingName;
458
+ readonly init?: Expression | null;
467
459
 
468
- +parent: VariableDeclaration;
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
- +type: 'ThisExpression';
498
+ readonly type: 'ThisExpression';
507
499
  }
508
500
 
509
501
  export interface ArrayExpression extends BaseNode {
510
- +type: 'ArrayExpression';
511
- +elements: $ReadOnlyArray<Expression | SpreadElement>;
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
- +trailingComma: boolean;
505
+ readonly trailingComma: boolean;
514
506
  }
515
507
 
516
508
  export interface ObjectExpression extends BaseNode {
517
- +type: 'ObjectExpression';
518
- +properties: $ReadOnlyArray<ObjectProperty | SpreadElement>;
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
- | Identifier
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
- +parent: ObjectExpression | ObjectPattern | RecordExpressionProperties;
526
+ readonly parent:
527
+ ObjectExpression | ObjectPattern | RecordExpressionProperties;
538
528
  }
539
- export interface ObjectPropertyWithNonShorthandStaticName
540
- extends ObjectPropertyBase {
541
- +type: 'Property';
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
- +key: ObjectPropertyKey;
545
- +value: Expression;
546
- +kind: 'init' | 'get' | 'set';
547
- +method: boolean;
548
- +shorthand: false;
549
- }
550
- export interface ObjectPropertyWithShorthandStaticName
551
- extends ObjectPropertyBase {
552
- +type: 'Property';
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
- +key: Identifier;
543
+ readonly key: Identifier;
556
544
  // shorthand values *must* be identifiers (that look the same as the key)
557
- +value: Identifier;
558
- +kind: 'init';
559
- +method: false;
560
- +shorthand: true;
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
- +type: 'Property';
564
- +computed: true;
551
+ readonly type: 'Property';
552
+ readonly computed: true;
565
553
  // computed names can be any expression
566
- +key: Expression;
567
- +value: Expression;
568
- +kind: 'init' | 'get' | 'set';
569
- +method: boolean;
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
- +shorthand: false;
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
- +kind: 'init';
581
- +method: false;
568
+ readonly kind: 'init';
569
+ readonly method: false;
582
570
 
583
- +parent: ObjectExpression | ObjectPattern;
571
+ readonly parent: ObjectExpression | ObjectPattern;
584
572
  }
585
- export interface DestructuringObjectPropertyWithNonShorthandStaticName
586
- extends DestructuringObjectPropertyBase {
587
- +type: 'Property';
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
- +key: ObjectPropertyKey;
577
+ readonly key: ObjectPropertyKey;
591
578
  // destructuring properties cannot have any value
592
- +value: DestructuringPattern;
593
- +shorthand: false;
579
+ readonly value: DestructuringPattern;
580
+ readonly shorthand: false;
594
581
  }
595
- export interface DestructuringObjectPropertyWithShorthandStaticName
596
- extends DestructuringObjectPropertyBase {
597
- +type: 'Property';
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
- +key: Identifier;
586
+ readonly key: Identifier;
601
587
  // shorthand values *must* be identifiers or assignments (that look the same as the key)
602
- +value: Identifier | AssignmentPattern;
603
- +shorthand: true;
588
+ readonly value: Identifier | AssignmentPattern;
589
+ readonly shorthand: true;
604
590
  }
605
- export interface DestructuringObjectPropertyWithComputedName
606
- extends DestructuringObjectPropertyBase {
607
- +type: 'Property';
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
- +key: Expression;
595
+ readonly key: Expression;
611
596
  // destructuring properties cannot have any value
612
- +value: DestructuringPattern;
597
+ readonly value: DestructuringPattern;
613
598
  // cannot have a shorthand computed name
614
- +shorthand: false;
599
+ readonly shorthand: false;
615
600
  }
616
601
 
617
602
  export interface FunctionExpression extends BaseFunction {
618
- +id?: Identifier | null;
619
- +type: 'FunctionExpression';
620
- +body: BlockStatement;
621
- +generator: boolean;
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
- +type: 'SequenceExpression';
626
- +expressions: $ReadOnlyArray<Expression>;
610
+ readonly type: 'SequenceExpression';
611
+ readonly expressions: ReadonlyArray<Expression>;
627
612
  }
628
613
 
629
614
  export interface UnaryExpression extends BaseNode {
630
- +type: 'UnaryExpression';
631
- +operator: UnaryOperator;
632
- +prefix: true;
633
- +argument: Expression;
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
- +type: 'BinaryExpression';
638
- +operator: BinaryOperatorWithoutIn;
639
- +left: Expression;
640
- +right: Expression;
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
- +type: 'BinaryExpression';
647
- +operator: 'in';
648
- +left: Expression | PrivateIdentifier;
649
- +right: Expression;
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
- +type: 'AssignmentExpression';
656
- +operator: AssignmentOperator;
657
- +left: BindingName | MemberExpression;
658
- +right: Expression;
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
- +type: 'UpdateExpression';
663
- +operator: UpdateOperator;
664
- +argument: Expression;
665
- +prefix: boolean;
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
- +type: 'LogicalExpression';
670
- +operator: LogicalOperator;
671
- +left: Expression;
672
- +right: Expression;
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
- +type: 'ConditionalExpression';
677
- +test: Expression;
678
- +alternate: Expression;
679
- +consequent: Expression;
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
- +callee: Expression | Super;
684
- +arguments: $ReadOnlyArray<Expression | SpreadElement>;
685
- +typeArguments: null | TypeParameterInstantiation;
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
- +type: 'CallExpression';
689
- +optional: boolean;
673
+ readonly type: 'CallExpression';
674
+ readonly optional: boolean;
690
675
  }
691
676
 
692
677
  export interface NewExpression extends BaseCallExpression {
693
- +type: 'NewExpression';
678
+ readonly type: 'NewExpression';
694
679
  }
695
680
 
696
681
  export type MemberExpression =
697
- | MemberExpressionWithComputedName
698
- | MemberExpressionWithNonComputedName;
682
+ MemberExpressionWithComputedName | MemberExpressionWithNonComputedName;
699
683
  export interface MemberExpressionWithComputedName extends BaseNode {
700
- +type: 'MemberExpression';
701
- +object: Expression | Super;
702
- +property: Expression;
703
- +computed: true;
704
- +optional: boolean;
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
- +type: 'MemberExpression';
708
- +object: Expression | Super;
709
- +property: Identifier | PrivateIdentifier;
710
- +computed: false;
711
- +optional: boolean;
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
- +type: 'ChainExpression';
718
- +expression: ChainElement;
701
+ readonly type: 'ChainExpression';
702
+ readonly expression: ChainElement;
719
703
  }
720
704
 
721
705
  export interface SwitchCase extends BaseNode {
722
- +type: 'SwitchCase';
723
- +test?: Expression | null;
724
- +consequent: $ReadOnlyArray<Statement>;
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
- +type: 'CatchClause';
729
- +param: BindingName | null;
730
- +body: BlockStatement;
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
- +type: 'Identifier';
735
- +name: string;
718
+ readonly type: 'Identifier';
719
+ readonly name: string;
736
720
 
737
- +typeAnnotation: TypeAnnotation | null;
721
+ readonly typeAnnotation: TypeAnnotation | null;
738
722
  // only applies to function arguments
739
- +optional: boolean;
723
+ readonly optional: boolean;
740
724
  }
741
725
 
742
726
  export interface PrivateIdentifier extends BaseNode {
743
- +type: 'PrivateIdentifier';
744
- +name: string;
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
- +type: 'Literal';
757
- +value: bigint;
758
- +bigint: string;
759
- +raw: string;
760
- +literalType: 'bigint';
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
- +type: 'Literal';
765
- +value: boolean;
766
- +raw: 'true' | 'false';
767
- +literalType: 'boolean';
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
- +type: 'Literal';
772
- +value: null;
773
- +raw: 'null';
774
- +literalType: 'null';
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
- +type: 'Literal';
779
- +value: number;
780
- +raw: string;
781
- +literalType: 'numeric';
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
- +type: 'Literal';
786
- +value: RegExp | null;
787
- +regex: interface {
788
- +pattern: string,
789
- +flags: string,
769
+ readonly type: 'Literal';
770
+ readonly value: RegExp | null;
771
+ readonly regex: interface {
772
+ readonly pattern: string,
773
+ readonly flags: string,
790
774
  };
791
- +raw: string;
792
- +literalType: 'regexp';
775
+ readonly raw: string;
776
+ readonly literalType: 'regexp';
793
777
  }
794
778
 
795
779
  export interface StringLiteral extends BaseNode {
796
- +type: 'Literal';
797
- +value: string;
798
- +raw: string;
799
- +literalType: 'string';
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
- +type: 'Super';
838
+ readonly type: 'Super';
861
839
  }
862
840
 
863
841
  export interface SpreadElement extends BaseNode {
864
- +type: 'SpreadElement';
865
- +argument: Expression;
842
+ readonly type: 'SpreadElement';
843
+ readonly argument: Expression;
866
844
  }
867
845
 
868
846
  export interface ArrowFunctionExpression extends BaseFunction {
869
- +type: 'ArrowFunctionExpression';
870
- +expression: boolean;
871
- +body: BlockStatement | Expression;
847
+ readonly type: 'ArrowFunctionExpression';
848
+ readonly expression: boolean;
849
+ readonly body: BlockStatement | Expression;
872
850
  // hermes emits this - but it's always null
873
- +id: null;
851
+ readonly id: null;
874
852
  // note - arrow functions cannot be generators
875
853
  }
876
854
 
877
855
  export interface YieldExpression extends BaseNode {
878
- +type: 'YieldExpression';
879
- +argument?: Expression | null;
880
- +delegate: boolean;
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
- +type: 'TemplateLiteral';
885
- +quasis: $ReadOnlyArray<TemplateElement>;
886
- +expressions: $ReadOnlyArray<Expression>;
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
- +type: 'TaggedTemplateExpression';
891
- +tag: Expression;
892
- +quasi: TemplateLiteral;
868
+ readonly type: 'TaggedTemplateExpression';
869
+ readonly tag: Expression;
870
+ readonly quasi: TemplateLiteral;
893
871
  }
894
872
 
895
873
  export interface TemplateElement extends BaseNode {
896
- +type: 'TemplateElement';
897
- +tail: boolean;
898
- +value: interface {
899
- +cooked: string,
900
- +raw: string,
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
- +type: 'ObjectPattern';
906
- +properties: $ReadOnlyArray<DestructuringObjectProperty | RestElement>;
883
+ readonly type: 'ObjectPattern';
884
+ readonly properties: ReadonlyArray<DestructuringObjectProperty | RestElement>;
907
885
  // if used as a VariableDeclarator.id
908
- +typeAnnotation: TypeAnnotation | null;
886
+ readonly typeAnnotation: TypeAnnotation | null;
909
887
  }
910
888
 
911
889
  export interface ArrayPattern extends BaseNode {
912
- +type: 'ArrayPattern';
890
+ readonly type: 'ArrayPattern';
913
891
  // an element will be null if the pattern contains a hole: `[a,,b]`
914
- +elements: $ReadOnlyArray<?DestructuringPattern>;
915
- +typeAnnotation: TypeAnnotation | null;
892
+ readonly elements: ReadonlyArray<?DestructuringPattern>;
893
+ readonly typeAnnotation: TypeAnnotation | null;
916
894
  }
917
895
 
918
896
  export interface RestElement extends BaseNode {
919
- +type: 'RestElement';
920
- +argument: RestElementPattern;
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
- +type: 'AssignmentPattern';
926
- +left: BindingName;
927
- +right: Expression;
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
- +superClass?: Expression | null;
933
- +body: ClassBody;
910
+ readonly superClass?: Expression | null;
911
+ readonly body: ClassBody;
934
912
 
935
- +typeParameters: null | TypeParameterDeclaration;
936
- +superTypeArguments: null | TypeParameterInstantiation;
937
- +implements: $ReadOnlyArray<ClassImplements>;
938
- +decorators: $ReadOnlyArray<Decorator>;
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
- | ClassPropertyNameComputed
943
- | ClassPropertyNameNonComputed;
920
+ ClassPropertyNameComputed | ClassPropertyNameNonComputed;
944
921
  export type ClassPropertyNameComputed = Expression;
945
922
  export type ClassPropertyNameNonComputed =
946
- | PrivateIdentifier
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
- +type: 'ClassBody';
956
- +body: $ReadOnlyArray<ClassMember>;
931
+ readonly type: 'ClassBody';
932
+ readonly body: ReadonlyArray<ClassMember>;
957
933
 
958
- +parent: AClass;
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
- +value: FunctionExpression;
942
+ readonly value: FunctionExpression;
967
943
 
968
- +parent: ClassBody;
944
+ readonly parent: ClassBody;
969
945
  }
970
946
  export interface MethodDefinitionConstructor extends MethodDefinitionBase {
971
- +type: 'MethodDefinition';
972
- +key: Identifier | StringLiteral;
973
- +kind: 'constructor';
974
- +computed: false;
975
- +static: false;
976
- +decorators: $ReadOnlyArray<Decorator>;
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
- +type: 'MethodDefinition';
980
- +key: ClassPropertyNameComputed;
981
- +kind: 'method' | 'get' | 'set';
982
- +computed: true;
983
- +static: boolean;
984
- +decorators: $ReadOnlyArray<Decorator>;
985
- }
986
- export interface MethodDefinitionWithNonComputedName
987
- extends MethodDefinitionBase {
988
- +type: 'MethodDefinition';
989
- +key: ClassPropertyNameNonComputed;
990
- +kind: 'method' | 'get' | 'set';
991
- +computed: false;
992
- +static: boolean;
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
- | PropertyDefinitionWithComputedName
999
- | PropertyDefinitionWithNonComputedName;
973
+ PropertyDefinitionWithComputedName | PropertyDefinitionWithNonComputedName;
1000
974
  interface PropertyDefinitionBase extends BaseNode {
1001
- +value: null | Expression;
1002
- +typeAnnotation: null | TypeAnnotation;
1003
- +static: boolean;
1004
- +decorators: $ReadOnlyArray<Decorator>;
1005
- +variance: null | Variance;
1006
- +declare: boolean;
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
- +optional: false;
982
+ readonly optional: false;
1009
983
 
1010
- +parent: ClassBody;
984
+ readonly parent: ClassBody;
1011
985
  }
1012
- export interface PropertyDefinitionWithComputedName
1013
- extends PropertyDefinitionBase {
1014
- +type: 'PropertyDefinition';
1015
- +key: ClassPropertyNameComputed;
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
- extends PropertyDefinitionBase {
1020
- +type: 'PropertyDefinition';
1021
- +key: ClassPropertyNameNonComputed;
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
- +type: 'ClassDeclaration';
998
+ readonly type: 'ClassDeclaration';
1027
999
  /** It is null when a class declaration is a part of the `export default class` statement */
1028
- +id: Identifier | null;
1000
+ readonly id: Identifier | null;
1029
1001
  }
1030
1002
 
1031
1003
  export interface ClassExpression extends BaseClass {
1032
- +type: 'ClassExpression';
1033
- +id?: Identifier | null;
1004
+ readonly type: 'ClassExpression';
1005
+ readonly id?: Identifier | null;
1034
1006
  }
1035
1007
 
1036
1008
  export interface MetaProperty extends BaseNode {
1037
- +type: 'MetaProperty';
1038
- +meta: Identifier;
1039
- +property: Identifier;
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
- +type: 'ImportDeclaration';
1059
- +specifiers: $ReadOnlyArray<
1030
+ readonly type: 'ImportDeclaration';
1031
+ readonly specifiers: ReadonlyArray<
1060
1032
  ImportSpecifier | ImportDefaultSpecifier | ImportNamespaceSpecifier,
1061
1033
  >;
1062
- +source: StringLiteral;
1063
- +attributes: $ReadOnlyArray<ImportAttribute>;
1034
+ readonly source: StringLiteral;
1035
+ readonly attributes: ReadonlyArray<ImportAttribute>;
1064
1036
 
1065
- +importKind: 'value' | 'type' | 'typeof';
1037
+ readonly importKind: 'value' | 'type' | 'typeof';
1066
1038
  }
1067
1039
  export interface ImportAttribute extends BaseNode {
1068
- +type: 'ImportAttribute';
1069
- +key: Identifier;
1070
- +value: StringLiteral;
1040
+ readonly type: 'ImportAttribute';
1041
+ readonly key: Identifier;
1042
+ readonly value: StringLiteral;
1071
1043
 
1072
- +parent: ImportDeclaration;
1044
+ readonly parent: ImportDeclaration;
1073
1045
  }
1074
1046
 
1075
1047
  export interface ImportSpecifier extends BaseNode {
1076
- +type: 'ImportSpecifier';
1077
- +imported: Identifier;
1078
- +local: Identifier;
1079
- +importKind: null | 'type' | 'typeof';
1048
+ readonly type: 'ImportSpecifier';
1049
+ readonly imported: Identifier;
1050
+ readonly local: Identifier;
1051
+ readonly importKind: null | 'type' | 'typeof';
1080
1052
 
1081
- +parent: ImportDeclaration;
1053
+ readonly parent: ImportDeclaration;
1082
1054
  }
1083
1055
 
1084
1056
  export interface ImportExpression extends BaseNode {
1085
- +type: 'ImportExpression';
1086
- +source: Expression;
1087
- +options: Expression | null;
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
- +type: 'ImportDefaultSpecifier';
1092
- +local: Identifier;
1063
+ readonly type: 'ImportDefaultSpecifier';
1064
+ readonly local: Identifier;
1093
1065
 
1094
- +parent: ImportDeclaration;
1066
+ readonly parent: ImportDeclaration;
1095
1067
  }
1096
1068
 
1097
1069
  export interface ImportNamespaceSpecifier extends BaseNode {
1098
- +type: 'ImportNamespaceSpecifier';
1099
- +local: Identifier;
1070
+ readonly type: 'ImportNamespaceSpecifier';
1071
+ readonly local: Identifier;
1100
1072
 
1101
- +parent: ImportDeclaration;
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
- +type: 'ExportNamedDeclaration';
1120
- +declaration?: NamedDeclaration | null;
1121
- +specifiers: $ReadOnlyArray<ExportSpecifier>;
1122
- +source?: StringLiteral | null;
1123
- +exportKind: 'value' | 'type';
1124
- }
1125
- export interface ExportNamedDeclarationWithSpecifiers
1126
- extends ExportNamedDeclarationBase {
1127
- +type: 'ExportNamedDeclaration';
1128
- +declaration: null;
1129
- +source?: StringLiteral | null;
1130
- +specifiers: $ReadOnlyArray<ExportSpecifier>;
1131
- }
1132
- export interface ExportNamedDeclarationWithDeclaration
1133
- extends ExportNamedDeclarationBase {
1134
- +type: 'ExportNamedDeclaration';
1135
- +declaration: NamedDeclaration;
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
- | ExportNamedDeclarationWithSpecifiers
1141
- | ExportNamedDeclarationWithDeclaration;
1110
+ ExportNamedDeclarationWithSpecifiers | ExportNamedDeclarationWithDeclaration;
1142
1111
 
1143
1112
  export interface ExportSpecifier extends BaseNode {
1144
- +type: 'ExportSpecifier';
1145
- +exported: Identifier;
1146
- +local: Identifier;
1113
+ readonly type: 'ExportSpecifier';
1114
+ readonly exported: Identifier;
1115
+ readonly local: Identifier;
1147
1116
  }
1148
1117
 
1149
1118
  export interface ExportDefaultDeclaration extends BaseNode {
1150
- +type: 'ExportDefaultDeclaration';
1151
- +declaration: DefaultDeclaration | Expression;
1119
+ readonly type: 'ExportDefaultDeclaration';
1120
+ readonly declaration: DefaultDeclaration | Expression;
1152
1121
  }
1153
1122
 
1154
1123
  export interface ExportAllDeclaration extends BaseNode {
1155
- +type: 'ExportAllDeclaration';
1156
- +source: StringLiteral;
1157
- +exportKind: 'value' | 'type';
1158
- +exported?: Identifier | null;
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
- +type: 'AwaitExpression';
1163
- +argument: Expression;
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
- +type: 'Variance';
1216
- +kind: 'plus' | 'minus' | 'readonly' | 'writeonly' | 'in' | 'out';
1184
+ readonly type: 'Variance';
1185
+ readonly kind: 'plus' | 'minus' | 'readonly' | 'writeonly' | 'in' | 'out';
1217
1186
  }
1218
1187
 
1219
1188
  interface BaseTypeAlias extends BaseNode {
1220
- +id: Identifier;
1221
- +typeParameters: null | TypeParameterDeclaration;
1222
- +right: TypeAnnotationType;
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
- +type: 'TypeAnnotation';
1227
- +typeAnnotation: TypeAnnotationType;
1195
+ readonly type: 'TypeAnnotation';
1196
+ readonly typeAnnotation: TypeAnnotationType;
1228
1197
  }
1229
1198
 
1230
1199
  export interface TypeAlias extends BaseTypeAlias {
1231
- +type: 'TypeAlias';
1200
+ readonly type: 'TypeAlias';
1232
1201
  }
1233
1202
 
1234
1203
  interface BaseOpaqueType extends BaseNode {
1235
- +id: Identifier;
1236
- +supertype: TypeAnnotationType | null;
1237
- +lowerBound: TypeAnnotationType | null;
1238
- +upperBound: TypeAnnotationType | null;
1239
- +typeParameters: TypeParameterDeclaration | null;
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
- +type: 'OpaqueType';
1243
- +impltype: TypeAnnotationType;
1211
+ readonly type: 'OpaqueType';
1212
+ readonly impltype: TypeAnnotationType;
1244
1213
  }
1245
1214
 
1246
1215
  export interface NumberTypeAnnotation extends BaseNode {
1247
- +type: 'NumberTypeAnnotation';
1216
+ readonly type: 'NumberTypeAnnotation';
1248
1217
  }
1249
1218
  export interface StringTypeAnnotation extends BaseNode {
1250
- +type: 'StringTypeAnnotation';
1219
+ readonly type: 'StringTypeAnnotation';
1251
1220
  }
1252
1221
  export interface BigIntTypeAnnotation extends BaseNode {
1253
- +type: 'BigIntTypeAnnotation';
1222
+ readonly type: 'BigIntTypeAnnotation';
1254
1223
  }
1255
1224
  export interface BooleanTypeAnnotation extends BaseNode {
1256
- +type: 'BooleanTypeAnnotation';
1225
+ readonly type: 'BooleanTypeAnnotation';
1257
1226
  }
1258
1227
  export interface NullLiteralTypeAnnotation extends BaseNode {
1259
- +type: 'NullLiteralTypeAnnotation';
1228
+ readonly type: 'NullLiteralTypeAnnotation';
1260
1229
  }
1261
1230
  export interface AnyTypeAnnotation extends BaseNode {
1262
- +type: 'AnyTypeAnnotation';
1231
+ readonly type: 'AnyTypeAnnotation';
1263
1232
  }
1264
1233
  export interface EmptyTypeAnnotation extends BaseNode {
1265
- +type: 'EmptyTypeAnnotation';
1234
+ readonly type: 'EmptyTypeAnnotation';
1266
1235
  }
1267
1236
  export interface SymbolTypeAnnotation extends BaseNode {
1268
- +type: 'SymbolTypeAnnotation';
1237
+ readonly type: 'SymbolTypeAnnotation';
1269
1238
  }
1270
1239
  export interface ThisTypeAnnotation extends BaseNode {
1271
- +type: 'ThisTypeAnnotation';
1240
+ readonly type: 'ThisTypeAnnotation';
1272
1241
  }
1273
1242
  export interface MixedTypeAnnotation extends BaseNode {
1274
- +type: 'MixedTypeAnnotation';
1243
+ readonly type: 'MixedTypeAnnotation';
1275
1244
  }
1276
1245
  export interface VoidTypeAnnotation extends BaseNode {
1277
- +type: 'VoidTypeAnnotation';
1246
+ readonly type: 'VoidTypeAnnotation';
1278
1247
  }
1279
1248
  export interface UnknownTypeAnnotation extends BaseNode {
1280
- +type: 'UnknownTypeAnnotation';
1249
+ readonly type: 'UnknownTypeAnnotation';
1281
1250
  }
1282
1251
  export interface NeverTypeAnnotation extends BaseNode {
1283
- +type: 'NeverTypeAnnotation';
1252
+ readonly type: 'NeverTypeAnnotation';
1284
1253
  }
1285
1254
  export interface UndefinedTypeAnnotation extends BaseNode {
1286
- +type: 'UndefinedTypeAnnotation';
1255
+ readonly type: 'UndefinedTypeAnnotation';
1287
1256
  }
1288
1257
  export interface StringLiteralTypeAnnotation extends BaseNode {
1289
- +type: 'StringLiteralTypeAnnotation';
1290
- +value: string;
1291
- +raw: string;
1258
+ readonly type: 'StringLiteralTypeAnnotation';
1259
+ readonly value: string;
1260
+ readonly raw: string;
1292
1261
  }
1293
1262
  export interface NumberLiteralTypeAnnotation extends BaseNode {
1294
- +type: 'NumberLiteralTypeAnnotation';
1295
- +value: number;
1296
- +raw: string;
1263
+ readonly type: 'NumberLiteralTypeAnnotation';
1264
+ readonly value: number;
1265
+ readonly raw: string;
1297
1266
  }
1298
1267
  export interface BigIntLiteralTypeAnnotation extends BaseNode {
1299
- +type: 'BigIntLiteralTypeAnnotation';
1300
- +bigint: string;
1301
- +value: bigint;
1302
- +raw: string;
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
- +type: 'BooleanLiteralTypeAnnotation';
1306
- +value: boolean;
1307
- +raw: 'true' | 'false';
1274
+ readonly type: 'BooleanLiteralTypeAnnotation';
1275
+ readonly value: boolean;
1276
+ readonly raw: 'true' | 'false';
1308
1277
  }
1309
1278
  export interface ArrayTypeAnnotation extends BaseNode {
1310
- +type: 'ArrayTypeAnnotation';
1311
- +elementType: TypeAnnotationType;
1279
+ readonly type: 'ArrayTypeAnnotation';
1280
+ readonly elementType: TypeAnnotationType;
1312
1281
  }
1313
1282
  export interface NullableTypeAnnotation extends BaseNode {
1314
- +type: 'NullableTypeAnnotation';
1315
- +typeAnnotation: TypeAnnotationType;
1283
+ readonly type: 'NullableTypeAnnotation';
1284
+ readonly typeAnnotation: TypeAnnotationType;
1316
1285
  }
1317
1286
  export interface ExistsTypeAnnotation extends BaseNode {
1318
- +type: 'ExistsTypeAnnotation';
1287
+ readonly type: 'ExistsTypeAnnotation';
1319
1288
  }
1320
1289
  export interface GenericTypeAnnotation extends BaseNode {
1321
- +type: 'GenericTypeAnnotation';
1322
- +id: Identifier | QualifiedTypeIdentifier;
1323
- +typeParameters: null | TypeParameterInstantiation;
1290
+ readonly type: 'GenericTypeAnnotation';
1291
+ readonly id: Identifier | QualifiedTypeIdentifier;
1292
+ readonly typeParameters: null | TypeParameterInstantiation;
1324
1293
  }
1325
1294
  export interface QualifiedTypeIdentifier extends BaseNode {
1326
- +type: 'QualifiedTypeIdentifier';
1327
- +id: Identifier;
1328
- +qualification: QualifiedTypeIdentifier | Identifier;
1295
+ readonly type: 'QualifiedTypeIdentifier';
1296
+ readonly id: Identifier;
1297
+ readonly qualification: QualifiedTypeIdentifier | Identifier;
1329
1298
  }
1330
1299
  export interface QualifiedTypeofIdentifier extends BaseNode {
1331
- +type: 'QualifiedTypeofIdentifier';
1332
- +id: Identifier;
1333
- +qualification: QualifiedTypeofIdentifier | Identifier;
1300
+ readonly type: 'QualifiedTypeofIdentifier';
1301
+ readonly id: Identifier;
1302
+ readonly qualification: QualifiedTypeofIdentifier | Identifier;
1334
1303
  }
1335
1304
  export interface TypeofTypeAnnotation extends BaseNode {
1336
- +type: 'TypeofTypeAnnotation';
1337
- +argument: QualifiedTypeofIdentifier | Identifier;
1338
- +typeArguments?: TypeParameterInstantiation;
1305
+ readonly type: 'TypeofTypeAnnotation';
1306
+ readonly argument: QualifiedTypeofIdentifier | Identifier;
1307
+ readonly typeArguments?: TypeParameterInstantiation;
1339
1308
  }
1340
1309
  export interface KeyofTypeAnnotation extends BaseNode {
1341
- +type: 'KeyofTypeAnnotation';
1342
- +argument: TypeAnnotationType;
1310
+ readonly type: 'KeyofTypeAnnotation';
1311
+ readonly argument: TypeAnnotationType;
1343
1312
  }
1344
1313
  export interface TupleTypeAnnotation extends BaseNode {
1345
- +type: 'TupleTypeAnnotation';
1346
- +elementTypes: $ReadOnlyArray<TypeAnnotationType>;
1347
- +inexact: boolean;
1314
+ readonly type: 'TupleTypeAnnotation';
1315
+ readonly elementTypes: ReadonlyArray<TypeAnnotationType>;
1316
+ readonly inexact: boolean;
1348
1317
  }
1349
1318
  export interface TupleTypeSpreadElement extends BaseNode {
1350
- +type: 'TupleTypeSpreadElement';
1351
- +label?: Identifier | null;
1352
- +typeAnnotation: TypeAnnotationType;
1319
+ readonly type: 'TupleTypeSpreadElement';
1320
+ readonly label?: Identifier | null;
1321
+ readonly typeAnnotation: TypeAnnotationType;
1353
1322
  }
1354
1323
  export interface TupleTypeLabeledElement extends BaseNode {
1355
- +type: 'TupleTypeLabeledElement';
1356
- +label: Identifier;
1357
- +elementType: TypeAnnotationType;
1358
- +optional: boolean;
1359
- +variance: Variance | null;
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
- +type: 'InferTypeAnnotation';
1364
- +typeParameter: TypeParameter;
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
- +type: 'ObjectTypeInternalSlot';
1370
- +id: Identifier;
1371
- +optional: boolean;
1372
- +static: boolean;
1373
- +method: boolean;
1374
- +value: TypeAnnotation;
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
- +parent: ObjectTypeAnnotation;
1345
+ readonly parent: ObjectTypeAnnotation;
1377
1346
  }
1378
1347
 
1379
1348
  export interface InterfaceTypeAnnotation extends BaseInterfaceNode {
1380
- +type: 'InterfaceTypeAnnotation';
1349
+ readonly type: 'InterfaceTypeAnnotation';
1381
1350
  }
1382
1351
 
1383
1352
  export interface UnionTypeAnnotation extends BaseNode {
1384
- +type: 'UnionTypeAnnotation';
1385
- +types: $ReadOnlyArray<TypeAnnotationType>;
1353
+ readonly type: 'UnionTypeAnnotation';
1354
+ readonly types: ReadonlyArray<TypeAnnotationType>;
1386
1355
  }
1387
1356
  export interface IntersectionTypeAnnotation extends BaseNode {
1388
- +type: 'IntersectionTypeAnnotation';
1389
- +types: $ReadOnlyArray<TypeAnnotationType>;
1357
+ readonly type: 'IntersectionTypeAnnotation';
1358
+ readonly types: ReadonlyArray<TypeAnnotationType>;
1390
1359
  }
1391
1360
 
1392
1361
  export interface ConditionalTypeAnnotation extends BaseNode {
1393
- +type: 'ConditionalTypeAnnotation';
1394
- +checkType: TypeAnnotationType;
1395
- +extendsType: TypeAnnotationType;
1396
- +trueType: TypeAnnotationType;
1397
- +falseType: TypeAnnotationType;
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
- | RendersTypeOperator
1402
- | RendersStarTypeOperator
1403
- | RendersQuestionTypeOperator;
1370
+ RendersTypeOperator | RendersStarTypeOperator | RendersQuestionTypeOperator;
1404
1371
 
1405
1372
  export type RendersType =
1406
- | RendersTypeOperator
1407
- | RendersStarTypeOperator
1408
- | RendersQuestionTypeOperator;
1373
+ RendersTypeOperator | RendersStarTypeOperator | RendersQuestionTypeOperator;
1409
1374
 
1410
1375
  interface TypeOperatorBase extends BaseNode {
1411
- +type: 'TypeOperator';
1412
- +typeAnnotation: TypeAnnotationType;
1376
+ readonly type: 'TypeOperator';
1377
+ readonly typeAnnotation: TypeAnnotationType;
1413
1378
  }
1414
1379
  export interface RendersTypeOperator extends TypeOperatorBase {
1415
- +type: 'TypeOperator';
1416
- +operator: 'renders';
1380
+ readonly type: 'TypeOperator';
1381
+ readonly operator: 'renders';
1417
1382
  }
1418
1383
  export interface RendersStarTypeOperator extends TypeOperatorBase {
1419
- +type: 'TypeOperator';
1420
- +operator: 'renders*';
1384
+ readonly type: 'TypeOperator';
1385
+ readonly operator: 'renders*';
1421
1386
  }
1422
1387
  export interface RendersQuestionTypeOperator extends TypeOperatorBase {
1423
- +type: 'TypeOperator';
1424
- +operator: 'renders?';
1388
+ readonly type: 'TypeOperator';
1389
+ readonly operator: 'renders?';
1425
1390
  }
1426
1391
 
1427
1392
  export interface TypePredicate extends BaseNode {
1428
- +type: 'TypePredicate';
1429
- +parameterName: Identifier;
1430
- +typeAnnotation: TypeAnnotationType | null;
1431
- +kind: null | 'asserts' | 'implies';
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
- +type: 'FunctionTypeAnnotation';
1436
- +params: $ReadOnlyArray<FunctionTypeParam>;
1437
- +returnType: TypeAnnotationType;
1438
- +rest: null | FunctionTypeParam;
1439
- +typeParameters: null | TypeParameterDeclaration;
1440
- +this: FunctionTypeParam | null;
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
- +type: 'FunctionTypeParam';
1444
- +name: Identifier | null;
1445
- +typeAnnotation: TypeAnnotationType;
1446
- +optional: boolean;
1408
+ readonly type: 'FunctionTypeParam';
1409
+ readonly name: Identifier | null;
1410
+ readonly typeAnnotation: TypeAnnotationType;
1411
+ readonly optional: boolean;
1447
1412
 
1448
- +parent: FunctionTypeAnnotation;
1413
+ readonly parent: FunctionTypeAnnotation;
1449
1414
  }
1450
1415
  export interface HookTypeAnnotation extends BaseNode {
1451
- +type: 'HookTypeAnnotation';
1452
- +params: $ReadOnlyArray<FunctionTypeParam>;
1453
- +returnType: TypeAnnotationType;
1454
- +rest: null | FunctionTypeParam;
1455
- +typeParameters: null | TypeParameterDeclaration;
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
- +type: 'ComponentTypeAnnotation';
1460
- +params: $ReadOnlyArray<ComponentTypeParameter>;
1461
- +rest: null | ComponentTypeParameter;
1462
- +typeParameters: null | TypeParameterDeclaration;
1463
- +rendersType: null | RendersType;
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
- +type: 'ComponentTypeParameter';
1467
- +name: Identifier | StringLiteral | null;
1468
- +typeAnnotation: TypeAnnotationType;
1469
- +optional: boolean;
1431
+ readonly type: 'ComponentTypeParameter';
1432
+ readonly name: Identifier | StringLiteral | null;
1433
+ readonly typeAnnotation: TypeAnnotationType;
1434
+ readonly optional: boolean;
1470
1435
 
1471
- +parent: ComponentTypeAnnotation | DeclareComponent;
1436
+ readonly parent: ComponentTypeAnnotation | DeclareComponent;
1472
1437
  }
1473
1438
 
1474
1439
  export interface InferredPredicate extends BaseNode {
1475
- +type: 'InferredPredicate';
1440
+ readonly type: 'InferredPredicate';
1476
1441
 
1477
- +parent: AFunction | DeclareFunction;
1442
+ readonly parent: AFunction | DeclareFunction;
1478
1443
  }
1479
1444
 
1480
1445
  export interface ObjectTypeAnnotation extends BaseNode {
1481
- +type: 'ObjectTypeAnnotation';
1482
- +inexact: boolean;
1483
- +exact: boolean;
1484
- +properties: $ReadOnlyArray<
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
- +indexers: $ReadOnlyArray<ObjectTypeIndexer>;
1490
- +callProperties: $ReadOnlyArray<ObjectTypeCallProperty>;
1491
- +internalSlots: $ReadOnlyArray<ObjectTypeInternalSlot>;
1454
+ readonly indexers: ReadonlyArray<ObjectTypeIndexer>;
1455
+ readonly callProperties: ReadonlyArray<ObjectTypeCallProperty>;
1456
+ readonly internalSlots: ReadonlyArray<ObjectTypeInternalSlot>;
1492
1457
  }
1493
1458
  interface ObjectTypePropertyBase extends BaseNode {
1494
- +type: 'ObjectTypeProperty';
1495
- +key: ObjectPropertyKey;
1496
- +value: TypeAnnotationType;
1497
- +method: boolean;
1498
- +optional: boolean;
1499
- +static: boolean; // only applies to the "declare class" case
1500
- +proto: boolean; // only applies to the "declare class" case
1501
- +variance: Variance | null;
1502
- +kind: 'init' | 'get' | 'set';
1503
-
1504
- +parent: ObjectTypeAnnotation;
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
- +type: 'ObjectTypeProperty';
1508
- +value: FunctionTypeAnnotation;
1509
- +method: true;
1510
- +optional: false;
1511
- +variance: null;
1512
- +kind: 'init';
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
- +parent: ObjectTypeAnnotation;
1479
+ readonly parent: ObjectTypeAnnotation;
1515
1480
  }
1516
1481
  export interface ObjectTypePropertySignature extends ObjectTypePropertyBase {
1517
- +type: 'ObjectTypeProperty';
1518
- +value: TypeAnnotationType;
1519
- +method: false;
1520
- +optional: boolean;
1521
- +variance: Variance | null;
1522
- +kind: 'init';
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
- +parent: ObjectTypeAnnotation;
1489
+ readonly parent: ObjectTypeAnnotation;
1525
1490
  }
1526
1491
  export interface ObjectTypeAccessorSignature extends ObjectTypePropertyBase {
1527
- +type: 'ObjectTypeProperty';
1528
- +value: FunctionTypeAnnotation;
1529
- +method: false;
1530
- +optional: false;
1531
- +variance: null;
1532
- +kind: 'get' | 'set';
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
- +parent: ObjectTypeAnnotation;
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
- +type: 'ObjectTypeCallProperty';
1543
- +value: FunctionTypeAnnotation;
1544
- +static: boolean; // can only be static when defined on a declare class
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
- +parent: ObjectTypeAnnotation;
1511
+ readonly parent: ObjectTypeAnnotation;
1547
1512
  }
1548
1513
  export interface ObjectTypeIndexer extends BaseNode {
1549
- +type: 'ObjectTypeIndexer';
1550
- +id: null | Identifier;
1551
- +key: TypeAnnotationType;
1552
- +value: TypeAnnotationType;
1553
- +static: boolean; // can only be static when defined on a declare class
1554
- +variance: null | Variance;
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
- +parent: ObjectTypeAnnotation;
1521
+ readonly parent: ObjectTypeAnnotation;
1557
1522
  }
1558
1523
  export interface ObjectTypeMappedTypeProperty extends BaseNode {
1559
- +type: 'ObjectTypeMappedTypeProperty';
1560
- +keyTparam: TypeParameter;
1561
- +propType: TypeAnnotationType;
1562
- +sourceType: TypeAnnotationType;
1563
- +variance: null | Variance;
1564
- +optional: null | 'PlusOptional' | 'MinusOptional' | 'Optional';
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
- +parent: ObjectTypeAnnotation;
1531
+ readonly parent: ObjectTypeAnnotation;
1567
1532
  }
1568
1533
 
1569
1534
  export interface ObjectTypeSpreadProperty extends BaseNode {
1570
- +type: 'ObjectTypeSpreadProperty';
1571
- +argument: TypeAnnotationType;
1535
+ readonly type: 'ObjectTypeSpreadProperty';
1536
+ readonly argument: TypeAnnotationType;
1572
1537
 
1573
- +parent: ObjectTypeAnnotation;
1538
+ readonly parent: ObjectTypeAnnotation;
1574
1539
  }
1575
1540
 
1576
1541
  export interface IndexedAccessType extends BaseNode {
1577
- +type: 'IndexedAccessType';
1578
- +objectType: TypeAnnotationType;
1579
- +indexType: TypeAnnotationType;
1542
+ readonly type: 'IndexedAccessType';
1543
+ readonly objectType: TypeAnnotationType;
1544
+ readonly indexType: TypeAnnotationType;
1580
1545
  }
1581
1546
  export interface OptionalIndexedAccessType extends BaseNode {
1582
- +type: 'OptionalIndexedAccessType';
1583
- +objectType: TypeAnnotationType;
1584
- +indexType: TypeAnnotationType;
1585
- +optional: boolean;
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
- +type: 'TypeCastExpression';
1590
- +expression: Expression;
1591
- +typeAnnotation: TypeAnnotation;
1554
+ readonly type: 'TypeCastExpression';
1555
+ readonly expression: Expression;
1556
+ readonly typeAnnotation: TypeAnnotation;
1592
1557
  }
1593
1558
  export interface AsExpression extends BaseNode {
1594
- +type: 'AsExpression';
1595
- +expression: Expression;
1596
- +typeAnnotation: TypeAnnotationType;
1559
+ readonly type: 'AsExpression';
1560
+ readonly expression: Expression;
1561
+ readonly typeAnnotation: TypeAnnotationType;
1597
1562
  }
1598
1563
  export interface AsConstExpression extends BaseNode {
1599
- +type: 'AsConstExpression';
1600
- +expression: Expression;
1564
+ readonly type: 'AsConstExpression';
1565
+ readonly expression: Expression;
1601
1566
  }
1602
1567
 
1603
1568
  interface BaseInterfaceNode extends BaseNode {
1604
- +body: ObjectTypeAnnotation;
1605
- +extends: $ReadOnlyArray<InterfaceExtends>;
1569
+ readonly body: ObjectTypeAnnotation;
1570
+ readonly extends: ReadonlyArray<InterfaceExtends>;
1606
1571
  }
1607
1572
  interface BaseInterfaceDeclaration extends BaseInterfaceNode {
1608
- +id: Identifier;
1609
- +typeParameters: null | TypeParameterDeclaration;
1573
+ readonly id: Identifier;
1574
+ readonly typeParameters: null | TypeParameterDeclaration;
1610
1575
  }
1611
1576
 
1612
1577
  export interface InterfaceDeclaration extends BaseInterfaceDeclaration {
1613
- +type: 'InterfaceDeclaration';
1578
+ readonly type: 'InterfaceDeclaration';
1614
1579
  }
1615
1580
 
1616
1581
  export interface InterfaceExtends extends BaseNode {
1617
- +type: 'InterfaceExtends';
1618
- +id: Identifier | QualifiedTypeIdentifier;
1619
- +typeParameters: null | TypeParameterInstantiation;
1582
+ readonly type: 'InterfaceExtends';
1583
+ readonly id: Identifier | QualifiedTypeIdentifier;
1584
+ readonly typeParameters: null | TypeParameterInstantiation;
1620
1585
 
1621
- +parent: InterfaceDeclaration | DeclareInterface;
1586
+ readonly parent: InterfaceDeclaration | DeclareInterface;
1622
1587
  }
1623
1588
 
1624
1589
  export interface ClassImplements extends BaseNode {
1625
- +type: 'ClassImplements';
1626
- +id: Identifier;
1627
- +typeParameters: null | TypeParameterInstantiation;
1590
+ readonly type: 'ClassImplements';
1591
+ readonly id: Identifier;
1592
+ readonly typeParameters: null | TypeParameterInstantiation;
1628
1593
 
1629
- +parent: AClass | DeclareClass;
1594
+ readonly parent: AClass | DeclareClass;
1630
1595
  }
1631
1596
 
1632
1597
  export interface Decorator extends BaseNode {
1633
- +type: 'Decorator';
1634
- +expression: Expression;
1598
+ readonly type: 'Decorator';
1599
+ readonly expression: Expression;
1635
1600
 
1636
- +parent: AClass;
1601
+ readonly parent: AClass;
1637
1602
  }
1638
1603
 
1639
1604
  export interface TypeParameterDeclaration extends BaseNode {
1640
- +type: 'TypeParameterDeclaration';
1641
- +params: $ReadOnlyArray<TypeParameter>;
1605
+ readonly type: 'TypeParameterDeclaration';
1606
+ readonly params: ReadonlyArray<TypeParameter>;
1642
1607
  }
1643
1608
  export interface TypeParameter extends BaseNode {
1644
- +type: 'TypeParameter';
1645
- +name: string;
1646
- +const: boolean;
1647
- +bound: null | TypeAnnotation;
1648
- +variance: null | Variance;
1649
- +default: null | TypeAnnotationType;
1650
- +usesExtendsBound: boolean;
1651
- +parent: TypeParameterDeclaration;
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
- +type: 'TypeParameterInstantiation';
1655
- +params: $ReadOnlyArray<TypeAnnotationType>;
1619
+ readonly type: 'TypeParameterInstantiation';
1620
+ readonly params: ReadonlyArray<TypeAnnotationType>;
1656
1621
 
1657
- +parent: GenericTypeAnnotation | CallExpression | NewExpression;
1622
+ readonly parent: GenericTypeAnnotation | CallExpression | NewExpression;
1658
1623
  }
1659
1624
 
1660
1625
  export interface EnumDeclaration extends BaseNode {
1661
- +type: 'EnumDeclaration';
1662
- +id: Identifier;
1663
- +body:
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
- +hasUnknownMembers: boolean;
1637
+ readonly hasUnknownMembers: boolean;
1673
1638
  }
1674
1639
  interface BaseInferrableEnumBody extends BaseEnumBody {
1675
- +explicitType: boolean;
1640
+ readonly explicitType: boolean;
1676
1641
  }
1677
1642
 
1678
1643
  export interface EnumNumberBody extends BaseInferrableEnumBody {
1679
- +type: 'EnumNumberBody';
1644
+ readonly type: 'EnumNumberBody';
1680
1645
  // enum number members cannot be defaulted
1681
- +members: $ReadOnlyArray<EnumNumberMember>;
1682
- +explicitType: boolean;
1646
+ readonly members: ReadonlyArray<EnumNumberMember>;
1647
+ readonly explicitType: boolean;
1683
1648
 
1684
- +parent: EnumDeclaration;
1649
+ readonly parent: EnumDeclaration;
1685
1650
  }
1686
1651
 
1687
1652
  export interface EnumNumberMember extends BaseNode {
1688
- +type: 'EnumNumberMember';
1689
- +id: Identifier;
1690
- +init: NumericLiteral;
1653
+ readonly type: 'EnumNumberMember';
1654
+ readonly id: Identifier;
1655
+ readonly init: NumericLiteral;
1691
1656
 
1692
- +parent: EnumNumberBody;
1657
+ readonly parent: EnumNumberBody;
1693
1658
  }
1694
1659
 
1695
1660
  export interface EnumBigIntBody extends BaseInferrableEnumBody {
1696
- +type: 'EnumBigIntBody';
1661
+ readonly type: 'EnumBigIntBody';
1697
1662
  // enum bigint members cannot be defaulted
1698
- +members: $ReadOnlyArray<EnumBigIntMember>;
1699
- +explicitType: boolean;
1663
+ readonly members: ReadonlyArray<EnumBigIntMember>;
1664
+ readonly explicitType: boolean;
1700
1665
 
1701
- +parent: EnumDeclaration;
1666
+ readonly parent: EnumDeclaration;
1702
1667
  }
1703
1668
 
1704
1669
  export interface EnumBigIntMember extends BaseNode {
1705
- +type: 'EnumBigIntMember';
1706
- +id: Identifier;
1707
- +init: BigIntLiteral;
1670
+ readonly type: 'EnumBigIntMember';
1671
+ readonly id: Identifier;
1672
+ readonly init: BigIntLiteral;
1708
1673
 
1709
- +parent: EnumBigIntBody;
1674
+ readonly parent: EnumBigIntBody;
1710
1675
  }
1711
1676
 
1712
1677
  export interface EnumStringBody extends BaseInferrableEnumBody {
1713
- +type: 'EnumStringBody';
1714
- +members: $ReadOnlyArray<EnumStringMember | EnumDefaultedMember>;
1678
+ readonly type: 'EnumStringBody';
1679
+ readonly members: ReadonlyArray<EnumStringMember | EnumDefaultedMember>;
1715
1680
 
1716
- +parent: EnumDeclaration;
1681
+ readonly parent: EnumDeclaration;
1717
1682
  }
1718
1683
 
1719
1684
  export interface EnumStringMember extends BaseNode {
1720
- +type: 'EnumStringMember';
1721
- +id: Identifier;
1722
- +init: StringLiteral;
1685
+ readonly type: 'EnumStringMember';
1686
+ readonly id: Identifier;
1687
+ readonly init: StringLiteral;
1723
1688
 
1724
- +parent: EnumStringBody;
1689
+ readonly parent: EnumStringBody;
1725
1690
  }
1726
1691
 
1727
1692
  export interface EnumBooleanBody extends BaseInferrableEnumBody {
1728
- +type: 'EnumBooleanBody';
1693
+ readonly type: 'EnumBooleanBody';
1729
1694
  // enum boolean members cannot be defaulted
1730
- +members: $ReadOnlyArray<EnumBooleanMember>;
1695
+ readonly members: ReadonlyArray<EnumBooleanMember>;
1731
1696
 
1732
- +parent: EnumDeclaration;
1697
+ readonly parent: EnumDeclaration;
1733
1698
  }
1734
1699
 
1735
1700
  export interface EnumBooleanMember extends BaseNode {
1736
- +type: 'EnumBooleanMember';
1737
- +id: Identifier;
1738
- +init: BooleanLiteral;
1701
+ readonly type: 'EnumBooleanMember';
1702
+ readonly id: Identifier;
1703
+ readonly init: BooleanLiteral;
1739
1704
 
1740
- +parent: EnumBooleanBody;
1705
+ readonly parent: EnumBooleanBody;
1741
1706
  }
1742
1707
 
1743
1708
  export interface EnumSymbolBody extends BaseEnumBody {
1744
- +type: 'EnumSymbolBody';
1709
+ readonly type: 'EnumSymbolBody';
1745
1710
  // enum symbol members can only be defaulted
1746
- +members: $ReadOnlyArray<EnumDefaultedMember>;
1711
+ readonly members: ReadonlyArray<EnumDefaultedMember>;
1747
1712
 
1748
- +parent: EnumDeclaration;
1713
+ readonly parent: EnumDeclaration;
1749
1714
  }
1750
1715
 
1751
1716
  export interface EnumDefaultedMember extends BaseNode {
1752
- +type: 'EnumDefaultedMember';
1753
- +id: Identifier;
1717
+ readonly type: 'EnumDefaultedMember';
1718
+ readonly id: Identifier;
1754
1719
 
1755
- +parent: EnumStringBody | EnumSymbolBody;
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
- +type: 'DeclareClass';
1780
- +id: Identifier;
1781
- +typeParameters: null | TypeParameterDeclaration;
1782
- +extends: $ReadOnlyArray<InterfaceExtends>;
1783
- +implements: $ReadOnlyArray<ClassImplements>;
1784
- +body: ObjectTypeAnnotation;
1785
- +mixins: $ReadOnlyArray<InterfaceExtends>;
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
- +type: 'DeclareComponent';
1790
- +id: Identifier;
1791
- +params: Array<ComponentTypeParameter>;
1792
- +rest: null | ComponentTypeParameter;
1793
- +typeParameters: null | TypeParameterDeclaration;
1794
- +rendersType: null | RendersType;
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
- +type: 'DeclareHook';
1763
+ readonly type: 'DeclareHook';
1799
1764
  // the hook signature is stored as a type annotation on the ID
1800
- +id: interface extends Identifier {
1801
- +typeAnnotation: interface extends TypeAnnotation {
1802
- +typeAnnotation: HookTypeAnnotation,
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
- +type: 'DeclareVariable';
1809
- +id: Identifier;
1810
- +kind: 'var' | 'let' | 'const';
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
- +type: 'DeclareEnum';
1815
- +id: Identifier;
1816
- +body: EnumNumberBody | EnumStringBody | EnumBooleanBody | EnumSymbolBody;
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
- +type: 'DeclareFunction';
1786
+ readonly type: 'DeclareFunction';
1821
1787
  // the function signature is stored as a type annotation on the ID
1822
- +id: interface extends Identifier {
1823
- +typeAnnotation: interface extends TypeAnnotation {
1824
- +typeAnnotation: FunctionTypeAnnotation,
1788
+ readonly id: interface extends Identifier {
1789
+ readonly typeAnnotation: interface extends TypeAnnotation {
1790
+ readonly typeAnnotation: FunctionTypeAnnotation,
1825
1791
  },
1826
1792
  };
1827
- +predicate: InferredPredicate | DeclaredPredicate | null;
1793
+ readonly predicate: InferredPredicate | DeclaredPredicate | null;
1828
1794
  }
1829
1795
 
1830
1796
  export interface DeclareModule extends BaseNode {
1831
- +type: 'DeclareModule';
1832
- +id: StringLiteral | Identifier;
1833
- +body: BlockStatement;
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
- +type: 'DeclareNamespace';
1838
- +id: Identifier;
1839
- +body: BlockStatement;
1803
+ readonly type: 'DeclareNamespace';
1804
+ readonly id: Identifier;
1805
+ readonly body: BlockStatement;
1840
1806
  }
1841
1807
 
1842
1808
  export interface DeclareInterface extends BaseInterfaceDeclaration {
1843
- +type: 'DeclareInterface';
1809
+ readonly type: 'DeclareInterface';
1844
1810
  }
1845
1811
 
1846
1812
  export interface DeclareTypeAlias extends BaseTypeAlias {
1847
- +type: 'DeclareTypeAlias';
1813
+ readonly type: 'DeclareTypeAlias';
1848
1814
  }
1849
1815
 
1850
1816
  export interface DeclareOpaqueType extends BaseOpaqueType {
1851
- +type: 'DeclareOpaqueType';
1852
- +impltype: null;
1817
+ readonly type: 'DeclareOpaqueType';
1818
+ readonly impltype: null;
1853
1819
  }
1854
1820
 
1855
1821
  export interface DeclareExportAllDeclaration extends BaseNode {
1856
- +type: 'DeclareExportAllDeclaration';
1857
- +source: StringLiteral;
1822
+ readonly type: 'DeclareExportAllDeclaration';
1823
+ readonly source: StringLiteral;
1858
1824
  }
1859
1825
 
1860
1826
  interface DeclareExportDeclarationBase extends BaseNode {
1861
- +type: 'DeclareExportDeclaration';
1862
- +specifiers: $ReadOnlyArray<ExportSpecifier>;
1863
- +source: StringLiteral | null;
1864
- +default: boolean;
1865
- }
1866
- export interface DeclareExportDefaultDeclaration
1867
- extends DeclareExportDeclarationBase {
1868
- +type: 'DeclareExportDeclaration';
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
- +default: true;
1840
+ readonly default: true;
1876
1841
  // default cannot have a source
1877
- +source: null;
1842
+ readonly source: null;
1878
1843
  // default cannot have specifiers
1879
- +specifiers: [];
1844
+ readonly specifiers: [];
1880
1845
  }
1881
- export interface DeclareExportDeclarationNamedWithDeclaration
1882
- extends DeclareExportDeclarationBase {
1883
- +type: 'DeclareExportDeclaration';
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
- +default: false;
1894
- +source: null;
1857
+ readonly default: false;
1858
+ readonly source: null;
1895
1859
  // default cannot have specifiers and a declaration
1896
- +specifiers: [];
1860
+ readonly specifiers: [];
1897
1861
  }
1898
- export interface DeclareExportDeclarationNamedWithSpecifiers
1899
- extends DeclareExportDeclarationBase {
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
- +declaration: null;
1903
- +default: false;
1904
- +source: StringLiteral;
1905
- +specifiers: $ReadOnlyArray<ExportSpecifier>;
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
- +type: 'DeclareModuleExports';
1914
- +typeAnnotation: TypeAnnotation;
1876
+ readonly type: 'DeclareModuleExports';
1877
+ readonly typeAnnotation: TypeAnnotation;
1915
1878
  }
1916
1879
 
1917
1880
  export interface DeclaredPredicate extends BaseNode {
1918
- +type: 'DeclaredPredicate';
1919
- +value: Expression;
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
- | JSXElement
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
- | JSXIdentifier
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
- +type: 'JSXAttribute';
1957
- +name: JSXIdentifier;
1958
- +value: Literal | JSXExpression | null;
1913
+ readonly type: 'JSXAttribute';
1914
+ readonly name: JSXIdentifier;
1915
+ readonly value: Literal | JSXExpression | null;
1959
1916
 
1960
- +parent: JSXOpeningElement;
1917
+ readonly parent: JSXOpeningElement;
1961
1918
  }
1962
1919
 
1963
1920
  export interface JSXClosingElement extends BaseNode {
1964
- +type: 'JSXClosingElement';
1965
- +name: JSXTagNameExpression;
1921
+ readonly type: 'JSXClosingElement';
1922
+ readonly name: JSXTagNameExpression;
1966
1923
 
1967
- +parent: JSXElement;
1924
+ readonly parent: JSXElement;
1968
1925
  }
1969
1926
 
1970
1927
  export interface JSXClosingFragment extends BaseNode {
1971
- +type: 'JSXClosingFragment';
1928
+ readonly type: 'JSXClosingFragment';
1972
1929
 
1973
- +parent: JSXFragment;
1930
+ readonly parent: JSXFragment;
1974
1931
  }
1975
1932
 
1976
1933
  export interface JSXElement extends BaseNode {
1977
- +type: 'JSXElement';
1978
- +openingElement: JSXOpeningElement;
1979
- +closingElement: JSXClosingElement | null;
1980
- +children: $ReadOnlyArray<JSXChild>;
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
- +type: 'JSXEmptyExpression';
1941
+ readonly type: 'JSXEmptyExpression';
1985
1942
  }
1986
1943
 
1987
1944
  export interface JSXExpressionContainer extends BaseNode {
1988
- +type: 'JSXExpressionContainer';
1989
- +expression: Expression | JSXEmptyExpression;
1945
+ readonly type: 'JSXExpressionContainer';
1946
+ readonly expression: Expression | JSXEmptyExpression;
1990
1947
  }
1991
1948
 
1992
1949
  export interface JSXFragment extends BaseNode {
1993
- +type: 'JSXFragment';
1994
- +openingFragment: JSXOpeningFragment;
1995
- +closingFragment: JSXClosingFragment;
1996
- +children: $ReadOnlyArray<JSXChild>;
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
- +type: 'JSXIdentifier';
2001
- +name: string;
1957
+ readonly type: 'JSXIdentifier';
1958
+ readonly name: string;
2002
1959
  }
2003
1960
 
2004
1961
  export interface JSXMemberExpression extends BaseNode {
2005
- +type: 'JSXMemberExpression';
2006
- +object: JSXTagNameExpression;
2007
- +property: JSXIdentifier;
1962
+ readonly type: 'JSXMemberExpression';
1963
+ readonly object: JSXTagNameExpression;
1964
+ readonly property: JSXIdentifier;
2008
1965
  }
2009
1966
 
2010
1967
  export interface JSXNamespacedName extends BaseNode {
2011
- +type: 'JSXNamespacedName';
2012
- +namespace: JSXIdentifier;
2013
- +name: JSXIdentifier;
1968
+ readonly type: 'JSXNamespacedName';
1969
+ readonly namespace: JSXIdentifier;
1970
+ readonly name: JSXIdentifier;
2014
1971
  }
2015
1972
 
2016
1973
  export interface JSXOpeningElement extends BaseNode {
2017
- +type: 'JSXOpeningElement';
2018
- +selfClosing: boolean;
2019
- +name: JSXTagNameExpression;
2020
- +attributes: $ReadOnlyArray<JSXAttribute | JSXSpreadAttribute>;
2021
- +typeArguments?: TypeParameterInstantiation | null;
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
- +parent: JSXElement;
1980
+ readonly parent: JSXElement;
2024
1981
  }
2025
1982
 
2026
1983
  export interface JSXOpeningFragment extends BaseNode {
2027
- +type: 'JSXOpeningFragment';
1984
+ readonly type: 'JSXOpeningFragment';
2028
1985
 
2029
- +parent: JSXFragment;
1986
+ readonly parent: JSXFragment;
2030
1987
  }
2031
1988
 
2032
1989
  export interface JSXSpreadAttribute extends BaseNode {
2033
- +type: 'JSXSpreadAttribute';
2034
- +argument: Expression;
1990
+ readonly type: 'JSXSpreadAttribute';
1991
+ readonly argument: Expression;
2035
1992
 
2036
- +parent: JSXOpeningElement;
1993
+ readonly parent: JSXOpeningElement;
2037
1994
  }
2038
1995
 
2039
1996
  export interface JSXText extends BaseNode {
2040
- +type: 'JSXText';
2041
- +value: string;
2042
- +raw: string;
1997
+ readonly type: 'JSXText';
1998
+ readonly value: string;
1999
+ readonly raw: string;
2043
2000
  }
2044
2001
 
2045
2002
  export interface JSXSpreadChild extends BaseNode {
2046
- +type: 'JSXSpreadChild';
2047
- +expression: Expression;
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
- +type: 'MatchExpression';
2056
- +argument: Expression;
2057
- +cases: $ReadOnlyArray<MatchExpressionCase>;
2012
+ readonly type: 'MatchExpression';
2013
+ readonly argument: Expression;
2014
+ readonly cases: ReadonlyArray<MatchExpressionCase>;
2058
2015
  }
2059
2016
  export interface MatchExpressionCase extends BaseNode {
2060
- +type: 'MatchExpressionCase';
2061
- +pattern: MatchPattern;
2062
- +body: Expression;
2063
- +guard: Expression | null;
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
- +type: 'MatchStatement';
2068
- +argument: Expression;
2069
- +cases: $ReadOnlyArray<MatchStatementCase>;
2024
+ readonly type: 'MatchStatement';
2025
+ readonly argument: Expression;
2026
+ readonly cases: ReadonlyArray<MatchStatementCase>;
2070
2027
  }
2071
2028
  export interface MatchStatementCase extends BaseNode {
2072
- +type: 'MatchStatementCase';
2073
- +pattern: MatchPattern;
2074
- +body: BlockStatement;
2075
- +guard: Expression | null;
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
- +type: 'MatchOrPattern';
2097
- +patterns: $ReadOnlyArray<MatchPattern>;
2053
+ readonly type: 'MatchOrPattern';
2054
+ readonly patterns: ReadonlyArray<MatchPattern>;
2098
2055
  }
2099
2056
  export interface MatchAsPattern extends BaseNode {
2100
- +type: 'MatchAsPattern';
2101
- +pattern: MatchPattern;
2102
- +target: Identifier | MatchBindingPattern;
2057
+ readonly type: 'MatchAsPattern';
2058
+ readonly pattern: MatchPattern;
2059
+ readonly target: Identifier | MatchBindingPattern;
2103
2060
  }
2104
2061
  export interface MatchWildcardPattern extends BaseNode {
2105
- +type: 'MatchWildcardPattern';
2062
+ readonly type: 'MatchWildcardPattern';
2106
2063
  }
2107
2064
  export interface MatchLiteralPattern extends BaseNode {
2108
- +type: 'MatchLiteralPattern';
2109
- +literal: Literal;
2065
+ readonly type: 'MatchLiteralPattern';
2066
+ readonly literal: Literal;
2110
2067
  }
2111
2068
  export interface MatchUnaryPattern extends BaseNode {
2112
- +type: 'MatchUnaryPattern';
2113
- +argument: Literal;
2114
- +operator: '-' | '+';
2069
+ readonly type: 'MatchUnaryPattern';
2070
+ readonly argument: Literal;
2071
+ readonly operator: '-' | '+';
2115
2072
  }
2116
2073
  export interface MatchIdentifierPattern extends BaseNode {
2117
- +type: 'MatchIdentifierPattern';
2118
- +id: Identifier;
2074
+ readonly type: 'MatchIdentifierPattern';
2075
+ readonly id: Identifier;
2119
2076
  }
2120
2077
  export interface MatchMemberPattern extends BaseNode {
2121
- +type: 'MatchMemberPattern';
2122
- +base: MatchIdentifierPattern | MatchMemberPattern;
2123
- +property: Identifier | StringLiteral | NumericLiteral | BigIntLiteral;
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
- +type: 'MatchBindingPattern';
2127
- +id: Identifier;
2128
- +kind: 'let' | 'const' | 'var';
2084
+ readonly type: 'MatchBindingPattern';
2085
+ readonly id: Identifier;
2086
+ readonly kind: 'let' | 'const' | 'var';
2129
2087
  }
2130
2088
  export interface MatchObjectPattern extends BaseNode {
2131
- +type: 'MatchObjectPattern';
2132
- +properties: $ReadOnlyArray<MatchObjectPatternProperty>;
2133
- +rest: MatchRestPattern | null;
2089
+ readonly type: 'MatchObjectPattern';
2090
+ readonly properties: ReadonlyArray<MatchObjectPatternProperty>;
2091
+ readonly rest: MatchRestPattern | null;
2134
2092
  }
2135
2093
  export interface MatchObjectPatternProperty extends BaseNode {
2136
- +type: 'MatchObjectPatternProperty';
2137
- +key: ObjectPropertyKey;
2138
- +pattern: MatchPattern;
2139
- +shorthand: boolean;
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
- +type: 'MatchInstancePattern';
2143
- +targetConstructor: MatchIdentifierPattern | MatchMemberPattern;
2144
- +properties: MatchInstanceObjectPattern;
2100
+ readonly type: 'MatchInstancePattern';
2101
+ readonly targetConstructor: MatchIdentifierPattern | MatchMemberPattern;
2102
+ readonly properties: MatchInstanceObjectPattern;
2145
2103
  }
2146
2104
  export interface MatchInstanceObjectPattern extends BaseNode {
2147
- +type: 'MatchInstanceObjectPattern';
2148
- +properties: $ReadOnlyArray<MatchObjectPatternProperty>;
2149
- +rest: MatchRestPattern | null;
2105
+ readonly type: 'MatchInstanceObjectPattern';
2106
+ readonly properties: ReadonlyArray<MatchObjectPatternProperty>;
2107
+ readonly rest: MatchRestPattern | null;
2150
2108
  }
2151
2109
  export interface MatchArrayPattern extends BaseNode {
2152
- +type: 'MatchArrayPattern';
2153
- +elements: $ReadOnlyArray<MatchPattern>;
2154
- +rest: MatchRestPattern | null;
2110
+ readonly type: 'MatchArrayPattern';
2111
+ readonly elements: ReadonlyArray<MatchPattern>;
2112
+ readonly rest: MatchRestPattern | null;
2155
2113
  }
2156
2114
  export interface MatchRestPattern extends BaseNode {
2157
- +type: 'MatchRestPattern';
2158
- +argument: MatchBindingPattern | null;
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
- +type: 'RecordDeclaration';
2166
- +id: Identifier;
2167
- +typeParameters: TypeParameterDeclaration | null;
2168
- +implements: $ReadOnlyArray<RecordDeclarationImplements>;
2169
- +body: RecordDeclarationBody;
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
- +type: 'RecordDeclarationImplements';
2174
- +id: Identifier;
2175
- +typeArguments: TypeParameterInstantiation | null;
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
- +type: 'RecordDeclarationBody';
2180
- +elements: $ReadOnlyArray<
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
- +type: 'RecordDeclarationProperty';
2189
- +key: ObjectPropertyKey;
2190
- +typeAnnotation: TypeAnnotation;
2191
- +defaultValue: Expression | null;
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
- +type: 'RecordDeclarationStaticProperty';
2196
- +key: ObjectPropertyKey;
2197
- +typeAnnotation: TypeAnnotation;
2198
- +value: Expression;
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
- +type: 'RecordExpression';
2203
- +recordConstructor: Expression;
2204
- +typeArguments: TypeParameterInstantiation | null;
2205
- +properties: RecordExpressionProperties;
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
- +type: 'RecordExpressionProperties';
2210
- +properties: $ReadOnlyArray<ObjectProperty | SpreadElement>;
2167
+ readonly type: 'RecordExpressionProperties';
2168
+ readonly properties: ReadonlyArray<ObjectProperty | SpreadElement>;
2211
2169
  }
2212
2170
 
2213
2171
  /******************************************************