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