@oxc-project/types 0.72.1 → 0.72.2

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 +67 -67
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oxc-project/types",
3
- "version": "0.72.1",
3
+ "version": "0.72.2",
4
4
  "description": "Types for Oxc AST nodes",
5
5
  "keywords": [
6
6
  "AST",
package/types.d.ts CHANGED
@@ -53,32 +53,32 @@ export type Expression =
53
53
 
54
54
  export interface IdentifierName extends Span {
55
55
  type: 'Identifier';
56
- name: string;
57
56
  decorators?: [];
57
+ name: string;
58
58
  optional?: false;
59
59
  typeAnnotation?: null;
60
60
  }
61
61
 
62
62
  export interface IdentifierReference extends Span {
63
63
  type: 'Identifier';
64
- name: string;
65
64
  decorators?: [];
65
+ name: string;
66
66
  optional?: false;
67
67
  typeAnnotation?: null;
68
68
  }
69
69
 
70
70
  export interface BindingIdentifier extends Span {
71
71
  type: 'Identifier';
72
- name: string;
73
72
  decorators?: [];
73
+ name: string;
74
74
  optional?: false;
75
75
  typeAnnotation?: null;
76
76
  }
77
77
 
78
78
  export interface LabelIdentifier extends Span {
79
79
  type: 'Identifier';
80
- name: string;
81
80
  decorators?: [];
81
+ name: string;
82
82
  optional?: false;
83
83
  typeAnnotation?: null;
84
84
  }
@@ -103,12 +103,12 @@ export type ObjectPropertyKind = ObjectProperty | SpreadElement;
103
103
 
104
104
  export interface ObjectProperty extends Span {
105
105
  type: 'Property';
106
+ kind: PropertyKind;
107
+ key: PropertyKey;
108
+ value: Expression;
106
109
  method: boolean;
107
110
  shorthand: boolean;
108
111
  computed: boolean;
109
- key: PropertyKey;
110
- value: Expression;
111
- kind: PropertyKind;
112
112
  optional?: false;
113
113
  }
114
114
 
@@ -118,15 +118,15 @@ export type PropertyKind = 'init' | 'get' | 'set';
118
118
 
119
119
  export interface TemplateLiteral extends Span {
120
120
  type: 'TemplateLiteral';
121
- expressions: Array<Expression>;
122
121
  quasis: Array<TemplateElement>;
122
+ expressions: Array<Expression>;
123
123
  }
124
124
 
125
125
  export interface TaggedTemplateExpression extends Span {
126
126
  type: 'TaggedTemplateExpression';
127
127
  tag: Expression;
128
- quasi: TemplateLiteral;
129
128
  typeArguments?: TSTypeParameterInstantiation | null;
129
+ quasi: TemplateLiteral;
130
130
  }
131
131
 
132
132
  export interface TemplateElement extends Span {
@@ -146,39 +146,39 @@ export interface ComputedMemberExpression extends Span {
146
146
  type: 'MemberExpression';
147
147
  object: Expression;
148
148
  property: Expression;
149
- computed: true;
150
149
  optional: boolean;
150
+ computed: true;
151
151
  }
152
152
 
153
153
  export interface StaticMemberExpression extends Span {
154
154
  type: 'MemberExpression';
155
155
  object: Expression;
156
156
  property: IdentifierName;
157
- computed: false;
158
157
  optional: boolean;
158
+ computed: false;
159
159
  }
160
160
 
161
161
  export interface PrivateFieldExpression extends Span {
162
162
  type: 'MemberExpression';
163
163
  object: Expression;
164
164
  property: PrivateIdentifier;
165
- computed: false;
166
165
  optional: boolean;
166
+ computed: false;
167
167
  }
168
168
 
169
169
  export interface CallExpression extends Span {
170
170
  type: 'CallExpression';
171
171
  callee: Expression;
172
+ typeArguments?: TSTypeParameterInstantiation | null;
172
173
  arguments: Array<Argument>;
173
174
  optional: boolean;
174
- typeArguments?: TSTypeParameterInstantiation | null;
175
175
  }
176
176
 
177
177
  export interface NewExpression extends Span {
178
178
  type: 'NewExpression';
179
179
  callee: Expression;
180
- arguments: Array<Argument>;
181
180
  typeArguments?: TSTypeParameterInstantiation | null;
181
+ arguments: Array<Argument>;
182
182
  }
183
183
 
184
184
  export interface MetaProperty extends Span {
@@ -204,8 +204,8 @@ export interface UpdateExpression extends Span {
204
204
  export interface UnaryExpression extends Span {
205
205
  type: 'UnaryExpression';
206
206
  operator: UnaryOperator;
207
- prefix: true;
208
207
  argument: Expression;
208
+ prefix: true;
209
209
  }
210
210
 
211
211
  export interface BinaryExpression extends Span {
@@ -257,24 +257,24 @@ export type AssignmentTargetPattern = ArrayAssignmentTarget | ObjectAssignmentTa
257
257
 
258
258
  export interface ArrayAssignmentTarget extends Span {
259
259
  type: 'ArrayPattern';
260
- elements: Array<AssignmentTargetMaybeDefault | AssignmentTargetRest | null>;
261
260
  decorators?: [];
261
+ elements: Array<AssignmentTargetMaybeDefault | AssignmentTargetRest | null>;
262
262
  optional?: false;
263
263
  typeAnnotation?: null;
264
264
  }
265
265
 
266
266
  export interface ObjectAssignmentTarget extends Span {
267
267
  type: 'ObjectPattern';
268
- properties: Array<AssignmentTargetProperty | AssignmentTargetRest>;
269
268
  decorators?: [];
269
+ properties: Array<AssignmentTargetProperty | AssignmentTargetRest>;
270
270
  optional?: false;
271
271
  typeAnnotation?: null;
272
272
  }
273
273
 
274
274
  export interface AssignmentTargetRest extends Span {
275
275
  type: 'RestElement';
276
- argument: AssignmentTarget;
277
276
  decorators?: [];
277
+ argument: AssignmentTarget;
278
278
  optional?: false;
279
279
  typeAnnotation?: null;
280
280
  value?: null;
@@ -284,9 +284,9 @@ export type AssignmentTargetMaybeDefault = AssignmentTargetWithDefault | Assignm
284
284
 
285
285
  export interface AssignmentTargetWithDefault extends Span {
286
286
  type: 'AssignmentPattern';
287
+ decorators?: [];
287
288
  left: AssignmentTarget;
288
289
  right: Expression;
289
- decorators?: [];
290
290
  optional?: false;
291
291
  typeAnnotation?: null;
292
292
  }
@@ -295,23 +295,23 @@ export type AssignmentTargetProperty = AssignmentTargetPropertyIdentifier | Assi
295
295
 
296
296
  export interface AssignmentTargetPropertyIdentifier extends Span {
297
297
  type: 'Property';
298
+ kind: 'init';
299
+ key: IdentifierReference;
300
+ value: IdentifierReference | AssignmentTargetWithDefault;
298
301
  method: false;
299
302
  shorthand: true;
300
303
  computed: false;
301
- key: IdentifierReference;
302
- value: IdentifierReference | AssignmentTargetWithDefault;
303
- kind: 'init';
304
304
  optional?: false;
305
305
  }
306
306
 
307
307
  export interface AssignmentTargetPropertyProperty extends Span {
308
308
  type: 'Property';
309
+ kind: 'init';
310
+ key: PropertyKey;
311
+ value: AssignmentTargetMaybeDefault;
309
312
  method: false;
310
313
  shorthand: false;
311
314
  computed: boolean;
312
- key: PropertyKey;
313
- value: AssignmentTargetMaybeDefault;
314
- kind: 'init';
315
315
  optional?: false;
316
316
  }
317
317
 
@@ -391,8 +391,8 @@ export type Declaration =
391
391
 
392
392
  export interface VariableDeclaration extends Span {
393
393
  type: 'VariableDeclaration';
394
- declarations: Array<VariableDeclarator>;
395
394
  kind: VariableDeclarationKind;
395
+ declarations: Array<VariableDeclarator>;
396
396
  declare?: boolean;
397
397
  }
398
398
 
@@ -490,14 +490,14 @@ export interface SwitchStatement extends Span {
490
490
 
491
491
  export interface SwitchCase extends Span {
492
492
  type: 'SwitchCase';
493
- consequent: Array<Statement>;
494
493
  test: Expression | null;
494
+ consequent: Array<Statement>;
495
495
  }
496
496
 
497
497
  export interface LabeledStatement extends Span {
498
498
  type: 'LabeledStatement';
499
- body: Statement;
500
499
  label: LabelIdentifier;
500
+ body: Statement;
501
501
  }
502
502
 
503
503
  export interface ThrowStatement extends Span {
@@ -533,44 +533,44 @@ export type BindingPatternKind = BindingIdentifier | ObjectPattern | ArrayPatter
533
533
 
534
534
  export interface AssignmentPattern extends Span {
535
535
  type: 'AssignmentPattern';
536
+ decorators?: [];
536
537
  left: BindingPattern;
537
538
  right: Expression;
538
- decorators?: [];
539
539
  optional?: false;
540
540
  typeAnnotation?: null;
541
541
  }
542
542
 
543
543
  export interface ObjectPattern extends Span {
544
544
  type: 'ObjectPattern';
545
- properties: Array<BindingProperty | BindingRestElement>;
546
545
  decorators?: [];
546
+ properties: Array<BindingProperty | BindingRestElement>;
547
547
  optional?: false;
548
548
  typeAnnotation?: null;
549
549
  }
550
550
 
551
551
  export interface BindingProperty extends Span {
552
552
  type: 'Property';
553
+ kind: 'init';
554
+ key: PropertyKey;
555
+ value: BindingPattern;
553
556
  method: false;
554
557
  shorthand: boolean;
555
558
  computed: boolean;
556
- key: PropertyKey;
557
- value: BindingPattern;
558
- kind: 'init';
559
559
  optional?: false;
560
560
  }
561
561
 
562
562
  export interface ArrayPattern extends Span {
563
563
  type: 'ArrayPattern';
564
- elements: Array<BindingPattern | BindingRestElement | null>;
565
564
  decorators?: [];
565
+ elements: Array<BindingPattern | BindingRestElement | null>;
566
566
  optional?: false;
567
567
  typeAnnotation?: null;
568
568
  }
569
569
 
570
570
  export interface BindingRestElement extends Span {
571
571
  type: 'RestElement';
572
- argument: BindingPattern;
573
572
  decorators?: [];
573
+ argument: BindingPattern;
574
574
  optional?: false;
575
575
  typeAnnotation?: null;
576
576
  value?: null;
@@ -579,14 +579,14 @@ export interface BindingRestElement extends Span {
579
579
  export interface Function extends Span {
580
580
  type: FunctionType;
581
581
  id: BindingIdentifier | null;
582
- expression: false;
583
582
  generator: boolean;
584
583
  async: boolean;
585
- params: ParamPattern[];
586
- body: FunctionBody | null;
587
584
  declare?: boolean;
588
585
  typeParameters?: TSTypeParameterDeclaration | null;
586
+ params: ParamPattern[];
589
587
  returnType?: TSTypeAnnotation | null;
588
+ body: FunctionBody | null;
589
+ expression: false;
590
590
  }
591
591
 
592
592
  export type ParamPattern = FormalParameter | TSParameterProperty | FormalParameterRest;
@@ -629,14 +629,14 @@ export interface FunctionBody extends Span {
629
629
 
630
630
  export interface ArrowFunctionExpression extends Span {
631
631
  type: 'ArrowFunctionExpression';
632
- id: null;
633
632
  expression: boolean;
634
- generator: false;
635
633
  async: boolean;
636
- params: ParamPattern[];
637
- body: FunctionBody | Expression;
638
634
  typeParameters?: TSTypeParameterDeclaration | null;
635
+ params: ParamPattern[];
639
636
  returnType?: TSTypeAnnotation | null;
637
+ body: FunctionBody | Expression;
638
+ id: null;
639
+ generator: false;
640
640
  }
641
641
 
642
642
  export interface YieldExpression extends Span {
@@ -647,13 +647,13 @@ export interface YieldExpression extends Span {
647
647
 
648
648
  export interface Class extends Span {
649
649
  type: ClassType;
650
+ decorators: Array<Decorator>;
650
651
  id: BindingIdentifier | null;
651
- superClass: Expression | null;
652
- body: ClassBody;
653
- decorators?: Array<Decorator>;
654
652
  typeParameters?: TSTypeParameterDeclaration | null;
653
+ superClass: Expression | null;
655
654
  superTypeArguments?: TSTypeParameterInstantiation | null;
656
655
  implements?: Array<TSClassImplements>;
656
+ body: ClassBody;
657
657
  abstract?: boolean;
658
658
  declare?: boolean;
659
659
  }
@@ -669,12 +669,12 @@ export type ClassElement = StaticBlock | MethodDefinition | PropertyDefinition |
669
669
 
670
670
  export interface MethodDefinition extends Span {
671
671
  type: MethodDefinitionType;
672
- static: boolean;
673
- computed: boolean;
672
+ decorators: Array<Decorator>;
674
673
  key: PropertyKey;
675
- kind: MethodDefinitionKind;
676
674
  value: Function;
677
- decorators?: Array<Decorator>;
675
+ kind: MethodDefinitionKind;
676
+ computed: boolean;
677
+ static: boolean;
678
678
  override?: boolean;
679
679
  optional?: boolean;
680
680
  accessibility?: TSAccessibility | null;
@@ -684,17 +684,17 @@ export type MethodDefinitionType = 'MethodDefinition' | 'TSAbstractMethodDefinit
684
684
 
685
685
  export interface PropertyDefinition extends Span {
686
686
  type: PropertyDefinitionType;
687
- static: boolean;
688
- computed: boolean;
687
+ decorators: Array<Decorator>;
689
688
  key: PropertyKey;
689
+ typeAnnotation?: TSTypeAnnotation | null;
690
690
  value: Expression | null;
691
- decorators?: Array<Decorator>;
691
+ computed: boolean;
692
+ static: boolean;
692
693
  declare?: boolean;
693
694
  override?: boolean;
694
695
  optional?: boolean;
695
696
  definite?: boolean;
696
697
  readonly?: boolean;
697
- typeAnnotation?: TSTypeAnnotation | null;
698
698
  accessibility?: TSAccessibility | null;
699
699
  }
700
700
 
@@ -724,18 +724,18 @@ export type AccessorPropertyType = 'AccessorProperty' | 'TSAbstractAccessorPrope
724
724
 
725
725
  export interface AccessorProperty extends Span {
726
726
  type: AccessorPropertyType;
727
+ decorators: Array<Decorator>;
727
728
  key: PropertyKey;
728
729
  typeAnnotation?: TSTypeAnnotation | null;
729
730
  value: Expression | null;
730
731
  computed: boolean;
731
732
  static: boolean;
732
- decorators?: Array<Decorator>;
733
+ override?: boolean;
733
734
  definite?: boolean;
734
735
  accessibility?: TSAccessibility | null;
736
+ declare?: false;
735
737
  optional?: false;
736
- override?: boolean;
737
738
  readonly?: false;
738
- declare?: false;
739
739
  }
740
740
 
741
741
  export interface ImportExpression extends Span {
@@ -749,8 +749,8 @@ export interface ImportDeclaration extends Span {
749
749
  type: 'ImportDeclaration';
750
750
  specifiers: Array<ImportDeclarationSpecifier>;
751
751
  source: StringLiteral;
752
- attributes: Array<ImportAttribute>;
753
752
  phase: ImportPhase | null;
753
+ attributes: Array<ImportAttribute>;
754
754
  importKind?: ImportOrExportKind;
755
755
  }
756
756
 
@@ -788,8 +788,8 @@ export interface ExportNamedDeclaration extends Span {
788
788
  declaration: Declaration | null;
789
789
  specifiers: Array<ExportSpecifier>;
790
790
  source: StringLiteral | null;
791
- attributes: Array<ImportAttribute>;
792
791
  exportKind?: ImportOrExportKind;
792
+ attributes: Array<ImportAttribute>;
793
793
  }
794
794
 
795
795
  export interface ExportDefaultDeclaration extends Span {
@@ -864,16 +864,16 @@ export interface RegExpLiteral extends Span {
864
864
  export interface JSXElement extends Span {
865
865
  type: 'JSXElement';
866
866
  openingElement: JSXOpeningElement;
867
- closingElement: JSXClosingElement | null;
868
867
  children: Array<JSXChild>;
868
+ closingElement: JSXClosingElement | null;
869
869
  }
870
870
 
871
871
  export interface JSXOpeningElement extends Span {
872
872
  type: 'JSXOpeningElement';
873
- attributes: Array<JSXAttributeItem>;
874
873
  name: JSXElementName;
875
- selfClosing: boolean;
876
874
  typeArguments?: TSTypeParameterInstantiation | null;
875
+ attributes: Array<JSXAttributeItem>;
876
+ selfClosing: boolean;
877
877
  }
878
878
 
879
879
  export interface JSXClosingElement extends Span {
@@ -884,8 +884,8 @@ export interface JSXClosingElement extends Span {
884
884
  export interface JSXFragment extends Span {
885
885
  type: 'JSXFragment';
886
886
  openingFragment: JSXOpeningFragment;
887
- closingFragment: JSXClosingFragment;
888
887
  children: Array<JSXChild>;
888
+ closingFragment: JSXClosingFragment;
889
889
  }
890
890
 
891
891
  export interface JSXOpeningFragment extends Span {
@@ -962,8 +962,8 @@ export interface JSXText extends Span {
962
962
 
963
963
  export interface TSThisParameter extends Span {
964
964
  type: 'Identifier';
965
- name: 'this';
966
965
  decorators: [];
966
+ name: 'this';
967
967
  optional: false;
968
968
  typeAnnotation: TSTypeAnnotation | null;
969
969
  }
@@ -984,8 +984,8 @@ export interface TSEnumBody extends Span {
984
984
  export interface TSEnumMember extends Span {
985
985
  type: 'TSEnumMember';
986
986
  id: TSEnumMemberName;
987
- computed: boolean;
988
987
  initializer: Expression | null;
988
+ computed: boolean;
989
989
  }
990
990
 
991
991
  export type TSEnumMemberName = IdentifierName | StringLiteral | TemplateLiteral;
@@ -1292,8 +1292,8 @@ export interface TSConstructSignatureDeclaration extends Span {
1292
1292
 
1293
1293
  export interface TSIndexSignatureName extends Span {
1294
1294
  type: 'Identifier';
1295
- name: string;
1296
1295
  decorators: [];
1296
+ name: string;
1297
1297
  optional: false;
1298
1298
  typeAnnotation: TSTypeAnnotation;
1299
1299
  }
@@ -1372,12 +1372,12 @@ export interface TSConstructorType extends Span {
1372
1372
 
1373
1373
  export interface TSMappedType extends Span {
1374
1374
  type: 'TSMappedType';
1375
+ key: TSTypeParameter['name'];
1376
+ constraint: TSTypeParameter['constraint'];
1375
1377
  nameType: TSType | null;
1376
1378
  typeAnnotation: TSType | null;
1377
1379
  optional: TSMappedTypeModifierOperator | false;
1378
1380
  readonly: TSMappedTypeModifierOperator | null;
1379
- key: TSTypeParameter['name'];
1380
- constraint: TSTypeParameter['constraint'];
1381
1381
  }
1382
1382
 
1383
1383
  export type TSMappedTypeModifierOperator = true | '+' | '-';