@oxc-project/types 0.59.0 → 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 +47 -47
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oxc-project/types",
3
- "version": "0.59.0",
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
- typeArguments: TSTypeParameterInstantiation | null;
116
+ typeArguments?: TSTypeParameterInstantiation | null;
117
117
  }
118
118
 
119
119
  export interface TemplateElement extends Span {
@@ -158,14 +158,14 @@ export interface CallExpression extends Span {
158
158
  callee: Expression;
159
159
  arguments: Array<Argument>;
160
160
  optional: boolean;
161
- typeArguments: TSTypeParameterInstantiation | null;
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
- typeArguments: 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,7 +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
+ directive?: string | null;
388
388
  }
389
389
 
390
390
  export interface IfStatement extends Span {
@@ -496,8 +496,8 @@ export interface DebuggerStatement extends Span {
496
496
 
497
497
  export type BindingPattern =
498
498
  & ({
499
- typeAnnotation: TSTypeAnnotation | null;
500
- optional: boolean;
499
+ typeAnnotation?: TSTypeAnnotation | null;
500
+ optional?: boolean;
501
501
  })
502
502
  & (BindingIdentifier | ObjectPattern | ArrayPattern | AssignmentPattern);
503
503
 
@@ -542,10 +542,10 @@ export interface Function extends Span {
542
542
  async: boolean;
543
543
  params: ParamPattern[];
544
544
  body: FunctionBody | null;
545
- declare: boolean;
546
- typeParameters: TSTypeParameterDeclaration | null;
547
- thisParam: TSThisParameter | null;
548
- returnType: TSTypeAnnotation | null;
545
+ declare?: boolean;
546
+ typeParameters?: TSTypeParameterDeclaration | null;
547
+ thisParam?: TSThisParameter | null;
548
+ returnType?: TSTypeAnnotation | null;
549
549
  }
550
550
 
551
551
  export type ParamPattern = FormalParameter | FormalParameterRest;
@@ -565,10 +565,10 @@ export interface FormalParameterRest extends Span {
565
565
 
566
566
  export type FormalParameter =
567
567
  & ({
568
- decorators: Array<Decorator>;
569
- accessibility: TSAccessibility | null;
570
- readonly: boolean;
571
- override: boolean;
568
+ decorators?: Array<Decorator>;
569
+ accessibility?: TSAccessibility | null;
570
+ readonly?: boolean;
571
+ override?: boolean;
572
572
  })
573
573
  & BindingPattern;
574
574
 
@@ -585,8 +585,8 @@ export interface ArrowFunctionExpression extends Span {
585
585
  async: boolean;
586
586
  params: ParamPattern[];
587
587
  body: FunctionBody | Expression;
588
- typeParameters: TSTypeParameterDeclaration | null;
589
- returnType: TSTypeAnnotation | null;
588
+ typeParameters?: TSTypeParameterDeclaration | null;
589
+ returnType?: TSTypeAnnotation | null;
590
590
  }
591
591
 
592
592
  export interface YieldExpression extends Span {
@@ -600,12 +600,12 @@ export interface Class extends Span {
600
600
  id: BindingIdentifier | null;
601
601
  superClass: Expression | null;
602
602
  body: ClassBody;
603
- decorators: Array<Decorator>;
604
- typeParameters: TSTypeParameterDeclaration | null;
605
- superTypeArguments: TSTypeParameterInstantiation | null;
606
- implements: Array<TSClassImplements>;
607
- abstract: boolean;
608
- declare: boolean;
603
+ decorators?: Array<Decorator>;
604
+ typeParameters?: TSTypeParameterDeclaration | null;
605
+ superTypeArguments?: TSTypeParameterInstantiation | null;
606
+ implements?: Array<TSClassImplements>;
607
+ abstract?: boolean;
608
+ declare?: boolean;
609
609
  }
610
610
 
611
611
  export type ClassType = 'ClassDeclaration' | 'ClassExpression';
@@ -624,10 +624,10 @@ export interface MethodDefinition extends Span {
624
624
  key: PropertyKey;
625
625
  kind: MethodDefinitionKind;
626
626
  value: Function;
627
- decorators: Array<Decorator>;
628
- override: boolean;
629
- optional: boolean;
630
- accessibility: TSAccessibility | null;
627
+ decorators?: Array<Decorator>;
628
+ override?: boolean;
629
+ optional?: boolean;
630
+ accessibility?: TSAccessibility | null;
631
631
  }
632
632
 
633
633
  export type MethodDefinitionType = 'MethodDefinition' | 'TSAbstractMethodDefinition';
@@ -638,14 +638,14 @@ export interface PropertyDefinition extends Span {
638
638
  computed: boolean;
639
639
  key: PropertyKey;
640
640
  value: Expression | 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;
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;
649
649
  }
650
650
 
651
651
  export type PropertyDefinitionType = 'PropertyDefinition' | 'TSAbstractPropertyDefinition';
@@ -678,10 +678,10 @@ export interface AccessorProperty extends Span {
678
678
  value: Expression | null;
679
679
  computed: boolean;
680
680
  static: boolean;
681
- decorators: Array<Decorator>;
682
- definite: boolean;
683
- typeAnnotation: TSTypeAnnotation | null;
684
- accessibility: TSAccessibility | null;
681
+ decorators?: Array<Decorator>;
682
+ definite?: boolean;
683
+ typeAnnotation?: TSTypeAnnotation | null;
684
+ accessibility?: TSAccessibility | null;
685
685
  }
686
686
 
687
687
  export interface ImportExpression extends Span {
@@ -695,7 +695,7 @@ export interface ImportDeclaration extends Span {
695
695
  specifiers: Array<ImportDeclarationSpecifier>;
696
696
  source: StringLiteral;
697
697
  attributes: Array<ImportAttribute>;
698
- importKind: ImportOrExportKind;
698
+ importKind?: ImportOrExportKind;
699
699
  }
700
700
 
701
701
  export type ImportPhase = 'source' | 'defer';
@@ -706,7 +706,7 @@ export interface ImportSpecifier extends Span {
706
706
  type: 'ImportSpecifier';
707
707
  imported: ModuleExportName;
708
708
  local: BindingIdentifier;
709
- importKind: ImportOrExportKind;
709
+ importKind?: ImportOrExportKind;
710
710
  }
711
711
 
712
712
  export interface ImportDefaultSpecifier extends Span {
@@ -733,7 +733,7 @@ export interface ExportNamedDeclaration extends Span {
733
733
  specifiers: Array<ExportSpecifier>;
734
734
  source: StringLiteral | null;
735
735
  attributes: Array<ImportAttribute>;
736
- exportKind: ImportOrExportKind;
736
+ exportKind?: ImportOrExportKind;
737
737
  }
738
738
 
739
739
  export interface ExportDefaultDeclaration extends Span {
@@ -746,14 +746,14 @@ export interface ExportAllDeclaration extends Span {
746
746
  exported: ModuleExportName | null;
747
747
  source: StringLiteral;
748
748
  attributes: Array<ImportAttribute>;
749
- exportKind: ImportOrExportKind;
749
+ exportKind?: ImportOrExportKind;
750
750
  }
751
751
 
752
752
  export interface ExportSpecifier extends Span {
753
753
  type: 'ExportSpecifier';
754
754
  local: ModuleExportName;
755
755
  exported: ModuleExportName;
756
- exportKind: ImportOrExportKind;
756
+ exportKind?: ImportOrExportKind;
757
757
  }
758
758
 
759
759
  export type ExportDefaultDeclarationKind = Function | Class | TSInterfaceDeclaration | Expression;
@@ -821,7 +821,7 @@ export interface JSXOpeningElement extends Span {
821
821
  attributes: Array<JSXAttributeItem>;
822
822
  name: JSXElementName;
823
823
  selfClosing: boolean;
824
- typeArguments: TSTypeParameterInstantiation | null;
824
+ typeArguments?: TSTypeParameterInstantiation | null;
825
825
  }
826
826
 
827
827
  export interface JSXClosingElement extends Span {