@swc/core 1.2.212 → 1.2.218

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/types.d.ts CHANGED
@@ -874,29 +874,31 @@ export interface HasDecorator {
874
874
  export interface Class extends HasSpan, HasDecorator {
875
875
  body: ClassMember[];
876
876
  superClass?: Expression;
877
- is_abstract: boolean;
878
- typeParams: TsTypeParameterDeclaration;
877
+ isAbstract: boolean;
878
+ typeParams?: TsTypeParameterDeclaration;
879
879
  superTypeParams?: TsTypeParameterInstantiation;
880
880
  implements: TsExpressionWithTypeArguments[];
881
881
  }
882
- export declare type ClassMember = Constructor | ClassMethod | PrivateMethod | ClassProperty | PrivateProperty | TsIndexSignature;
882
+ export declare type ClassMember = Constructor | ClassMethod | PrivateMethod | ClassProperty | PrivateProperty | TsIndexSignature | EmptyStatement | StaticBlock;
883
883
  export interface ClassPropertyBase extends Node, HasSpan, HasDecorator {
884
884
  value?: Expression;
885
885
  typeAnnotation?: TsTypeAnnotation;
886
- is_static: boolean;
886
+ isStatic: boolean;
887
887
  accessibility?: Accessibility;
888
- is_optional: boolean;
888
+ isOptional: boolean;
889
+ isOverride: boolean;
889
890
  readonly: boolean;
891
+ definite: boolean;
890
892
  }
891
893
  export interface ClassProperty extends ClassPropertyBase {
892
894
  type: "ClassProperty";
893
895
  key: PropertyName;
896
+ isAbstract: boolean;
897
+ declare: boolean;
894
898
  }
895
899
  export interface PrivateProperty extends ClassPropertyBase {
896
900
  type: "PrivateProperty";
897
901
  key: PrivateName;
898
- is_abstract: boolean;
899
- definite: boolean;
900
902
  }
901
903
  export interface Param extends Node, HasSpan, HasDecorator {
902
904
  type: "Parameter";
@@ -905,18 +907,19 @@ export interface Param extends Node, HasSpan, HasDecorator {
905
907
  export interface Constructor extends Node, HasSpan {
906
908
  type: "Constructor";
907
909
  key: PropertyName;
908
- params: (Param | TsParameterProperty)[];
909
- body: BlockStatement;
910
+ params: (TsParameterProperty | Param)[];
911
+ body?: BlockStatement;
910
912
  accessibility?: Accessibility;
911
- is_optional: boolean;
913
+ isOptional: boolean;
912
914
  }
913
915
  export interface ClassMethodBase extends Node, HasSpan {
914
916
  function: Fn;
915
917
  kind: MethodKind;
916
- is_static: boolean;
918
+ isStatic: boolean;
917
919
  accessibility?: Accessibility;
918
- is_abstract: boolean;
919
- is_optional: boolean;
920
+ isAbstract: boolean;
921
+ isOptional: boolean;
922
+ isOverride: boolean;
920
923
  }
921
924
  export interface ClassMethod extends ClassMethodBase {
922
925
  type: "ClassMethod";
@@ -926,11 +929,15 @@ export interface PrivateMethod extends ClassMethodBase {
926
929
  type: "PrivateMethod";
927
930
  key: PrivateName;
928
931
  }
932
+ export interface StaticBlock extends Node, HasSpan {
933
+ type: "StaticBlock";
934
+ body: BlockStatement;
935
+ }
929
936
  export interface Decorator extends Node, HasSpan {
930
937
  type: "Decorator";
931
938
  expression: Expression;
932
939
  }
933
- export declare type MethodKind = "method" | "setter" | "getter";
940
+ export declare type MethodKind = "method" | "getter" | "setter";
934
941
  export declare type Declaration = ClassDeclaration | FunctionDeclaration | VariableDeclaration | TsInterfaceDeclaration | TsTypeAliasDeclaration | TsEnumDeclaration | TsModuleDeclaration;
935
942
  export interface FunctionDeclaration extends Fn {
936
943
  type: "FunctionDeclaration";
@@ -955,15 +962,27 @@ export interface VariableDeclarator extends Node, HasSpan {
955
962
  init?: Expression;
956
963
  definite: boolean;
957
964
  }
958
- export declare type Expression = ThisExpression | ArrayExpression | ObjectExpression | FunctionExpression | UnaryExpression | UpdateExpression | BinaryExpression | AssignmentExpression | MemberExpression | SuperPropExpression | ConditionalExpression | CallExpression | NewExpression | SequenceExpression | Identifier | Literal | TemplateLiteral | TaggedTemplateExpression | ArrowFunctionExpression | ClassExpression | YieldExpression | MetaProperty | AwaitExpression | ParenthesisExpression | JSXMemberExpression | JSXNamespacedName | JSXEmptyExpression | JSXElement | JSXFragment | TsTypeAssertion | TsConstAssertion | TsNonNullExpression | TsAsExpression | PrivateName | OptionalChainingExpression | Invalid;
965
+ export declare type Expression = ThisExpression | ArrayExpression | ObjectExpression | FunctionExpression | UnaryExpression | UpdateExpression | BinaryExpression | AssignmentExpression | MemberExpression | SuperPropExpression | ConditionalExpression | CallExpression | NewExpression | SequenceExpression | Identifier | Literal | TemplateLiteral | TaggedTemplateExpression | ArrowFunctionExpression | ClassExpression | YieldExpression | MetaProperty | AwaitExpression | ParenthesisExpression | JSXMemberExpression | JSXNamespacedName | JSXEmptyExpression | JSXElement | JSXFragment | TsTypeAssertion | TsConstAssertion | TsNonNullExpression | TsAsExpression | TsInstantiation | PrivateName | OptionalChainingExpression | Invalid;
959
966
  interface ExpressionBase extends Node, HasSpan {
960
967
  }
968
+ export interface Identifier extends ExpressionBase {
969
+ type: "Identifier";
970
+ value: string;
971
+ optional: boolean;
972
+ }
961
973
  export interface OptionalChainingExpression extends ExpressionBase {
962
974
  type: "OptionalChainingExpression";
975
+ questionDotToken: Span;
963
976
  /**
964
977
  * Call expression or member expression.
965
978
  */
966
- base: Expression;
979
+ base: MemberExpression | OptionalChainingCall;
980
+ }
981
+ export interface OptionalChainingCall extends ExpressionBase {
982
+ type: "CallExpression";
983
+ callee: Expression;
984
+ arguments: ExprOrSpread[];
985
+ typeArguments?: TsTypeParameterInstantiation;
967
986
  }
968
987
  export interface ThisExpression extends ExpressionBase {
969
988
  type: "ThisExpression";
@@ -978,13 +997,12 @@ export interface ExprOrSpread {
978
997
  }
979
998
  export interface ObjectExpression extends ExpressionBase {
980
999
  type: "ObjectExpression";
981
- properties: (Property | SpreadElement)[];
1000
+ properties: (SpreadElement | Property)[];
982
1001
  }
983
1002
  export interface Argument {
984
1003
  spread?: Span;
985
1004
  expression: Expression;
986
1005
  }
987
- export declare type PropertOrSpread = Property | SpreadElement;
988
1006
  export interface SpreadElement extends Node {
989
1007
  type: "SpreadElement";
990
1008
  spread: Span;
@@ -1009,16 +1027,16 @@ export interface BinaryExpression extends ExpressionBase {
1009
1027
  }
1010
1028
  export interface FunctionExpression extends Fn, ExpressionBase {
1011
1029
  type: "FunctionExpression";
1012
- identifier: Identifier;
1030
+ identifier?: Identifier;
1013
1031
  }
1014
1032
  export interface ClassExpression extends Class, ExpressionBase {
1015
1033
  type: "ClassExpression";
1016
- identifier: Identifier;
1034
+ identifier?: Identifier;
1017
1035
  }
1018
1036
  export interface AssignmentExpression extends ExpressionBase {
1019
1037
  type: "AssignmentExpression";
1020
1038
  operator: AssignmentOperator;
1021
- left: Pattern | Expression;
1039
+ left: Expression | Pattern;
1022
1040
  right: Expression;
1023
1041
  }
1024
1042
  export interface MemberExpression extends ExpressionBase {
@@ -1028,7 +1046,7 @@ export interface MemberExpression extends ExpressionBase {
1028
1046
  }
1029
1047
  export interface SuperPropExpression extends ExpressionBase {
1030
1048
  type: "SuperPropExpression";
1031
- object: Super;
1049
+ obj: Super;
1032
1050
  property: Identifier | ComputedPropName;
1033
1051
  }
1034
1052
  export interface ConditionalExpression extends ExpressionBase {
@@ -1045,14 +1063,14 @@ export interface Import extends Node, HasSpan {
1045
1063
  }
1046
1064
  export interface CallExpression extends ExpressionBase {
1047
1065
  type: "CallExpression";
1048
- callee: Expression | Super | Import;
1066
+ callee: Super | Import | Expression;
1049
1067
  arguments: Argument[];
1050
1068
  typeArguments?: TsTypeParameterInstantiation;
1051
1069
  }
1052
1070
  export interface NewExpression extends ExpressionBase {
1053
1071
  type: "NewExpression";
1054
1072
  callee: Expression;
1055
- arguments: Argument[];
1073
+ arguments?: Argument[];
1056
1074
  typeArguments?: TsTypeParameterInstantiation;
1057
1075
  }
1058
1076
  export interface SequenceExpression extends ExpressionBase {
@@ -1073,9 +1091,9 @@ export interface YieldExpression extends ExpressionBase {
1073
1091
  argument?: Expression;
1074
1092
  delegate: boolean;
1075
1093
  }
1076
- export interface MetaProperty extends Node {
1094
+ export interface MetaProperty extends Node, HasSpan {
1077
1095
  type: "MetaProperty";
1078
- kind: 'ImportMeta' | 'NewTarget';
1096
+ kind: "new.target" | "import.meta";
1079
1097
  }
1080
1098
  export interface AwaitExpression extends ExpressionBase {
1081
1099
  type: "AwaitExpression";
@@ -1089,14 +1107,14 @@ export interface TemplateLiteral extends ExpressionBase {
1089
1107
  export interface TaggedTemplateExpression extends ExpressionBase {
1090
1108
  type: "TaggedTemplateExpression";
1091
1109
  tag: Expression;
1110
+ typeParameters?: TsTypeParameterInstantiation;
1092
1111
  template: TemplateLiteral;
1093
- typeParameters: TsTypeParameterInstantiation;
1094
1112
  }
1095
1113
  export interface TemplateElement extends ExpressionBase {
1096
1114
  type: "TemplateElement";
1097
1115
  tail: boolean;
1098
- cooked: StringLiteral;
1099
- raw: StringLiteral;
1116
+ cooked?: string;
1117
+ raw: string;
1100
1118
  }
1101
1119
  export interface ParenthesisExpression extends ExpressionBase {
1102
1120
  type: "ParenthesisExpression";
@@ -1104,20 +1122,15 @@ export interface ParenthesisExpression extends ExpressionBase {
1104
1122
  }
1105
1123
  export interface Fn extends HasSpan, HasDecorator {
1106
1124
  params: Param[];
1107
- body: BlockStatement;
1125
+ body?: BlockStatement;
1108
1126
  generator: boolean;
1109
1127
  async: boolean;
1110
1128
  typeParameters?: TsTypeParameterDeclaration;
1111
1129
  returnType?: TsTypeAnnotation;
1112
1130
  }
1113
- interface PatternBase {
1131
+ interface PatternBase extends Node, HasSpan {
1114
1132
  typeAnnotation?: TsTypeAnnotation;
1115
1133
  }
1116
- export interface Identifier extends HasSpan, PatternBase {
1117
- type: "Identifier";
1118
- value: string;
1119
- optional: boolean;
1120
- }
1121
1134
  export interface PrivateName extends ExpressionBase {
1122
1135
  type: "PrivateName";
1123
1136
  id: Identifier;
@@ -1139,12 +1152,12 @@ export interface JSXNamespacedName extends Node {
1139
1152
  export interface JSXEmptyExpression extends Node, HasSpan {
1140
1153
  type: "JSXEmptyExpression";
1141
1154
  }
1142
- export interface JSXExpressionContainer extends Node {
1155
+ export interface JSXExpressionContainer extends Node, HasSpan {
1143
1156
  type: "JSXExpressionContainer";
1144
1157
  expression: JSXExpression;
1145
1158
  }
1146
1159
  export declare type JSXExpression = JSXEmptyExpression | Expression;
1147
- export interface JSXSpreadChild extends Node {
1160
+ export interface JSXSpreadChild extends Node, HasSpan {
1148
1161
  type: "JSXSpreadChild";
1149
1162
  expression: Expression;
1150
1163
  }
@@ -1152,7 +1165,7 @@ export declare type JSXElementName = Identifier | JSXMemberExpression | JSXNames
1152
1165
  export interface JSXOpeningElement extends Node, HasSpan {
1153
1166
  type: "JSXOpeningElement";
1154
1167
  name: JSXElementName;
1155
- attributes?: JSXAttributeOrSpread[];
1168
+ attributes: JSXAttributeOrSpread[];
1156
1169
  selfClosing: boolean;
1157
1170
  typeArguments?: TsTypeParameterInstantiation;
1158
1171
  }
@@ -1192,11 +1205,11 @@ export interface JSXOpeningFragment extends Node, HasSpan {
1192
1205
  export interface JSXClosingFragment extends Node, HasSpan {
1193
1206
  type: "JSXClosingFragment";
1194
1207
  }
1195
- export declare type Literal = StringLiteral | BooleanLiteral | NullLiteral | NumericLiteral | RegExpLiteral | JSXText;
1208
+ export declare type Literal = StringLiteral | BooleanLiteral | NullLiteral | NumericLiteral | BigIntLiteral | RegExpLiteral | JSXText;
1196
1209
  export interface StringLiteral extends Node, HasSpan {
1197
1210
  type: "StringLiteral";
1198
1211
  value: string;
1199
- hasEscape: boolean;
1212
+ raw?: string;
1200
1213
  }
1201
1214
  export interface BooleanLiteral extends Node, HasSpan {
1202
1215
  type: "BooleanLiteral";
@@ -1213,10 +1226,12 @@ export interface RegExpLiteral extends Node, HasSpan {
1213
1226
  export interface NumericLiteral extends Node, HasSpan {
1214
1227
  type: "NumericLiteral";
1215
1228
  value: number;
1229
+ raw?: string;
1216
1230
  }
1217
1231
  export interface BigIntLiteral extends Node, HasSpan {
1218
1232
  type: "BigIntLiteral";
1219
1233
  value: bigint;
1234
+ raw?: string;
1220
1235
  }
1221
1236
  export declare type ModuleDeclaration = ImportDeclaration | ExportDeclaration | ExportNamedDeclaration | ExportDefaultDeclaration | ExportDefaultExpression | ExportAllDeclaration | TsImportEqualsDeclaration | TsExportAssignment | TsNamespaceExportDeclaration;
1222
1237
  export interface ExportDefaultExpression extends Node, HasSpan {
@@ -1229,13 +1244,15 @@ export interface ExportDeclaration extends Node, HasSpan {
1229
1244
  }
1230
1245
  export interface ImportDeclaration extends Node, HasSpan {
1231
1246
  type: "ImportDeclaration";
1232
- typeOnly?: boolean;
1233
1247
  specifiers: ImportSpecifier[];
1234
1248
  source: StringLiteral;
1249
+ typeOnly: boolean;
1250
+ asserts?: ObjectExpression;
1235
1251
  }
1236
1252
  export interface ExportAllDeclaration extends Node, HasSpan {
1237
1253
  type: "ExportAllDeclaration";
1238
1254
  source: StringLiteral;
1255
+ asserts?: ObjectExpression;
1239
1256
  }
1240
1257
  /**
1241
1258
  * - `export { foo } from 'mod'`
@@ -1246,6 +1263,7 @@ export interface ExportNamedDeclaration extends Node, HasSpan {
1246
1263
  specifiers: ExportSpecifier[];
1247
1264
  source?: StringLiteral;
1248
1265
  typeOnly: boolean;
1266
+ asserts?: ObjectExpression;
1249
1267
  }
1250
1268
  export interface ExportDefaultDeclaration extends Node, HasSpan {
1251
1269
  type: "ExportDefaultDeclaration";
@@ -1279,16 +1297,17 @@ export interface ImportNamespaceSpecifier extends Node, HasSpan {
1279
1297
  export interface NamedImportSpecifier extends Node, HasSpan {
1280
1298
  type: "ImportSpecifier";
1281
1299
  local: Identifier;
1282
- imported: Identifier | null;
1283
- isTypeOnly?: boolean;
1300
+ imported?: ModuleExportName;
1301
+ isTypeOnly: boolean;
1284
1302
  }
1303
+ export declare type ModuleExportName = Identifier | StringLiteral;
1285
1304
  export declare type ExportSpecifier = ExportNamespaceSpecifier | ExportDefaultSpecifier | NamedExportSpecifier;
1286
1305
  /**
1287
1306
  * `export * as foo from 'src';`
1288
1307
  */
1289
1308
  export interface ExportNamespaceSpecifier extends Node, HasSpan {
1290
1309
  type: "ExportNamespaceSpecifier";
1291
- name: Identifier;
1310
+ name: ModuleExportName;
1292
1311
  }
1293
1312
  export interface ExportDefaultSpecifier extends Node, HasSpan {
1294
1313
  type: "ExportDefaultSpecifier";
@@ -1296,12 +1315,12 @@ export interface ExportDefaultSpecifier extends Node, HasSpan {
1296
1315
  }
1297
1316
  export interface NamedExportSpecifier extends Node, HasSpan {
1298
1317
  type: "ExportSpecifier";
1299
- orig: Identifier;
1318
+ orig: ModuleExportName;
1300
1319
  /**
1301
1320
  * `Some(bar)` in `export { foo as bar }`
1302
1321
  */
1303
- exported: Identifier | null;
1304
- isTypeOnly?: boolean;
1322
+ exported?: ModuleExportName;
1323
+ isTypeOnly: boolean;
1305
1324
  }
1306
1325
  interface HasInterpreter {
1307
1326
  /**
@@ -1319,25 +1338,32 @@ export interface Script extends Node, HasSpan, HasInterpreter {
1319
1338
  body: Statement[];
1320
1339
  }
1321
1340
  export declare type ModuleItem = ModuleDeclaration | Statement;
1322
- export declare type BinaryOperator = "==" | "!=" | "===" | "!==" | "<" | "<=" | ">" | ">=" | "<<" | ">>" | ">>>" | "+" | "-" | "*" | "/" | "%" | "**" | "|" | "^" | "&" | "||" | "&&" | "in" | "instanceof" | "??";
1323
- export declare type AssignmentOperator = "=" | "+=" | "-=" | "*=" | "/=" | "%=" | "**=" | "<<=" | ">>=" | ">>>=" | "|=" | "^=" | "&=";
1341
+ export declare type BinaryOperator = "==" | "!=" | "===" | "!==" | "<" | "<=" | ">" | ">=" | "<<" | ">>" | ">>>" | "+" | "-" | "*" | "/" | "%" | "|" | "^" | "&" | "||" | "&&" | "in" | "instanceof" | "**" | "??";
1342
+ export declare type AssignmentOperator = "=" | "+=" | "-=" | "*=" | "/=" | "%=" | "<<=" | ">>=" | ">>>=" | "|=" | "^=" | "&=" | "**=" | "&&=" | "||=" | "??=";
1324
1343
  export declare type UpdateOperator = "++" | "--";
1325
1344
  export declare type UnaryOperator = "-" | "+" | "!" | "~" | "typeof" | "void" | "delete";
1326
- export declare type Pattern = Identifier | ArrayPattern | RestElement | ObjectPattern | AssignmentPattern | Invalid | Expression;
1327
- export interface ArrayPattern extends Node, HasSpan, PatternBase {
1345
+ export declare type Pattern = BindingIdentifier | ArrayPattern | RestElement | ObjectPattern | AssignmentPattern | Invalid | Expression;
1346
+ export interface BindingIdentifier extends PatternBase {
1347
+ type: "Identifier";
1348
+ value: string;
1349
+ optional: boolean;
1350
+ }
1351
+ export interface ArrayPattern extends PatternBase {
1328
1352
  type: "ArrayPattern";
1329
1353
  elements: (Pattern | undefined)[];
1354
+ optional: boolean;
1330
1355
  }
1331
- export interface ObjectPattern extends Node, HasSpan, PatternBase {
1356
+ export interface ObjectPattern extends PatternBase {
1332
1357
  type: "ObjectPattern";
1333
1358
  properties: ObjectPatternProperty[];
1359
+ optional: boolean;
1334
1360
  }
1335
- export interface AssignmentPattern extends Node, HasSpan, PatternBase {
1361
+ export interface AssignmentPattern extends PatternBase {
1336
1362
  type: "AssignmentPattern";
1337
1363
  left: Pattern;
1338
1364
  right: Expression;
1339
1365
  }
1340
- export interface RestElement extends Node, HasSpan, PatternBase {
1366
+ export interface RestElement extends PatternBase {
1341
1367
  type: "RestElement";
1342
1368
  rest: Span;
1343
1369
  argument: Pattern;
@@ -1376,17 +1402,17 @@ export interface AssignmentProperty extends Node {
1376
1402
  export interface GetterProperty extends PropBase, HasSpan {
1377
1403
  type: "GetterProperty";
1378
1404
  typeAnnotation?: TsTypeAnnotation;
1379
- body: BlockStatement;
1405
+ body?: BlockStatement;
1380
1406
  }
1381
1407
  export interface SetterProperty extends PropBase, HasSpan {
1382
1408
  type: "SetterProperty";
1383
1409
  param: Pattern;
1384
- body: BlockStatement;
1410
+ body?: BlockStatement;
1385
1411
  }
1386
1412
  export interface MethodProperty extends PropBase, Fn {
1387
1413
  type: "MethodProperty";
1388
1414
  }
1389
- export declare type PropertyName = Identifier | StringLiteral | NumericLiteral | BigIntLiteral | ComputedPropName;
1415
+ export declare type PropertyName = Identifier | StringLiteral | NumericLiteral | ComputedPropName | BigIntLiteral;
1390
1416
  export interface ComputedPropName extends Node, HasSpan {
1391
1417
  type: "Computed";
1392
1418
  expression: Expression;
@@ -1399,7 +1425,7 @@ export interface ExpressionStatement extends Node, HasSpan {
1399
1425
  type: "ExpressionStatement";
1400
1426
  expression: Expression;
1401
1427
  }
1402
- export declare type Statement = ExpressionStatement | BlockStatement | EmptyStatement | DebuggerStatement | WithStatement | ReturnStatement | LabeledStatement | BreakStatement | ContinueStatement | IfStatement | SwitchStatement | ThrowStatement | TryStatement | WhileStatement | DoWhileStatement | ForStatement | ForInStatement | ForOfStatement | Declaration;
1428
+ export declare type Statement = BlockStatement | EmptyStatement | DebuggerStatement | WithStatement | ReturnStatement | LabeledStatement | BreakStatement | ContinueStatement | IfStatement | SwitchStatement | ThrowStatement | TryStatement | WhileStatement | DoWhileStatement | ForStatement | ForInStatement | ForOfStatement | Declaration | ExpressionStatement;
1403
1429
  export interface EmptyStatement extends Node, HasSpan {
1404
1430
  type: "EmptyStatement";
1405
1431
  }
@@ -1413,7 +1439,7 @@ export interface WithStatement extends Node, HasSpan {
1413
1439
  }
1414
1440
  export interface ReturnStatement extends Node, HasSpan {
1415
1441
  type: "ReturnStatement";
1416
- argument: Expression;
1442
+ argument?: Expression;
1417
1443
  }
1418
1444
  export interface LabeledStatement extends Node, HasSpan {
1419
1445
  type: "LabeledStatement";
@@ -1422,11 +1448,11 @@ export interface LabeledStatement extends Node, HasSpan {
1422
1448
  }
1423
1449
  export interface BreakStatement extends Node, HasSpan {
1424
1450
  type: "BreakStatement";
1425
- label: Identifier;
1451
+ label?: Identifier;
1426
1452
  }
1427
1453
  export interface ContinueStatement extends Node, HasSpan {
1428
1454
  type: "ContinueStatement";
1429
- label: Identifier;
1455
+ label?: Identifier;
1430
1456
  }
1431
1457
  export interface IfStatement extends Node, HasSpan {
1432
1458
  type: "IfStatement";
@@ -1447,7 +1473,7 @@ export interface TryStatement extends Node, HasSpan {
1447
1473
  type: "TryStatement";
1448
1474
  block: BlockStatement;
1449
1475
  handler?: CatchClause;
1450
- finalizer: BlockStatement;
1476
+ finalizer?: BlockStatement;
1451
1477
  }
1452
1478
  export interface WhileStatement extends Node, HasSpan {
1453
1479
  type: "WhileStatement";
@@ -1479,7 +1505,7 @@ export interface ForOfStatement extends Node, HasSpan {
1479
1505
  *
1480
1506
  * es2018 for-await-of statements, e.g., `for await (const x of xs) {`
1481
1507
  */
1482
- await: Span;
1508
+ await?: Span;
1483
1509
  left: VariableDeclaration | Pattern;
1484
1510
  right: Expression;
1485
1511
  body: Statement;
@@ -1497,7 +1523,7 @@ export interface CatchClause extends Node, HasSpan {
1497
1523
  /**
1498
1524
  * The param is `undefined` if the catch binding is omitted. E.g., `try { foo() } catch {}`
1499
1525
  */
1500
- param: Pattern;
1526
+ param?: Pattern;
1501
1527
  body: BlockStatement;
1502
1528
  }
1503
1529
  export interface TsTypeAnnotation extends Node, HasSpan {
@@ -1511,8 +1537,10 @@ export interface TsTypeParameterDeclaration extends Node, HasSpan {
1511
1537
  export interface TsTypeParameter extends Node, HasSpan {
1512
1538
  type: "TsTypeParameter";
1513
1539
  name: Identifier;
1514
- constraint: TsType;
1515
- default: TsType;
1540
+ in: boolean;
1541
+ out: boolean;
1542
+ constraint?: TsType;
1543
+ default?: TsType;
1516
1544
  }
1517
1545
  export interface TsTypeParameterInstantiation extends Node, HasSpan {
1518
1546
  type: "TsTypeParameterInstantiation";
@@ -1521,28 +1549,29 @@ export interface TsTypeParameterInstantiation extends Node, HasSpan {
1521
1549
  export interface TsParameterProperty extends Node, HasSpan, HasDecorator {
1522
1550
  type: "TsParameterProperty";
1523
1551
  accessibility?: Accessibility;
1552
+ override: boolean;
1524
1553
  readonly: boolean;
1525
1554
  param: TsParameterPropertyParameter;
1526
1555
  }
1527
- export declare type TsParameterPropertyParameter = Identifier | AssignmentPattern;
1556
+ export declare type TsParameterPropertyParameter = BindingIdentifier | AssignmentPattern;
1528
1557
  export interface TsQualifiedName extends Node {
1529
1558
  type: "TsQualifiedName";
1530
1559
  left: TsEntityName;
1531
1560
  right: Identifier;
1532
1561
  }
1533
1562
  export declare type TsEntityName = TsQualifiedName | Identifier;
1534
- export declare type TsTypeElement = TsCallSignatureDeclaration | TsConstructSignatureDeclaration | TsPropertySignature | TsMethodSignature | TsIndexSignature;
1563
+ export declare type TsTypeElement = TsCallSignatureDeclaration | TsConstructSignatureDeclaration | TsPropertySignature | TsGetterSignature | TsSetterSignature | TsMethodSignature | TsIndexSignature;
1535
1564
  export interface TsCallSignatureDeclaration extends Node, HasSpan {
1536
1565
  type: "TsCallSignatureDeclaration";
1537
1566
  params: TsFnParameter[];
1538
- typeAnnotation: TsTypeAnnotation;
1539
- typeParams: TsTypeParameterDeclaration;
1567
+ typeAnnotation?: TsTypeAnnotation;
1568
+ typeParams?: TsTypeParameterDeclaration;
1540
1569
  }
1541
1570
  export interface TsConstructSignatureDeclaration extends Node, HasSpan {
1542
1571
  type: "TsConstructSignatureDeclaration";
1543
1572
  params: TsFnParameter[];
1544
- typeAnnotation: TsTypeAnnotation;
1545
- typeParams: TsTypeParameterDeclaration;
1573
+ typeAnnotation?: TsTypeAnnotation;
1574
+ typeParams?: TsTypeParameterDeclaration;
1546
1575
  }
1547
1576
  export interface TsPropertySignature extends Node, HasSpan {
1548
1577
  type: "TsPropertySignature";
@@ -1550,10 +1579,26 @@ export interface TsPropertySignature extends Node, HasSpan {
1550
1579
  key: Expression;
1551
1580
  computed: boolean;
1552
1581
  optional: boolean;
1553
- init: Expression;
1582
+ init?: Expression;
1554
1583
  params: TsFnParameter[];
1555
1584
  typeAnnotation?: TsTypeAnnotation;
1556
- typeParams: TsTypeParameterDeclaration;
1585
+ typeParams?: TsTypeParameterDeclaration;
1586
+ }
1587
+ export interface TsGetterSignature extends Node, HasSpan {
1588
+ type: "TsGetterSignature";
1589
+ readonly: boolean;
1590
+ key: Expression;
1591
+ computed: boolean;
1592
+ optional: boolean;
1593
+ typeAnnotation?: TsTypeAnnotation;
1594
+ }
1595
+ export interface TsSetterSignature extends Node, HasSpan {
1596
+ type: "TsSetterSignature";
1597
+ readonly: boolean;
1598
+ key: Expression;
1599
+ computed: boolean;
1600
+ optional: boolean;
1601
+ param: TsFnParameter;
1557
1602
  }
1558
1603
  export interface TsMethodSignature extends Node, HasSpan {
1559
1604
  type: "TsMethodSignature";
@@ -1562,50 +1607,54 @@ export interface TsMethodSignature extends Node, HasSpan {
1562
1607
  computed: boolean;
1563
1608
  optional: boolean;
1564
1609
  params: TsFnParameter[];
1565
- typeAnnotation: TsTypeAnnotation;
1566
- typeParams: TsTypeParameterDeclaration;
1610
+ typeAnn?: TsTypeAnnotation;
1611
+ typeParams?: TsTypeParameterDeclaration;
1567
1612
  }
1568
1613
  export interface TsIndexSignature extends Node, HasSpan {
1569
1614
  type: "TsIndexSignature";
1570
- readonly: boolean;
1571
1615
  params: TsFnParameter[];
1572
1616
  typeAnnotation?: TsTypeAnnotation;
1617
+ readonly: boolean;
1618
+ static: boolean;
1573
1619
  }
1574
- export declare type TsType = TsKeywordType | TsThisType | TsFnOrConstructorType | TsTypeReference | TsTypeQuery | TsTypeLiteral | TsArrayType | TsTupleType | TsOptionalType | TsRestType | TsUnionOrIntersectionType | TsConditionalType | TsInferType | TsParenthesizedType | TsTypeOperator | TsIndexedAccessType | TsMappedType | TsLiteralType | TsImportType | TsTypePredicate;
1620
+ export declare type TsType = TsKeywordType | TsThisType | TsFnOrConstructorType | TsTypeReference | TsTypeQuery | TsTypeLiteral | TsArrayType | TsTupleType | TsOptionalType | TsRestType | TsUnionOrIntersectionType | TsConditionalType | TsInferType | TsParenthesizedType | TsTypeOperator | TsIndexedAccessType | TsMappedType | TsLiteralType | TsTypePredicate | TsImportType;
1575
1621
  export declare type TsFnOrConstructorType = TsFunctionType | TsConstructorType;
1576
1622
  export interface TsKeywordType extends Node, HasSpan {
1577
1623
  type: "TsKeywordType";
1578
1624
  kind: TsKeywordTypeKind;
1579
1625
  }
1580
- export declare type TsKeywordTypeKind = "any" | "unknown" | "number" | "object" | "boolean" | "bigint" | "string" | "symbol" | "void" | "undefined" | "null" | "never";
1626
+ export declare type TsKeywordTypeKind = "any" | "unknown" | "number" | "object" | "boolean" | "bigint" | "string" | "symbol" | "void" | "undefined" | "null" | "never" | "intrinsic";
1581
1627
  export interface TsThisType extends Node, HasSpan {
1582
1628
  type: "TsThisType";
1583
1629
  }
1584
- export declare type TsFnParameter = Identifier | RestElement | ObjectPattern;
1630
+ export declare type TsFnParameter = BindingIdentifier | ArrayPattern | RestElement | ObjectPattern;
1585
1631
  export interface TsFunctionType extends Node, HasSpan {
1586
1632
  type: "TsFunctionType";
1587
- typeParams: TsTypeParameterDeclaration;
1633
+ params: TsFnParameter[];
1634
+ typeParams?: TsTypeParameterDeclaration;
1588
1635
  typeAnnotation: TsTypeAnnotation;
1589
1636
  }
1590
1637
  export interface TsConstructorType extends Node, HasSpan {
1591
1638
  type: "TsConstructorType";
1592
1639
  params: TsFnParameter[];
1593
- typeParams: TsTypeParameterDeclaration;
1640
+ typeParams?: TsTypeParameterDeclaration;
1594
1641
  typeAnnotation: TsTypeAnnotation;
1642
+ isAbstract: boolean;
1595
1643
  }
1596
1644
  export interface TsTypeReference extends Node, HasSpan {
1597
1645
  type: "TsTypeReference";
1598
1646
  typeName: TsEntityName;
1599
- typeParams: TsTypeParameterInstantiation;
1647
+ typeParams?: TsTypeParameterInstantiation;
1600
1648
  }
1601
1649
  export interface TsTypePredicate extends Node, HasSpan {
1602
1650
  type: "TsTypePredicate";
1603
1651
  asserts: boolean;
1604
1652
  paramName: TsThisTypeOrIdent;
1605
- typeAnnotation: TsTypeAnnotation;
1653
+ typeAnnotation?: TsTypeAnnotation;
1606
1654
  }
1607
1655
  export declare type TsThisTypeOrIdent = TsThisType | Identifier;
1608
1656
  export interface TsImportType extends Node, HasSpan {
1657
+ type: "TsImportType";
1609
1658
  argument: StringLiteral;
1610
1659
  qualifier?: TsEntityName;
1611
1660
  typeArguments?: TsTypeParameterInstantiation;
@@ -1616,6 +1665,7 @@ export interface TsImportType extends Node, HasSpan {
1616
1665
  export interface TsTypeQuery extends Node, HasSpan {
1617
1666
  type: "TsTypeQuery";
1618
1667
  exprName: TsTypeQueryExpr;
1668
+ typeArguments?: TsTypeParameterInstantiation;
1619
1669
  }
1620
1670
  export declare type TsTypeQueryExpr = TsEntityName | TsImportType;
1621
1671
  export interface TsTypeLiteral extends Node, HasSpan {
@@ -1628,7 +1678,12 @@ export interface TsArrayType extends Node, HasSpan {
1628
1678
  }
1629
1679
  export interface TsTupleType extends Node, HasSpan {
1630
1680
  type: "TsTupleType";
1631
- elemTypes: TsType[];
1681
+ elemTypes: TsTupleElement[];
1682
+ }
1683
+ export interface TsTupleElement extends Node, HasSpan {
1684
+ type: "TsTupleElement";
1685
+ label?: Pattern;
1686
+ ty: TsType;
1632
1687
  }
1633
1688
  export interface TsOptionalType extends Node, HasSpan {
1634
1689
  type: "TsOptionalType";
@@ -1667,25 +1722,32 @@ export interface TsTypeOperator extends Node, HasSpan {
1667
1722
  op: TsTypeOperatorOp;
1668
1723
  typeAnnotation: TsType;
1669
1724
  }
1670
- export declare type TsTypeOperatorOp = "keyof" | "unique";
1725
+ export declare type TsTypeOperatorOp = "keyof" | "unique" | "readonly";
1671
1726
  export interface TsIndexedAccessType extends Node, HasSpan {
1672
1727
  type: "TsIndexedAccessType";
1728
+ readonly: boolean;
1673
1729
  objectType: TsType;
1674
1730
  indexType: TsType;
1675
1731
  }
1676
1732
  export declare type TruePlusMinus = true | "+" | "-";
1677
1733
  export interface TsMappedType extends Node, HasSpan {
1678
1734
  type: "TsMappedType";
1679
- readonly: TruePlusMinus;
1735
+ readonly?: TruePlusMinus;
1680
1736
  typeParam: TsTypeParameter;
1681
- optional: TruePlusMinus;
1682
- typeAnnotation: TsType;
1737
+ nameType?: TsType;
1738
+ optional?: TruePlusMinus;
1739
+ typeAnnotation?: TsType;
1683
1740
  }
1684
1741
  export interface TsLiteralType extends Node, HasSpan {
1685
1742
  type: "TsLiteralType";
1686
1743
  literal: TsLiteral;
1687
1744
  }
1688
- export declare type TsLiteral = NumericLiteral | StringLiteral | BooleanLiteral | TemplateLiteral;
1745
+ export declare type TsLiteral = NumericLiteral | StringLiteral | BooleanLiteral | BigIntLiteral | TsTemplateLiteralType;
1746
+ export interface TsTemplateLiteralType extends Node, HasSpan {
1747
+ type: "TemplateLiteral";
1748
+ types: TsType[];
1749
+ quasis: TemplateElement[];
1750
+ }
1689
1751
  export interface TsInterfaceDeclaration extends Node, HasSpan {
1690
1752
  type: "TsInterfaceDeclaration";
1691
1753
  id: Identifier;
@@ -1700,7 +1762,7 @@ export interface TsInterfaceBody extends Node, HasSpan {
1700
1762
  }
1701
1763
  export interface TsExpressionWithTypeArguments extends Node, HasSpan {
1702
1764
  type: "TsExpressionWithTypeArguments";
1703
- expression: TsEntityName;
1765
+ expression: Expression;
1704
1766
  typeArguments?: TsTypeParameterInstantiation;
1705
1767
  }
1706
1768
  export interface TsTypeAliasDeclaration extends Node, HasSpan {
@@ -1713,7 +1775,7 @@ export interface TsTypeAliasDeclaration extends Node, HasSpan {
1713
1775
  export interface TsEnumDeclaration extends Node, HasSpan {
1714
1776
  type: "TsEnumDeclaration";
1715
1777
  declare: boolean;
1716
- is_const: boolean;
1778
+ isConst: boolean;
1717
1779
  id: Identifier;
1718
1780
  members: TsEnumMember[];
1719
1781
  }
@@ -1749,14 +1811,15 @@ export declare type TsModuleName = Identifier | StringLiteral;
1749
1811
  export interface TsImportEqualsDeclaration extends Node, HasSpan {
1750
1812
  type: "TsImportEqualsDeclaration";
1751
1813
  declare: boolean;
1752
- is_export: boolean;
1814
+ isExport: boolean;
1815
+ isTypeOnly: boolean;
1753
1816
  id: Identifier;
1754
1817
  moduleRef: TsModuleReference;
1755
1818
  }
1756
1819
  export declare type TsModuleReference = TsEntityName | TsExternalModuleReference;
1757
1820
  export interface TsExternalModuleReference extends Node, HasSpan {
1758
1821
  type: "TsExternalModuleReference";
1759
- expression: Expression;
1822
+ expression: StringLiteral;
1760
1823
  }
1761
1824
  export interface TsExportAssignment extends Node, HasSpan {
1762
1825
  type: "TsExportAssignment";
@@ -1771,6 +1834,11 @@ export interface TsAsExpression extends ExpressionBase {
1771
1834
  expression: Expression;
1772
1835
  typeAnnotation: TsType;
1773
1836
  }
1837
+ export interface TsInstantiation extends Node, HasSpan {
1838
+ type: "TsInstantiation";
1839
+ expression: Expression;
1840
+ typeArguments: TsTypeParameterInstantiation;
1841
+ }
1774
1842
  export interface TsTypeAssertion extends ExpressionBase {
1775
1843
  type: "TsTypeAssertion";
1776
1844
  expression: Expression;