@atlaspack/transformer-typescript-types 2.14.21 → 2.14.22-typescript-5ad950d33.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/LICENSE +201 -0
- package/lib/TSModule.d.ts +25 -0
- package/lib/TSModuleGraph.d.ts +33 -0
- package/lib/TSModuleGraph.js +13 -0
- package/lib/TSTypesTransformer.d.ts +3 -0
- package/lib/TSTypesTransformer.js +6 -4
- package/lib/collect.d.ts +2 -0
- package/lib/collect.js +28 -4
- package/lib/shake.d.ts +2 -0
- package/lib/shake.js +24 -6
- package/lib/utils.d.ts +2 -0
- package/lib/utils.js +4 -0
- package/lib/wrappers.d.ts +8 -0
- package/lib/wrappers.js +1 -0
- package/package.json +14 -9
- package/src/{TSModule.js → TSModule.ts} +13 -6
- package/src/{TSModuleGraph.js → TSModuleGraph.ts} +48 -9
- package/src/{TSTypesTransformer.js → TSTypesTransformer.ts} +10 -10
- package/src/{collect.js → collect.ts} +22 -5
- package/src/{shake.js → shake.ts} +19 -6
- package/src/{utils.js → utils.ts} +3 -2
- package/src/{wrappers.js → wrappers.ts} +95 -58
- package/tsconfig.json +4 -0
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
// @flow
|
|
2
1
|
/* eslint-disable no-unused-vars */
|
|
3
2
|
import type {
|
|
4
3
|
ExportDeclaration,
|
|
@@ -26,18 +25,30 @@ const [majorVersion, minorVersion] = ts.versionMajorMinor
|
|
|
26
25
|
export const createImportClause: (
|
|
27
26
|
factory: any,
|
|
28
27
|
isTypeOnly: boolean,
|
|
29
|
-
name: Identifier |
|
|
30
|
-
namedBindings: NamedImportBindings |
|
|
28
|
+
name: Identifier | undefined,
|
|
29
|
+
namedBindings: NamedImportBindings | undefined,
|
|
31
30
|
) => ImportClause = (() => {
|
|
32
31
|
if (majorVersion > 4 || (majorVersion === 4 && minorVersion >= 0)) {
|
|
33
|
-
return (
|
|
34
|
-
factory
|
|
32
|
+
return (
|
|
33
|
+
factory: any,
|
|
34
|
+
isTypeOnly: boolean,
|
|
35
|
+
name: undefined | Identifier,
|
|
36
|
+
namedBindings: undefined | NamedImportBindings,
|
|
37
|
+
) => factory.createImportClause(isTypeOnly, name, namedBindings);
|
|
35
38
|
} else if (majorVersion > 3 || (majorVersion === 3 && minorVersion >= 8)) {
|
|
36
|
-
return (
|
|
37
|
-
factory
|
|
39
|
+
return (
|
|
40
|
+
factory: any,
|
|
41
|
+
isTypeOnly: boolean,
|
|
42
|
+
name: undefined | Identifier,
|
|
43
|
+
namedBindings: undefined | NamedImportBindings,
|
|
44
|
+
) => factory.createImportClause(name, namedBindings, isTypeOnly);
|
|
38
45
|
} else if (majorVersion > 3 || (majorVersion === 3 && minorVersion >= 0)) {
|
|
39
|
-
return (
|
|
40
|
-
factory
|
|
46
|
+
return (
|
|
47
|
+
factory: any,
|
|
48
|
+
isTypeOnly: boolean,
|
|
49
|
+
name: undefined | Identifier,
|
|
50
|
+
namedBindings: undefined | NamedImportBindings,
|
|
51
|
+
) => factory.createImportClause(name, namedBindings);
|
|
41
52
|
} else {
|
|
42
53
|
invariant(false);
|
|
43
54
|
}
|
|
@@ -45,13 +56,19 @@ export const createImportClause: (
|
|
|
45
56
|
|
|
46
57
|
export const createImportDeclaration: (
|
|
47
58
|
factory: any,
|
|
48
|
-
modifiers: Modifier[] |
|
|
49
|
-
importClause: ImportClause |
|
|
59
|
+
modifiers: Modifier[] | undefined,
|
|
60
|
+
importClause: ImportClause | undefined,
|
|
50
61
|
moduleSpecifier: Expression,
|
|
51
62
|
assertClause: AssertClause,
|
|
52
63
|
) => ImportDeclaration = (() => {
|
|
53
64
|
if (majorVersion > 4 || (majorVersion === 4 && minorVersion >= 8)) {
|
|
54
|
-
return (
|
|
65
|
+
return (
|
|
66
|
+
factory: any,
|
|
67
|
+
modifiers: undefined | Array<Modifier>,
|
|
68
|
+
importClause: undefined | ImportClause,
|
|
69
|
+
moduleSpecifier: Expression,
|
|
70
|
+
assertClause: AssertClause,
|
|
71
|
+
) =>
|
|
55
72
|
factory.createImportDeclaration(
|
|
56
73
|
modifiers,
|
|
57
74
|
importClause,
|
|
@@ -59,7 +76,13 @@ export const createImportDeclaration: (
|
|
|
59
76
|
assertClause,
|
|
60
77
|
);
|
|
61
78
|
} else if (majorVersion > 4 || (majorVersion === 4 && minorVersion >= 5)) {
|
|
62
|
-
return (
|
|
79
|
+
return (
|
|
80
|
+
factory: any,
|
|
81
|
+
modifiers: undefined | Array<Modifier>,
|
|
82
|
+
importClause: undefined | ImportClause,
|
|
83
|
+
moduleSpecifier: Expression,
|
|
84
|
+
assertClause: AssertClause,
|
|
85
|
+
) =>
|
|
63
86
|
factory.createImportDeclaration(
|
|
64
87
|
undefined /* decorators */,
|
|
65
88
|
modifiers,
|
|
@@ -68,7 +91,13 @@ export const createImportDeclaration: (
|
|
|
68
91
|
assertClause,
|
|
69
92
|
);
|
|
70
93
|
} else if (majorVersion > 3 || (majorVersion === 3 && minorVersion >= 0)) {
|
|
71
|
-
return (
|
|
94
|
+
return (
|
|
95
|
+
factory: any,
|
|
96
|
+
modifiers: undefined | Array<Modifier>,
|
|
97
|
+
importClause: undefined | ImportClause,
|
|
98
|
+
moduleSpecifier: Expression,
|
|
99
|
+
assertClause: AssertClause,
|
|
100
|
+
) =>
|
|
72
101
|
factory.createImportDeclaration(
|
|
73
102
|
undefined /* decorators */,
|
|
74
103
|
modifiers,
|
|
@@ -83,15 +112,23 @@ export const createImportDeclaration: (
|
|
|
83
112
|
export const createImportSpecifier: (
|
|
84
113
|
factory: any,
|
|
85
114
|
isTypeOnly: boolean,
|
|
86
|
-
propertyName: Identifier |
|
|
115
|
+
propertyName: Identifier | undefined,
|
|
87
116
|
name: Identifier,
|
|
88
117
|
) => ImportSpecifier = (() => {
|
|
89
118
|
if (majorVersion > 4 || (majorVersion === 4 && minorVersion >= 5)) {
|
|
90
|
-
return (
|
|
91
|
-
factory
|
|
119
|
+
return (
|
|
120
|
+
factory: any,
|
|
121
|
+
isTypeOnly: boolean,
|
|
122
|
+
propertyName: undefined | Identifier,
|
|
123
|
+
name: Identifier,
|
|
124
|
+
) => factory.createImportSpecifier(isTypeOnly, propertyName, name);
|
|
92
125
|
} else if (majorVersion > 3 || (majorVersion === 3 && minorVersion >= 0)) {
|
|
93
|
-
return (
|
|
94
|
-
factory
|
|
126
|
+
return (
|
|
127
|
+
factory: any,
|
|
128
|
+
isTypeOnly: boolean,
|
|
129
|
+
propertyName: undefined | Identifier,
|
|
130
|
+
name: Identifier,
|
|
131
|
+
) => factory.createImportSpecifier(propertyName, name);
|
|
95
132
|
} else {
|
|
96
133
|
invariant(false);
|
|
97
134
|
}
|
|
@@ -100,21 +137,21 @@ export const createImportSpecifier: (
|
|
|
100
137
|
export const updateExportDeclaration: (
|
|
101
138
|
factory: any,
|
|
102
139
|
node: ExportDeclaration,
|
|
103
|
-
modifiers: Modifier[] |
|
|
140
|
+
modifiers: Modifier[] | undefined,
|
|
104
141
|
isTypeOnly: boolean,
|
|
105
|
-
exportClause: NamedExportBindings |
|
|
106
|
-
moduleSpecifier: Expression |
|
|
107
|
-
assertClause: AssertClause |
|
|
142
|
+
exportClause: NamedExportBindings | undefined,
|
|
143
|
+
moduleSpecifier: Expression | undefined,
|
|
144
|
+
assertClause: AssertClause | undefined,
|
|
108
145
|
) => ExportDeclaration = (() => {
|
|
109
146
|
if (majorVersion > 4 || (majorVersion === 4 && minorVersion >= 8)) {
|
|
110
147
|
return (
|
|
111
|
-
factory,
|
|
112
|
-
node,
|
|
113
|
-
modifiers
|
|
114
|
-
isTypeOnly,
|
|
115
|
-
exportClause,
|
|
116
|
-
moduleSpecifier,
|
|
117
|
-
assertClause,
|
|
148
|
+
factory: any,
|
|
149
|
+
node: ExportDeclaration,
|
|
150
|
+
modifiers: undefined | Array<Modifier>,
|
|
151
|
+
isTypeOnly: boolean,
|
|
152
|
+
exportClause: undefined | NamedExportBindings,
|
|
153
|
+
moduleSpecifier: undefined | Expression,
|
|
154
|
+
assertClause: undefined | AssertClause,
|
|
118
155
|
) =>
|
|
119
156
|
factory.updateExportDeclaration(
|
|
120
157
|
node,
|
|
@@ -126,13 +163,13 @@ export const updateExportDeclaration: (
|
|
|
126
163
|
);
|
|
127
164
|
} else if (majorVersion > 4 || (majorVersion === 4 && minorVersion >= 5)) {
|
|
128
165
|
return (
|
|
129
|
-
factory,
|
|
130
|
-
node,
|
|
131
|
-
modifiers
|
|
132
|
-
isTypeOnly,
|
|
133
|
-
exportClause,
|
|
134
|
-
moduleSpecifier,
|
|
135
|
-
assertClause,
|
|
166
|
+
factory: any,
|
|
167
|
+
node: ExportDeclaration,
|
|
168
|
+
modifiers: undefined | Array<Modifier>,
|
|
169
|
+
isTypeOnly: boolean,
|
|
170
|
+
exportClause: undefined | NamedExportBindings,
|
|
171
|
+
moduleSpecifier: undefined | Expression,
|
|
172
|
+
assertClause: undefined | AssertClause,
|
|
136
173
|
) =>
|
|
137
174
|
factory.updateExportDeclaration(
|
|
138
175
|
node,
|
|
@@ -145,13 +182,13 @@ export const updateExportDeclaration: (
|
|
|
145
182
|
);
|
|
146
183
|
} else if (majorVersion > 4 || (majorVersion === 4 && minorVersion >= 0)) {
|
|
147
184
|
return (
|
|
148
|
-
factory,
|
|
149
|
-
node,
|
|
150
|
-
modifiers
|
|
151
|
-
isTypeOnly,
|
|
152
|
-
exportClause,
|
|
153
|
-
moduleSpecifier,
|
|
154
|
-
assertClause,
|
|
185
|
+
factory: any,
|
|
186
|
+
node: ExportDeclaration,
|
|
187
|
+
modifiers: undefined | Array<Modifier>,
|
|
188
|
+
isTypeOnly: boolean,
|
|
189
|
+
exportClause: undefined | NamedExportBindings,
|
|
190
|
+
moduleSpecifier: undefined | Expression,
|
|
191
|
+
assertClause: undefined | AssertClause,
|
|
155
192
|
) =>
|
|
156
193
|
factory.updateExportDeclaration(
|
|
157
194
|
node,
|
|
@@ -163,13 +200,13 @@ export const updateExportDeclaration: (
|
|
|
163
200
|
);
|
|
164
201
|
} else if (majorVersion > 3 || (majorVersion === 3 && minorVersion >= 8)) {
|
|
165
202
|
return (
|
|
166
|
-
factory,
|
|
167
|
-
node,
|
|
168
|
-
modifiers
|
|
169
|
-
isTypeOnly,
|
|
170
|
-
exportClause,
|
|
171
|
-
moduleSpecifier,
|
|
172
|
-
assertClause,
|
|
203
|
+
factory: any,
|
|
204
|
+
node: ExportDeclaration,
|
|
205
|
+
modifiers: undefined | Array<Modifier>,
|
|
206
|
+
isTypeOnly: boolean,
|
|
207
|
+
exportClause: undefined | NamedExportBindings,
|
|
208
|
+
moduleSpecifier: undefined | Expression,
|
|
209
|
+
assertClause: undefined | AssertClause,
|
|
173
210
|
) =>
|
|
174
211
|
factory.updateExportDeclaration(
|
|
175
212
|
node,
|
|
@@ -181,13 +218,13 @@ export const updateExportDeclaration: (
|
|
|
181
218
|
);
|
|
182
219
|
} else if (majorVersion > 3 || (majorVersion === 3 && minorVersion >= 0)) {
|
|
183
220
|
return (
|
|
184
|
-
factory,
|
|
185
|
-
node,
|
|
186
|
-
modifiers
|
|
187
|
-
isTypeOnly,
|
|
188
|
-
exportClause,
|
|
189
|
-
moduleSpecifier,
|
|
190
|
-
assertClause,
|
|
221
|
+
factory: any,
|
|
222
|
+
node: ExportDeclaration,
|
|
223
|
+
modifiers: undefined | Array<Modifier>,
|
|
224
|
+
isTypeOnly: boolean,
|
|
225
|
+
exportClause: undefined | NamedExportBindings,
|
|
226
|
+
moduleSpecifier: undefined | Expression,
|
|
227
|
+
assertClause: undefined | AssertClause,
|
|
191
228
|
) =>
|
|
192
229
|
factory.updateExportDeclaration(
|
|
193
230
|
node,
|
package/tsconfig.json
ADDED