@swc/core 1.3.17 → 1.3.19
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/CHANGELOG.md +73 -0
- package/package.json +11 -11
- package/spack.d.ts +4 -4
- package/types.d.ts +55 -55
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,79 @@
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
|
+
- **(es/compat)** Fix consecutive optional call (#6461) ([f7072db](https://github.com/swc-project/swc/commit/f7072dbb7eb768e2a4dad5aa9f2ac6c6bacf560e))
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
- **(es/lints)** Revert check for reassignment to classes (#6472) ([ca20d94](https://github.com/swc-project/swc/commit/ca20d94a7492198b450755a9d5033fb6404737f9))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
- **(es/minifier)** Preserve unused imported specifiers (#6458) ([dabea71](https://github.com/swc-project/swc/commit/dabea71c4461a96836e4456bd2c6bbcf07f238a4))
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
- **(es/minifier)** Abort inliner on fn declarations used multiple time (#6473) ([15ad2c2](https://github.com/swc-project/swc/commit/15ad2c256880bea01931203ec7adfa61c9ca13be))
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
- **(es/minifier)** Avoid dropping statements which has side-effects (#6476) ([9154bbc](https://github.com/swc-project/swc/commit/9154bbc1117f91dd53fdf87c7eab29db90149376))
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
- **(es/modules)** Remove wrong check for `jsc.paths` (#6470) ([072bd13](https://github.com/swc-project/swc/commit/072bd130239579566d319a47156c570277cebb1b))
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
- **(es/parser)** Fix parsing of regexp (#6469) ([3e702b9](https://github.com/swc-project/swc/commit/3e702b9804a07f610948f731bbb8cfdcec8065a5))
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
- **(xml/parser)** Fix parsing of comments (#6449) ([3a0d98b](https://github.com/swc-project/swc/commit/3a0d98b6e986dd175b64534bc99c2a59a99b97d0))
|
|
30
|
+
|
|
31
|
+
### Features
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
- **(es/minifier)** Support script fully (#6455) ([4d7b920](https://github.com/swc-project/swc/commit/4d7b920bd4521aacd7e4b77e3f2973a30c8ab5e9))
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
- **(html/minifier)** Remove empty script and style tags with attributes (#6447) ([7441721](https://github.com/swc-project/swc/commit/74417217a98bb26dcce7f913bb8ee35b538f0d06))
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
- **(html/minifier)** Use the latest `EsVersion` (#6453) ([7f6bf59](https://github.com/swc-project/swc/commit/7f6bf59a98710ce7964e99ab621a68dc729c021d))
|
|
42
|
+
|
|
43
|
+
### Refactor
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
- **(bindings)** Deprecate `jsvalue::*_serde` (#6462) ([dd4b9e8](https://github.com/swc-project/swc/commit/dd4b9e87de93294ed402c357745a2e0d268b34ef))
|
|
48
|
+
|
|
49
|
+
## [1.3.18] - 2022-11-16
|
|
50
|
+
|
|
51
|
+
### Bug Fixes
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
- **(es/minifier)** Fix code for dropping unreachable statements (#6429) ([bb544ba](https://github.com/swc-project/swc/commit/bb544ba2f58531e2cf984bbbaf2f819a1e4d8ada))
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
- **(es/modules)** Fix `jsc.paths` (#6454) ([05d185d](https://github.com/swc-project/swc/commit/05d185d59b4e8f7259a1f9908c25cf9e288b92af))
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
- **(es/plugins/proxy)** Adjust import with compile time flags (#6451) ([f14b156](https://github.com/swc-project/swc/commit/f14b156a60bd6b54b08b17e76accb5c108d27679))
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
- **(html/minifier)** Fix script/style merging (#6443) ([1dfd8ce](https://github.com/swc-project/swc/commit/1dfd8cef88b16180e6525b524637fd3eb627b857))
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
- **(xml/parser)** Fix parsing of pi (#6450) ([6388920](https://github.com/swc-project/swc/commit/638892071a8713a278c114aae6fedc74f77a8cc0))
|
|
68
|
+
|
|
69
|
+
### Features
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
- **(css/parser)** Add `parse_string_input` (#6441) ([9600308](https://github.com/swc-project/swc/commit/9600308108daa60c142a5a6fddc9c6ef94c12b80))
|
|
74
|
+
|
|
75
|
+
## [1.3.17] - 2022-11-15
|
|
76
|
+
|
|
77
|
+
### Bug Fixes
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
|
|
8
81
|
- **(bindings)** Revert #6436 (#6444) ([948e35b](https://github.com/swc-project/swc/commit/948e35bcd66b98c460d67b4d58f536ea4d3d5992))
|
|
9
82
|
|
|
10
83
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@swc/core",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.19",
|
|
4
4
|
"description": "Super-fast alternative for babel",
|
|
5
5
|
"homepage": "https://swc.rs",
|
|
6
6
|
"main": "./index.js",
|
|
@@ -141,16 +141,16 @@
|
|
|
141
141
|
"url": "https://opencollective.com/swc"
|
|
142
142
|
},
|
|
143
143
|
"optionalDependencies": {
|
|
144
|
-
"@swc/core-win32-x64-msvc": "1.3.
|
|
145
|
-
"@swc/core-darwin-x64": "1.3.
|
|
146
|
-
"@swc/core-linux-x64-gnu": "1.3.
|
|
147
|
-
"@swc/core-linux-x64-musl": "1.3.
|
|
148
|
-
"@swc/core-win32-ia32-msvc": "1.3.
|
|
149
|
-
"@swc/core-linux-arm64-gnu": "1.3.
|
|
150
|
-
"@swc/core-linux-arm-gnueabihf": "1.3.
|
|
151
|
-
"@swc/core-darwin-arm64": "1.3.
|
|
152
|
-
"@swc/core-linux-arm64-musl": "1.3.
|
|
153
|
-
"@swc/core-win32-arm64-msvc": "1.3.
|
|
144
|
+
"@swc/core-win32-x64-msvc": "1.3.19",
|
|
145
|
+
"@swc/core-darwin-x64": "1.3.19",
|
|
146
|
+
"@swc/core-linux-x64-gnu": "1.3.19",
|
|
147
|
+
"@swc/core-linux-x64-musl": "1.3.19",
|
|
148
|
+
"@swc/core-win32-ia32-msvc": "1.3.19",
|
|
149
|
+
"@swc/core-linux-arm64-gnu": "1.3.19",
|
|
150
|
+
"@swc/core-linux-arm-gnueabihf": "1.3.19",
|
|
151
|
+
"@swc/core-darwin-arm64": "1.3.19",
|
|
152
|
+
"@swc/core-linux-arm64-musl": "1.3.19",
|
|
153
|
+
"@swc/core-win32-arm64-msvc": "1.3.19"
|
|
154
154
|
},
|
|
155
155
|
"files": [
|
|
156
156
|
"CHANGELOG.md",
|
package/spack.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Options } from "./types";
|
|
2
|
-
export
|
|
2
|
+
export type BundleInput = BundleOptions | BundleOptions[];
|
|
3
3
|
export declare function compileBundleOptions(config: BundleInput | string | undefined): Promise<BundleInput>;
|
|
4
4
|
/**
|
|
5
5
|
* Usage: In `spack.config.js` / `spack.config.ts`, you can utilize type annotations (to get autocompletions) like
|
|
@@ -43,8 +43,8 @@ export interface OutputConfig {
|
|
|
43
43
|
}
|
|
44
44
|
export interface ModuleConfig {
|
|
45
45
|
}
|
|
46
|
-
export
|
|
47
|
-
export
|
|
48
|
-
export
|
|
46
|
+
export type Mode = 'production' | 'development' | 'none';
|
|
47
|
+
export type Target = 'browser' | 'node';
|
|
48
|
+
export type EntryConfig = string | string[] | {
|
|
49
49
|
[name: string]: string;
|
|
50
50
|
};
|
package/types.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export interface Plugin {
|
|
2
2
|
(module: Program): Program;
|
|
3
3
|
}
|
|
4
|
-
export
|
|
4
|
+
export type ParseOptions = ParserConfig & {
|
|
5
5
|
comments?: boolean;
|
|
6
6
|
script?: boolean;
|
|
7
7
|
/**
|
|
@@ -9,7 +9,7 @@ export declare type ParseOptions = ParserConfig & {
|
|
|
9
9
|
*/
|
|
10
10
|
target?: JscTarget;
|
|
11
11
|
};
|
|
12
|
-
export
|
|
12
|
+
export type TerserEcmaVersion = 5 | 2015 | 2016 | string | number;
|
|
13
13
|
export interface JsMinifyOptions {
|
|
14
14
|
compress?: TerserCompressOptions | boolean;
|
|
15
15
|
format?: JsFormatOptions & ToSnakeCaseProperties<JsFormatOptions>;
|
|
@@ -27,11 +27,11 @@ export interface JsMinifyOptions {
|
|
|
27
27
|
/**
|
|
28
28
|
* @example ToSnakeCase<'indentLevel'> == 'indent_level'
|
|
29
29
|
*/
|
|
30
|
-
|
|
30
|
+
type ToSnakeCase<T extends string> = T extends `${infer A}${infer B}` ? `${A extends Lowercase<A> ? A : `_${Lowercase<A>}`}${ToSnakeCase<B>}` : T;
|
|
31
31
|
/**
|
|
32
32
|
* @example ToSnakeCaseProperties<{indentLevel: 3}> == {indent_level: 3}
|
|
33
33
|
*/
|
|
34
|
-
|
|
34
|
+
type ToSnakeCaseProperties<T> = {
|
|
35
35
|
[K in keyof T as (K extends string ? ToSnakeCase<K> : K)]: T[K];
|
|
36
36
|
};
|
|
37
37
|
/**
|
|
@@ -374,7 +374,7 @@ export interface CallerOptions {
|
|
|
374
374
|
name: string;
|
|
375
375
|
[key: string]: any;
|
|
376
376
|
}
|
|
377
|
-
export
|
|
377
|
+
export type Swcrc = Config | Config[];
|
|
378
378
|
/**
|
|
379
379
|
* .swcrc
|
|
380
380
|
*/
|
|
@@ -473,8 +473,8 @@ export interface JscConfig {
|
|
|
473
473
|
minify?: JsMinifyOptions;
|
|
474
474
|
preserveAllComments?: boolean;
|
|
475
475
|
}
|
|
476
|
-
export
|
|
477
|
-
export
|
|
476
|
+
export type JscTarget = "es3" | "es5" | "es2015" | "es2016" | "es2017" | "es2018" | "es2019" | "es2020" | "es2021" | "es2022";
|
|
477
|
+
export type ParserConfig = TsParserConfig | EsParserConfig;
|
|
478
478
|
export interface TsParserConfig {
|
|
479
479
|
syntax: "typescript";
|
|
480
480
|
/**
|
|
@@ -667,7 +667,7 @@ export interface GlobalPassOption {
|
|
|
667
667
|
*/
|
|
668
668
|
envs?: string[];
|
|
669
669
|
}
|
|
670
|
-
export
|
|
670
|
+
export type ModuleConfig = Es6Config | CommonJsConfig | UmdConfig | AmdConfig | NodeNextConfig | SystemjsConfig;
|
|
671
671
|
export interface BaseModuleConfig {
|
|
672
672
|
/**
|
|
673
673
|
* By default, when using exports with babel a non-enumerable `__esModule`
|
|
@@ -885,7 +885,7 @@ export interface Class extends HasSpan, HasDecorator {
|
|
|
885
885
|
superTypeParams?: TsTypeParameterInstantiation;
|
|
886
886
|
implements: TsExpressionWithTypeArguments[];
|
|
887
887
|
}
|
|
888
|
-
export
|
|
888
|
+
export type ClassMember = Constructor | ClassMethod | PrivateMethod | ClassProperty | PrivateProperty | TsIndexSignature | EmptyStatement | StaticBlock;
|
|
889
889
|
export interface ClassPropertyBase extends Node, HasSpan, HasDecorator {
|
|
890
890
|
value?: Expression;
|
|
891
891
|
typeAnnotation?: TsTypeAnnotation;
|
|
@@ -943,8 +943,8 @@ export interface Decorator extends Node, HasSpan {
|
|
|
943
943
|
type: "Decorator";
|
|
944
944
|
expression: Expression;
|
|
945
945
|
}
|
|
946
|
-
export
|
|
947
|
-
export
|
|
946
|
+
export type MethodKind = "method" | "getter" | "setter";
|
|
947
|
+
export type Declaration = ClassDeclaration | FunctionDeclaration | VariableDeclaration | TsInterfaceDeclaration | TsTypeAliasDeclaration | TsEnumDeclaration | TsModuleDeclaration;
|
|
948
948
|
export interface FunctionDeclaration extends Fn {
|
|
949
949
|
type: "FunctionDeclaration";
|
|
950
950
|
identifier: Identifier;
|
|
@@ -961,14 +961,14 @@ export interface VariableDeclaration extends Node, HasSpan {
|
|
|
961
961
|
declare: boolean;
|
|
962
962
|
declarations: VariableDeclarator[];
|
|
963
963
|
}
|
|
964
|
-
export
|
|
964
|
+
export type VariableDeclarationKind = "var" | "let" | "const";
|
|
965
965
|
export interface VariableDeclarator extends Node, HasSpan {
|
|
966
966
|
type: "VariableDeclarator";
|
|
967
967
|
id: Pattern;
|
|
968
968
|
init?: Expression;
|
|
969
969
|
definite: boolean;
|
|
970
970
|
}
|
|
971
|
-
export
|
|
971
|
+
export type Expression = ThisExpression | ArrayExpression | ObjectExpression | FunctionExpression | UnaryExpression | UpdateExpression | BinaryExpression | AssignmentExpression | MemberExpression | SuperPropExpression | ConditionalExpression | CallExpression | NewExpression | SequenceExpression | Identifier | Literal | TemplateLiteral | TaggedTemplateExpression | ArrowFunctionExpression | ClassExpression | YieldExpression | MetaProperty | AwaitExpression | ParenthesisExpression | JSXMemberExpression | JSXNamespacedName | JSXEmptyExpression | JSXElement | JSXFragment | TsTypeAssertion | TsConstAssertion | TsNonNullExpression | TsAsExpression | TsInstantiation | PrivateName | OptionalChainingExpression | Invalid;
|
|
972
972
|
interface ExpressionBase extends Node, HasSpan {
|
|
973
973
|
}
|
|
974
974
|
export interface Identifier extends ExpressionBase {
|
|
@@ -1141,7 +1141,7 @@ export interface PrivateName extends ExpressionBase {
|
|
|
1141
1141
|
type: "PrivateName";
|
|
1142
1142
|
id: Identifier;
|
|
1143
1143
|
}
|
|
1144
|
-
export
|
|
1144
|
+
export type JSXObject = JSXMemberExpression | Identifier;
|
|
1145
1145
|
export interface JSXMemberExpression extends Node {
|
|
1146
1146
|
type: "JSXMemberExpression";
|
|
1147
1147
|
object: JSXObject;
|
|
@@ -1162,12 +1162,12 @@ export interface JSXExpressionContainer extends Node, HasSpan {
|
|
|
1162
1162
|
type: "JSXExpressionContainer";
|
|
1163
1163
|
expression: JSXExpression;
|
|
1164
1164
|
}
|
|
1165
|
-
export
|
|
1165
|
+
export type JSXExpression = JSXEmptyExpression | Expression;
|
|
1166
1166
|
export interface JSXSpreadChild extends Node, HasSpan {
|
|
1167
1167
|
type: "JSXSpreadChild";
|
|
1168
1168
|
expression: Expression;
|
|
1169
1169
|
}
|
|
1170
|
-
export
|
|
1170
|
+
export type JSXElementName = Identifier | JSXMemberExpression | JSXNamespacedName;
|
|
1171
1171
|
export interface JSXOpeningElement extends Node, HasSpan {
|
|
1172
1172
|
type: "JSXOpeningElement";
|
|
1173
1173
|
name: JSXElementName;
|
|
@@ -1175,7 +1175,7 @@ export interface JSXOpeningElement extends Node, HasSpan {
|
|
|
1175
1175
|
selfClosing: boolean;
|
|
1176
1176
|
typeArguments?: TsTypeParameterInstantiation;
|
|
1177
1177
|
}
|
|
1178
|
-
export
|
|
1178
|
+
export type JSXAttributeOrSpread = JSXAttribute | SpreadElement;
|
|
1179
1179
|
export interface JSXClosingElement extends Node, HasSpan {
|
|
1180
1180
|
type: "JSXClosingElement";
|
|
1181
1181
|
name: JSXElementName;
|
|
@@ -1185,8 +1185,8 @@ export interface JSXAttribute extends Node, HasSpan {
|
|
|
1185
1185
|
name: JSXAttributeName;
|
|
1186
1186
|
value?: JSXAttrValue;
|
|
1187
1187
|
}
|
|
1188
|
-
export
|
|
1189
|
-
export
|
|
1188
|
+
export type JSXAttributeName = Identifier | JSXNamespacedName;
|
|
1189
|
+
export type JSXAttrValue = Literal | JSXExpressionContainer | JSXElement | JSXFragment;
|
|
1190
1190
|
export interface JSXText extends Node, HasSpan {
|
|
1191
1191
|
type: "JSXText";
|
|
1192
1192
|
value: string;
|
|
@@ -1198,7 +1198,7 @@ export interface JSXElement extends Node, HasSpan {
|
|
|
1198
1198
|
children: JSXElementChild[];
|
|
1199
1199
|
closing?: JSXClosingElement;
|
|
1200
1200
|
}
|
|
1201
|
-
export
|
|
1201
|
+
export type JSXElementChild = JSXText | JSXExpressionContainer | JSXSpreadChild | JSXElement | JSXFragment;
|
|
1202
1202
|
export interface JSXFragment extends Node, HasSpan {
|
|
1203
1203
|
type: "JSXFragment";
|
|
1204
1204
|
opening: JSXOpeningFragment;
|
|
@@ -1211,7 +1211,7 @@ export interface JSXOpeningFragment extends Node, HasSpan {
|
|
|
1211
1211
|
export interface JSXClosingFragment extends Node, HasSpan {
|
|
1212
1212
|
type: "JSXClosingFragment";
|
|
1213
1213
|
}
|
|
1214
|
-
export
|
|
1214
|
+
export type Literal = StringLiteral | BooleanLiteral | NullLiteral | NumericLiteral | BigIntLiteral | RegExpLiteral | JSXText;
|
|
1215
1215
|
export interface StringLiteral extends Node, HasSpan {
|
|
1216
1216
|
type: "StringLiteral";
|
|
1217
1217
|
value: string;
|
|
@@ -1239,7 +1239,7 @@ export interface BigIntLiteral extends Node, HasSpan {
|
|
|
1239
1239
|
value: bigint;
|
|
1240
1240
|
raw?: string;
|
|
1241
1241
|
}
|
|
1242
|
-
export
|
|
1242
|
+
export type ModuleDeclaration = ImportDeclaration | ExportDeclaration | ExportNamedDeclaration | ExportDefaultDeclaration | ExportDefaultExpression | ExportAllDeclaration | TsImportEqualsDeclaration | TsExportAssignment | TsNamespaceExportDeclaration;
|
|
1243
1243
|
export interface ExportDefaultExpression extends Node, HasSpan {
|
|
1244
1244
|
type: "ExportDefaultExpression";
|
|
1245
1245
|
expression: Expression;
|
|
@@ -1275,8 +1275,8 @@ export interface ExportDefaultDeclaration extends Node, HasSpan {
|
|
|
1275
1275
|
type: "ExportDefaultDeclaration";
|
|
1276
1276
|
decl: DefaultDecl;
|
|
1277
1277
|
}
|
|
1278
|
-
export
|
|
1279
|
-
export
|
|
1278
|
+
export type DefaultDecl = ClassExpression | FunctionExpression | TsInterfaceDeclaration;
|
|
1279
|
+
export type ImportSpecifier = NamedImportSpecifier | ImportDefaultSpecifier | ImportNamespaceSpecifier;
|
|
1280
1280
|
/**
|
|
1281
1281
|
* e.g. `import foo from 'mod.js'`
|
|
1282
1282
|
*/
|
|
@@ -1306,8 +1306,8 @@ export interface NamedImportSpecifier extends Node, HasSpan {
|
|
|
1306
1306
|
imported?: ModuleExportName;
|
|
1307
1307
|
isTypeOnly: boolean;
|
|
1308
1308
|
}
|
|
1309
|
-
export
|
|
1310
|
-
export
|
|
1309
|
+
export type ModuleExportName = Identifier | StringLiteral;
|
|
1310
|
+
export type ExportSpecifier = ExportNamespaceSpecifier | ExportDefaultSpecifier | NamedExportSpecifier;
|
|
1311
1311
|
/**
|
|
1312
1312
|
* `export * as foo from 'src';`
|
|
1313
1313
|
*/
|
|
@@ -1334,7 +1334,7 @@ interface HasInterpreter {
|
|
|
1334
1334
|
*/
|
|
1335
1335
|
interpreter: string;
|
|
1336
1336
|
}
|
|
1337
|
-
export
|
|
1337
|
+
export type Program = Module | Script;
|
|
1338
1338
|
export interface Module extends Node, HasSpan, HasInterpreter {
|
|
1339
1339
|
type: "Module";
|
|
1340
1340
|
body: ModuleItem[];
|
|
@@ -1343,12 +1343,12 @@ export interface Script extends Node, HasSpan, HasInterpreter {
|
|
|
1343
1343
|
type: "Script";
|
|
1344
1344
|
body: Statement[];
|
|
1345
1345
|
}
|
|
1346
|
-
export
|
|
1347
|
-
export
|
|
1348
|
-
export
|
|
1349
|
-
export
|
|
1350
|
-
export
|
|
1351
|
-
export
|
|
1346
|
+
export type ModuleItem = ModuleDeclaration | Statement;
|
|
1347
|
+
export type BinaryOperator = "==" | "!=" | "===" | "!==" | "<" | "<=" | ">" | ">=" | "<<" | ">>" | ">>>" | "+" | "-" | "*" | "/" | "%" | "|" | "^" | "&" | "||" | "&&" | "in" | "instanceof" | "**" | "??";
|
|
1348
|
+
export type AssignmentOperator = "=" | "+=" | "-=" | "*=" | "/=" | "%=" | "<<=" | ">>=" | ">>>=" | "|=" | "^=" | "&=" | "**=" | "&&=" | "||=" | "??=";
|
|
1349
|
+
export type UpdateOperator = "++" | "--";
|
|
1350
|
+
export type UnaryOperator = "-" | "+" | "!" | "~" | "typeof" | "void" | "delete";
|
|
1351
|
+
export type Pattern = BindingIdentifier | ArrayPattern | RestElement | ObjectPattern | AssignmentPattern | Invalid | Expression;
|
|
1352
1352
|
export interface BindingIdentifier extends PatternBase {
|
|
1353
1353
|
type: "Identifier";
|
|
1354
1354
|
value: string;
|
|
@@ -1374,7 +1374,7 @@ export interface RestElement extends PatternBase {
|
|
|
1374
1374
|
rest: Span;
|
|
1375
1375
|
argument: Pattern;
|
|
1376
1376
|
}
|
|
1377
|
-
export
|
|
1377
|
+
export type ObjectPatternProperty = KeyValuePatternProperty | AssignmentPatternProperty | RestElement;
|
|
1378
1378
|
/**
|
|
1379
1379
|
* `{key: value}`
|
|
1380
1380
|
*/
|
|
@@ -1392,7 +1392,7 @@ export interface AssignmentPatternProperty extends Node, HasSpan {
|
|
|
1392
1392
|
value?: Expression;
|
|
1393
1393
|
}
|
|
1394
1394
|
/** Identifier is `a` in `{ a, }` */
|
|
1395
|
-
export
|
|
1395
|
+
export type Property = Identifier | KeyValueProperty | AssignmentProperty | GetterProperty | SetterProperty | MethodProperty;
|
|
1396
1396
|
interface PropBase extends Node {
|
|
1397
1397
|
key: PropertyName;
|
|
1398
1398
|
}
|
|
@@ -1418,7 +1418,7 @@ export interface SetterProperty extends PropBase, HasSpan {
|
|
|
1418
1418
|
export interface MethodProperty extends PropBase, Fn {
|
|
1419
1419
|
type: "MethodProperty";
|
|
1420
1420
|
}
|
|
1421
|
-
export
|
|
1421
|
+
export type PropertyName = Identifier | StringLiteral | NumericLiteral | ComputedPropName | BigIntLiteral;
|
|
1422
1422
|
export interface ComputedPropName extends Node, HasSpan {
|
|
1423
1423
|
type: "Computed";
|
|
1424
1424
|
expression: Expression;
|
|
@@ -1431,7 +1431,7 @@ export interface ExpressionStatement extends Node, HasSpan {
|
|
|
1431
1431
|
type: "ExpressionStatement";
|
|
1432
1432
|
expression: Expression;
|
|
1433
1433
|
}
|
|
1434
|
-
export
|
|
1434
|
+
export type Statement = BlockStatement | EmptyStatement | DebuggerStatement | WithStatement | ReturnStatement | LabeledStatement | BreakStatement | ContinueStatement | IfStatement | SwitchStatement | ThrowStatement | TryStatement | WhileStatement | DoWhileStatement | ForStatement | ForInStatement | ForOfStatement | Declaration | ExpressionStatement;
|
|
1435
1435
|
export interface EmptyStatement extends Node, HasSpan {
|
|
1436
1436
|
type: "EmptyStatement";
|
|
1437
1437
|
}
|
|
@@ -1559,14 +1559,14 @@ export interface TsParameterProperty extends Node, HasSpan, HasDecorator {
|
|
|
1559
1559
|
readonly: boolean;
|
|
1560
1560
|
param: TsParameterPropertyParameter;
|
|
1561
1561
|
}
|
|
1562
|
-
export
|
|
1562
|
+
export type TsParameterPropertyParameter = BindingIdentifier | AssignmentPattern;
|
|
1563
1563
|
export interface TsQualifiedName extends Node {
|
|
1564
1564
|
type: "TsQualifiedName";
|
|
1565
1565
|
left: TsEntityName;
|
|
1566
1566
|
right: Identifier;
|
|
1567
1567
|
}
|
|
1568
|
-
export
|
|
1569
|
-
export
|
|
1568
|
+
export type TsEntityName = TsQualifiedName | Identifier;
|
|
1569
|
+
export type TsTypeElement = TsCallSignatureDeclaration | TsConstructSignatureDeclaration | TsPropertySignature | TsGetterSignature | TsSetterSignature | TsMethodSignature | TsIndexSignature;
|
|
1570
1570
|
export interface TsCallSignatureDeclaration extends Node, HasSpan {
|
|
1571
1571
|
type: "TsCallSignatureDeclaration";
|
|
1572
1572
|
params: TsFnParameter[];
|
|
@@ -1623,17 +1623,17 @@ export interface TsIndexSignature extends Node, HasSpan {
|
|
|
1623
1623
|
readonly: boolean;
|
|
1624
1624
|
static: boolean;
|
|
1625
1625
|
}
|
|
1626
|
-
export
|
|
1627
|
-
export
|
|
1626
|
+
export type TsType = TsKeywordType | TsThisType | TsFnOrConstructorType | TsTypeReference | TsTypeQuery | TsTypeLiteral | TsArrayType | TsTupleType | TsOptionalType | TsRestType | TsUnionOrIntersectionType | TsConditionalType | TsInferType | TsParenthesizedType | TsTypeOperator | TsIndexedAccessType | TsMappedType | TsLiteralType | TsTypePredicate | TsImportType;
|
|
1627
|
+
export type TsFnOrConstructorType = TsFunctionType | TsConstructorType;
|
|
1628
1628
|
export interface TsKeywordType extends Node, HasSpan {
|
|
1629
1629
|
type: "TsKeywordType";
|
|
1630
1630
|
kind: TsKeywordTypeKind;
|
|
1631
1631
|
}
|
|
1632
|
-
export
|
|
1632
|
+
export type TsKeywordTypeKind = "any" | "unknown" | "number" | "object" | "boolean" | "bigint" | "string" | "symbol" | "void" | "undefined" | "null" | "never" | "intrinsic";
|
|
1633
1633
|
export interface TsThisType extends Node, HasSpan {
|
|
1634
1634
|
type: "TsThisType";
|
|
1635
1635
|
}
|
|
1636
|
-
export
|
|
1636
|
+
export type TsFnParameter = BindingIdentifier | ArrayPattern | RestElement | ObjectPattern;
|
|
1637
1637
|
export interface TsFunctionType extends Node, HasSpan {
|
|
1638
1638
|
type: "TsFunctionType";
|
|
1639
1639
|
params: TsFnParameter[];
|
|
@@ -1658,7 +1658,7 @@ export interface TsTypePredicate extends Node, HasSpan {
|
|
|
1658
1658
|
paramName: TsThisTypeOrIdent;
|
|
1659
1659
|
typeAnnotation?: TsTypeAnnotation;
|
|
1660
1660
|
}
|
|
1661
|
-
export
|
|
1661
|
+
export type TsThisTypeOrIdent = TsThisType | Identifier;
|
|
1662
1662
|
export interface TsImportType extends Node, HasSpan {
|
|
1663
1663
|
type: "TsImportType";
|
|
1664
1664
|
argument: StringLiteral;
|
|
@@ -1673,7 +1673,7 @@ export interface TsTypeQuery extends Node, HasSpan {
|
|
|
1673
1673
|
exprName: TsTypeQueryExpr;
|
|
1674
1674
|
typeArguments?: TsTypeParameterInstantiation;
|
|
1675
1675
|
}
|
|
1676
|
-
export
|
|
1676
|
+
export type TsTypeQueryExpr = TsEntityName | TsImportType;
|
|
1677
1677
|
export interface TsTypeLiteral extends Node, HasSpan {
|
|
1678
1678
|
type: "TsTypeLiteral";
|
|
1679
1679
|
members: TsTypeElement[];
|
|
@@ -1699,7 +1699,7 @@ export interface TsRestType extends Node, HasSpan {
|
|
|
1699
1699
|
type: "TsRestType";
|
|
1700
1700
|
typeAnnotation: TsType;
|
|
1701
1701
|
}
|
|
1702
|
-
export
|
|
1702
|
+
export type TsUnionOrIntersectionType = TsUnionType | TsIntersectionType;
|
|
1703
1703
|
export interface TsUnionType extends Node, HasSpan {
|
|
1704
1704
|
type: "TsUnionType";
|
|
1705
1705
|
types: TsType[];
|
|
@@ -1728,14 +1728,14 @@ export interface TsTypeOperator extends Node, HasSpan {
|
|
|
1728
1728
|
op: TsTypeOperatorOp;
|
|
1729
1729
|
typeAnnotation: TsType;
|
|
1730
1730
|
}
|
|
1731
|
-
export
|
|
1731
|
+
export type TsTypeOperatorOp = "keyof" | "unique" | "readonly";
|
|
1732
1732
|
export interface TsIndexedAccessType extends Node, HasSpan {
|
|
1733
1733
|
type: "TsIndexedAccessType";
|
|
1734
1734
|
readonly: boolean;
|
|
1735
1735
|
objectType: TsType;
|
|
1736
1736
|
indexType: TsType;
|
|
1737
1737
|
}
|
|
1738
|
-
export
|
|
1738
|
+
export type TruePlusMinus = true | "+" | "-";
|
|
1739
1739
|
export interface TsMappedType extends Node, HasSpan {
|
|
1740
1740
|
type: "TsMappedType";
|
|
1741
1741
|
readonly?: TruePlusMinus;
|
|
@@ -1748,7 +1748,7 @@ export interface TsLiteralType extends Node, HasSpan {
|
|
|
1748
1748
|
type: "TsLiteralType";
|
|
1749
1749
|
literal: TsLiteral;
|
|
1750
1750
|
}
|
|
1751
|
-
export
|
|
1751
|
+
export type TsLiteral = NumericLiteral | StringLiteral | BooleanLiteral | BigIntLiteral | TsTemplateLiteralType;
|
|
1752
1752
|
export interface TsTemplateLiteralType extends Node, HasSpan {
|
|
1753
1753
|
type: "TemplateLiteral";
|
|
1754
1754
|
types: TsType[];
|
|
@@ -1790,7 +1790,7 @@ export interface TsEnumMember extends Node, HasSpan {
|
|
|
1790
1790
|
id: TsEnumMemberId;
|
|
1791
1791
|
init?: Expression;
|
|
1792
1792
|
}
|
|
1793
|
-
export
|
|
1793
|
+
export type TsEnumMemberId = Identifier | StringLiteral;
|
|
1794
1794
|
export interface TsModuleDeclaration extends Node, HasSpan {
|
|
1795
1795
|
type: "TsModuleDeclaration";
|
|
1796
1796
|
declare: boolean;
|
|
@@ -1801,7 +1801,7 @@ export interface TsModuleDeclaration extends Node, HasSpan {
|
|
|
1801
1801
|
/**
|
|
1802
1802
|
* `namespace A.B { }` is a namespace named `A` with another TsNamespaceDecl as its body.
|
|
1803
1803
|
*/
|
|
1804
|
-
export
|
|
1804
|
+
export type TsNamespaceBody = TsModuleBlock | TsNamespaceDeclaration;
|
|
1805
1805
|
export interface TsModuleBlock extends Node, HasSpan {
|
|
1806
1806
|
type: "TsModuleBlock";
|
|
1807
1807
|
body: ModuleItem[];
|
|
@@ -1813,7 +1813,7 @@ export interface TsNamespaceDeclaration extends Node, HasSpan {
|
|
|
1813
1813
|
id: Identifier;
|
|
1814
1814
|
body: TsNamespaceBody;
|
|
1815
1815
|
}
|
|
1816
|
-
export
|
|
1816
|
+
export type TsModuleName = Identifier | StringLiteral;
|
|
1817
1817
|
export interface TsImportEqualsDeclaration extends Node, HasSpan {
|
|
1818
1818
|
type: "TsImportEqualsDeclaration";
|
|
1819
1819
|
declare: boolean;
|
|
@@ -1822,7 +1822,7 @@ export interface TsImportEqualsDeclaration extends Node, HasSpan {
|
|
|
1822
1822
|
id: Identifier;
|
|
1823
1823
|
moduleRef: TsModuleReference;
|
|
1824
1824
|
}
|
|
1825
|
-
export
|
|
1825
|
+
export type TsModuleReference = TsEntityName | TsExternalModuleReference;
|
|
1826
1826
|
export interface TsExternalModuleReference extends Node, HasSpan {
|
|
1827
1827
|
type: "TsExternalModuleReference";
|
|
1828
1828
|
expression: StringLiteral;
|
|
@@ -1858,7 +1858,7 @@ export interface TsNonNullExpression extends ExpressionBase {
|
|
|
1858
1858
|
type: "TsNonNullExpression";
|
|
1859
1859
|
expression: Expression;
|
|
1860
1860
|
}
|
|
1861
|
-
export
|
|
1861
|
+
export type Accessibility = "public" | "protected" | "private";
|
|
1862
1862
|
export interface Invalid extends Node, HasSpan {
|
|
1863
1863
|
type: "Invalid";
|
|
1864
1864
|
}
|