@oxc-project/types 0.58.1 → 0.60.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 +51 -50
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oxc-project/types",
3
- "version": "0.58.1",
3
+ "version": "0.60.0",
4
4
  "description": "Types for Oxc AST nodes",
5
5
  "keywords": [
6
6
  "AST",
package/types.d.ts CHANGED
@@ -113,7 +113,7 @@ export interface TaggedTemplateExpression extends Span {
113
113
  type: 'TaggedTemplateExpression';
114
114
  tag: Expression;
115
115
  quasi: TemplateLiteral;
116
- typeParameters: TSTypeParameterInstantiation | null;
116
+ typeArguments?: TSTypeParameterInstantiation | null;
117
117
  }
118
118
 
119
119
  export interface TemplateElement extends Span {
@@ -156,16 +156,16 @@ export interface PrivateFieldExpression extends Span {
156
156
  export interface CallExpression extends Span {
157
157
  type: 'CallExpression';
158
158
  callee: Expression;
159
- typeParameters: TSTypeParameterInstantiation | null;
160
159
  arguments: Array<Argument>;
161
160
  optional: boolean;
161
+ typeArguments?: TSTypeParameterInstantiation | null;
162
162
  }
163
163
 
164
164
  export interface NewExpression extends Span {
165
165
  type: 'NewExpression';
166
166
  callee: Expression;
167
167
  arguments: Array<Argument>;
168
- typeParameters: TSTypeParameterInstantiation | null;
168
+ typeArguments?: TSTypeParameterInstantiation | null;
169
169
  }
170
170
 
171
171
  export interface MetaProperty extends Span {
@@ -365,16 +365,16 @@ export interface VariableDeclaration extends Span {
365
365
  type: 'VariableDeclaration';
366
366
  declarations: Array<VariableDeclarator>;
367
367
  kind: VariableDeclarationKind;
368
- declare: boolean;
368
+ declare?: boolean;
369
369
  }
370
370
 
371
- export type VariableDeclarationKind = 'var' | 'const' | 'let' | 'using' | 'await using';
371
+ export type VariableDeclarationKind = 'var' | 'let' | 'const' | 'using' | 'await using';
372
372
 
373
373
  export interface VariableDeclarator extends Span {
374
374
  type: 'VariableDeclarator';
375
375
  id: BindingPattern;
376
376
  init: Expression | null;
377
- definite: boolean;
377
+ definite?: boolean;
378
378
  }
379
379
 
380
380
  export interface EmptyStatement extends Span {
@@ -384,6 +384,7 @@ export interface EmptyStatement extends Span {
384
384
  export interface ExpressionStatement extends Span {
385
385
  type: 'ExpressionStatement';
386
386
  expression: Expression;
387
+ directive?: string | null;
387
388
  }
388
389
 
389
390
  export interface IfStatement extends Span {
@@ -495,8 +496,8 @@ export interface DebuggerStatement extends Span {
495
496
 
496
497
  export type BindingPattern =
497
498
  & ({
498
- typeAnnotation: TSTypeAnnotation | null;
499
- optional: boolean;
499
+ typeAnnotation?: TSTypeAnnotation | null;
500
+ optional?: boolean;
500
501
  })
501
502
  & (BindingIdentifier | ObjectPattern | ArrayPattern | AssignmentPattern);
502
503
 
@@ -541,10 +542,10 @@ export interface Function extends Span {
541
542
  async: boolean;
542
543
  params: ParamPattern[];
543
544
  body: FunctionBody | null;
544
- declare: boolean;
545
- typeParameters: TSTypeParameterDeclaration | null;
546
- thisParam: TSThisParameter | null;
547
- returnType: TSTypeAnnotation | null;
545
+ declare?: boolean;
546
+ typeParameters?: TSTypeParameterDeclaration | null;
547
+ thisParam?: TSThisParameter | null;
548
+ returnType?: TSTypeAnnotation | null;
548
549
  }
549
550
 
550
551
  export type ParamPattern = FormalParameter | FormalParameterRest;
@@ -564,10 +565,10 @@ export interface FormalParameterRest extends Span {
564
565
 
565
566
  export type FormalParameter =
566
567
  & ({
567
- decorators: Array<Decorator>;
568
- accessibility: TSAccessibility | null;
569
- readonly: boolean;
570
- override: boolean;
568
+ decorators?: Array<Decorator>;
569
+ accessibility?: TSAccessibility | null;
570
+ readonly?: boolean;
571
+ override?: boolean;
571
572
  })
572
573
  & BindingPattern;
573
574
 
@@ -584,8 +585,8 @@ export interface ArrowFunctionExpression extends Span {
584
585
  async: boolean;
585
586
  params: ParamPattern[];
586
587
  body: FunctionBody | Expression;
587
- typeParameters: TSTypeParameterDeclaration | null;
588
- returnType: TSTypeAnnotation | null;
588
+ typeParameters?: TSTypeParameterDeclaration | null;
589
+ returnType?: TSTypeAnnotation | null;
589
590
  }
590
591
 
591
592
  export interface YieldExpression extends Span {
@@ -599,12 +600,12 @@ export interface Class extends Span {
599
600
  id: BindingIdentifier | null;
600
601
  superClass: Expression | null;
601
602
  body: ClassBody;
602
- decorators: Array<Decorator>;
603
- typeParameters: TSTypeParameterDeclaration | null;
604
- superTypeParameters: TSTypeParameterInstantiation | null;
605
- implements: Array<TSClassImplements> | null;
606
- abstract: boolean;
607
- declare: boolean;
603
+ decorators?: Array<Decorator>;
604
+ typeParameters?: TSTypeParameterDeclaration | null;
605
+ superTypeArguments?: TSTypeParameterInstantiation | null;
606
+ implements?: Array<TSClassImplements>;
607
+ abstract?: boolean;
608
+ declare?: boolean;
608
609
  }
609
610
 
610
611
  export type ClassType = 'ClassDeclaration' | 'ClassExpression';
@@ -623,10 +624,10 @@ export interface MethodDefinition extends Span {
623
624
  key: PropertyKey;
624
625
  kind: MethodDefinitionKind;
625
626
  value: Function;
626
- decorators: Array<Decorator>;
627
- override: boolean;
628
- optional: boolean;
629
- accessibility: TSAccessibility | null;
627
+ decorators?: Array<Decorator>;
628
+ override?: boolean;
629
+ optional?: boolean;
630
+ accessibility?: TSAccessibility | null;
630
631
  }
631
632
 
632
633
  export type MethodDefinitionType = 'MethodDefinition' | 'TSAbstractMethodDefinition';
@@ -637,14 +638,14 @@ export interface PropertyDefinition extends Span {
637
638
  computed: boolean;
638
639
  key: PropertyKey;
639
640
  value: Expression | null;
640
- decorators: Array<Decorator>;
641
- declare: boolean;
642
- override: boolean;
643
- optional: boolean;
644
- definite: boolean;
645
- readonly: boolean;
646
- typeAnnotation: TSTypeAnnotation | null;
647
- accessibility: TSAccessibility | null;
641
+ decorators?: Array<Decorator>;
642
+ declare?: boolean;
643
+ override?: boolean;
644
+ optional?: boolean;
645
+ definite?: boolean;
646
+ readonly?: boolean;
647
+ typeAnnotation?: TSTypeAnnotation | null;
648
+ accessibility?: TSAccessibility | null;
648
649
  }
649
650
 
650
651
  export type PropertyDefinitionType = 'PropertyDefinition' | 'TSAbstractPropertyDefinition';
@@ -677,10 +678,10 @@ export interface AccessorProperty extends Span {
677
678
  value: Expression | null;
678
679
  computed: boolean;
679
680
  static: boolean;
680
- decorators: Array<Decorator>;
681
- definite: boolean;
682
- typeAnnotation: TSTypeAnnotation | null;
683
- accessibility: TSAccessibility | null;
681
+ decorators?: Array<Decorator>;
682
+ definite?: boolean;
683
+ typeAnnotation?: TSTypeAnnotation | null;
684
+ accessibility?: TSAccessibility | null;
684
685
  }
685
686
 
686
687
  export interface ImportExpression extends Span {
@@ -694,7 +695,7 @@ export interface ImportDeclaration extends Span {
694
695
  specifiers: Array<ImportDeclarationSpecifier>;
695
696
  source: StringLiteral;
696
697
  attributes: Array<ImportAttribute>;
697
- importKind: ImportOrExportKind;
698
+ importKind?: ImportOrExportKind;
698
699
  }
699
700
 
700
701
  export type ImportPhase = 'source' | 'defer';
@@ -705,7 +706,7 @@ export interface ImportSpecifier extends Span {
705
706
  type: 'ImportSpecifier';
706
707
  imported: ModuleExportName;
707
708
  local: BindingIdentifier;
708
- importKind: ImportOrExportKind;
709
+ importKind?: ImportOrExportKind;
709
710
  }
710
711
 
711
712
  export interface ImportDefaultSpecifier extends Span {
@@ -731,8 +732,8 @@ export interface ExportNamedDeclaration extends Span {
731
732
  declaration: Declaration | null;
732
733
  specifiers: Array<ExportSpecifier>;
733
734
  source: StringLiteral | null;
734
- exportKind: ImportOrExportKind;
735
735
  attributes: Array<ImportAttribute>;
736
+ exportKind?: ImportOrExportKind;
736
737
  }
737
738
 
738
739
  export interface ExportDefaultDeclaration extends Span {
@@ -745,14 +746,14 @@ export interface ExportAllDeclaration extends Span {
745
746
  exported: ModuleExportName | null;
746
747
  source: StringLiteral;
747
748
  attributes: Array<ImportAttribute>;
748
- exportKind: ImportOrExportKind;
749
+ exportKind?: ImportOrExportKind;
749
750
  }
750
751
 
751
752
  export interface ExportSpecifier extends Span {
752
753
  type: 'ExportSpecifier';
753
754
  local: ModuleExportName;
754
755
  exported: ModuleExportName;
755
- exportKind: ImportOrExportKind;
756
+ exportKind?: ImportOrExportKind;
756
757
  }
757
758
 
758
759
  export type ExportDefaultDeclarationKind = Function | Class | TSInterfaceDeclaration | Expression;
@@ -820,7 +821,7 @@ export interface JSXOpeningElement extends Span {
820
821
  attributes: Array<JSXAttributeItem>;
821
822
  name: JSXElementName;
822
823
  selfClosing: boolean;
823
- typeParameters: TSTypeParameterInstantiation | null;
824
+ typeArguments?: TSTypeParameterInstantiation | null;
824
825
  }
825
826
 
826
827
  export interface JSXClosingElement extends Span {
@@ -1110,7 +1111,7 @@ export interface TSBigIntKeyword extends Span {
1110
1111
  export interface TSTypeReference extends Span {
1111
1112
  type: 'TSTypeReference';
1112
1113
  typeName: TSTypeName;
1113
- typeParameters: TSTypeParameterInstantiation | null;
1114
+ typeArguments: TSTypeParameterInstantiation | null;
1114
1115
  }
1115
1116
 
1116
1117
  export type TSTypeName = IdentifierReference | TSQualifiedName;
@@ -1154,7 +1155,7 @@ export type TSAccessibility = 'private' | 'protected' | 'public';
1154
1155
  export interface TSClassImplements extends Span {
1155
1156
  type: 'TSClassImplements';
1156
1157
  expression: TSTypeName;
1157
- typeParameters: TSTypeParameterInstantiation | null;
1158
+ typeArguments: TSTypeParameterInstantiation | null;
1158
1159
  }
1159
1160
 
1160
1161
  export interface TSInterfaceDeclaration extends Span {
@@ -1233,7 +1234,7 @@ export interface TSIndexSignatureName extends Span {
1233
1234
  export interface TSInterfaceHeritage extends Span {
1234
1235
  type: 'TSInterfaceHeritage';
1235
1236
  expression: Expression;
1236
- typeParameters: TSTypeParameterInstantiation | null;
1237
+ typeArguments: TSTypeParameterInstantiation | null;
1237
1238
  }
1238
1239
 
1239
1240
  export interface TSTypePredicate extends Span {
@@ -1277,7 +1278,7 @@ export interface TSInferType extends Span {
1277
1278
  export interface TSTypeQuery extends Span {
1278
1279
  type: 'TSTypeQuery';
1279
1280
  exprName: TSTypeQueryExprName;
1280
- typeParameters: TSTypeParameterInstantiation | null;
1281
+ typeArguments: TSTypeParameterInstantiation | null;
1281
1282
  }
1282
1283
 
1283
1284
  export type TSTypeQueryExprName = TSImportType | TSTypeName;