@oxc-project/types 0.50.0 → 0.51.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 +46 -56
package/package.json
CHANGED
package/types.d.ts
CHANGED
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
|
|
4
4
|
export interface Program extends Span {
|
|
5
5
|
type: 'Program';
|
|
6
|
+
body: Array<Directive | Statement>;
|
|
6
7
|
sourceType: ModuleKind;
|
|
7
8
|
hashbang: Hashbang | null;
|
|
8
|
-
body: Array<Directive | Statement>;
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
export type Expression =
|
|
@@ -90,12 +90,12 @@ export type ObjectPropertyKind = ObjectProperty | SpreadElement;
|
|
|
90
90
|
|
|
91
91
|
export interface ObjectProperty extends Span {
|
|
92
92
|
type: 'Property';
|
|
93
|
-
kind: PropertyKind;
|
|
94
|
-
key: PropertyKey;
|
|
95
|
-
value: Expression;
|
|
96
93
|
method: boolean;
|
|
97
94
|
shorthand: boolean;
|
|
98
95
|
computed: boolean;
|
|
96
|
+
key: PropertyKey;
|
|
97
|
+
kind: PropertyKind;
|
|
98
|
+
value: Expression;
|
|
99
99
|
}
|
|
100
100
|
|
|
101
101
|
export type PropertyKey = IdentifierName | PrivateIdentifier | Expression;
|
|
@@ -104,8 +104,8 @@ export type PropertyKind = 'init' | 'get' | 'set';
|
|
|
104
104
|
|
|
105
105
|
export interface TemplateLiteral extends Span {
|
|
106
106
|
type: 'TemplateLiteral';
|
|
107
|
-
quasis: Array<TemplateElement>;
|
|
108
107
|
expressions: Array<Expression>;
|
|
108
|
+
quasis: Array<TemplateElement>;
|
|
109
109
|
}
|
|
110
110
|
|
|
111
111
|
export interface TaggedTemplateExpression extends Span {
|
|
@@ -117,8 +117,8 @@ export interface TaggedTemplateExpression extends Span {
|
|
|
117
117
|
|
|
118
118
|
export interface TemplateElement extends Span {
|
|
119
119
|
type: 'TemplateElement';
|
|
120
|
-
tail: boolean;
|
|
121
120
|
value: TemplateElementValue;
|
|
121
|
+
tail: boolean;
|
|
122
122
|
}
|
|
123
123
|
|
|
124
124
|
export interface TemplateElementValue {
|
|
@@ -132,24 +132,24 @@ export interface ComputedMemberExpression extends Span {
|
|
|
132
132
|
type: 'MemberExpression';
|
|
133
133
|
object: Expression;
|
|
134
134
|
property: Expression;
|
|
135
|
-
optional: boolean;
|
|
136
135
|
computed: true;
|
|
136
|
+
optional: boolean;
|
|
137
137
|
}
|
|
138
138
|
|
|
139
139
|
export interface StaticMemberExpression extends Span {
|
|
140
140
|
type: 'MemberExpression';
|
|
141
141
|
object: Expression;
|
|
142
142
|
property: IdentifierName;
|
|
143
|
-
optional: boolean;
|
|
144
143
|
computed: false;
|
|
144
|
+
optional: boolean;
|
|
145
145
|
}
|
|
146
146
|
|
|
147
147
|
export interface PrivateFieldExpression extends Span {
|
|
148
148
|
type: 'MemberExpression';
|
|
149
149
|
object: Expression;
|
|
150
150
|
property: PrivateIdentifier;
|
|
151
|
-
optional: boolean;
|
|
152
151
|
computed: false;
|
|
152
|
+
optional: boolean;
|
|
153
153
|
}
|
|
154
154
|
|
|
155
155
|
export interface CallExpression extends Span {
|
|
@@ -190,8 +190,8 @@ export interface UpdateExpression extends Span {
|
|
|
190
190
|
export interface UnaryExpression extends Span {
|
|
191
191
|
type: 'UnaryExpression';
|
|
192
192
|
operator: UnaryOperator;
|
|
193
|
-
argument: Expression;
|
|
194
193
|
prefix: true;
|
|
194
|
+
argument: Expression;
|
|
195
195
|
}
|
|
196
196
|
|
|
197
197
|
export interface BinaryExpression extends Span {
|
|
@@ -204,8 +204,8 @@ export interface BinaryExpression extends Span {
|
|
|
204
204
|
export interface PrivateInExpression extends Span {
|
|
205
205
|
type: 'BinaryExpression';
|
|
206
206
|
left: PrivateIdentifier;
|
|
207
|
-
right: Expression;
|
|
208
207
|
operator: 'in';
|
|
208
|
+
right: Expression;
|
|
209
209
|
}
|
|
210
210
|
|
|
211
211
|
export interface LogicalExpression extends Span {
|
|
@@ -269,22 +269,22 @@ export type AssignmentTargetProperty = AssignmentTargetPropertyIdentifier | Assi
|
|
|
269
269
|
|
|
270
270
|
export interface AssignmentTargetPropertyIdentifier extends Span {
|
|
271
271
|
type: 'Property';
|
|
272
|
-
key: IdentifierReference;
|
|
273
|
-
value: IdentifierReference | AssignmentTargetWithDefault;
|
|
274
|
-
kind: 'init';
|
|
275
272
|
method: false;
|
|
276
|
-
shorthand:
|
|
273
|
+
shorthand: true;
|
|
277
274
|
computed: false;
|
|
275
|
+
key: IdentifierReference;
|
|
276
|
+
kind: 'init';
|
|
277
|
+
value: IdentifierReference | AssignmentTargetWithDefault;
|
|
278
278
|
}
|
|
279
279
|
|
|
280
280
|
export interface AssignmentTargetPropertyProperty extends Span {
|
|
281
281
|
type: 'Property';
|
|
282
|
+
method: false;
|
|
283
|
+
shorthand: false;
|
|
284
|
+
computed: boolean;
|
|
282
285
|
key: PropertyKey;
|
|
283
286
|
value: AssignmentTargetMaybeDefault;
|
|
284
|
-
computed: boolean;
|
|
285
287
|
kind: 'init';
|
|
286
|
-
method: false;
|
|
287
|
-
shorthand: false;
|
|
288
288
|
}
|
|
289
289
|
|
|
290
290
|
export interface SequenceExpression extends Span {
|
|
@@ -363,8 +363,8 @@ export type Declaration =
|
|
|
363
363
|
|
|
364
364
|
export interface VariableDeclaration extends Span {
|
|
365
365
|
type: 'VariableDeclaration';
|
|
366
|
-
kind: VariableDeclarationKind;
|
|
367
366
|
declarations: Array<VariableDeclarator>;
|
|
367
|
+
kind: VariableDeclarationKind;
|
|
368
368
|
declare: boolean;
|
|
369
369
|
}
|
|
370
370
|
|
|
@@ -461,14 +461,14 @@ export interface SwitchStatement extends Span {
|
|
|
461
461
|
|
|
462
462
|
export interface SwitchCase extends Span {
|
|
463
463
|
type: 'SwitchCase';
|
|
464
|
-
test: Expression | null;
|
|
465
464
|
consequent: Array<Statement>;
|
|
465
|
+
test: Expression | null;
|
|
466
466
|
}
|
|
467
467
|
|
|
468
468
|
export interface LabeledStatement extends Span {
|
|
469
469
|
type: 'LabeledStatement';
|
|
470
|
-
label: LabelIdentifier;
|
|
471
470
|
body: Statement;
|
|
471
|
+
label: LabelIdentifier;
|
|
472
472
|
}
|
|
473
473
|
|
|
474
474
|
export interface ThrowStatement extends Span {
|
|
@@ -485,17 +485,10 @@ export interface TryStatement extends Span {
|
|
|
485
485
|
|
|
486
486
|
export interface CatchClause extends Span {
|
|
487
487
|
type: 'CatchClause';
|
|
488
|
-
param:
|
|
488
|
+
param: BindingPattern | null;
|
|
489
489
|
body: BlockStatement;
|
|
490
490
|
}
|
|
491
491
|
|
|
492
|
-
export type CatchParameter =
|
|
493
|
-
& ({
|
|
494
|
-
type: 'CatchParameter';
|
|
495
|
-
})
|
|
496
|
-
& Span
|
|
497
|
-
& BindingPattern;
|
|
498
|
-
|
|
499
492
|
export interface DebuggerStatement extends Span {
|
|
500
493
|
type: 'DebuggerStatement';
|
|
501
494
|
}
|
|
@@ -522,12 +515,12 @@ export interface ObjectPattern extends Span {
|
|
|
522
515
|
|
|
523
516
|
export interface BindingProperty extends Span {
|
|
524
517
|
type: 'Property';
|
|
525
|
-
|
|
526
|
-
value: BindingPattern;
|
|
518
|
+
method: false;
|
|
527
519
|
shorthand: boolean;
|
|
528
520
|
computed: boolean;
|
|
521
|
+
key: PropertyKey;
|
|
529
522
|
kind: 'init';
|
|
530
|
-
|
|
523
|
+
value: BindingPattern;
|
|
531
524
|
}
|
|
532
525
|
|
|
533
526
|
export interface ArrayPattern extends Span {
|
|
@@ -543,15 +536,15 @@ export interface BindingRestElement extends Span {
|
|
|
543
536
|
export interface Function extends Span {
|
|
544
537
|
type: FunctionType;
|
|
545
538
|
id: BindingIdentifier | null;
|
|
539
|
+
expression: false;
|
|
546
540
|
generator: boolean;
|
|
547
541
|
async: boolean;
|
|
542
|
+
params: ParamPattern[];
|
|
543
|
+
body: FunctionBody | null;
|
|
548
544
|
declare: boolean;
|
|
549
545
|
typeParameters: TSTypeParameterDeclaration | null;
|
|
550
546
|
thisParam: TSThisParameter | null;
|
|
551
|
-
params: ParamPattern[];
|
|
552
547
|
returnType: TSTypeAnnotation | null;
|
|
553
|
-
body: FunctionBody | null;
|
|
554
|
-
expression: false;
|
|
555
548
|
}
|
|
556
549
|
|
|
557
550
|
export type ParamPattern = FormalParameter | FormalParameterRest;
|
|
@@ -582,7 +575,6 @@ export type FormalParameter =
|
|
|
582
575
|
readonly: boolean;
|
|
583
576
|
override: boolean;
|
|
584
577
|
})
|
|
585
|
-
& Span
|
|
586
578
|
& BindingPattern;
|
|
587
579
|
|
|
588
580
|
export type FormalParameterKind = 'FormalParameter' | 'UniqueFormalParameters' | 'ArrowFormalParameters' | 'Signature';
|
|
@@ -594,14 +586,14 @@ export interface FunctionBody extends Span {
|
|
|
594
586
|
|
|
595
587
|
export interface ArrowFunctionExpression extends Span {
|
|
596
588
|
type: 'ArrowFunctionExpression';
|
|
589
|
+
id: null;
|
|
597
590
|
expression: boolean;
|
|
591
|
+
generator: false;
|
|
598
592
|
async: boolean;
|
|
599
|
-
typeParameters: TSTypeParameterDeclaration | null;
|
|
600
593
|
params: ParamPattern[];
|
|
601
|
-
returnType: TSTypeAnnotation | null;
|
|
602
594
|
body: FunctionBody | Expression;
|
|
603
|
-
|
|
604
|
-
|
|
595
|
+
typeParameters: TSTypeParameterDeclaration | null;
|
|
596
|
+
returnType: TSTypeAnnotation | null;
|
|
605
597
|
}
|
|
606
598
|
|
|
607
599
|
export interface YieldExpression extends Span {
|
|
@@ -612,13 +604,13 @@ export interface YieldExpression extends Span {
|
|
|
612
604
|
|
|
613
605
|
export interface Class extends Span {
|
|
614
606
|
type: ClassType;
|
|
615
|
-
decorators: Array<Decorator>;
|
|
616
607
|
id: BindingIdentifier | null;
|
|
617
|
-
typeParameters: TSTypeParameterDeclaration | null;
|
|
618
608
|
superClass: Expression | null;
|
|
609
|
+
body: ClassBody;
|
|
610
|
+
decorators: Array<Decorator>;
|
|
611
|
+
typeParameters: TSTypeParameterDeclaration | null;
|
|
619
612
|
superTypeParameters: TSTypeParameterInstantiation | null;
|
|
620
613
|
implements: Array<TSClassImplements> | null;
|
|
621
|
-
body: ClassBody;
|
|
622
614
|
abstract: boolean;
|
|
623
615
|
declare: boolean;
|
|
624
616
|
}
|
|
@@ -634,12 +626,12 @@ export type ClassElement = StaticBlock | MethodDefinition | PropertyDefinition |
|
|
|
634
626
|
|
|
635
627
|
export interface MethodDefinition extends Span {
|
|
636
628
|
type: MethodDefinitionType;
|
|
637
|
-
|
|
629
|
+
static: boolean;
|
|
630
|
+
computed: boolean;
|
|
638
631
|
key: PropertyKey;
|
|
639
|
-
value: Function;
|
|
640
632
|
kind: MethodDefinitionKind;
|
|
641
|
-
|
|
642
|
-
|
|
633
|
+
value: Function;
|
|
634
|
+
decorators: Array<Decorator>;
|
|
643
635
|
override: boolean;
|
|
644
636
|
optional: boolean;
|
|
645
637
|
accessibility: TSAccessibility | null;
|
|
@@ -649,11 +641,11 @@ export type MethodDefinitionType = 'MethodDefinition' | 'TSAbstractMethodDefinit
|
|
|
649
641
|
|
|
650
642
|
export interface PropertyDefinition extends Span {
|
|
651
643
|
type: PropertyDefinitionType;
|
|
652
|
-
|
|
644
|
+
static: boolean;
|
|
645
|
+
computed: boolean;
|
|
653
646
|
key: PropertyKey;
|
|
654
647
|
value: Expression | null;
|
|
655
|
-
|
|
656
|
-
static: boolean;
|
|
648
|
+
decorators: Array<Decorator>;
|
|
657
649
|
declare: boolean;
|
|
658
650
|
override: boolean;
|
|
659
651
|
optional: boolean;
|
|
@@ -689,11 +681,11 @@ export type AccessorPropertyType = 'AccessorProperty' | 'TSAbstractAccessorPrope
|
|
|
689
681
|
|
|
690
682
|
export interface AccessorProperty extends Span {
|
|
691
683
|
type: AccessorPropertyType;
|
|
692
|
-
decorators: Array<Decorator>;
|
|
693
684
|
key: PropertyKey;
|
|
694
685
|
value: Expression | null;
|
|
695
686
|
computed: boolean;
|
|
696
687
|
static: boolean;
|
|
688
|
+
decorators: Array<Decorator>;
|
|
697
689
|
definite: boolean;
|
|
698
690
|
typeAnnotation: TSTypeAnnotation | null;
|
|
699
691
|
accessibility: TSAccessibility | null;
|
|
@@ -809,16 +801,16 @@ export interface StringLiteral extends Span {
|
|
|
809
801
|
|
|
810
802
|
export interface BigIntLiteral extends Span {
|
|
811
803
|
type: 'Literal';
|
|
804
|
+
value: BigInt;
|
|
812
805
|
raw: string | null;
|
|
813
|
-
value: null;
|
|
814
806
|
bigint: string;
|
|
815
807
|
}
|
|
816
808
|
|
|
817
809
|
export interface RegExpLiteral extends Span {
|
|
818
810
|
type: 'Literal';
|
|
819
|
-
|
|
811
|
+
value: RegExp | null;
|
|
820
812
|
raw: string | null;
|
|
821
|
-
|
|
813
|
+
regex: RegExp;
|
|
822
814
|
}
|
|
823
815
|
|
|
824
816
|
export interface RegExp {
|
|
@@ -958,7 +950,6 @@ export type TSLiteral =
|
|
|
958
950
|
| NullLiteral
|
|
959
951
|
| NumericLiteral
|
|
960
952
|
| BigIntLiteral
|
|
961
|
-
| RegExpLiteral
|
|
962
953
|
| StringLiteral
|
|
963
954
|
| TemplateLiteral
|
|
964
955
|
| UnaryExpression;
|
|
@@ -988,7 +979,6 @@ export type TSType =
|
|
|
988
979
|
| TSLiteralType
|
|
989
980
|
| TSMappedType
|
|
990
981
|
| TSNamedTupleMember
|
|
991
|
-
| TSQualifiedName
|
|
992
982
|
| TSTemplateLiteralType
|
|
993
983
|
| TSThisType
|
|
994
984
|
| TSTupleType
|