@oxc-project/types 0.34.0 → 0.36.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oxc-project/types",
3
- "version": "0.34.0",
3
+ "version": "0.36.0",
4
4
  "description": "Types for Oxc AST nodes",
5
5
  "keywords": [
6
6
  "AST",
@@ -18,8 +18,8 @@
18
18
  "funding": {
19
19
  "url": "https://github.com/sponsors/Boshen"
20
20
  },
21
- "types": "src/generated/types.d.ts",
21
+ "types": "types.d.ts",
22
22
  "files": [
23
- "src/generated/types.d.ts"
23
+ "types.d.ts"
24
24
  ]
25
25
  }
@@ -1,63 +1,36 @@
1
1
  // Auto-generated code, DO NOT EDIT DIRECTLY!
2
2
  // To edit this generated file you have to edit `tasks/ast_tools/src/generators/typescript.rs`
3
3
 
4
- export interface FormalParameterRest extends Span {
5
- type: 'RestElement';
6
- argument: BindingPatternKind;
7
- typeAnnotation: TSTypeAnnotation | null;
8
- optional: boolean;
9
- }
10
-
11
- export type RegExpFlags = {
12
- /** Global flag */
13
- G: 1;
14
- /** Ignore case flag */
15
- I: 2;
16
- /** Multiline flag */
17
- M: 4;
18
- /** DotAll flag */
19
- S: 8;
20
- /** Unicode flag */
21
- U: 16;
22
- /** Sticky flag */
23
- Y: 32;
24
- /** Indices flag */
25
- D: 64;
26
- /** Unicode sets flag */
27
- V: 128;
28
- };
29
-
30
- export type JSXElementName =
31
- | JSXIdentifier
32
- | JSXNamespacedName
33
- | JSXMemberExpression;
34
-
35
- export type JSXMemberExpressionObject = JSXIdentifier | JSXMemberExpression;
36
-
37
4
  export interface BooleanLiteral extends Span {
38
- type: 'BooleanLiteral';
5
+ type: 'Literal';
39
6
  value: boolean;
7
+ raw: string;
40
8
  }
41
9
 
42
10
  export interface NullLiteral extends Span {
43
- type: 'NullLiteral';
11
+ type: 'Literal';
12
+ value: null;
13
+ raw: 'null';
44
14
  }
45
15
 
46
16
  export interface NumericLiteral extends Span {
47
- type: 'NumericLiteral';
17
+ type: 'Literal';
48
18
  value: number;
49
19
  raw: string;
50
20
  }
51
21
 
52
22
  export interface BigIntLiteral extends Span {
53
- type: 'BigIntLiteral';
23
+ type: 'Literal';
54
24
  raw: string;
25
+ value: null;
26
+ bigint: string;
55
27
  }
56
28
 
57
29
  export interface RegExpLiteral extends Span {
58
- type: 'RegExpLiteral';
59
- value: EmptyObject;
60
- regex: RegExp;
30
+ type: 'Literal';
31
+ raw: string;
32
+ value: {} | null;
33
+ regex: { pattern: string; flags: string };
61
34
  }
62
35
 
