@oxc-project/types 0.59.0 → 0.61.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.
- package/package.json +1 -1
- package/types.d.ts +54 -64
package/package.json
CHANGED
package/types.d.ts
CHANGED
|
@@ -54,11 +54,17 @@ export type Expression =
|
|
|
54
54
|
export interface IdentifierName extends Span {
|
|
55
55
|
type: 'Identifier';
|
|
56
56
|
name: string;
|
|
57
|
+
decorators?: [];
|
|
58
|
+
optional?: false;
|
|
59
|
+
typeAnnotation?: null;
|
|
57
60
|
}
|
|
58
61
|
|
|
59
62
|
export interface IdentifierReference extends Span {
|
|
60
63
|
type: 'Identifier';
|
|
61
64
|
name: string;
|
|
65
|
+
decorators?: [];
|
|
66
|
+
optional?: false;
|
|
67
|
+
typeAnnotation?: null;
|
|
62
68
|
}
|
|
63
69
|
|
|
64
70
|
export interface BindingIdentifier extends Span {
|
|
@@ -113,7 +119,7 @@ export interface TaggedTemplateExpression extends Span {
|
|
|
113
119
|
type: 'TaggedTemplateExpression';
|
|
114
120
|
tag: Expression;
|
|
115
121
|
quasi: TemplateLiteral;
|
|
116
|
-
typeArguments
|
|
122
|
+
typeArguments?: TSTypeParameterInstantiation | null;
|
|
117
123
|
}
|
|
118
124
|
|
|
119
125
|
export interface TemplateElement extends Span {
|
|
@@ -158,14 +164,14 @@ export interface CallExpression extends Span {
|
|
|
158
164
|
callee: Expression;
|
|
159
165
|
arguments: Array<Argument>;
|
|
160
166
|
optional: boolean;
|
|
161
|
-
typeArguments
|
|
167
|
+
typeArguments?: TSTypeParameterInstantiation | null;
|
|
162
168
|
}
|
|
163
169
|
|
|
164
170
|
export interface NewExpression extends Span {
|
|
165
171
|
type: 'NewExpression';
|
|
166
172
|
callee: Expression;
|
|
167
173
|
arguments: Array<Argument>;
|
|
168
|
-
typeArguments
|
|
174
|
+
typeArguments?: TSTypeParameterInstantiation | null;
|
|
169
175
|
}
|
|
170
176
|
|
|
171
177
|
export interface MetaProperty extends Span {
|
|
@@ -365,16 +371,16 @@ export interface VariableDeclaration extends Span {
|
|
|
365
371
|
type: 'VariableDeclaration';
|
|
366
372
|
declarations: Array<VariableDeclarator>;
|
|
367
373
|
kind: VariableDeclarationKind;
|
|
368
|
-
declare
|
|
374
|
+
declare?: boolean;
|
|
369
375
|
}
|
|
370
376
|
|
|
371
|
-
export type VariableDeclarationKind = 'var' | '
|
|
377
|
+
export type VariableDeclarationKind = 'var' | 'let' | 'const' | 'using' | 'await using';
|
|
372
378
|
|
|
373
379
|
export interface VariableDeclarator extends Span {
|
|
374
380
|
type: 'VariableDeclarator';
|
|
375
381
|
id: BindingPattern;
|
|
376
382
|
init: Expression | null;
|
|
377
|
-
definite
|
|
383
|
+
definite?: boolean;
|
|
378
384
|
}
|
|
379
385
|
|
|
380
386
|
export interface EmptyStatement extends Span {
|
|
@@ -384,7 +390,7 @@ export interface EmptyStatement extends Span {
|
|
|
384
390
|
export interface ExpressionStatement extends Span {
|
|
385
391
|
type: 'ExpressionStatement';
|
|
386
392
|
expression: Expression;
|
|
387
|
-
directive
|
|
393
|
+
directive?: string | null;
|
|
388
394
|
}
|
|
389
395
|
|
|
390
396
|
export interface IfStatement extends Span {
|
|
@@ -496,8 +502,8 @@ export interface DebuggerStatement extends Span {
|
|
|
496
502
|
|
|
497
503
|
export type BindingPattern =
|
|
498
504
|
& ({
|
|
499
|
-
typeAnnotation
|
|
500
|
-
optional
|
|
505
|
+
typeAnnotation?: TSTypeAnnotation | null;
|
|
506
|
+
optional?: boolean;
|
|
501
507
|
})
|
|
502
508
|
& (BindingIdentifier | ObjectPattern | ArrayPattern | AssignmentPattern);
|
|
503
509
|
|
|
@@ -542,10 +548,10 @@ export interface Function extends Span {
|
|
|
542
548
|
async: boolean;
|
|
543
549
|
params: ParamPattern[];
|
|
544
550
|
body: FunctionBody | null;
|
|
545
|
-
declare
|
|
546
|
-
typeParameters
|
|
547
|
-
thisParam
|
|
548
|
-
returnType
|
|
551
|
+
declare?: boolean;
|
|
552
|
+
typeParameters?: TSTypeParameterDeclaration | null;
|
|
553
|
+
thisParam?: TSThisParameter | null;
|
|
554
|
+
returnType?: TSTypeAnnotation | null;
|
|
549
555
|
}
|
|
550
556
|
|
|
551
557
|
export type ParamPattern = FormalParameter | FormalParameterRest;
|
|
@@ -565,10 +571,10 @@ export interface FormalParameterRest extends Span {
|
|
|
565
571
|
|
|
566
572
|
export type FormalParameter =
|
|
567
573
|
& ({
|
|
568
|
-
decorators
|
|
569
|
-
accessibility
|
|
570
|
-
readonly
|
|
571
|
-
override
|
|
574
|
+
decorators?: Array<Decorator>;
|
|
575
|
+
accessibility?: TSAccessibility | null;
|
|
576
|
+
readonly?: boolean;
|
|
577
|
+
override?: boolean;
|
|
572
578
|
})
|
|
573
579
|
& BindingPattern;
|
|
574
580
|
|
|
@@ -585,8 +591,8 @@ export interface ArrowFunctionExpression extends Span {
|
|
|
585
591
|
async: boolean;
|
|
586
592
|
params: ParamPattern[];
|
|
587
593
|
body: FunctionBody | Expression;
|
|
588
|
-
typeParameters
|
|
589
|
-
returnType
|
|
594
|
+
typeParameters?: TSTypeParameterDeclaration | null;
|
|
595
|
+
returnType?: TSTypeAnnotation | null;
|
|
590
596
|
}
|
|
591
597
|
|
|
592
598
|
export interface YieldExpression extends Span {
|
|
@@ -600,12 +606,12 @@ export interface Class extends Span {
|
|
|
600
606
|
id: BindingIdentifier | null;
|
|
601
607
|
superClass: Expression | null;
|
|
602
608
|
body: ClassBody;
|
|
603
|
-
decorators
|
|
604
|
-
typeParameters
|
|
605
|
-
superTypeArguments
|
|
606
|
-
implements
|
|
607
|
-
abstract
|
|
608
|
-
declare
|
|
609
|
+
decorators?: Array<Decorator>;
|
|
610
|
+
typeParameters?: TSTypeParameterDeclaration | null;
|
|
611
|
+
superTypeArguments?: TSTypeParameterInstantiation | null;
|
|
612
|
+
implements?: Array<TSClassImplements>;
|
|
613
|
+
abstract?: boolean;
|
|
614
|
+
declare?: boolean;
|
|
609
615
|
}
|
|
610
616
|
|
|
611
617
|
export type ClassType = 'ClassDeclaration' | 'ClassExpression';
|
|
@@ -624,10 +630,10 @@ export interface MethodDefinition extends Span {
|
|
|
624
630
|
key: PropertyKey;
|
|
625
631
|
kind: MethodDefinitionKind;
|
|
626
632
|
value: Function;
|
|
627
|
-
decorators
|
|
628
|
-
override
|
|
629
|
-
optional
|
|
630
|
-
accessibility
|
|
633
|
+
decorators?: Array<Decorator>;
|
|
634
|
+
override?: boolean;
|
|
635
|
+
optional?: boolean;
|
|
636
|
+
accessibility?: TSAccessibility | null;
|
|
631
637
|
}
|
|
632
638
|
|
|
633
639
|
export type MethodDefinitionType = 'MethodDefinition' | 'TSAbstractMethodDefinition';
|
|
@@ -638,14 +644,14 @@ export interface PropertyDefinition extends Span {
|
|
|
638
644
|
computed: boolean;
|
|
639
645
|
key: PropertyKey;
|
|
640
646
|
value: Expression | null;
|
|
641
|
-
decorators
|
|
642
|
-
declare
|
|
643
|
-
override
|
|
644
|
-
optional
|
|
645
|
-
definite
|
|
646
|
-
readonly
|
|
647
|
-
typeAnnotation
|
|
648
|
-
accessibility
|
|
647
|
+
decorators?: Array<Decorator>;
|
|
648
|
+
declare?: boolean;
|
|
649
|
+
override?: boolean;
|
|
650
|
+
optional?: boolean;
|
|
651
|
+
definite?: boolean;
|
|
652
|
+
readonly?: boolean;
|
|
653
|
+
typeAnnotation?: TSTypeAnnotation | null;
|
|
654
|
+
accessibility?: TSAccessibility | null;
|
|
649
655
|
}
|
|
650
656
|
|
|
651
657
|
export type PropertyDefinitionType = 'PropertyDefinition' | 'TSAbstractPropertyDefinition';
|
|
@@ -678,10 +684,10 @@ export interface AccessorProperty extends Span {
|
|
|
678
684
|
value: Expression | null;
|
|
679
685
|
computed: boolean;
|
|
680
686
|
static: boolean;
|
|
681
|
-
decorators
|
|
682
|
-
definite
|
|
683
|
-
typeAnnotation
|
|
684
|
-
accessibility
|
|
687
|
+
decorators?: Array<Decorator>;
|
|
688
|
+
definite?: boolean;
|
|
689
|
+
typeAnnotation?: TSTypeAnnotation | null;
|
|
690
|
+
accessibility?: TSAccessibility | null;
|
|
685
691
|
}
|
|
686
692
|
|
|
687
693
|
export interface ImportExpression extends Span {
|
|
@@ -695,7 +701,7 @@ export interface ImportDeclaration extends Span {
|
|
|
695
701
|
specifiers: Array<ImportDeclarationSpecifier>;
|
|
696
702
|
source: StringLiteral;
|
|
697
703
|
attributes: Array<ImportAttribute>;
|
|
698
|
-
importKind
|
|
704
|
+
importKind?: ImportOrExportKind;
|
|
699
705
|
}
|
|
700
706
|
|
|
701
707
|
export type ImportPhase = 'source' | 'defer';
|
|
@@ -706,7 +712,7 @@ export interface ImportSpecifier extends Span {
|
|
|
706
712
|
type: 'ImportSpecifier';
|
|
707
713
|
imported: ModuleExportName;
|
|
708
714
|
local: BindingIdentifier;
|
|
709
|
-
importKind
|
|
715
|
+
importKind?: ImportOrExportKind;
|
|
710
716
|
}
|
|
711
717
|
|
|
712
718
|
export interface ImportDefaultSpecifier extends Span {
|
|
@@ -733,7 +739,7 @@ export interface ExportNamedDeclaration extends Span {
|
|
|
733
739
|
specifiers: Array<ExportSpecifier>;
|
|
734
740
|
source: StringLiteral | null;
|
|
735
741
|
attributes: Array<ImportAttribute>;
|
|
736
|
-
exportKind
|
|
742
|
+
exportKind?: ImportOrExportKind;
|
|
737
743
|
}
|
|
738
744
|
|
|
739
745
|
export interface ExportDefaultDeclaration extends Span {
|
|
@@ -746,14 +752,14 @@ export interface ExportAllDeclaration extends Span {
|
|
|
746
752
|
exported: ModuleExportName | null;
|
|
747
753
|
source: StringLiteral;
|
|
748
754
|
attributes: Array<ImportAttribute>;
|
|
749
|
-
exportKind
|
|
755
|
+
exportKind?: ImportOrExportKind;
|
|
750
756
|
}
|
|
751
757
|
|
|
752
758
|
export interface ExportSpecifier extends Span {
|
|
753
759
|
type: 'ExportSpecifier';
|
|
754
760
|
local: ModuleExportName;
|
|
755
761
|
exported: ModuleExportName;
|
|
756
|
-
exportKind
|
|
762
|
+
exportKind?: ImportOrExportKind;
|
|
757
763
|
}
|
|
758
764
|
|
|
759
765
|
export type ExportDefaultDeclarationKind = Function | Class | TSInterfaceDeclaration | Expression;
|
|
@@ -821,7 +827,7 @@ export interface JSXOpeningElement extends Span {
|
|
|
821
827
|
attributes: Array<JSXAttributeItem>;
|
|
822
828
|
name: JSXElementName;
|
|
823
829
|
selfClosing: boolean;
|
|
824
|
-
typeArguments
|
|
830
|
+
typeArguments?: TSTypeParameterInstantiation | null;
|
|
825
831
|
}
|
|
826
832
|
|
|
827
833
|
export interface JSXClosingElement extends Span {
|
|
@@ -1286,26 +1292,12 @@ export type TSTypeQueryExprName = TSImportType | TSTypeName;
|
|
|
1286
1292
|
export interface TSImportType extends Span {
|
|
1287
1293
|
type: 'TSImportType';
|
|
1288
1294
|
argument: TSType;
|
|
1289
|
-
options:
|
|
1295
|
+
options: ObjectExpression | null;
|
|
1290
1296
|
qualifier: TSTypeName | null;
|
|
1291
1297
|
typeArguments: TSTypeParameterInstantiation | null;
|
|
1292
1298
|
isTypeOf: boolean;
|
|
1293
1299
|
}
|
|
1294
1300
|
|
|
1295
|
-
export interface TSImportAttributes extends Span {
|
|
1296
|
-
type: 'TSImportAttributes';
|
|
1297
|
-
attributesKeyword: IdentifierName;
|
|
1298
|
-
elements: Array<TSImportAttribute>;
|
|
1299
|
-
}
|
|
1300
|
-
|
|
1301
|
-
export interface TSImportAttribute extends Span {
|
|
1302
|
-
type: 'TSImportAttribute';
|
|
1303
|
-
name: TSImportAttributeName;
|
|
1304
|
-
value: Expression;
|
|
1305
|
-
}
|
|
1306
|
-
|
|
1307
|
-
export type TSImportAttributeName = IdentifierName | StringLiteral;
|
|
1308
|
-
|
|
1309
1301
|
export interface TSFunctionType extends Span {
|
|
1310
1302
|
type: 'TSFunctionType';
|
|
1311
1303
|
typeParameters: TSTypeParameterDeclaration | null;
|
|
@@ -1793,8 +1785,6 @@ export type Node =
|
|
|
1793
1785
|
| TSInferType
|
|
1794
1786
|
| TSTypeQuery
|
|
1795
1787
|
| TSImportType
|
|
1796
|
-
| TSImportAttributes
|
|
1797
|
-
| TSImportAttribute
|
|
1798
1788
|
| TSFunctionType
|
|
1799
1789
|
| TSConstructorType
|
|
1800
1790
|
| TSMappedType
|