@oxc-project/types 0.63.0 → 0.65.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/types.d.ts +37 -15
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oxc-project/types",
3
- "version": "0.63.0",
3
+ "version": "0.65.0",
4
4
  "description": "Types for Oxc AST nodes",
5
5
  "keywords": [
6
6
  "AST",
package/types.d.ts CHANGED
@@ -258,16 +258,26 @@ export type AssignmentTargetPattern = ArrayAssignmentTarget | ObjectAssignmentTa
258
258
  export interface ArrayAssignmentTarget extends Span {
259
259
  type: 'ArrayPattern';
260
260
  elements: Array<AssignmentTargetMaybeDefault | AssignmentTargetRest | null>;
261
+ decorators?: [];
262
+ optional?: false;
263
+ typeAnnotation?: null;
261
264
  }
262
265
 
263
266
  export interface ObjectAssignmentTarget extends Span {
264
267
  type: 'ObjectPattern';
265
268
  properties: Array<AssignmentTargetProperty | AssignmentTargetRest>;
269
+ decorators?: [];
270
+ optional?: false;
271
+ typeAnnotation?: null;
266
272
  }
267
273
 
268
274
  export interface AssignmentTargetRest extends Span {
269
275
  type: 'RestElement';
270
276
  argument: AssignmentTarget;
277
+ decorators?: [];
278
+ optional?: false;
279
+ typeAnnotation?: null;
280
+ value?: null;
271
281
  }
272
282
 
273
283
  export type AssignmentTargetMaybeDefault = AssignmentTargetWithDefault | AssignmentTarget;
@@ -276,6 +286,9 @@ export interface AssignmentTargetWithDefault extends Span {
276
286
  type: 'AssignmentPattern';
277
287
  left: AssignmentTarget;
278
288
  right: Expression;
289
+ decorators?: [];
290
+ optional?: false;
291
+ typeAnnotation?: null;
279
292
  }
280
293
 
281
294
  export type AssignmentTargetProperty = AssignmentTargetPropertyIdentifier | AssignmentTargetPropertyProperty;
@@ -288,6 +301,7 @@ export interface AssignmentTargetPropertyIdentifier extends Span {
288
301
  key: IdentifierReference;
289
302
  value: IdentifierReference | AssignmentTargetWithDefault;
290
303
  kind: 'init';
304
+ optional?: false;
291
305
  }
292
306
 
293
307
  export interface AssignmentTargetPropertyProperty extends Span {
@@ -298,6 +312,7 @@ export interface AssignmentTargetPropertyProperty extends Span {
298
312
  key: PropertyKey;
299
313
  value: AssignmentTargetMaybeDefault;
300
314
  kind: 'init';
315
+ optional?: false;
301
316
  }
302
317
 
303
318
  export interface SequenceExpression extends Span {
@@ -521,6 +536,8 @@ export interface AssignmentPattern extends Span {
521
536
  left: BindingPattern;
522
537
  right: Expression;
523
538
  decorators?: [];
539
+ optional?: false;
540
+ typeAnnotation?: null;
524
541
  }
525
542
 
526
543
  export interface ObjectPattern extends Span {
@@ -551,6 +568,10 @@ export interface ArrayPattern extends Span {
551
568
  export interface BindingRestElement extends Span {
552
569
  type: 'RestElement';
553
570
  argument: BindingPattern;
571
+ decorators?: [];
572
+ optional?: false;
573
+ typeAnnotation?: null;
574
+ value?: null;
554
575
  }
555
576
 
556
577
  export interface Function extends Span {
@@ -698,7 +719,7 @@ export interface AccessorProperty extends Span {
698
719
  typeAnnotation?: TSTypeAnnotation | null;
699
720
  accessibility?: TSAccessibility | null;
700
721
  optional?: false;
701
- override?: false;
722
+ override?: boolean;
702
723
  readonly?: false;
703
724
  declare?: false;
704
725
  }
@@ -858,8 +879,8 @@ export interface JSXFragment extends Span {
858
879
 
859
880
  export interface JSXOpeningFragment extends Span {
860
881
  type: 'JSXOpeningFragment';
861
- attributes: Array<JSXAttributeItem>;
862
- selfClosing: false;
882
+ attributes?: [];
883
+ selfClosing?: false;
863
884
  }
864
885
 
865
886
  export interface JSXClosingFragment extends Span {
@@ -946,16 +967,17 @@ export interface TSEnumDeclaration extends Span {
946
967
 
947
968
  export interface TSEnumBody extends Span {
948
969
  type: 'TSEnumBody';
949
- members: TSEnumMember[];
970
+ members: Array<TSEnumMember>;
950
971
  }
951
972
 
952
973
  export interface TSEnumMember extends Span {
953
974
  type: 'TSEnumMember';
954
975
  id: TSEnumMemberName;
976
+ computed: boolean;
955
977
  initializer: Expression | null;
956
978
  }
957
979
 
958
- export type TSEnumMemberName = IdentifierName | StringLiteral;
980
+ export type TSEnumMemberName = IdentifierName | StringLiteral | TemplateLiteral;
959
981
 
960
982
  export interface TSTypeAnnotation extends Span {
961
983
  type: 'TSTypeAnnotation';
@@ -1189,8 +1211,8 @@ export interface TSClassImplements extends Span {
1189
1211
  export interface TSInterfaceDeclaration extends Span {
1190
1212
  type: 'TSInterfaceDeclaration';
1191
1213
  id: BindingIdentifier;
1192
- extends: Array<TSInterfaceHeritage>;
1193
1214
  typeParameters: TSTypeParameterDeclaration | null;
1215
+ extends: Array<TSInterfaceHeritage>;
1194
1216
  body: TSInterfaceBody;
1195
1217
  declare: boolean;
1196
1218
  }
@@ -1343,15 +1365,14 @@ export interface TSConstructorType extends Span {
1343
1365
 
1344
1366
  export interface TSMappedType extends Span {
1345
1367
  type: 'TSMappedType';
1346
- typeParameter: TSTypeParameter;
1347
1368
  nameType: TSType | null;
1348
1369
  typeAnnotation: TSType | null;
1349
- optional: TSMappedTypeModifierOperator;
1350
- readonly: TSMappedTypeModifierOperator;
1370
+ optional: true | '+' | '-' | null;
1371
+ readonly: true | '+' | '-' | null;
1372
+ key: TSTypeParameter['name'];
1373
+ constraint: TSTypeParameter['constraint'];
1351
1374
  }
1352
1375
 
1353
- export type TSMappedTypeModifierOperator = 'true' | '+' | '-' | 'none';
1354
-
1355
1376
  export interface TSTemplateLiteralType extends Span {
1356
1377
  type: 'TSTemplateLiteralType';
1357
1378
  quasis: Array<TemplateElement>;
@@ -1413,25 +1434,25 @@ export interface TSNamespaceExportDeclaration extends Span {
1413
1434
  export interface TSInstantiationExpression extends Span {
1414
1435
  type: 'TSInstantiationExpression';
1415
1436
  expression: Expression;
1416
- typeParameters: TSTypeParameterInstantiation;
1437
+ typeArguments: TSTypeParameterInstantiation;
1417
1438
  }
1418
1439
 
1419
1440
  export type ImportOrExportKind = 'value' | 'type';
1420
1441
 
1421
1442
  export interface JSDocNullableType extends Span {
1422
- type: 'JSDocNullableType';
1443
+ type: 'TSJSDocNullableType';
1423
1444
  typeAnnotation: TSType;
1424
1445
  postfix: boolean;
1425
1446
  }
1426
1447
 
1427
1448
  export interface JSDocNonNullableType extends Span {
1428
- type: 'JSDocNonNullableType';
1449
+ type: 'TSJSDocNonNullableType';
1429
1450
  typeAnnotation: TSType;
1430
1451
  postfix: boolean;
1431
1452
  }
1432
1453
 
1433
1454
  export interface JSDocUnknownType extends Span {
1434
- type: 'JSDocUnknownType';
1455
+ type: 'TSJSDocUnknownType';
1435
1456
  }
1436
1457
 
1437
1458
  export type AssignmentOperator =
@@ -1761,6 +1782,7 @@ export type Node =
1761
1782
  | JSXText
1762
1783
  | TSThisParameter
1763
1784
  | TSEnumDeclaration
1785
+ | TSEnumBody
1764
1786
  | TSEnumMember
1765
1787
  | TSTypeAnnotation
1766
1788
  | TSLiteralType