@oxc-project/types 0.48.2 → 0.49.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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/types.d.ts +235 -566
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oxc-project/types",
3
- "version": "0.48.2",
3
+ "version": "0.49.0",
4
4
  "description": "Types for Oxc AST nodes",
5
5
  "keywords": [
6
6
  "AST",
package/types.d.ts CHANGED
@@ -1,57 +1,11 @@
1
1
  // Auto-generated code, DO NOT EDIT DIRECTLY!
2
2
  // To edit this generated file you have to edit `tasks/ast_tools/src/generators/typescript.rs`
3
3
 
4
- export interface BooleanLiteral extends Span {
5
- type: 'Literal';
6
- value: boolean;
7
- raw: string | null;
8
- }
9
-
10
- export interface NullLiteral extends Span {
11
- type: 'Literal';
12
- value: null;
13
- raw: 'null' | null;
14
- }
15
-
16
- export interface NumericLiteral extends Span {
17
- type: 'Literal';
18
- value: number;
19
- raw: string | null;
20
- }
21
-
22
- export interface StringLiteral extends Span {
23
- type: 'Literal';
24
- value: string;
25
- raw: string | null;
26
- }
27
-
28
- export interface BigIntLiteral extends Span {
29
- type: 'Literal';
30
- raw: string | null;
31
- value: null;
32
- bigint: string;
33
- }
34
-
35
- export interface RegExpLiteral extends Span {
36
- type: 'Literal';
37
- raw: string | null;
38
- value: {} | null;
39
- regex: { pattern: string; flags: string };
40
- }
41
-
42
- export interface RegExp {
43
- pattern: RegExpPattern;
44
- flags: RegExpFlags;
45
- }
46
-
47
- export type RegExpPattern = string | string | Pattern;
48
-
49
4
  export interface Program extends Span {
50
5
  type: 'Program';
51
- sourceType: SourceType;
6
+ sourceType: ModuleKind;
52
7
  hashbang: Hashbang | null;
53
- directives: Array<Directive>;
54
- body: Array<Statement>;
8
+ body: Array<Directive | Statement>;
55
9
  }
56
10
 
57
11
  export type Expression =
@@ -94,9 +48,7 @@ export type Expression =
94
48
  | TSTypeAssertion
95
49
  | TSNonNullExpression
96
50
  | TSInstantiationExpression
97
- | ComputedMemberExpression
98
- | StaticMemberExpression
99
- | PrivateFieldExpression;
51
+ | MemberExpression;
100
52
 
101
53
  export interface IdentifierName extends Span {
102
54
  type: 'Identifier';
@@ -124,9 +76,11 @@ export interface ThisExpression extends Span {
124
76
 
125
77
  export interface ArrayExpression extends Span {
126
78
  type: 'ArrayExpression';
127
- elements: Array<SpreadElement | Expression | null>;
79
+ elements: Array<ArrayExpressionElement>;
128
80
  }
129
81
 
82
+ export type ArrayExpressionElement = SpreadElement | null | Expression;
83
+
130
84
  export interface ObjectExpression extends Span {
131
85
  type: 'ObjectExpression';
132
86
  properties: Array<ObjectPropertyKind>;
@@ -135,7 +89,7 @@ export interface ObjectExpression extends Span {
135
89
  export type ObjectPropertyKind = ObjectProperty | SpreadElement;
136
90
 
137
91
  export interface ObjectProperty extends Span {
138
- type: 'ObjectProperty';
92
+ type: 'Property';
139
93
  kind: PropertyKind;
140
94
  key: PropertyKey;
141
95
  value: Expression;
@@ -144,51 +98,7 @@ export interface ObjectProperty extends Span {
144
98
  computed: boolean;
145
99
  }
146
100
 
147
- export type PropertyKey =
148
- | IdentifierName
149
- | PrivateIdentifier
150
- | BooleanLiteral
151
- | NullLiteral
152
- | NumericLiteral
153
- | BigIntLiteral
154
- | RegExpLiteral
155
- | StringLiteral
156
- | TemplateLiteral
157
- | IdentifierReference
158
- | MetaProperty
159
- | Super
160
- | ArrayExpression
161
- | ArrowFunctionExpression
162
- | AssignmentExpression
163
- | AwaitExpression
164
- | BinaryExpression
165
- | CallExpression
166
- | ChainExpression
167
- | Class
168
- | ConditionalExpression
169
- | Function
170
- | ImportExpression
171
- | LogicalExpression
172
- | NewExpression
173
- | ObjectExpression
174
- | ParenthesizedExpression
175
- | SequenceExpression
176
- | TaggedTemplateExpression
177
- | ThisExpression
178
- | UnaryExpression
179
- | UpdateExpression
180
- | YieldExpression
181
- | PrivateInExpression
182
- | JSXElement
183
- | JSXFragment
184
- | TSAsExpression
185
- | TSSatisfiesExpression
186
- | TSTypeAssertion
187
- | TSNonNullExpression
188
- | TSInstantiationExpression
189
- | ComputedMemberExpression
190
- | StaticMemberExpression
191
- | PrivateFieldExpression;
101
+ export type PropertyKey = IdentifierName | PrivateIdentifier | Expression;
192
102
 
193
103
  export type PropertyKind = 'init' | 'get' | 'set';
194
104
 
@@ -219,24 +129,27 @@ export interface TemplateElementValue {
219
129
  export type MemberExpression = ComputedMemberExpression | StaticMemberExpression | PrivateFieldExpression;
220
130
 
221
131
  export interface ComputedMemberExpression extends Span {
222
- type: 'ComputedMemberExpression';
132
+ type: 'MemberExpression';
223
133
  object: Expression;
224
- expression: Expression;
134
+ property: Expression;
225
135
  optional: boolean;
136
+ computed: true;
226
137
  }
227
138
 
228
139
  export interface StaticMemberExpression extends Span {
229
- type: 'StaticMemberExpression';
140
+ type: 'MemberExpression';
230
141
  object: Expression;
231
142
  property: IdentifierName;
232
143
  optional: boolean;
144
+ computed: false;
233
145
  }
234
146
 
235
147
  export interface PrivateFieldExpression extends Span {
236
- type: 'PrivateFieldExpression';
148
+ type: 'MemberExpression';
237
149
  object: Expression;
238
150
  field: PrivateIdentifier;
239
151
  optional: boolean;
152
+ computed: false;
240
153
  }
241
154
 
242
155
  export interface CallExpression extends Span {
@@ -265,50 +178,7 @@ export interface SpreadElement extends Span {
265
178
  argument: Expression;
266
179
  }
267
180
 
268
- export type Argument =
269
- | SpreadElement
270
- | BooleanLiteral
271
- | NullLiteral
272
- | NumericLiteral
273
- | BigIntLiteral
274
- | RegExpLiteral
275
- | StringLiteral
276
- | TemplateLiteral
277
- | IdentifierReference
278
- | MetaProperty
279
- | Super
280
- | ArrayExpression
281
- | ArrowFunctionExpression
282
- | AssignmentExpression
283
- | AwaitExpression
284
- | BinaryExpression
285
- | CallExpression
286
- | ChainExpression
287
- | Class
288
- | ConditionalExpression
289
- | Function
290
- | ImportExpression
291
- | LogicalExpression
292
- | NewExpression
293
- | ObjectExpression
294
- | ParenthesizedExpression
295
- | SequenceExpression
296
- | TaggedTemplateExpression
297
- | ThisExpression
298
- | UnaryExpression
299
- | UpdateExpression
300
- | YieldExpression
301
- | PrivateInExpression
302
- | JSXElement
303
- | JSXFragment
304
- | TSAsExpression
305
- | TSSatisfiesExpression
306
- | TSTypeAssertion
307
- | TSNonNullExpression
308
- | TSInstantiationExpression
309
- | ComputedMemberExpression
310
- | StaticMemberExpression
311
- | PrivateFieldExpression;
181
+ export type Argument = SpreadElement | Expression;
312
182
 
313
183
  export interface UpdateExpression extends Span {
314
184
  type: 'UpdateExpression';
@@ -321,6 +191,7 @@ export interface UnaryExpression extends Span {
321
191
  type: 'UnaryExpression';
322
192
  operator: UnaryOperator;
323
193
  argument: Expression;
194
+ prefix: true;
324
195
  }
325
196
 
326
197
  export interface BinaryExpression extends Span {
@@ -358,18 +229,7 @@ export interface AssignmentExpression extends Span {
358
229
  right: Expression;
359
230
  }
360
231
 
361
- export type AssignmentTarget =
362
- | IdentifierReference
363
- | TSAsExpression
364
- | TSSatisfiesExpression
365
- | TSNonNullExpression
366
- | TSTypeAssertion
367
- | TSInstantiationExpression
368
- | ComputedMemberExpression
369
- | StaticMemberExpression
370
- | PrivateFieldExpression
371
- | ArrayAssignmentTarget
372
- | ObjectAssignmentTarget;
232
+ export type AssignmentTarget = SimpleAssignmentTarget | AssignmentTargetPattern;
373
233
 
374
234
  export type SimpleAssignmentTarget =
375
235
  | IdentifierReference
@@ -378,20 +238,18 @@ export type SimpleAssignmentTarget =
378
238
  | TSNonNullExpression
379
239
  | TSTypeAssertion
380
240
  | TSInstantiationExpression
381
- | ComputedMemberExpression
382
- | StaticMemberExpression
383
- | PrivateFieldExpression;
241
+ | MemberExpression;
384
242
 
385
243
  export type AssignmentTargetPattern = ArrayAssignmentTarget | ObjectAssignmentTarget;
386
244
 
387
245
  export interface ArrayAssignmentTarget extends Span {
388
- type: 'ArrayAssignmentTarget';
389
- elements: Array<AssignmentTargetRest | AssignmentTargetMaybeDefault | null>;
246
+ type: 'ArrayPattern';
247
+ elements: Array<AssignmentTargetMaybeDefault | AssignmentTargetRest | null>;
390
248
  }
391
249
 
392
250
  export interface ObjectAssignmentTarget extends Span {
393
- type: 'ObjectAssignmentTarget';
394
- properties: Array<AssignmentTargetRest | AssignmentTargetProperty>;
251
+ type: 'ObjectPattern';
252
+ properties: Array<AssignmentTargetProperty | AssignmentTargetRest>;
395
253
  }
396
254
 
397
255
  export interface AssignmentTargetRest extends Span {
@@ -399,24 +257,12 @@ export interface AssignmentTargetRest extends Span {
399
257
  argument: AssignmentTarget;
400
258
  }
401
259
 
402
- export type AssignmentTargetMaybeDefault =
403
- | AssignmentTargetWithDefault
404
- | IdentifierReference
405
- | TSAsExpression
406
- | TSSatisfiesExpression
407
- | TSNonNullExpression
408
- | TSTypeAssertion
409
- | TSInstantiationExpression
410
- | ComputedMemberExpression
411
- | StaticMemberExpression
412
- | PrivateFieldExpression
413
- | ArrayAssignmentTarget
414
- | ObjectAssignmentTarget;
260
+ export type AssignmentTargetMaybeDefault = AssignmentTargetWithDefault | AssignmentTarget;
415
261
 
416
262
  export interface AssignmentTargetWithDefault extends Span {
417
- type: 'AssignmentTargetWithDefault';
418
- binding: AssignmentTarget;
419
- init: Expression;
263
+ type: 'AssignmentPattern';
264
+ left: AssignmentTarget;
265
+ right: Expression;
420
266
  }
421
267
 
422
268
  export type AssignmentTargetProperty = AssignmentTargetPropertyIdentifier | AssignmentTargetPropertyProperty;
@@ -428,10 +274,13 @@ export interface AssignmentTargetPropertyIdentifier extends Span {
428
274
  }
429
275
 
430
276
  export interface AssignmentTargetPropertyProperty extends Span {
431
- type: 'AssignmentTargetPropertyProperty';
432
- name: PropertyKey;
433
- binding: AssignmentTargetMaybeDefault;
277
+ type: 'Property';
278
+ key: PropertyKey;
279
+ value: AssignmentTargetMaybeDefault;
434
280
  computed: boolean;
281
+ kind: 'init';
282
+ method: false;
283
+ shorthand: false;
435
284
  }
436
285
 
437
286
  export interface SequenceExpression extends Span {
@@ -453,12 +302,7 @@ export interface ChainExpression extends Span {
453
302
  expression: ChainElement;
454
303
  }
455
304
 
456
- export type ChainElement =
457
- | CallExpression
458
- | TSNonNullExpression
459
- | ComputedMemberExpression
460
- | StaticMemberExpression
461
- | PrivateFieldExpression;
305
+ export type ChainElement = CallExpression | TSNonNullExpression | MemberExpression;
462
306
 
463
307
  export interface ParenthesizedExpression extends Span {
464
308
  type: 'ParenthesizedExpression';
@@ -484,23 +328,11 @@ export type Statement =
484
328
  | TryStatement
485
329
  | WhileStatement
486
330
  | WithStatement
487
- | VariableDeclaration
488
- | Function
489
- | Class
490
- | TSTypeAliasDeclaration
491
- | TSInterfaceDeclaration
492
- | TSEnumDeclaration
493
- | TSModuleDeclaration
494
- | TSImportEqualsDeclaration
495
- | ImportDeclaration
496
- | ExportAllDeclaration
497
- | ExportDefaultDeclaration
498
- | ExportNamedDeclaration
499
- | TSExportAssignment
500
- | TSNamespaceExportDeclaration;
331
+ | Declaration
332
+ | ModuleDeclaration;
501
333
 
502
334
  export interface Directive extends Span {
503
- type: 'Directive';
335
+ type: 'ExpressionStatement';
504
336
  expression: StringLiteral;
505
337
  directive: string;
506
338
  }
@@ -577,50 +409,7 @@ export interface ForStatement extends Span {
577
409
  body: Statement;
578
410
  }
579
411
 
580
- export type ForStatementInit =
581
- | VariableDeclaration
582
- | BooleanLiteral
583
- | NullLiteral
584
- | NumericLiteral
585
- | BigIntLiteral
586
- | RegExpLiteral
587
- | StringLiteral
588
- | TemplateLiteral
589
- | IdentifierReference
590
- | MetaProperty
591
- | Super
592
- | ArrayExpression
593
- | ArrowFunctionExpression
594
- | AssignmentExpression
595
- | AwaitExpression
596
- | BinaryExpression
597
- | CallExpression
598
- | ChainExpression
599
- | Class
600
- | ConditionalExpression
601
- | Function
602
- | ImportExpression
603
- | LogicalExpression
604
- | NewExpression
605
- | ObjectExpression
606
- | ParenthesizedExpression
607
- | SequenceExpression
608
- | TaggedTemplateExpression
609
- | ThisExpression
610
- | UnaryExpression
611
- | UpdateExpression
612
- | YieldExpression
613
- | PrivateInExpression
614
- | JSXElement
615
- | JSXFragment
616
- | TSAsExpression
617
- | TSSatisfiesExpression
618
- | TSTypeAssertion
619
- | TSNonNullExpression
620
- | TSInstantiationExpression
621
- | ComputedMemberExpression
622
- | StaticMemberExpression
623
- | PrivateFieldExpression;
412
+ export type ForStatementInit = VariableDeclaration | Expression;
624
413
 
625
414
  export interface ForInStatement extends Span {
626
415
  type: 'ForInStatement';
@@ -629,19 +418,7 @@ export interface ForInStatement extends Span {
629
418
  body: Statement;
630
419
  }
631
420
 
632
- export type ForStatementLeft =
633
- | VariableDeclaration
634
- | IdentifierReference
635
- | TSAsExpression
636
- | TSSatisfiesExpression
637
- | TSNonNullExpression
638
- | TSTypeAssertion
639
- | TSInstantiationExpression
640
- | ComputedMemberExpression
641
- | StaticMemberExpression
642
- | PrivateFieldExpression
643
- | ArrayAssignmentTarget
644
- | ObjectAssignmentTarget;
421
+ export type ForStatementLeft = VariableDeclaration | AssignmentTarget;
645
422
 
646
423
  export interface ForOfStatement extends Span {
647
424
  type: 'ForOfStatement';
@@ -708,10 +485,12 @@ export interface CatchClause extends Span {
708
485
  body: BlockStatement;
709
486
  }
710
487
 
711
- export interface CatchParameter extends Span {
712
- type: 'CatchParameter';
713
- pattern: BindingPattern;
714
- }
488
+ export type CatchParameter =
489
+ & ({
490
+ type: 'CatchParameter';
491
+ })
492
+ & Span
493
+ & BindingPattern;
715
494
 
716
495
  export interface DebuggerStatement extends Span {
717
496
  type: 'DebuggerStatement';
@@ -734,20 +513,22 @@ export interface AssignmentPattern extends Span {
734
513
 
735
514
  export interface ObjectPattern extends Span {
736
515
  type: 'ObjectPattern';
737
- properties: Array<BindingRestElement | BindingProperty>;
516
+ properties: Array<BindingProperty | BindingRestElement>;
738
517
  }
739
518
 
740
519
  export interface BindingProperty extends Span {
741
- type: 'BindingProperty';
520
+ type: 'Property';
742
521
  key: PropertyKey;
743
522
  value: BindingPattern;
744
523
  shorthand: boolean;
745
524
  computed: boolean;
525
+ kind: 'init';
526
+ method: false;
746
527
  }
747
528
 
748
529
  export interface ArrayPattern extends Span {
749
530
  type: 'ArrayPattern';
750
- elements: Array<BindingRestElement | BindingPattern | null>;
531
+ elements: Array<BindingPattern | BindingRestElement | null>;
751
532
  }
752
533
 
753
534
  export interface BindingRestElement extends Span {
@@ -763,11 +544,14 @@ export interface Function extends Span {
763
544
  declare: boolean;
764
545
  typeParameters: TSTypeParameterDeclaration | null;
765
546
  thisParam: TSThisParameter | null;
766
- params: FormalParameters;
547
+ params: ParamPattern[];
767
548
  returnType: TSTypeAnnotation | null;
768
549
  body: FunctionBody | null;
550
+ expression: false;
769
551
  }
770
552
 
553
+ export type ParamPattern = FormalParameter | FormalParameterRest;
554
+
771
555
  export type FunctionType =
772
556
  | 'FunctionDeclaration'
773
557
  | 'FunctionExpression'
@@ -780,21 +564,28 @@ export interface FormalParameters extends Span {
780
564
  items: Array<FormalParameter | FormalParameterRest>;
781
565
  }
782
566
 
783
- export interface FormalParameter extends Span {
784
- type: 'FormalParameter';
785
- decorators: Array<Decorator>;
786
- pattern: BindingPattern;
787
- accessibility: TSAccessibility | null;
788
- readonly: boolean;
789
- override: boolean;
567
+ export interface FormalParameterRest extends Span {
568
+ type: 'RestElement';
569
+ argument: BindingPatternKind;
570
+ typeAnnotation: TSTypeAnnotation | null;
571
+ optional: boolean;
790
572
  }
791
573
 
574
+ export type FormalParameter =
575
+ & ({
576
+ decorators: Array<Decorator>;
577
+ accessibility: TSAccessibility | null;
578
+ readonly: boolean;
579
+ override: boolean;
580
+ })
581
+ & Span
582
+ & (BindingIdentifier | ObjectPattern | ArrayPattern | AssignmentPattern);
583
+
792
584
  export type FormalParameterKind = 'FormalParameter' | 'UniqueFormalParameters' | 'ArrowFormalParameters' | 'Signature';
793
585
 
794
586
  export interface FunctionBody extends Span {
795
- type: 'FunctionBody';
796
- directives: Array<Directive>;
797
- statements: Array<Statement>;
587
+ type: 'BlockStatement';
588
+ body: Array<Directive | Statement>;
798
589
  }
799
590
 
800
591
  export interface ArrowFunctionExpression extends Span {
@@ -802,9 +593,11 @@ export interface ArrowFunctionExpression extends Span {
802
593
  expression: boolean;
803
594
  async: boolean;
804
595
  typeParameters: TSTypeParameterDeclaration | null;
805
- params: FormalParameters;
596
+ params: ParamPattern[];
806
597
  returnType: TSTypeAnnotation | null;
807
- body: FunctionBody;
598
+ body: FunctionBody | Expression;
599
+ generator: false;
600
+ id: null;
808
601
  }
809
602
 
810
603
  export interface YieldExpression extends Span {
@@ -968,69 +761,163 @@ export interface ExportDefaultDeclaration extends Span {
968
761
  exported: ModuleExportName;
969
762
  }
970
763
 
971
- export interface ExportAllDeclaration extends Span {
972
- type: 'ExportAllDeclaration';
973
- exported: ModuleExportName | null;
974
- source: StringLiteral;
975
- withClause: WithClause | null;
976
- exportKind: ImportOrExportKind;
764
+ export interface ExportAllDeclaration extends Span {
765
+ type: 'ExportAllDeclaration';
766
+ exported: ModuleExportName | null;
767
+ source: StringLiteral;
768
+ withClause: WithClause | null;
769
+ exportKind: ImportOrExportKind;
770
+ }
771
+
772
+ export interface ExportSpecifier extends Span {
773
+ type: 'ExportSpecifier';
774
+ local: ModuleExportName;
775
+ exported: ModuleExportName;
776
+ exportKind: ImportOrExportKind;
777
+ }
778
+
779
+ export type ExportDefaultDeclarationKind = Function | Class | TSInterfaceDeclaration | Expression;
780
+
781
+ export type ModuleExportName = IdentifierName | IdentifierReference | StringLiteral;
782
+
783
+ export interface BooleanLiteral extends Span {
784
+ type: 'Literal';
785
+ value: boolean;
786
+ raw: string | null;
787
+ }
788
+
789
+ export interface NullLiteral extends Span {
790
+ type: 'Literal';
791
+ value: null;
792
+ raw: 'null' | null;
793
+ }
794
+
795
+ export interface NumericLiteral extends Span {
796
+ type: 'Literal';
797
+ value: number;
798
+ raw: string | null;
799
+ }
800
+
801
+ export interface StringLiteral extends Span {
802
+ type: 'Literal';
803
+ value: string;
804
+ raw: string | null;
805
+ }
806
+
807
+ export interface BigIntLiteral extends Span {
808
+ type: 'Literal';
809
+ raw: string | null;
810
+ value: null;
811
+ bigint: string;
812
+ }
813
+
814
+ export interface RegExpLiteral extends Span {
815
+ type: 'Literal';
816
+ regex: RegExp;
817
+ raw: string | null;
818
+ value: {} | null;
819
+ }
820
+
821
+ export interface RegExp {
822
+ pattern: string;
823
+ flags: string;
824
+ }
825
+
826
+ export interface JSXElement extends Span {
827
+ type: 'JSXElement';
828
+ openingElement: JSXOpeningElement;
829
+ closingElement: JSXClosingElement | null;
830
+ children: Array<JSXChild>;
831
+ }
832
+
833
+ export interface JSXOpeningElement extends Span {
834
+ type: 'JSXOpeningElement';
835
+ selfClosing: boolean;
836
+ name: JSXElementName;
837
+ attributes: Array<JSXAttributeItem>;
838
+ typeParameters: TSTypeParameterInstantiation | null;
839
+ }
840
+
841
+ export interface JSXClosingElement extends Span {
842
+ type: 'JSXClosingElement';
843
+ name: JSXElementName;
844
+ }
845
+
846
+ export interface JSXFragment extends Span {
847
+ type: 'JSXFragment';
848
+ openingFragment: JSXOpeningFragment;
849
+ closingFragment: JSXClosingFragment;
850
+ children: Array<JSXChild>;
851
+ }
852
+
853
+ export interface JSXOpeningFragment extends Span {
854
+ type: 'JSXOpeningFragment';
855
+ }
856
+
857
+ export interface JSXClosingFragment extends Span {
858
+ type: 'JSXClosingFragment';
859
+ }
860
+
861
+ export type JSXElementName = JSXIdentifier | JSXNamespacedName | JSXMemberExpression;
862
+
863
+ export interface JSXNamespacedName extends Span {
864
+ type: 'JSXNamespacedName';
865
+ namespace: JSXIdentifier;
866
+ property: JSXIdentifier;
867
+ }
868
+
869
+ export interface JSXMemberExpression extends Span {
870
+ type: 'JSXMemberExpression';
871
+ object: JSXMemberExpressionObject;
872
+ property: JSXIdentifier;
873
+ }
874
+
875
+ export type JSXMemberExpressionObject = JSXIdentifier | JSXMemberExpression;
876
+
877
+ export interface JSXExpressionContainer extends Span {
878
+ type: 'JSXExpressionContainer';
879
+ expression: JSXExpression;
880
+ }
881
+
882
+ export type JSXExpression = JSXEmptyExpression | Expression;
883
+
884
+ export interface JSXEmptyExpression extends Span {
885
+ type: 'JSXEmptyExpression';
886
+ }
887
+
888
+ export type JSXAttributeItem = JSXAttribute | JSXSpreadAttribute;
889
+
890
+ export interface JSXAttribute extends Span {
891
+ type: 'JSXAttribute';
892
+ name: JSXAttributeName;
893
+ value: JSXAttributeValue | null;
894
+ }
895
+
896
+ export interface JSXSpreadAttribute extends Span {
897
+ type: 'JSXSpreadAttribute';
898
+ argument: Expression;
977
899
  }
978
900
 
979
- export interface ExportSpecifier extends Span {
980
- type: 'ExportSpecifier';
981
- local: ModuleExportName;
982
- exported: ModuleExportName;
983
- exportKind: ImportOrExportKind;
901
+ export type JSXAttributeName = JSXIdentifier | JSXNamespacedName;
902
+
903
+ export type JSXAttributeValue = StringLiteral | JSXExpressionContainer | JSXElement | JSXFragment;
904
+
905
+ export interface JSXIdentifier extends Span {
906
+ type: 'JSXIdentifier';
907
+ name: string;
984
908
  }
985
909
 
986
- export type ExportDefaultDeclarationKind =
987
- | Function
988
- | Class
989
- | TSInterfaceDeclaration
990
- | BooleanLiteral
991
- | NullLiteral
992
- | NumericLiteral
993
- | BigIntLiteral
994
- | RegExpLiteral
995
- | StringLiteral
996
- | TemplateLiteral
997
- | IdentifierReference
998
- | MetaProperty
999
- | Super
1000
- | ArrayExpression
1001
- | ArrowFunctionExpression
1002
- | AssignmentExpression
1003
- | AwaitExpression
1004
- | BinaryExpression
1005
- | CallExpression
1006
- | ChainExpression
1007
- | Class
1008
- | ConditionalExpression
1009
- | Function
1010
- | ImportExpression
1011
- | LogicalExpression
1012
- | NewExpression
1013
- | ObjectExpression
1014
- | ParenthesizedExpression
1015
- | SequenceExpression
1016
- | TaggedTemplateExpression
1017
- | ThisExpression
1018
- | UnaryExpression
1019
- | UpdateExpression
1020
- | YieldExpression
1021
- | PrivateInExpression
1022
- | JSXElement
1023
- | JSXFragment
1024
- | TSAsExpression
1025
- | TSSatisfiesExpression
1026
- | TSTypeAssertion
1027
- | TSNonNullExpression
1028
- | TSInstantiationExpression
1029
- | ComputedMemberExpression
1030
- | StaticMemberExpression
1031
- | PrivateFieldExpression;
910
+ export type JSXChild = JSXText | JSXElement | JSXFragment | JSXExpressionContainer | JSXSpreadChild;
1032
911
 
1033
- export type ModuleExportName = IdentifierName | IdentifierReference | StringLiteral;
912
+ export interface JSXSpreadChild extends Span {
913
+ type: 'JSXSpreadChild';
914
+ expression: Expression;
915
+ }
916
+
917
+ export interface JSXText extends Span {
918
+ type: 'JSXText';
919
+ value: string;
920
+ }
1034
921
 
1035
922
  export interface TSThisParameter extends Span {
1036
923
  type: 'TSThisParameter';
@@ -1177,47 +1064,7 @@ export interface TSRestType extends Span {
1177
1064
  typeAnnotation: TSType;
1178
1065
  }
1179
1066
 
1180
- export type TSTupleElement =
1181
- | TSOptionalType
1182
- | TSRestType
1183
- | TSAnyKeyword
1184
- | TSBigIntKeyword
1185
- | TSBooleanKeyword
1186
- | TSIntrinsicKeyword
1187
- | TSNeverKeyword
1188
- | TSNullKeyword
1189
- | TSNumberKeyword
1190
- | TSObjectKeyword
1191
- | TSStringKeyword
1192
- | TSSymbolKeyword
1193
- | TSUndefinedKeyword
1194
- | TSUnknownKeyword
1195
- | TSVoidKeyword
1196
- | TSArrayType
1197
- | TSConditionalType
1198
- | TSConstructorType
1199
- | TSFunctionType
1200
- | TSImportType
1201
- | TSIndexedAccessType
1202
- | TSInferType
1203
- | TSIntersectionType
1204
- | TSLiteralType
1205
- | TSMappedType
1206
- | TSNamedTupleMember
1207
- | TSQualifiedName
1208
- | TSTemplateLiteralType
1209
- | TSThisType
1210
- | TSTupleType
1211
- | TSTypeLiteral
1212
- | TSTypeOperator
1213
- | TSTypePredicate
1214
- | TSTypeQuery
1215
- | TSTypeReference
1216
- | TSUnionType
1217
- | TSParenthesizedType
1218
- | JSDocNullableType
1219
- | JSDocNonNullableType
1220
- | JSDocUnknownType;
1067
+ export type TSTupleElement = TSOptionalType | TSRestType | TSType;
1221
1068
 
1222
1069
  export interface TSAnyKeyword extends Span {
1223
1070
  type: 'TSAnyKeyword';
@@ -1367,7 +1214,7 @@ export interface TSCallSignatureDeclaration extends Span {
1367
1214
  type: 'TSCallSignatureDeclaration';
1368
1215
  typeParameters: TSTypeParameterDeclaration | null;
1369
1216
  thisParam: TSThisParameter | null;
1370
- params: FormalParameters;
1217
+ params: ParamPattern[];
1371
1218
  returnType: TSTypeAnnotation | null;
1372
1219
  }
1373
1220
 
@@ -1381,14 +1228,14 @@ export interface TSMethodSignature extends Span {
1381
1228
  kind: TSMethodSignatureKind;
1382
1229
  typeParameters: TSTypeParameterDeclaration | null;
1383
1230
  thisParam: TSThisParameter | null;
1384
- params: FormalParameters;
1231
+ params: ParamPattern[];
1385
1232
  returnType: TSTypeAnnotation | null;
1386
1233
  }
1387
1234
 
1388
1235
  export interface TSConstructSignatureDeclaration extends Span {
1389
1236
  type: 'TSConstructSignatureDeclaration';
1390
1237
  typeParameters: TSTypeParameterDeclaration | null;
1391
- params: FormalParameters;
1238
+ params: ParamPattern[];
1392
1239
  returnType: TSTypeAnnotation | null;
1393
1240
  }
1394
1241
 
@@ -1448,7 +1295,7 @@ export interface TSTypeQuery extends Span {
1448
1295
  typeParameters: TSTypeParameterInstantiation | null;
1449
1296
  }
1450
1297
 
1451
- export type TSTypeQueryExprName = TSImportType | IdentifierReference | TSQualifiedName;
1298
+ export type TSTypeQueryExprName = TSImportType | TSTypeName;
1452
1299
 
1453
1300
  export interface TSImportType extends Span {
1454
1301
  type: 'TSImportType';
@@ -1477,7 +1324,7 @@ export interface TSFunctionType extends Span {
1477
1324
  type: 'TSFunctionType';
1478
1325
  typeParameters: TSTypeParameterDeclaration | null;
1479
1326
  thisParam: TSThisParameter | null;
1480
- params: FormalParameters;
1327
+ params: ParamPattern[];
1481
1328
  returnType: TSTypeAnnotation;
1482
1329
  }
1483
1330
 
@@ -1485,7 +1332,7 @@ export interface TSConstructorType extends Span {
1485
1332
  type: 'TSConstructorType';
1486
1333
  abstract: boolean;
1487
1334
  typeParameters: TSTypeParameterDeclaration | null;
1488
- params: FormalParameters;
1335
+ params: ParamPattern[];
1489
1336
  returnType: TSTypeAnnotation;
1490
1337
  }
1491
1338
 
@@ -1531,7 +1378,7 @@ export interface TSImportEqualsDeclaration extends Span {
1531
1378
  importKind: ImportOrExportKind;
1532
1379
  }
1533
1380
 
1534
- export type TSModuleReference = TSExternalModuleReference | IdentifierReference | TSQualifiedName;
1381
+ export type TSModuleReference = TSExternalModuleReference | TSTypeName;
1535
1382
 
1536
1383
  export interface TSExternalModuleReference extends Span {
1537
1384
  type: 'TSExternalModuleReference';
@@ -1582,141 +1429,6 @@ export interface JSDocUnknownType extends Span {
1582
1429
  type: 'JSDocUnknownType';
1583
1430
  }
1584
1431
 
1585
- export interface JSXElement extends Span {
1586
- type: 'JSXElement';
1587
- openingElement: JSXOpeningElement;
1588
- closingElement: JSXClosingElement | null;
1589
- children: Array<JSXChild>;
1590
- }
1591
-
1592
- export interface JSXOpeningElement extends Span {
1593
- type: 'JSXOpeningElement';
1594
- selfClosing: boolean;
1595
- name: JSXElementName;
1596
- attributes: Array<JSXAttributeItem>;
1597
- typeParameters: TSTypeParameterInstantiation | null;
1598
- }
1599
-
1600
- export interface JSXClosingElement extends Span {
1601
- type: 'JSXClosingElement';
1602
- name: JSXElementName;
1603
- }
1604
-
1605
- export interface JSXFragment extends Span {
1606
- type: 'JSXFragment';
1607
- openingFragment: JSXOpeningFragment;
1608
- closingFragment: JSXClosingFragment;
1609
- children: Array<JSXChild>;
1610
- }
1611
-
1612
- export interface JSXOpeningFragment extends Span {
1613
- type: 'JSXOpeningFragment';
1614
- }
1615
-
1616
- export interface JSXClosingFragment extends Span {
1617
- type: 'JSXClosingFragment';
1618
- }
1619
-
1620
- export interface JSXNamespacedName extends Span {
1621
- type: 'JSXNamespacedName';
1622
- namespace: JSXIdentifier;
1623
- property: JSXIdentifier;
1624
- }
1625
-
1626
- export interface JSXMemberExpression extends Span {
1627
- type: 'JSXMemberExpression';
1628
- object: JSXMemberExpressionObject;
1629
- property: JSXIdentifier;
1630
- }
1631
-
1632
- export interface JSXExpressionContainer extends Span {
1633
- type: 'JSXExpressionContainer';
1634
- expression: JSXExpression;
1635
- }
1636
-
1637
- export type JSXExpression =
1638
- | JSXEmptyExpression
1639
- | BooleanLiteral
1640
- | NullLiteral
1641
- | NumericLiteral
1642
- | BigIntLiteral
1643
- | RegExpLiteral
1644
- | StringLiteral
1645
- | TemplateLiteral
1646
- | IdentifierReference
1647
- | MetaProperty
1648
- | Super
1649
- | ArrayExpression
1650
- | ArrowFunctionExpression
1651
- | AssignmentExpression
1652
- | AwaitExpression
1653
- | BinaryExpression
1654
- | CallExpression
1655
- | ChainExpression
1656
- | Class
1657
- | ConditionalExpression
1658
- | Function
1659
- | ImportExpression
1660
- | LogicalExpression
1661
- | NewExpression
1662
- | ObjectExpression
1663
- | ParenthesizedExpression
1664
- | SequenceExpression
1665
- | TaggedTemplateExpression
1666
- | ThisExpression
1667
- | UnaryExpression
1668
- | UpdateExpression
1669
- | YieldExpression
1670
- | PrivateInExpression
1671
- | JSXElement
1672
- | JSXFragment
1673
- | TSAsExpression
1674
- | TSSatisfiesExpression
1675
- | TSTypeAssertion
1676
- | TSNonNullExpression
1677
- | TSInstantiationExpression
1678
- | ComputedMemberExpression
1679
- | StaticMemberExpression
1680
- | PrivateFieldExpression;
1681
-
1682
- export interface JSXEmptyExpression extends Span {
1683
- type: 'JSXEmptyExpression';
1684
- }
1685
-
1686
- export type JSXAttributeItem = JSXAttribute | JSXSpreadAttribute;
1687
-
1688
- export interface JSXAttribute extends Span {
1689
- type: 'JSXAttribute';
1690
- name: JSXAttributeName;
1691
- value: JSXAttributeValue | null;
1692
- }
1693
-
1694
- export interface JSXSpreadAttribute extends Span {
1695
- type: 'JSXSpreadAttribute';
1696
- argument: Expression;
1697
- }
1698
-
1699
- export type JSXAttributeName = JSXIdentifier | JSXNamespacedName;
1700
-
1701
- export type JSXAttributeValue = StringLiteral | JSXExpressionContainer | JSXElement | JSXFragment;
1702
-
1703
- export interface JSXIdentifier extends Span {
1704
- type: 'JSXIdentifier';
1705
- name: string;
1706
- }
1707
-
1708
- export type JSXChild = JSXText | JSXElement | JSXFragment | JSXExpressionContainer | JSXSpreadChild;
1709
-
1710
- export interface JSXSpreadChild extends Span {
1711
- type: 'JSXSpreadChild';
1712
- expression: Expression;
1713
- }
1714
-
1715
- export interface JSXText extends Span {
1716
- type: 'JSXText';
1717
- value: string;
1718
- }
1719
-
1720
1432
  export type AssignmentOperator =
1721
1433
  | '='
1722
1434
  | '+='
@@ -1770,18 +1482,8 @@ export interface Span {
1770
1482
  end: number;
1771
1483
  }
1772
1484
 
1773
- export interface SourceType {
1774
- language: Language;
1775
- moduleKind: ModuleKind;
1776
- variant: LanguageVariant;
1777
- }
1778
-
1779
- export type Language = 'javascript' | 'typescript' | 'typescriptDefinition';
1780
-
1781
1485
  export type ModuleKind = 'script' | 'module' | 'unambiguous';
1782
1486
 
1783
- export type LanguageVariant = 'standard' | 'jsx';
1784
-
1785
1487
  export interface Pattern extends Span {
1786
1488
  type: 'Pattern';
1787
1489
  body: Disjunction;
@@ -1941,36 +1643,3 @@ export interface NamedReference extends Span {
1941
1643
  type: 'NamedReference';
1942
1644
  name: string;
1943
1645
  }
1944
-
1945
- export interface FormalParameterRest extends Span {
1946
- type: 'RestElement';
1947
- argument: BindingPatternKind;
1948
- typeAnnotation: TSTypeAnnotation | null;
1949
- optional: boolean;
1950
- }
1951
-
1952
- export type RegExpFlags = {
1953
- /** Global flag */
1954
- G: 1;
1955
- /** Ignore case flag */
1956
- I: 2;
1957
- /** Multiline flag */
1958
- M: 4;
1959
- /** DotAll flag */
1960
- S: 8;
1961
- /** Unicode flag */
1962
- U: 16;
1963
- /** Sticky flag */
1964
- Y: 32;
1965
- /** Indices flag */
1966
- D: 64;
1967
- /** Unicode sets flag */
1968
- V: 128;
1969
- };
1970
-
1971
- export type JSXElementName =
1972
- | JSXIdentifier
1973
- | JSXNamespacedName
1974
- | JSXMemberExpression;
1975
-
1976
- export type JSXMemberExpressionObject = JSXIdentifier | JSXMemberExpression;