@eslint-react/ast 1.15.0 → 1.15.1-beta.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -155,20 +155,21 @@ declare interface AccessorPropertyNonComputedName extends PropertyDefinitionNonC
155
155
  type: AST_NODE_TYPES.AccessorProperty;
156
156
  }
157
157
  declare interface ArrayExpression extends BaseNode {
158
+ type: AST_NODE_TYPES.ArrayExpression;
158
159
  /**
159
160
  * an element will be `null` in the case of a sparse array: `[1, ,3]`
160
161
  */
161
162
  elements: (Expression | SpreadElement | null)[];
162
- type: AST_NODE_TYPES.ArrayExpression;
163
163
  }
164
164
  declare interface ArrayPattern extends BaseNode {
165
+ type: AST_NODE_TYPES.ArrayPattern;
165
166
  decorators: Decorator[];
166
167
  elements: (DestructuringPattern | null)[];
167
168
  optional: boolean;
168
- type: AST_NODE_TYPES.ArrayPattern;
169
169
  typeAnnotation: TSTypeAnnotation | undefined;
170
170
  }
171
171
  declare interface ArrowFunctionExpression extends BaseNode {
172
+ type: AST_NODE_TYPES.ArrowFunctionExpression;
172
173
  async: boolean;
173
174
  body: BlockStatement | Expression;
174
175
  expression: boolean;
@@ -176,14 +177,13 @@ declare interface ArrowFunctionExpression extends BaseNode {
176
177
  id: null;
177
178
  params: Parameter[];
178
179
  returnType: TSTypeAnnotation | undefined;
179
- type: AST_NODE_TYPES.ArrowFunctionExpression;
180
180
  typeParameters: TSTypeParameterDeclaration | undefined;
181
181
  }
182
182
  declare interface AssignmentExpression extends BaseNode {
183
+ type: AST_NODE_TYPES.AssignmentExpression;
183
184
  left: Expression;
184
185
  operator: ValueOf<AssignmentOperatorToText>;
185
186
  right: Expression;
186
- type: AST_NODE_TYPES.AssignmentExpression;
187
187
  }
188
188
  declare interface AssignmentOperatorToText {
189
189
  [SyntaxKind.AmpersandAmpersandEqualsToken]: '&&=';
@@ -204,11 +204,11 @@ declare interface AssignmentOperatorToText {
204
204
  [SyntaxKind.SlashEqualsToken]: '/=';
205
205
  }
206
206
  declare interface AssignmentPattern extends BaseNode {
207
+ type: AST_NODE_TYPES.AssignmentPattern;
207
208
  decorators: Decorator[];
208
209
  left: BindingName;
209
210
  optional: boolean;
210
211
  right: Expression;
211
- type: AST_NODE_TYPES.AssignmentPattern;
212
212
  typeAnnotation: TSTypeAnnotation | undefined;
213
213
  }
214
214
  declare enum AST_NODE_TYPES {
@@ -397,8 +397,8 @@ declare enum AST_TOKEN_TYPES {
397
397
  Line = "Line"
398
398
  }
399
399
  declare interface AwaitExpression extends BaseNode {
400
- argument: Expression;
401
400
  type: AST_NODE_TYPES.AwaitExpression;
401
+ argument: Expression;
402
402
  }
403
403
  declare interface BaseNode extends NodeOrTokenData {
404
404
  type: AST_NODE_TYPES;
@@ -412,10 +412,10 @@ declare interface BigIntLiteral extends LiteralBase {
412
412
  value: bigint | null;
413
413
  }
414
414
  declare interface BinaryExpression extends BaseNode {
415
+ type: AST_NODE_TYPES.BinaryExpression;
415
416
  left: Expression | PrivateIdentifier;
416
417
  operator: ValueOf<BinaryOperatorToText>;
417
418
  right: Expression;
418
- type: AST_NODE_TYPES.BinaryExpression;
419
419
  }
420
420
  declare interface BinaryOperatorToText {
421
421
  [SyntaxKind.AmpersandAmpersandToken]: '&&';
@@ -449,8 +449,8 @@ declare interface BlockComment extends BaseToken {
449
449
  type: AST_TOKEN_TYPES.Block;
450
450
  }
451
451
  declare interface BlockStatement extends BaseNode {
452
- body: Statement[];
453
452
  type: AST_NODE_TYPES.BlockStatement;
453
+ body: Statement[];
454
454
  }
455
455
  declare interface BooleanLiteral extends LiteralBase {
456
456
  raw: 'false' | 'true';
@@ -460,26 +460,26 @@ declare interface BooleanToken extends BaseToken {
460
460
  type: AST_TOKEN_TYPES.Boolean;
461
461
  }
462
462
  declare interface BreakStatement extends BaseNode {
463
- label: Identifier | null;
464
463
  type: AST_NODE_TYPES.BreakStatement;
464
+ label: Identifier | null;
465
465
  }
466
466
  declare interface CallExpression extends BaseNode {
467
+ type: AST_NODE_TYPES.CallExpression;
467
468
  arguments: CallExpressionArgument[];
468
469
  callee: Expression;
469
470
  optional: boolean;
470
- type: AST_NODE_TYPES.CallExpression;
471
471
  typeArguments: TSTypeParameterInstantiation | undefined;
472
472
  }
473
473
  declare type CallExpressionArgument = Expression | SpreadElement;
474
474
  declare interface CatchClause extends BaseNode {
475
+ type: AST_NODE_TYPES.CatchClause;
475
476
  body: BlockStatement;
476
477
  param: BindingName | null;
477
- type: AST_NODE_TYPES.CatchClause;
478
478
  }
479
479
  declare type ChainElement = CallExpression | MemberExpression | TSNonNullExpression;
480
480
  declare interface ChainExpression extends BaseNode {
481
- expression: ChainElement;
482
481
  type: AST_NODE_TYPES.ChainExpression;
482
+ expression: ChainElement;
483
483
  }
484
484
  declare interface ClassBase extends BaseNode {
485
485
  /**
@@ -536,8 +536,8 @@ declare interface ClassBase extends BaseNode {
536
536
  typeParameters: TSTypeParameterDeclaration | undefined;
537
537
  }
538
538
  declare interface ClassBody extends BaseNode {
539
- body: ClassElement[];
540
539
  type: AST_NODE_TYPES.ClassBody;
540
+ body: ClassElement[];
541
541
  }
542
542
  declare type ClassDeclaration = ClassDeclarationWithName | ClassDeclarationWithOptionalName;
543
543
  declare interface ClassDeclarationBase extends ClassBase {
@@ -563,9 +563,9 @@ declare interface ClassDeclarationWithOptionalName extends ClassDeclarationBase
563
563
  }
564
564
  declare type ClassElement = AccessorProperty | MethodDefinition | PropertyDefinition | StaticBlock | TSAbstractAccessorProperty | TSAbstractMethodDefinition | TSAbstractPropertyDefinition | TSIndexSignature;
565
565
  declare interface ClassExpression extends ClassBase {
566
+ type: AST_NODE_TYPES.ClassExpression;
566
567
  abstract: false;
567
568
  declare: false;
568
- type: AST_NODE_TYPES.ClassExpression;
569
569
  }
570
570
  declare interface ClassMethodDefinitionNonComputedNameBase extends MethodDefinitionBase {
571
571
  computed: false;
@@ -578,10 +578,10 @@ declare interface ClassPropertyDefinitionNonComputedNameBase extends PropertyDef
578
578
  declare type ClassPropertyNameNonComputed = PrivateIdentifier | PropertyNameNonComputed;
579
579
  declare type Comment = BlockComment | LineComment;
580
580
  declare interface ConditionalExpression extends BaseNode {
581
+ type: AST_NODE_TYPES.ConditionalExpression;
581
582
  alternate: Expression;
582
583
  consequent: Expression;
583
584
  test: Expression;
584
- type: AST_NODE_TYPES.ConditionalExpression;
585
585
  }
586
586
  declare interface ConstDeclaration extends LetOrConstOrVarDeclarationBase {
587
587
  /**
@@ -596,28 +596,29 @@ declare interface ConstDeclaration extends LetOrConstOrVarDeclarationBase {
596
596
  kind: 'const';
597
597
  }
598
598
  declare interface ContinueStatement extends BaseNode {
599
- label: Identifier | null;
600
599
  type: AST_NODE_TYPES.ContinueStatement;
600
+ label: Identifier | null;
601
601
  }
602
602
  declare interface DebuggerStatement extends BaseNode {
603
603
  type: AST_NODE_TYPES.DebuggerStatement;
604
604
  }
605
605
  declare interface Decorator extends BaseNode {
606
- expression: LeftHandSideExpression;
607
606
  type: AST_NODE_TYPES.Decorator;
607
+ expression: LeftHandSideExpression;
608
608
  }
609
609
  declare type DefaultExportDeclarations = ClassDeclarationWithOptionalName | Expression | FunctionDeclarationWithName | FunctionDeclarationWithOptionalName | TSDeclareFunction | TSEnumDeclaration | TSInterfaceDeclaration | TSModuleDeclaration | TSTypeAliasDeclaration | VariableDeclaration;
610
610
  declare type DestructuringPattern = ArrayPattern | AssignmentPattern | Identifier | MemberExpression | ObjectPattern | RestElement;
611
611
  declare interface DoWhileStatement extends BaseNode {
612
+ type: AST_NODE_TYPES.DoWhileStatement;
612
613
  body: Statement;
613
614
  test: Expression;
614
- type: AST_NODE_TYPES.DoWhileStatement;
615
615
  }
616
616
  declare interface EmptyStatement extends BaseNode {
617
617
  type: AST_NODE_TYPES.EmptyStatement;
618
618
  }
619
619
  declare type EntityName = Identifier | ThisExpression | TSQualifiedName;
620
620
  declare interface ExportAllDeclaration extends BaseNode {
621
+ type: AST_NODE_TYPES.ExportAllDeclaration;
621
622
  /**
622
623
  * The assertions declared for the export.
623
624
  * @example
@@ -647,10 +648,10 @@ declare interface ExportAllDeclaration extends BaseNode {
647
648
  * The source module being exported from.
648
649
  */
649
650
  source: StringLiteral;
650
- type: AST_NODE_TYPES.ExportAllDeclaration;
651
651
  }
652
652
  declare type ExportAndImportKind = 'type' | 'value';
653
653
  declare interface ExportDefaultDeclaration extends BaseNode {
654
+ type: AST_NODE_TYPES.ExportDefaultDeclaration;
654
655
  /**
655
656
  * The declaration being exported.
656
657
  */
@@ -659,11 +660,11 @@ declare interface ExportDefaultDeclaration extends BaseNode {
659
660
  * The kind of the export. Always `value` for default exports.
660
661
  */
661
662
  exportKind: 'value';
662
- type: AST_NODE_TYPES.ExportDefaultDeclaration;
663
663
  }
664
664
  declare type ExportKind = ExportAndImportKind;
665
665
  declare type ExportNamedDeclaration = ExportNamedDeclarationWithoutSourceWithMultiple | ExportNamedDeclarationWithoutSourceWithSingle | ExportNamedDeclarationWithSource;
666
666
  declare interface ExportNamedDeclarationBase extends BaseNode {
667
+ type: AST_NODE_TYPES.ExportNamedDeclaration;
667
668
  /**
668
669
  * The assertions declared for the export.
669
670
  * @example
@@ -709,7 +710,6 @@ declare interface ExportNamedDeclarationBase extends BaseNode {
709
710
  * This will be an empty array if `declaration` is not `null`
710
711
  */
711
712
  specifiers: ExportSpecifier[];
712
- type: AST_NODE_TYPES.ExportNamedDeclaration;
713
713
  }
714
714
  /**
715
715
  * Exporting names from the current module.
@@ -730,6 +730,7 @@ declare interface ExportNamedDeclarationWithoutSourceWithMultiple extends Export
730
730
  attributes: ImportAttribute[];
731
731
  declaration: null;
732
732
  source: null;
733
+ specifiers: ExportSpecifierWithIdentifierLocal[];
733
734
  }
734
735
  /**
735
736
  * Exporting a single named declaration.
@@ -752,7 +753,7 @@ declare interface ExportNamedDeclarationWithoutSourceWithSingle extends ExportNa
752
753
  /**
753
754
  * This will always be an empty array.
754
755
  */
755
- specifiers: ExportSpecifier[];
756
+ specifiers: ExportSpecifierWithIdentifierLocal[];
756
757
  }
757
758
  /**
758
759
  * Export names from another module.
@@ -764,38 +765,45 @@ declare interface ExportNamedDeclarationWithSource extends ExportNamedDeclaratio
764
765
  declaration: null;
765
766
  source: StringLiteral;
766
767
  }
767
- declare interface ExportSpecifier extends BaseNode {
768
- exported: Identifier;
768
+ declare type ExportSpecifier = ExportSpecifierWithIdentifierLocal | ExportSpecifierWithStringOrLiteralLocal;
769
+ declare interface ExportSpecifierBase extends BaseNode {
770
+ type: AST_NODE_TYPES.ExportSpecifier;
771
+ exported: Identifier | StringLiteral;
769
772
  exportKind: ExportKind;
773
+ local: Identifier | StringLiteral;
774
+ }
775
+ declare interface ExportSpecifierWithIdentifierLocal extends ExportSpecifierBase {
770
776
  local: Identifier;
771
- type: AST_NODE_TYPES.ExportSpecifier;
777
+ }
778
+ declare interface ExportSpecifierWithStringOrLiteralLocal extends ExportSpecifierBase {
779
+ local: Identifier | StringLiteral;
772
780
  }
773
781
  declare type Expression = ArrayExpression | ArrayPattern | ArrowFunctionExpression | AssignmentExpression | AwaitExpression | BinaryExpression | CallExpression | ChainExpression | ClassExpression | ConditionalExpression | FunctionExpression | Identifier | ImportExpression | JSXElement | JSXFragment | LiteralExpression | LogicalExpression | MemberExpression | MetaProperty | NewExpression | ObjectExpression | ObjectPattern | SequenceExpression | Super | TaggedTemplateExpression | TemplateLiteral | ThisExpression | TSAsExpression | TSInstantiationExpression | TSNonNullExpression | TSSatisfiesExpression | TSTypeAssertion | UnaryExpression | UpdateExpression | YieldExpression;
774
782
  declare interface ExpressionStatement extends BaseNode {
783
+ type: AST_NODE_TYPES.ExpressionStatement;
775
784
  directive: string | undefined;
776
785
  expression: Expression;
777
- type: AST_NODE_TYPES.ExpressionStatement;
778
786
  }
779
787
  declare type ForInitialiser = Expression | LetOrConstOrVarDeclaration;
780
788
  declare interface ForInStatement extends BaseNode {
789
+ type: AST_NODE_TYPES.ForInStatement;
781
790
  body: Statement;
782
791
  left: ForInitialiser;
783
792
  right: Expression;
784
- type: AST_NODE_TYPES.ForInStatement;
785
793
  }
786
794
  declare type ForOfInitialiser = Expression | LetOrConstOrVarDeclaration | UsingInForOfDeclaration;
787
795
  declare interface ForOfStatement extends BaseNode {
796
+ type: AST_NODE_TYPES.ForOfStatement;
788
797
  await: boolean;
789
798
  body: Statement;
790
799
  left: ForOfInitialiser;
791
800
  right: Expression;
792
- type: AST_NODE_TYPES.ForOfStatement;
793
801
  }
794
802
  declare interface ForStatement extends BaseNode {
803
+ type: AST_NODE_TYPES.ForStatement;
795
804
  body: Statement;
796
805
  init: Expression | ForInitialiser | null;
797
806
  test: Expression | null;
798
- type: AST_NODE_TYPES.ForStatement;
799
807
  update: Expression | null;
800
808
  }
801
809
  declare interface FunctionBase extends BaseNode {
@@ -863,10 +871,10 @@ declare interface FunctionBase extends BaseNode {
863
871
  }
864
872
  declare type FunctionDeclaration = FunctionDeclarationWithName | FunctionDeclarationWithOptionalName;
865
873
  declare interface FunctionDeclarationBase extends FunctionBase {
874
+ type: AST_NODE_TYPES.FunctionDeclaration;
866
875
  body: BlockStatement;
867
876
  declare: false;
868
877
  expression: false;
869
- type: AST_NODE_TYPES.FunctionDeclaration;
870
878
  }
871
879
  /**
872
880
  * A normal function declaration:
@@ -887,33 +895,34 @@ declare interface FunctionDeclarationWithOptionalName extends FunctionDeclaratio
887
895
  id: Identifier | null;
888
896
  }
889
897
  declare interface FunctionExpression extends FunctionBase {
898
+ type: AST_NODE_TYPES.FunctionExpression;
890
899
  body: BlockStatement;
891
900
  expression: false;
892
- type: AST_NODE_TYPES.FunctionExpression;
893
901
  }
894
902
  declare interface Identifier extends BaseNode {
903
+ type: AST_NODE_TYPES.Identifier;
895
904
  decorators: Decorator[];
896
905
  name: string;
897
906
  optional: boolean;
898
- type: AST_NODE_TYPES.Identifier;
899
907
  typeAnnotation: TSTypeAnnotation | undefined;
900
908
  }
901
909
  declare interface IdentifierToken extends BaseToken {
902
910
  type: AST_TOKEN_TYPES.Identifier;
903
911
  }
904
912
  declare interface IfStatement extends BaseNode {
913
+ type: AST_NODE_TYPES.IfStatement;
905
914
  alternate: Statement | null;
906
915
  consequent: Statement;
907
916
  test: Expression;
908
- type: AST_NODE_TYPES.IfStatement;
909
917
  }
910
918
  declare interface ImportAttribute extends BaseNode {
911
- key: Identifier | Literal;
912
919
  type: AST_NODE_TYPES.ImportAttribute;
920
+ key: Identifier | Literal;
913
921
  value: Literal;
914
922
  }
915
923
  declare type ImportClause = ImportDefaultSpecifier | ImportNamespaceSpecifier | ImportSpecifier;
916
924
  declare interface ImportDeclaration extends BaseNode {
925
+ type: AST_NODE_TYPES.ImportDeclaration;
917
926
  /**
918
927
  * The assertions declared for the export.
919
928
  * @example
@@ -951,100 +960,99 @@ declare interface ImportDeclaration extends BaseNode {
951
960
  * ```
952
961
  */
953
962
  specifiers: ImportClause[];
954
- type: AST_NODE_TYPES.ImportDeclaration;
955
963
  }
956
964
  declare interface ImportDefaultSpecifier extends BaseNode {
957
- local: Identifier;
958
965
  type: AST_NODE_TYPES.ImportDefaultSpecifier;
966
+ local: Identifier;
959
967
  }
960
968
  declare interface ImportExpression extends BaseNode {
969
+ type: AST_NODE_TYPES.ImportExpression;
961
970
  attributes: Expression | null;
962
971
  source: Expression;
963
- type: AST_NODE_TYPES.ImportExpression;
964
972
  }
965
973
  declare type ImportKind = ExportAndImportKind;
966
974
  declare interface ImportNamespaceSpecifier extends BaseNode {
967
- local: Identifier;
968
975
  type: AST_NODE_TYPES.ImportNamespaceSpecifier;
976
+ local: Identifier;
969
977
  }
970
978
  declare interface ImportSpecifier extends BaseNode {
971
- imported: Identifier;
979
+ type: AST_NODE_TYPES.ImportSpecifier;
980
+ imported: Identifier | StringLiteral;
972
981
  importKind: ImportKind;
973
982
  local: Identifier;
974
- type: AST_NODE_TYPES.ImportSpecifier;
975
983
  }
976
984
  declare interface JSXAttribute extends BaseNode {
977
- name: JSXIdentifier | JSXNamespacedName;
978
985
  type: AST_NODE_TYPES.JSXAttribute;
986
+ name: JSXIdentifier | JSXNamespacedName;
979
987
  value: JSXElement | JSXExpression | Literal | null;
980
988
  }
981
989
  declare type JSXChild = JSXElement | JSXExpression | JSXFragment | JSXText;
982
990
  declare interface JSXClosingElement extends BaseNode {
983
- name: JSXTagNameExpression;
984
991
  type: AST_NODE_TYPES.JSXClosingElement;
992
+ name: JSXTagNameExpression;
985
993
  }
986
994
  declare interface JSXClosingFragment extends BaseNode {
987
995
  type: AST_NODE_TYPES.JSXClosingFragment;
988
996
  }
989
997
  declare interface JSXElement extends BaseNode {
998
+ type: AST_NODE_TYPES.JSXElement;
990
999
  children: JSXChild[];
991
1000
  closingElement: JSXClosingElement | null;
992
1001
  openingElement: JSXOpeningElement;
993
- type: AST_NODE_TYPES.JSXElement;
994
1002
  }
995
1003
  declare interface JSXEmptyExpression extends BaseNode {
996
1004
  type: AST_NODE_TYPES.JSXEmptyExpression;
997
1005
  }
998
1006
  declare type JSXExpression = JSXExpressionContainer | JSXSpreadChild;
999
1007
  declare interface JSXExpressionContainer extends BaseNode {
1000
- expression: Expression | JSXEmptyExpression;
1001
1008
  type: AST_NODE_TYPES.JSXExpressionContainer;
1009
+ expression: Expression | JSXEmptyExpression;
1002
1010
  }
1003
1011
  declare interface JSXFragment extends BaseNode {
1012
+ type: AST_NODE_TYPES.JSXFragment;
1004
1013
  children: JSXChild[];
1005
1014
  closingFragment: JSXClosingFragment;
1006
1015
  openingFragment: JSXOpeningFragment;
1007
- type: AST_NODE_TYPES.JSXFragment;
1008
1016
  }
1009
1017
  declare interface JSXIdentifier extends BaseNode {
1010
- name: string;
1011
1018
  type: AST_NODE_TYPES.JSXIdentifier;
1019
+ name: string;
1012
1020
  }
1013
1021
  declare interface JSXIdentifierToken extends BaseToken {
1014
1022
  type: AST_TOKEN_TYPES.JSXIdentifier;
1015
1023
  }
1016
1024
  declare interface JSXMemberExpression extends BaseNode {
1025
+ type: AST_NODE_TYPES.JSXMemberExpression;
1017
1026
  object: JSXTagNameExpression;
1018
1027
  property: JSXIdentifier;
1019
- type: AST_NODE_TYPES.JSXMemberExpression;
1020
1028
  }
1021
1029
  declare interface JSXNamespacedName extends BaseNode {
1030
+ type: AST_NODE_TYPES.JSXNamespacedName;
1022
1031
  name: JSXIdentifier;
1023
1032
  namespace: JSXIdentifier;
1024
- type: AST_NODE_TYPES.JSXNamespacedName;
1025
1033
  }
1026
1034
  declare interface JSXOpeningElement extends BaseNode {
1035
+ type: AST_NODE_TYPES.JSXOpeningElement;
1027
1036
  attributes: (JSXAttribute | JSXSpreadAttribute)[];
1028
1037
  name: JSXTagNameExpression;
1029
1038
  selfClosing: boolean;
1030
- type: AST_NODE_TYPES.JSXOpeningElement;
1031
1039
  typeArguments: TSTypeParameterInstantiation | undefined;
1032
1040
  }
1033
1041
  declare interface JSXOpeningFragment extends BaseNode {
1034
1042
  type: AST_NODE_TYPES.JSXOpeningFragment;
1035
1043
  }
1036
1044
  declare interface JSXSpreadAttribute extends BaseNode {
1037
- argument: Expression;
1038
1045
  type: AST_NODE_TYPES.JSXSpreadAttribute;
1046
+ argument: Expression;
1039
1047
  }
1040
1048
  declare interface JSXSpreadChild extends BaseNode {
1041
- expression: Expression | JSXEmptyExpression;
1042
1049
  type: AST_NODE_TYPES.JSXSpreadChild;
1050
+ expression: Expression | JSXEmptyExpression;
1043
1051
  }
1044
1052
  declare type JSXTagNameExpression = JSXIdentifier | JSXMemberExpression | JSXNamespacedName;
1045
1053
  declare interface JSXText extends BaseNode {
1046
- raw: string;
1047
1054
  type: AST_NODE_TYPES.JSXText;
1055
+ raw: string;
1048
1056
  value: string;
1049
1057
  }
1050
1058
  declare interface JSXTextToken extends BaseToken {
@@ -1054,13 +1062,14 @@ declare interface KeywordToken extends BaseToken {
1054
1062
  type: AST_TOKEN_TYPES.Keyword;
1055
1063
  }
1056
1064
  declare interface LabeledStatement extends BaseNode {
1065
+ type: AST_NODE_TYPES.LabeledStatement;
1057
1066
  body: Statement;
1058
1067
  label: Identifier;
1059
- type: AST_NODE_TYPES.LabeledStatement;
1060
1068
  }
1061
1069
  declare type LeftHandSideExpression = ArrayExpression | ArrayPattern | ArrowFunctionExpression | CallExpression | ClassExpression | FunctionExpression | Identifier | JSXElement | JSXFragment | LiteralExpression | MemberExpression | MetaProperty | ObjectExpression | ObjectPattern | SequenceExpression | Super | TaggedTemplateExpression | ThisExpression | TSAsExpression | TSNonNullExpression | TSTypeAssertion;
1062
1070
  declare type LetOrConstOrVarDeclaration = ConstDeclaration | LetOrVarDeclaredDeclaration | LetOrVarNonDeclaredDeclaration;
1063
1071
  declare interface LetOrConstOrVarDeclarationBase extends BaseNode {
1072
+ type: AST_NODE_TYPES.VariableDeclaration;
1064
1073
  /**
1065
1074
  * The variables declared by this declaration.
1066
1075
  * Always non-empty.
@@ -1089,7 +1098,6 @@ declare interface LetOrConstOrVarDeclarationBase extends BaseNode {
1089
1098
  * ```
1090
1099
  */
1091
1100
  kind: 'const' | 'let' | 'var';
1092
- type: AST_NODE_TYPES.VariableDeclaration;
1093
1101
  }
1094
1102
  declare type LetOrConstOrVarDeclarator = VariableDeclaratorDefiniteAssignment | VariableDeclaratorMaybeInit | VariableDeclaratorNoInit;
1095
1103
  declare interface LetOrVarDeclaredDeclaration extends LetOrConstOrVarDeclarationBase {
@@ -1121,16 +1129,16 @@ declare interface LineComment extends BaseToken {
1121
1129
  }
1122
1130
  declare type Literal = BigIntLiteral | BooleanLiteral | NullLiteral | NumberLiteral | RegExpLiteral | StringLiteral;
1123
1131
  declare interface LiteralBase extends BaseNode {
1124
- raw: string;
1125
1132
  type: AST_NODE_TYPES.Literal;
1133
+ raw: string;
1126
1134
  value: RegExp | bigint | boolean | number | string | null;
1127
1135
  }
1128
1136
  declare type LiteralExpression = Literal | TemplateLiteral;
1129
1137
  declare interface LogicalExpression extends BaseNode {
1138
+ type: AST_NODE_TYPES.LogicalExpression;
1130
1139
  left: Expression;
1131
1140
  operator: '&&' | '??' | '||';
1132
1141
  right: Expression;
1133
- type: AST_NODE_TYPES.LogicalExpression;
1134
1142
  }
1135
1143
  declare type MemberExpression = MemberExpressionComputedName | MemberExpressionNonComputedName;
1136
1144
  declare interface MemberExpressionBase extends BaseNode {
@@ -1140,19 +1148,19 @@ declare interface MemberExpressionBase extends BaseNode {
1140
1148
  property: Expression | Identifier | PrivateIdentifier;
1141
1149
  }
1142
1150
  declare interface MemberExpressionComputedName extends MemberExpressionBase {
1151
+ type: AST_NODE_TYPES.MemberExpression;
1143
1152
  computed: true;
1144
1153
  property: Expression;
1145
- type: AST_NODE_TYPES.MemberExpression;
1146
1154
  }
1147
1155
  declare interface MemberExpressionNonComputedName extends MemberExpressionBase {
1156
+ type: AST_NODE_TYPES.MemberExpression;
1148
1157
  computed: false;
1149
1158
  property: Identifier | PrivateIdentifier;
1150
- type: AST_NODE_TYPES.MemberExpression;
1151
1159
  }
1152
1160
  declare interface MetaProperty extends BaseNode {
1161
+ type: AST_NODE_TYPES.MetaProperty;
1153
1162
  meta: Identifier;
1154
1163
  property: Identifier;
1155
- type: AST_NODE_TYPES.MetaProperty;
1156
1164
  }
1157
1165
  declare type MethodDefinition = MethodDefinitionComputedName | MethodDefinitionNonComputedName;
1158
1166
  /** this should not be directly used - instead use MethodDefinitionComputedNameBase or MethodDefinitionNonComputedNameBase */
@@ -1183,13 +1191,14 @@ declare interface MethodDefinitionNonComputedNameBase extends MethodDefinitionBa
1183
1191
  }
1184
1192
  declare type NamedExportDeclarations = ClassDeclarationWithName | ClassDeclarationWithOptionalName | FunctionDeclarationWithName | FunctionDeclarationWithOptionalName | TSDeclareFunction | TSEnumDeclaration | TSImportEqualsDeclaration | TSInterfaceDeclaration | TSModuleDeclaration | TSTypeAliasDeclaration | VariableDeclaration;
1185
1193
  declare interface NewExpression extends BaseNode {
1194
+ type: AST_NODE_TYPES.NewExpression;
1186
1195
  arguments: CallExpressionArgument[];
1187
1196
  callee: Expression;
1188
- type: AST_NODE_TYPES.NewExpression;
1189
1197
  typeArguments: TSTypeParameterInstantiation | undefined;
1190
1198
  }
1191
1199
  declare type Node = AccessorProperty | ArrayExpression | ArrayPattern | ArrowFunctionExpression | AssignmentExpression | AssignmentPattern | AwaitExpression | BinaryExpression | BlockStatement | BreakStatement | CallExpression | CatchClause | ChainExpression | ClassBody | ClassDeclaration | ClassExpression | ConditionalExpression | ContinueStatement | DebuggerStatement | Decorator | DoWhileStatement | EmptyStatement | ExportAllDeclaration | ExportDefaultDeclaration | ExportNamedDeclaration | ExportSpecifier | ExpressionStatement | ForInStatement | ForOfStatement | ForStatement | FunctionDeclaration | FunctionExpression | Identifier | IfStatement | ImportAttribute | ImportDeclaration | ImportDefaultSpecifier | ImportExpression | ImportNamespaceSpecifier | ImportSpecifier | JSXAttribute | JSXClosingElement | JSXClosingFragment | JSXElement | JSXEmptyExpression | JSXExpressionContainer | JSXFragment | JSXIdentifier | JSXMemberExpression | JSXNamespacedName | JSXOpeningElement | JSXOpeningFragment | JSXSpreadAttribute | JSXSpreadChild | JSXText | LabeledStatement | Literal | LogicalExpression | MemberExpression | MetaProperty | MethodDefinition | NewExpression | ObjectExpression | ObjectPattern | PrivateIdentifier | Program | Property | PropertyDefinition | RestElement | ReturnStatement | SequenceExpression | SpreadElement | StaticBlock | Super | SwitchCase | SwitchStatement | TaggedTemplateExpression | TemplateElement | TemplateLiteral | ThisExpression | ThrowStatement | TryStatement | TSAbstractAccessorProperty | TSAbstractKeyword | TSAbstractMethodDefinition | TSAbstractPropertyDefinition | TSAnyKeyword | TSArrayType | TSAsExpression | TSAsyncKeyword | TSBigIntKeyword | TSBooleanKeyword | TSCallSignatureDeclaration | TSClassImplements | TSConditionalType | TSConstructorType | TSConstructSignatureDeclaration | TSDeclareFunction | TSDeclareKeyword | TSEmptyBodyFunctionExpression | TSEnumBody | TSEnumDeclaration | TSEnumMember | TSExportAssignment | TSExportKeyword | TSExternalModuleReference | TSFunctionType | TSImportEqualsDeclaration | TSImportType | TSIndexedAccessType | TSIndexSignature | TSInferType | TSInstantiationExpression | TSInterfaceBody | TSInterfaceDeclaration | TSInterfaceHeritage | TSIntersectionType | TSIntrinsicKeyword | TSLiteralType | TSMappedType | TSMethodSignature | TSModuleBlock | TSModuleDeclaration | TSNamedTupleMember | TSNamespaceExportDeclaration | TSNeverKeyword | TSNonNullExpression | TSNullKeyword | TSNumberKeyword | TSObjectKeyword | TSOptionalType | TSParameterProperty | TSPrivateKeyword | TSPropertySignature | TSProtectedKeyword | TSPublicKeyword | TSQualifiedName | TSReadonlyKeyword | TSRestType | TSSatisfiesExpression | TSStaticKeyword | TSStringKeyword | TSSymbolKeyword | TSTemplateLiteralType | TSThisType | TSTupleType | TSTypeAliasDeclaration | TSTypeAnnotation | TSTypeAssertion | TSTypeLiteral | TSTypeOperator | TSTypeParameter | TSTypeParameterDeclaration | TSTypeParameterInstantiation | TSTypePredicate | TSTypeQuery | TSTypeReference | TSUndefinedKeyword | TSUnionType | TSUnknownKeyword | TSVoidKeyword | UnaryExpression | UpdateExpression | VariableDeclaration | VariableDeclarator | WhileStatement | WithStatement | YieldExpression;
1192
1200
  declare interface NodeOrTokenData {
1201
+ type: string;
1193
1202
  /**
1194
1203
  * The source location information of the node.
1195
1204
  *
@@ -1197,7 +1206,6 @@ declare interface NodeOrTokenData {
1197
1206
  */
1198
1207
  loc: SourceLocation;
1199
1208
  range: Range;
1200
- type: string;
1201
1209
  }
1202
1210
  declare interface NullLiteral extends LiteralBase {
1203
1211
  raw: 'null';
@@ -1213,15 +1221,15 @@ declare interface NumericToken extends BaseToken {
1213
1221
  type: AST_TOKEN_TYPES.Numeric;
1214
1222
  }
1215
1223
  declare interface ObjectExpression extends BaseNode {
1216
- properties: ObjectLiteralElement[];
1217
1224
  type: AST_NODE_TYPES.ObjectExpression;
1225
+ properties: ObjectLiteralElement[];
1218
1226
  }
1219
1227
  declare type ObjectLiteralElement = Property | SpreadElement;
1220
1228
  declare interface ObjectPattern extends BaseNode {
1229
+ type: AST_NODE_TYPES.ObjectPattern;
1221
1230
  decorators: Decorator[];
1222
1231
  optional: boolean;
1223
1232
  properties: (Property | RestElement)[];
1224
- type: AST_NODE_TYPES.ObjectPattern;
1225
1233
  typeAnnotation: TSTypeAnnotation | undefined;
1226
1234
  }
1227
1235
  declare type Parameter = ArrayPattern | AssignmentPattern | Identifier | ObjectPattern | RestElement | TSParameterProperty;
@@ -1236,26 +1244,26 @@ declare interface Position {
1236
1244
  line: number;
1237
1245
  }
1238
1246
  declare interface PrivateIdentifier extends BaseNode {
1239
- name: string;
1240
1247
  type: AST_NODE_TYPES.PrivateIdentifier;
1248
+ name: string;
1241
1249
  }
1242
1250
  declare interface Program extends NodeOrTokenData {
1251
+ type: AST_NODE_TYPES.Program;
1243
1252
  body: ProgramStatement[];
1244
1253
  comments: Comment[] | undefined;
1245
1254
  sourceType: 'module' | 'script';
1246
1255
  tokens: Token[] | undefined;
1247
- type: AST_NODE_TYPES.Program;
1248
1256
  }
1249
1257
  declare type ProgramStatement = ExportAllDeclaration | ExportDefaultDeclaration | ExportNamedDeclaration | ImportDeclaration | Statement | TSImportEqualsDeclaration | TSNamespaceExportDeclaration;
1250
1258
  declare type Property = PropertyComputedName | PropertyNonComputedName;
1251
1259
  declare interface PropertyBase extends BaseNode {
1260
+ type: AST_NODE_TYPES.Property;
1252
1261
  computed: boolean;
1253
1262
  key: PropertyName;
1254
1263
  kind: 'get' | 'init' | 'set';
1255
1264
  method: boolean;
1256
1265
  optional: boolean;
1257
1266
  shorthand: boolean;
1258
- type: AST_NODE_TYPES.Property;
1259
1267
  value: AssignmentPattern | BindingName | Expression | TSEmptyBodyFunctionExpression;
1260
1268
  }
1261
1269
  declare interface PropertyComputedName extends PropertyBase {
@@ -1363,27 +1371,27 @@ declare interface RegExpLiteral extends LiteralBase {
1363
1371
  value: RegExp | null;
1364
1372
  }
1365
1373
  declare interface RegularExpressionToken extends BaseToken {
1374
+ type: AST_TOKEN_TYPES.RegularExpression;
1366
1375
  regex: {
1367
1376
  flags: string;
1368
1377
  pattern: string;
1369
1378
  };
1370
- type: AST_TOKEN_TYPES.RegularExpression;
1371
1379
  }
1372
1380
  declare interface RestElement extends BaseNode {
1381
+ type: AST_NODE_TYPES.RestElement;
1373
1382
  argument: DestructuringPattern;
1374
1383
  decorators: Decorator[];
1375
1384
  optional: boolean;
1376
- type: AST_NODE_TYPES.RestElement;
1377
1385
  typeAnnotation: TSTypeAnnotation | undefined;
1378
1386
  value: AssignmentPattern | undefined;
1379
1387
  }
1380
1388
  declare interface ReturnStatement extends BaseNode {
1381
- argument: Expression | null;
1382
1389
  type: AST_NODE_TYPES.ReturnStatement;
1390
+ argument: Expression | null;
1383
1391
  }
1384
1392
  declare interface SequenceExpression extends BaseNode {
1385
- expressions: Expression[];
1386
1393
  type: AST_NODE_TYPES.SequenceExpression;
1394
+ expressions: Expression[];
1387
1395
  }
1388
1396
  declare interface SourceLocation {
1389
1397
  /**
@@ -1396,13 +1404,13 @@ declare interface SourceLocation {
1396
1404
  start: Position;
1397
1405
  }
1398
1406
  declare interface SpreadElement extends BaseNode {
1399
- argument: Expression;
1400
1407
  type: AST_NODE_TYPES.SpreadElement;
1408
+ argument: Expression;
1401
1409
  }
1402
1410
  declare type Statement = BlockStatement | BreakStatement | ClassDeclarationWithName | ContinueStatement | DebuggerStatement | DoWhileStatement | EmptyStatement | ExportAllDeclaration | ExportDefaultDeclaration | ExportNamedDeclaration | ExpressionStatement | ForInStatement | ForOfStatement | ForStatement | FunctionDeclarationWithName | IfStatement | ImportDeclaration | LabeledStatement | ReturnStatement | SwitchStatement | ThrowStatement | TryStatement | TSDeclareFunction | TSEnumDeclaration | TSExportAssignment | TSImportEqualsDeclaration | TSInterfaceDeclaration | TSModuleDeclaration | TSNamespaceExportDeclaration | TSTypeAliasDeclaration | VariableDeclaration | WhileStatement | WithStatement;
1403
1411
  declare interface StaticBlock extends BaseNode {
1404
- body: Statement[];
1405
1412
  type: AST_NODE_TYPES.StaticBlock;
1413
+ body: Statement[];
1406
1414
  }
1407
1415
  declare interface StringLiteral extends LiteralBase {
1408
1416
  value: string;
@@ -1414,33 +1422,33 @@ declare interface Super extends BaseNode {
1414
1422
  type: AST_NODE_TYPES.Super;
1415
1423
  }
1416
1424
  declare interface SwitchCase extends BaseNode {
1425
+ type: AST_NODE_TYPES.SwitchCase;
1417
1426
  consequent: Statement[];
1418
1427
  test: Expression | null;
1419
- type: AST_NODE_TYPES.SwitchCase;
1420
1428
  }
1421
1429
  declare interface SwitchStatement extends BaseNode {
1430
+ type: AST_NODE_TYPES.SwitchStatement;
1422
1431
  cases: SwitchCase[];
1423
1432
  discriminant: Expression;
1424
- type: AST_NODE_TYPES.SwitchStatement;
1425
1433
  }
1426
1434
  declare interface TaggedTemplateExpression extends BaseNode {
1435
+ type: AST_NODE_TYPES.TaggedTemplateExpression;
1427
1436
  quasi: TemplateLiteral;
1428
1437
  tag: Expression;
1429
- type: AST_NODE_TYPES.TaggedTemplateExpression;
1430
1438
  typeArguments: TSTypeParameterInstantiation | undefined;
1431
1439
  }
1432
1440
  declare interface TemplateElement extends BaseNode {
1433
- tail: boolean;
1434
1441
  type: AST_NODE_TYPES.TemplateElement;
1442
+ tail: boolean;
1435
1443
  value: {
1436
1444
  cooked: string;
1437
1445
  raw: string;
1438
1446
  };
1439
1447
  }
1440
1448
  declare interface TemplateLiteral extends BaseNode {
1449
+ type: AST_NODE_TYPES.TemplateLiteral;
1441
1450
  expressions: Expression[];
1442
1451
  quasis: TemplateElement[];
1443
- type: AST_NODE_TYPES.TemplateLiteral;
1444
1452
  }
1445
1453
  declare interface TemplateToken extends BaseToken {
1446
1454
  type: AST_TOKEN_TYPES.Template;
@@ -1449,15 +1457,15 @@ declare interface ThisExpression extends BaseNode {
1449
1457
  type: AST_NODE_TYPES.ThisExpression;
1450
1458
  }
1451
1459
  declare interface ThrowStatement extends BaseNode {
1452
- argument: Expression;
1453
1460
  type: AST_NODE_TYPES.ThrowStatement;
1461
+ argument: Expression;
1454
1462
  }
1455
1463
  declare type Token = BooleanToken | Comment | IdentifierToken | JSXIdentifierToken | JSXTextToken | KeywordToken | NullToken | NumericToken | PunctuatorToken | RegularExpressionToken | StringToken | TemplateToken;
1456
1464
  declare interface TryStatement extends BaseNode {
1465
+ type: AST_NODE_TYPES.TryStatement;
1457
1466
  block: BlockStatement;
1458
1467
  finalizer: BlockStatement | null;
1459
1468
  handler: CatchClause | null;
1460
- type: AST_NODE_TYPES.TryStatement;
1461
1469
  }
1462
1470
  declare type TSAbstractAccessorProperty = TSAbstractAccessorPropertyComputedName | TSAbstractAccessorPropertyNonComputedName;
1463
1471
  declare interface TSAbstractAccessorPropertyComputedName extends PropertyDefinitionComputedNameBase {
@@ -1491,12 +1499,12 @@ declare interface TSAnyKeyword extends BaseNode {
1491
1499
  type: AST_NODE_TYPES.TSAnyKeyword;
1492
1500
  }
1493
1501
  declare interface TSArrayType extends BaseNode {
1494
- elementType: TypeNode;
1495
1502
  type: AST_NODE_TYPES.TSArrayType;
1503
+ elementType: TypeNode;
1496
1504
  }
1497
1505
  declare interface TSAsExpression extends BaseNode {
1498
- expression: Expression;
1499
1506
  type: AST_NODE_TYPES.TSAsExpression;
1507
+ expression: Expression;
1500
1508
  typeAnnotation: TypeNode;
1501
1509
  }
1502
1510
  declare interface TSAsyncKeyword extends BaseNode {
@@ -1515,21 +1523,22 @@ declare interface TSClassImplements extends TSHeritageBase {
1515
1523
  type: AST_NODE_TYPES.TSClassImplements;
1516
1524
  }
1517
1525
  declare interface TSConditionalType extends BaseNode {
1526
+ type: AST_NODE_TYPES.TSConditionalType;
1518
1527
  checkType: TypeNode;
1519
1528
  extendsType: TypeNode;
1520
1529
  falseType: TypeNode;
1521
1530
  trueType: TypeNode;
1522
- type: AST_NODE_TYPES.TSConditionalType;
1523
1531
  }
1524
1532
  declare interface TSConstructorType extends TSFunctionSignatureBase {
1525
- abstract: boolean;
1526
1533
  type: AST_NODE_TYPES.TSConstructorType;
1534
+ abstract: boolean;
1527
1535
  }
1528
1536
  declare interface TSConstructSignatureDeclaration extends TSFunctionSignatureBase {
1529
1537
  type: AST_NODE_TYPES.TSConstructSignatureDeclaration;
1530
1538
  }
1531
1539
  declare type TSDeclareFunction = TSDeclareFunctionNoDeclare | TSDeclareFunctionWithDeclare;
1532
1540
  declare interface TSDeclareFunctionBase extends FunctionBase {
1541
+ type: AST_NODE_TYPES.TSDeclareFunction;
1533
1542
  /**
1534
1543
  * TS1183: An implementation cannot be declared in ambient contexts.
1535
1544
  */
@@ -1539,7 +1548,6 @@ declare interface TSDeclareFunctionBase extends FunctionBase {
1539
1548
  */
1540
1549
  declare: boolean;
1541
1550
  expression: false;
1542
- type: AST_NODE_TYPES.TSDeclareFunction;
1543
1551
  }
1544
1552
  /**
1545
1553
  * Function declaration without the `declare` keyword:
@@ -1578,15 +1586,16 @@ declare interface TSDeclareKeyword extends BaseNode {
1578
1586
  type: AST_NODE_TYPES.TSDeclareKeyword;
1579
1587
  }
1580
1588
  declare interface TSEmptyBodyFunctionExpression extends FunctionBase {
1589
+ type: AST_NODE_TYPES.TSEmptyBodyFunctionExpression;
1581
1590
  body: null;
1582
1591
  id: null;
1583
- type: AST_NODE_TYPES.TSEmptyBodyFunctionExpression;
1584
1592
  }
1585
1593
  declare interface TSEnumBody extends BaseNode {
1586
- members: TSEnumMember[];
1587
1594
  type: AST_NODE_TYPES.TSEnumBody;
1595
+ members: TSEnumMember[];
1588
1596
  }
1589
1597
  declare interface TSEnumDeclaration extends BaseNode {
1598
+ type: AST_NODE_TYPES.TSEnumDeclaration;
1590
1599
  /**
1591
1600
  * The body of the enum.
1592
1601
  */
@@ -1616,14 +1625,13 @@ declare interface TSEnumDeclaration extends BaseNode {
1616
1625
  * @deprecated Use {@link body} instead.
1617
1626
  */
1618
1627
  members: TSEnumMember[];
1619
- type: AST_NODE_TYPES.TSEnumDeclaration;
1620
1628
  }
1621
1629
  declare type TSEnumMember = TSEnumMemberComputedName | TSEnumMemberNonComputedName;
1622
1630
  declare interface TSEnumMemberBase extends BaseNode {
1631
+ type: AST_NODE_TYPES.TSEnumMember;
1623
1632
  computed: boolean;
1624
1633
  id: PropertyNameComputed | PropertyNameNonComputed;
1625
1634
  initializer: Expression | undefined;
1626
- type: AST_NODE_TYPES.TSEnumMember;
1627
1635
  }
1628
1636
  /**
1629
1637
  * this should only really happen in semantically invalid code (errors 1164 and 2452)
@@ -1648,15 +1656,15 @@ declare interface TSEnumMemberNonComputedName extends TSEnumMemberBase {
1648
1656
  id: PropertyNameNonComputed;
1649
1657
  }
1650
1658
  declare interface TSExportAssignment extends BaseNode {
1651
- expression: Expression;
1652
1659
  type: AST_NODE_TYPES.TSExportAssignment;
1660
+ expression: Expression;
1653
1661
  }
1654
1662
  declare interface TSExportKeyword extends BaseNode {
1655
1663
  type: AST_NODE_TYPES.TSExportKeyword;
1656
1664
  }
1657
1665
  declare interface TSExternalModuleReference extends BaseNode {
1658
- expression: StringLiteral;
1659
1666
  type: AST_NODE_TYPES.TSExternalModuleReference;
1667
+ expression: StringLiteral;
1660
1668
  }
1661
1669
  declare interface TSFunctionSignatureBase extends BaseNode {
1662
1670
  params: Parameter[];
@@ -1672,6 +1680,7 @@ declare interface TSHeritageBase extends BaseNode {
1672
1680
  }
1673
1681
  declare type TSImportEqualsDeclaration = TSImportEqualsNamespaceDeclaration | TSImportEqualsRequireDeclaration;
1674
1682
  declare interface TSImportEqualsDeclarationBase extends BaseNode {
1683
+ type: AST_NODE_TYPES.TSImportEqualsDeclaration;
1675
1684
  /**
1676
1685
  * The locally imported name.
1677
1686
  */
@@ -1691,7 +1700,6 @@ declare interface TSImportEqualsDeclarationBase extends BaseNode {
1691
1700
  * ```
1692
1701
  */
1693
1702
  moduleReference: Identifier | TSExternalModuleReference | TSQualifiedName;
1694
- type: AST_NODE_TYPES.TSImportEqualsDeclaration;
1695
1703
  }
1696
1704
  declare interface TSImportEqualsNamespaceDeclaration extends TSImportEqualsDeclarationBase {
1697
1705
  /**
@@ -1721,22 +1729,22 @@ declare interface TSImportEqualsRequireDeclaration extends TSImportEqualsDeclara
1721
1729
  moduleReference: TSExternalModuleReference;
1722
1730
  }
1723
1731
  declare interface TSImportType extends BaseNode {
1732
+ type: AST_NODE_TYPES.TSImportType;
1724
1733
  argument: TypeNode;
1725
1734
  qualifier: EntityName | null;
1726
- type: AST_NODE_TYPES.TSImportType;
1727
1735
  typeArguments: TSTypeParameterInstantiation | null;
1728
1736
  }
1729
1737
  declare interface TSIndexedAccessType extends BaseNode {
1738
+ type: AST_NODE_TYPES.TSIndexedAccessType;
1730
1739
  indexType: TypeNode;
1731
1740
  objectType: TypeNode;
1732
- type: AST_NODE_TYPES.TSIndexedAccessType;
1733
1741
  }
1734
1742
  declare interface TSIndexSignature extends BaseNode {
1743
+ type: AST_NODE_TYPES.TSIndexSignature;
1735
1744
  accessibility: Accessibility | undefined;
1736
1745
  parameters: Parameter[];
1737
1746
  readonly: boolean;
1738
1747
  static: boolean;
1739
- type: AST_NODE_TYPES.TSIndexSignature;
1740
1748
  typeAnnotation: TSTypeAnnotation | undefined;
1741
1749
  }
1742
1750
  declare interface TSInferType extends BaseNode {
@@ -1744,15 +1752,16 @@ declare interface TSInferType extends BaseNode {
1744
1752
  typeParameter: TSTypeParameter;
1745
1753
  }
1746
1754
  declare interface TSInstantiationExpression extends BaseNode {
1747
- expression: Expression;
1748
1755
  type: AST_NODE_TYPES.TSInstantiationExpression;
1756
+ expression: Expression;
1749
1757
  typeArguments: TSTypeParameterInstantiation;
1750
1758
  }
1751
1759
  declare interface TSInterfaceBody extends BaseNode {
1752
- body: TypeElement[];
1753
1760
  type: AST_NODE_TYPES.TSInterfaceBody;
1761
+ body: TypeElement[];
1754
1762
  }
1755
1763
  declare interface TSInterfaceDeclaration extends BaseNode {
1764
+ type: AST_NODE_TYPES.TSInterfaceDeclaration;
1756
1765
  /**
1757
1766
  * The body of the interface
1758
1767
  */
@@ -1769,7 +1778,6 @@ declare interface TSInterfaceDeclaration extends BaseNode {
1769
1778
  * The name of this interface
1770
1779
  */
1771
1780
  id: Identifier;
1772
- type: AST_NODE_TYPES.TSInterfaceDeclaration;
1773
1781
  /**
1774
1782
  * The generic type parameters declared for the interface. Empty declaration
1775
1783
  * (`<>`) is different from no declaration.
@@ -1787,22 +1795,23 @@ declare interface TSIntrinsicKeyword extends BaseNode {
1787
1795
  type: AST_NODE_TYPES.TSIntrinsicKeyword;
1788
1796
  }
1789
1797
  declare interface TSLiteralType extends BaseNode {
1790
- literal: LiteralExpression | UnaryExpression | UpdateExpression;
1791
1798
  type: AST_NODE_TYPES.TSLiteralType;
1799
+ literal: LiteralExpression | UnaryExpression | UpdateExpression;
1792
1800
  }
1793
1801
  declare interface TSMappedType extends BaseNode {
1802
+ type: AST_NODE_TYPES.TSMappedType;
1794
1803
  constraint: TypeNode;
1795
1804
  key: Identifier;
1796
1805
  nameType: TypeNode | null;
1797
1806
  optional: '+' | '-' | boolean | undefined;
1798
1807
  readonly: '+' | '-' | boolean | undefined;
1799
- type: AST_NODE_TYPES.TSMappedType;
1800
1808
  typeAnnotation: TypeNode | undefined;
1801
1809
  /** @deprecated Use {@link `constraint`} and {@link `key`} instead. */
1802
1810
  typeParameter: TSTypeParameter;
1803
1811
  }
1804
1812
  declare type TSMethodSignature = TSMethodSignatureComputedName | TSMethodSignatureNonComputedName;
1805
1813
  declare interface TSMethodSignatureBase extends BaseNode {
1814
+ type: AST_NODE_TYPES.TSMethodSignature;
1806
1815
  accessibility: Accessibility | undefined;
1807
1816
  computed: boolean;
1808
1817
  key: PropertyName;
@@ -1812,7 +1821,6 @@ declare interface TSMethodSignatureBase extends BaseNode {
1812
1821
  readonly: boolean;
1813
1822
  returnType: TSTypeAnnotation | undefined;
1814
1823
  static: boolean;
1815
- type: AST_NODE_TYPES.TSMethodSignature;
1816
1824
  typeParameters: TSTypeParameterDeclaration | undefined;
1817
1825
  }
1818
1826
  declare interface TSMethodSignatureComputedName extends TSMethodSignatureBase {
@@ -1824,11 +1832,12 @@ declare interface TSMethodSignatureNonComputedName extends TSMethodSignatureBase
1824
1832
  key: PropertyNameNonComputed;
1825
1833
  }
1826
1834
  declare interface TSModuleBlock extends BaseNode {
1827
- body: ProgramStatement[];
1828
1835
  type: AST_NODE_TYPES.TSModuleBlock;
1836
+ body: ProgramStatement[];
1829
1837
  }
1830
1838
  declare type TSModuleDeclaration = TSModuleDeclarationGlobal | TSModuleDeclarationModule | TSModuleDeclarationNamespace;
1831
1839
  declare interface TSModuleDeclarationBase extends BaseNode {
1840
+ type: AST_NODE_TYPES.TSModuleDeclaration;
1832
1841
  /**
1833
1842
  * The body of the module.
1834
1843
  * This can only be `undefined` for the code `declare module 'mod';`
@@ -1876,7 +1885,6 @@ declare interface TSModuleDeclarationBase extends BaseNode {
1876
1885
  * ```
1877
1886
  */
1878
1887
  kind: TSModuleDeclarationKind;
1879
- type: AST_NODE_TYPES.TSModuleDeclaration;
1880
1888
  }
1881
1889
  declare interface TSModuleDeclarationGlobal extends TSModuleDeclarationBase {
1882
1890
  body: TSModuleBlock;
@@ -1934,10 +1942,10 @@ declare interface TSModuleDeclarationNamespace extends TSModuleDeclarationBase {
1934
1942
  kind: 'namespace';
1935
1943
  }
1936
1944
  declare interface TSNamedTupleMember extends BaseNode {
1945
+ type: AST_NODE_TYPES.TSNamedTupleMember;
1937
1946
  elementType: TypeNode;
1938
1947
  label: Identifier;
1939
1948
  optional: boolean;
1940
- type: AST_NODE_TYPES.TSNamedTupleMember;
1941
1949
  }
1942
1950
  /**
1943
1951
  * For the following declaration:
@@ -1946,18 +1954,18 @@ declare interface TSNamedTupleMember extends BaseNode {
1946
1954
  * ```
1947
1955
  */
1948
1956
  declare interface TSNamespaceExportDeclaration extends BaseNode {
1957
+ type: AST_NODE_TYPES.TSNamespaceExportDeclaration;
1949
1958
  /**
1950
1959
  * The name of the global variable that's exported as namespace
1951
1960
  */
1952
1961
  id: Identifier;
1953
- type: AST_NODE_TYPES.TSNamespaceExportDeclaration;
1954
1962
  }
1955
1963
  declare interface TSNeverKeyword extends BaseNode {
1956
1964
  type: AST_NODE_TYPES.TSNeverKeyword;
1957
1965
  }
1958
1966
  declare interface TSNonNullExpression extends BaseNode {
1959
- expression: Expression;
1960
1967
  type: AST_NODE_TYPES.TSNonNullExpression;
1968
+ expression: Expression;
1961
1969
  }
1962
1970
  declare interface TSNullKeyword extends BaseNode {
1963
1971
  type: AST_NODE_TYPES.TSNullKeyword;
@@ -1973,26 +1981,26 @@ declare interface TSOptionalType extends BaseNode {
1973
1981
  typeAnnotation: TypeNode;
1974
1982
  }
1975
1983
  declare interface TSParameterProperty extends BaseNode {
1984
+ type: AST_NODE_TYPES.TSParameterProperty;
1976
1985
  accessibility: Accessibility | undefined;
1977
1986
  decorators: Decorator[];
1978
1987
  override: boolean;
1979
1988
  parameter: AssignmentPattern | BindingName | RestElement;
1980
1989
  readonly: boolean;
1981
1990
  static: boolean;
1982
- type: AST_NODE_TYPES.TSParameterProperty;
1983
1991
  }
1984
1992
  declare interface TSPrivateKeyword extends BaseNode {
1985
1993
  type: AST_NODE_TYPES.TSPrivateKeyword;
1986
1994
  }
1987
1995
  declare type TSPropertySignature = TSPropertySignatureComputedName | TSPropertySignatureNonComputedName;
1988
1996
  declare interface TSPropertySignatureBase extends BaseNode {
1997
+ type: AST_NODE_TYPES.TSPropertySignature;
1989
1998
  accessibility: Accessibility | undefined;
1990
1999
  computed: boolean;
1991
2000
  key: PropertyName;
1992
2001
  optional: boolean;
1993
2002
  readonly: boolean;
1994
2003
  static: boolean;
1995
- type: AST_NODE_TYPES.TSPropertySignature;
1996
2004
  typeAnnotation: TSTypeAnnotation | undefined;
1997
2005
  }
1998
2006
  declare interface TSPropertySignatureComputedName extends TSPropertySignatureBase {
@@ -2010,9 +2018,9 @@ declare interface TSPublicKeyword extends BaseNode {
2010
2018
  type: AST_NODE_TYPES.TSPublicKeyword;
2011
2019
  }
2012
2020
  declare interface TSQualifiedName extends BaseNode {
2021
+ type: AST_NODE_TYPES.TSQualifiedName;
2013
2022
  left: EntityName;
2014
2023
  right: Identifier;
2015
- type: AST_NODE_TYPES.TSQualifiedName;
2016
2024
  }
2017
2025
  declare interface TSReadonlyKeyword extends BaseNode {
2018
2026
  type: AST_NODE_TYPES.TSReadonlyKeyword;
@@ -2022,8 +2030,8 @@ declare interface TSRestType extends BaseNode {
2022
2030
  typeAnnotation: TypeNode;
2023
2031
  }
2024
2032
  declare interface TSSatisfiesExpression extends BaseNode {
2025
- expression: Expression;
2026
2033
  type: AST_NODE_TYPES.TSSatisfiesExpression;
2034
+ expression: Expression;
2027
2035
  typeAnnotation: TypeNode;
2028
2036
  }
2029
2037
  declare interface TSStaticKeyword extends BaseNode {
@@ -2036,18 +2044,19 @@ declare interface TSSymbolKeyword extends BaseNode {
2036
2044
  type: AST_NODE_TYPES.TSSymbolKeyword;
2037
2045
  }
2038
2046
  declare interface TSTemplateLiteralType extends BaseNode {
2039
- quasis: TemplateElement[];
2040
2047
  type: AST_NODE_TYPES.TSTemplateLiteralType;
2048
+ quasis: TemplateElement[];
2041
2049
  types: TypeNode[];
2042
2050
  }
2043
2051
  declare interface TSThisType extends BaseNode {
2044
2052
  type: AST_NODE_TYPES.TSThisType;
2045
2053
  }
2046
2054
  declare interface TSTupleType extends BaseNode {
2047
- elementTypes: TypeNode[];
2048
2055
  type: AST_NODE_TYPES.TSTupleType;
2056
+ elementTypes: TypeNode[];
2049
2057
  }
2050
2058
  declare interface TSTypeAliasDeclaration extends BaseNode {
2059
+ type: AST_NODE_TYPES.TSTypeAliasDeclaration;
2051
2060
  /**
2052
2061
  * Whether the type was `declare`d.
2053
2062
  * @example
@@ -2060,7 +2069,6 @@ declare interface TSTypeAliasDeclaration extends BaseNode {
2060
2069
  * The name of the type.
2061
2070
  */
2062
2071
  id: Identifier;
2063
- type: AST_NODE_TYPES.TSTypeAliasDeclaration;
2064
2072
  /**
2065
2073
  * The "value" (type) of the declaration
2066
2074
  */
@@ -2076,45 +2084,45 @@ declare interface TSTypeAnnotation extends BaseNode {
2076
2084
  typeAnnotation: TypeNode;
2077
2085
  }
2078
2086
  declare interface TSTypeAssertion extends BaseNode {
2079
- expression: Expression;
2080
2087
  type: AST_NODE_TYPES.TSTypeAssertion;
2088
+ expression: Expression;
2081
2089
  typeAnnotation: TypeNode;
2082
2090
  }
2083
2091
  declare interface TSTypeLiteral extends BaseNode {
2084
- members: TypeElement[];
2085
2092
  type: AST_NODE_TYPES.TSTypeLiteral;
2093
+ members: TypeElement[];
2086
2094
  }
2087
2095
  declare interface TSTypeOperator extends BaseNode {
2088
- operator: 'keyof' | 'readonly' | 'unique';
2089
2096
  type: AST_NODE_TYPES.TSTypeOperator;
2097
+ operator: 'keyof' | 'readonly' | 'unique';
2090
2098
  typeAnnotation: TypeNode | undefined;
2091
2099
  }
2092
2100
  declare interface TSTypeParameter extends BaseNode {
2101
+ type: AST_NODE_TYPES.TSTypeParameter;
2093
2102
  const: boolean;
2094
2103
  constraint: TypeNode | undefined;
2095
2104
  default: TypeNode | undefined;
2096
2105
  in: boolean;
2097
2106
  name: Identifier;
2098
2107
  out: boolean;
2099
- type: AST_NODE_TYPES.TSTypeParameter;
2100
2108
  }
2101
2109
  declare interface TSTypeParameterDeclaration extends BaseNode {
2102
- params: TSTypeParameter[];
2103
2110
  type: AST_NODE_TYPES.TSTypeParameterDeclaration;
2111
+ params: TSTypeParameter[];
2104
2112
  }
2105
2113
  declare interface TSTypeParameterInstantiation extends BaseNode {
2106
- params: TypeNode[];
2107
2114
  type: AST_NODE_TYPES.TSTypeParameterInstantiation;
2115
+ params: TypeNode[];
2108
2116
  }
2109
2117
  declare interface TSTypePredicate extends BaseNode {
2118
+ type: AST_NODE_TYPES.TSTypePredicate;
2110
2119
  asserts: boolean;
2111
2120
  parameterName: Identifier | TSThisType;
2112
- type: AST_NODE_TYPES.TSTypePredicate;
2113
2121
  typeAnnotation: TSTypeAnnotation | null;
2114
2122
  }
2115
2123
  declare interface TSTypeQuery extends BaseNode {
2116
- exprName: EntityName | TSImportType;
2117
2124
  type: AST_NODE_TYPES.TSTypeQuery;
2125
+ exprName: EntityName | TSImportType;
2118
2126
  typeArguments: TSTypeParameterInstantiation | undefined;
2119
2127
  }
2120
2128
  declare interface TSTypeReference extends BaseNode {
@@ -2138,8 +2146,8 @@ declare interface TSVoidKeyword extends BaseNode {
2138
2146
  declare type TypeElement = TSCallSignatureDeclaration | TSConstructSignatureDeclaration | TSIndexSignature | TSMethodSignature | TSPropertySignature;
2139
2147
  declare type TypeNode = TSAbstractKeyword | TSAnyKeyword | TSArrayType | TSAsyncKeyword | TSBigIntKeyword | TSBooleanKeyword | TSConditionalType | TSConstructorType | TSDeclareKeyword | TSExportKeyword | TSFunctionType | TSImportType | TSIndexedAccessType | TSInferType | TSIntersectionType | TSIntrinsicKeyword | TSLiteralType | TSMappedType | TSNamedTupleMember | TSNeverKeyword | TSNullKeyword | TSNumberKeyword | TSObjectKeyword | TSOptionalType | TSPrivateKeyword | TSProtectedKeyword | TSPublicKeyword | TSQualifiedName | TSReadonlyKeyword | TSRestType | TSStaticKeyword | TSStringKeyword | TSSymbolKeyword | TSTemplateLiteralType | TSThisType | TSTupleType | TSTypeLiteral | TSTypeOperator | TSTypePredicate | TSTypeQuery | TSTypeReference | TSUndefinedKeyword | TSUnionType | TSUnknownKeyword | TSVoidKeyword;
2140
2148
  declare interface UnaryExpression extends UnaryExpressionBase {
2141
- operator: '!' | '+' | '~' | '-' | 'delete' | 'typeof' | 'void';
2142
2149
  type: AST_NODE_TYPES.UnaryExpression;
2150
+ operator: '!' | '+' | '~' | '-' | 'delete' | 'typeof' | 'void';
2143
2151
  }
2144
2152
  declare interface UnaryExpressionBase extends BaseNode {
2145
2153
  argument: Expression;
@@ -2147,11 +2155,12 @@ declare interface UnaryExpressionBase extends BaseNode {
2147
2155
  prefix: boolean;
2148
2156
  }
2149
2157
  declare interface UpdateExpression extends UnaryExpressionBase {
2150
- operator: '++' | '--';
2151
2158
  type: AST_NODE_TYPES.UpdateExpression;
2159
+ operator: '++' | '--';
2152
2160
  }
2153
2161
  declare type UsingDeclaration = UsingInForOfDeclaration | UsingInNormalContextDeclaration;
2154
2162
  declare interface UsingDeclarationBase extends BaseNode {
2163
+ type: AST_NODE_TYPES.VariableDeclaration;
2155
2164
  /**
2156
2165
  * This value will always be `false`
2157
2166
  * because 'declare' modifier cannot appear on a 'using' declaration.
@@ -2166,7 +2175,6 @@ declare interface UsingDeclarationBase extends BaseNode {
2166
2175
  * ```
2167
2176
  */
2168
2177
  kind: 'await using' | 'using';
2169
- type: AST_NODE_TYPES.VariableDeclaration;
2170
2178
  }
2171
2179
  declare type UsingDeclarator = UsingInForOfDeclarator | UsingInNormalContextDeclarator;
2172
2180
  declare interface UsingInForOfDeclaration extends UsingDeclarationBase {
@@ -2206,6 +2214,7 @@ declare type ValueOf<T> = T[keyof T];
2206
2214
  declare type VariableDeclaration = LetOrConstOrVarDeclaration | UsingDeclaration;
2207
2215
  declare type VariableDeclarator = LetOrConstOrVarDeclarator | UsingDeclarator;
2208
2216
  declare interface VariableDeclaratorBase extends BaseNode {
2217
+ type: AST_NODE_TYPES.VariableDeclarator;
2209
2218
  /**
2210
2219
  * Whether there's definite assignment assertion (`let x!: number`).
2211
2220
  * If `true`, then: `id` must be an identifier with a type annotation,
@@ -2221,7 +2230,6 @@ declare interface VariableDeclaratorBase extends BaseNode {
2221
2230
  * in a `declare const`.
2222
2231
  */
2223
2232
  init: Expression | null;
2224
- type: AST_NODE_TYPES.VariableDeclarator;
2225
2233
  }
2226
2234
  declare interface VariableDeclaratorDefiniteAssignment extends VariableDeclaratorBase {
2227
2235
  definite: true;
@@ -2239,19 +2247,19 @@ declare interface VariableDeclaratorNoInit extends VariableDeclaratorBase {
2239
2247
  init: null;
2240
2248
  }
2241
2249
  declare interface WhileStatement extends BaseNode {
2250
+ type: AST_NODE_TYPES.WhileStatement;
2242
2251
  body: Statement;
2243
2252
  test: Expression;
2244
- type: AST_NODE_TYPES.WhileStatement;
2245
2253
  }
2246
2254
  declare interface WithStatement extends BaseNode {
2255
+ type: AST_NODE_TYPES.WithStatement;
2247
2256
  body: Statement;
2248
2257
  object: Expression;
2249
- type: AST_NODE_TYPES.WithStatement;
2250
2258
  }
2251
2259
  declare interface YieldExpression extends BaseNode {
2260
+ type: AST_NODE_TYPES.YieldExpression;
2252
2261
  argument: Expression | undefined;
2253
2262
  delegate: boolean;
2254
- type: AST_NODE_TYPES.YieldExpression;
2255
2263
  }
2256
2264
 
2257
2265
  /**