63
36
  export interface RegExp {
@@ -67,9 +40,6 @@ export interface RegExp {
67
40
 
68
41
  export type RegExpPattern = string | string | Pattern;
69
42
 
70
- export interface EmptyObject {
71
- }
72
-
73
43
  export interface StringLiteral extends Span {
74
44
  type: 'StringLiteral';
75
45
  value: string;
@@ -168,7 +138,6 @@ export interface ObjectProperty extends Span {
168
138
  kind: PropertyKind;
169
139
  key: PropertyKey;
170
140
  value: Expression;
171
- init: Expression | null;
172
141
  method: boolean;
173
142
  shorthand: boolean;
174
143
  computed: boolean;
@@ -416,12 +385,12 @@ export type AssignmentTargetPattern = ArrayAssignmentTarget | ObjectAssignmentTa
416
385
 
417
386
  export interface ArrayAssignmentTarget extends Span {
418
387
  type: 'ArrayAssignmentTarget';
419
- elements: Array<AssignmentTargetMaybeDefault | AssignmentTargetRest | null>;
388
+ elements: Array<AssignmentTargetRest | AssignmentTargetMaybeDefault | null>;
420
389
  }
421
390
 
422
391
  export interface ObjectAssignmentTarget extends Span {
423
392
  type: 'ObjectAssignmentTarget';
424
- properties: Array<AssignmentTargetProperty | AssignmentTargetRest>;
393
+ properties: Array<AssignmentTargetRest | AssignmentTargetProperty>;
425
394
  }
426
395
 
427
396
  export interface AssignmentTargetRest extends Span {
@@ -758,7 +727,7 @@ export interface AssignmentPattern extends Span {
758
727
 
759
728
  export interface ObjectPattern extends Span {
760
729
  type: 'ObjectPattern';
761
- properties: Array<BindingProperty | BindingRestElement>;
730
+ properties: Array<BindingRestElement | BindingProperty>;
762
731
  }
763
732
 
764
733
  export interface BindingProperty extends Span {
@@ -771,7 +740,7 @@ export interface BindingProperty extends Span {
771
740
 
772
741
  export interface ArrayPattern extends Span {
773
742
  type: 'ArrayPattern';
774
- elements: Array<BindingPattern | BindingRestElement | null>;
743
+ elements: Array<BindingRestElement | BindingPattern | null>;
775
744
  }
776
745
 
777
746
  export interface BindingRestElement extends Span {
@@ -1054,7 +1023,6 @@ export type ModuleExportName = IdentifierName | IdentifierReference | StringLite
1054
1023
 
1055
1024
  export interface TSThisParameter extends Span {
1056
1025
  type: 'TSThisParameter';
1057
- thisSpan: Span;
1058
1026
  typeAnnotation: TSTypeAnnotation | null;
1059
1027
  }
1060
1028
 
@@ -1072,53 +1040,7 @@ export interface TSEnumMember extends Span {
1072
1040
  initializer: Expression | null;
1073
1041
  }
1074
1042
 
1075
- export type TSEnumMemberName =
1076
- | IdentifierName
1077
- | StringLiteral
1078
- | TemplateLiteral
1079
- | NumericLiteral
1080
- | BooleanLiteral
1081
- | NullLiteral
1082
- | NumericLiteral
1083
- | BigIntLiteral
1084
- | RegExpLiteral
1085
- | StringLiteral
1086
- | TemplateLiteral
1087
- | IdentifierReference
1088
- | MetaProperty
1089
- | Super
1090
- | ArrayExpression
1091
- | ArrowFunctionExpression
1092
- | AssignmentExpression
1093
- | AwaitExpression
1094
- | BinaryExpression
1095
- | CallExpression
1096
- | ChainExpression
1097
- | Class
1098
- | ConditionalExpression
1099
- | Function
1100
- | ImportExpression
1101
- | LogicalExpression
1102
- | NewExpression
1103
- | ObjectExpression
1104
- | ParenthesizedExpression
1105
- | SequenceExpression
1106
- | TaggedTemplateExpression
1107
- | ThisExpression
1108
- | UnaryExpression
1109
- | UpdateExpression
1110
- | YieldExpression
1111
- | PrivateInExpression
1112
- | JSXElement
1113
- | JSXFragment
1114
- | TSAsExpression
1115
- | TSSatisfiesExpression
1116
- | TSTypeAssertion
1117
- | TSNonNullExpression
1118
- | TSInstantiationExpression
1119
- | ComputedMemberExpression
1120
- | StaticMemberExpression
1121
- | PrivateFieldExpression;
1043
+ export type TSEnumMemberName = IdentifierName | StringLiteral;
1122
1044
 
1123
1045
  export interface TSTypeAnnotation extends Span {
1124
1046
  type: 'TSTypeAnnotation';
@@ -1427,6 +1349,7 @@ export interface TSIndexSignature extends Span {
1427
1349
  parameters: Array<TSIndexSignatureName>;
1428
1350
  typeAnnotation: TSTypeAnnotation;
1429
1351
  readonly: boolean;
1352
+ static: boolean;
1430
1353
  }
1431
1354
 
1432
1355
  export interface TSCallSignatureDeclaration extends Span {
@@ -1877,9 +1800,8 @@ export type Term =
1877
1800
  | IndexedReference
1878
1801
  | NamedReference;
1879
1802
 
1880
- export interface BoundaryAssertion {
1803
+ export interface BoundaryAssertion extends Span {
1881
1804
  type: 'BoundaryAssertion';
1882
- span: Span;
1883
1805
  kind: BoundaryAssertionKind;
1884
1806
  }
1885
1807
 
@@ -2008,3 +1930,36 @@ export interface NamedReference extends Span {
2008
1930
  type: 'NamedReference';
2009
1931
  name: string;
2010
1932
  }
1933
+
1934
+ export interface FormalParameterRest extends Span {
1935
+ type: 'RestElement';
1936
+ argument: BindingPatternKind;
1937
+ typeAnnotation: TSTypeAnnotation | null;
1938
+ optional: boolean;
1939
+ }
1940
+
1941
+ export type RegExpFlags = {
1942
+ /** Global flag */
1943
+ G: 1;
1944
+ /** Ignore case flag */
1945
+ I: 2;
1946
+ /** Multiline flag */
1947
+ M: 4;
1948
+ /** DotAll flag */
1949
+ S: 8;
1950
+ /** Unicode flag */
1951
+ U: 16;
1952
+ /** Sticky flag */
1953
+ Y: 32;
1954
+ /** Indices flag */
1955
+ D: 64;
1956
+ /** Unicode sets flag */
1957
+ V: 128;
1958
+ };
1959
+
1960
+ export type JSXElementName =
1961
+ | JSXIdentifier
1962
+ | JSXNamespacedName
1963
+ | JSXMemberExpression;
1964
+
1965
+ export type JSXMemberExpressionObject = JSXIdentifier | JSXMemberExpression;