@ibyar/expressions 0.5.2 → 0.5.4
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/README.md +3 -3
- package/api/abstract.d.ts +3 -4
- package/api/abstract.js +1 -1
- package/api/abstract.js.map +1 -1
- package/api/class/class.d.ts +196 -0
- package/api/class/class.js +594 -0
- package/api/class/class.js.map +1 -0
- package/api/class/decorator.d.ts +20 -0
- package/api/class/decorator.js +48 -0
- package/api/class/decorator.js.map +1 -0
- package/api/computing/call.d.ts +3 -1
- package/api/computing/call.js +16 -4
- package/api/computing/call.js.map +1 -1
- package/api/computing/new.d.ts +2 -1
- package/api/computing/new.js +4 -0
- package/api/computing/new.js.map +1 -1
- package/api/computing/rest.d.ts +3 -3
- package/api/computing/rest.js +5 -2
- package/api/computing/rest.js.map +1 -1
- package/api/computing/return.d.ts +2 -1
- package/api/computing/return.js +3 -0
- package/api/computing/return.js.map +1 -1
- package/api/computing/spread.d.ts +2 -1
- package/api/computing/spread.js +5 -2
- package/api/computing/spread.js.map +1 -1
- package/api/computing/throw.d.ts +2 -1
- package/api/computing/throw.js +3 -0
- package/api/computing/throw.js.map +1 -1
- package/api/computing/yield.d.ts +2 -1
- package/api/computing/yield.js +3 -0
- package/api/computing/yield.js.map +1 -1
- package/api/definition/array.d.ts +6 -7
- package/api/definition/array.js +13 -13
- package/api/definition/array.js.map +1 -1
- package/api/definition/bind.d.ts +2 -2
- package/api/definition/bind.js +1 -1
- package/api/definition/bind.js.map +1 -1
- package/api/definition/function.d.ts +8 -8
- package/api/definition/function.js +25 -25
- package/api/definition/function.js.map +1 -1
- package/api/definition/member.d.ts +2 -2
- package/api/definition/member.js +1 -1
- package/api/definition/member.js.map +1 -1
- package/api/definition/object.d.ts +7 -7
- package/api/definition/object.js +9 -9
- package/api/definition/object.js.map +1 -1
- package/api/definition/statement.d.ts +2 -2
- package/api/definition/statement.js +2 -2
- package/api/definition/statement.js.map +1 -1
- package/api/definition/values.d.ts +5 -4
- package/api/definition/values.js +7 -4
- package/api/definition/values.js.map +1 -1
- package/api/expression.d.ts +9 -12
- package/api/expression.js.map +1 -1
- package/api/{app → module/app}/program.d.ts +8 -9
- package/api/module/app/program.js +45 -0
- package/api/module/app/program.js.map +1 -0
- package/api/module/export.d.ts +60 -25
- package/api/module/export.js +230 -60
- package/api/module/export.js.map +1 -1
- package/api/module/import.d.ts +66 -25
- package/api/module/import.js +236 -68
- package/api/module/import.js.map +1 -1
- package/api/operators/assignment.d.ts +2 -2
- package/api/operators/assignment.js +1 -1
- package/api/operators/assignment.js.map +1 -1
- package/api/operators/await.d.ts +2 -2
- package/api/operators/await.js +1 -1
- package/api/operators/await.js.map +1 -1
- package/api/operators/binary.d.ts +2 -2
- package/api/operators/binary.js +1 -1
- package/api/operators/binary.js.map +1 -1
- package/api/operators/chaining.d.ts +2 -2
- package/api/operators/chaining.js +1 -1
- package/api/operators/chaining.js.map +1 -1
- package/api/operators/comma.d.ts +2 -2
- package/api/operators/comma.js +2 -2
- package/api/operators/comma.js.map +1 -1
- package/api/operators/grouping.d.ts +2 -2
- package/api/operators/grouping.js +1 -1
- package/api/operators/grouping.js.map +1 -1
- package/api/operators/logical.d.ts +2 -2
- package/api/operators/logical.js +1 -1
- package/api/operators/logical.js.map +1 -1
- package/api/operators/pipeline.d.ts +2 -2
- package/api/operators/pipeline.js +1 -1
- package/api/operators/pipeline.js.map +1 -1
- package/api/operators/ternary.d.ts +2 -2
- package/api/operators/ternary.js +1 -1
- package/api/operators/ternary.js.map +1 -1
- package/api/operators/unary.d.ts +3 -3
- package/api/operators/unary.js +4 -3
- package/api/operators/unary.js.map +1 -1
- package/api/operators/update.d.ts +2 -2
- package/api/operators/update.js +1 -1
- package/api/operators/update.js.map +1 -1
- package/api/statement/control/block.d.ts +3 -3
- package/api/statement/control/block.js +2 -2
- package/api/statement/control/block.js.map +1 -1
- package/api/statement/control/empty.d.ts +1 -1
- package/api/statement/control/empty.js.map +1 -1
- package/api/statement/control/if.d.ts +2 -2
- package/api/statement/control/if.js +1 -1
- package/api/statement/control/if.js.map +1 -1
- package/api/statement/control/switch.d.ts +4 -5
- package/api/statement/control/switch.js +5 -6
- package/api/statement/control/switch.js.map +1 -1
- package/api/statement/control/terminate.d.ts +3 -3
- package/api/statement/control/terminate.js +2 -2
- package/api/statement/control/terminate.js.map +1 -1
- package/api/statement/declarations/declares.d.ts +12 -11
- package/api/statement/declarations/declares.js +23 -18
- package/api/statement/declarations/declares.js.map +1 -1
- package/api/statement/iterations/for.d.ts +5 -5
- package/api/statement/iterations/for.js +7 -7
- package/api/statement/iterations/for.js.map +1 -1
- package/api/statement/iterations/while.d.ts +3 -3
- package/api/statement/iterations/while.js +2 -2
- package/api/statement/iterations/while.js.map +1 -1
- package/api/utils.d.ts +3 -0
- package/api/utils.js +2 -0
- package/api/utils.js.map +1 -0
- package/package.json +4 -4
- package/scope/finalizer.d.ts +4 -0
- package/scope/finalizer.js +11 -0
- package/scope/finalizer.js.map +1 -0
- package/scope/proxy.d.ts +2 -1
- package/scope/proxy.js +18 -2
- package/scope/proxy.js.map +1 -1
- package/scope/scope.d.ts +40 -51
- package/scope/scope.js +67 -134
- package/scope/scope.js.map +1 -1
- package/scope/stack.d.ts +41 -24
- package/scope/stack.js +148 -102
- package/scope/stack.js.map +1 -1
- package/v8/parser.js +3 -2
- package/v8/parser.js.map +1 -1
- package/visit/visitor.js +4 -7
- package/visit/visitor.js.map +1 -1
- package/api/app/class.d.ts +0 -117
- package/api/app/class.js +0 -292
- package/api/app/class.js.map +0 -1
- package/api/app/program.js +0 -39
- package/api/app/program.js.map +0 -1
- package/api/module/module.d.ts +0 -26
- package/api/module/module.js +0 -63
- package/api/module/module.js.map +0 -1
package/api/module/export.js
CHANGED
|
@@ -1,67 +1,145 @@
|
|
|
1
|
-
var
|
|
1
|
+
var ExportSpecifier_1, ExportNamedDeclaration_1, ExportDefaultDeclaration_1, ExportAllDeclaration_1;
|
|
2
2
|
import { __decorate, __metadata } from "tslib";
|
|
3
|
+
import { ReactiveScope } from '../../scope/scope.js';
|
|
3
4
|
import { AbstractExpressionNode } from '../abstract.js';
|
|
4
5
|
import { Deserializer } from '../deserialize/deserialize.js';
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
import { Identifier, StringLiteral } from '../definition/values.js';
|
|
7
|
+
import { ModuleSpecifier } from './import.js';
|
|
8
|
+
let ExportSpecifier = ExportSpecifier_1 = class ExportSpecifier extends ModuleSpecifier {
|
|
9
|
+
constructor(local, exported) {
|
|
10
|
+
super(local);
|
|
11
|
+
this.exported = exported;
|
|
9
12
|
}
|
|
10
|
-
static
|
|
11
|
-
|
|
12
|
-
|
|
13
|
+
static fromJSON(node, deserializer) {
|
|
14
|
+
return new ExportSpecifier_1(deserializer(node.local), deserializer(node.exported));
|
|
15
|
+
}
|
|
16
|
+
static visit(node, visitNode) {
|
|
17
|
+
visitNode(node.local);
|
|
18
|
+
visitNode(node.exported);
|
|
19
|
+
}
|
|
20
|
+
getExported() {
|
|
21
|
+
return this.exported;
|
|
22
|
+
}
|
|
23
|
+
shareVariables(scopeList) {
|
|
24
|
+
}
|
|
25
|
+
set(stack, value) {
|
|
26
|
+
throw new Error('Method not implemented.');
|
|
13
27
|
}
|
|
14
|
-
get
|
|
15
|
-
|
|
28
|
+
get(stack, thisContext) {
|
|
29
|
+
throw new Error('Method not implemented.');
|
|
16
30
|
}
|
|
17
|
-
|
|
18
|
-
|
|
31
|
+
dependency(computed) {
|
|
32
|
+
return [];
|
|
33
|
+
}
|
|
34
|
+
dependencyPath(computed) {
|
|
35
|
+
return [];
|
|
19
36
|
}
|
|
20
37
|
toString() {
|
|
21
|
-
|
|
22
|
-
|
|
38
|
+
const local = this.local.toString();
|
|
39
|
+
const exported = this.exported.toString();
|
|
40
|
+
if (local == exported) {
|
|
41
|
+
return local;
|
|
23
42
|
}
|
|
24
|
-
return
|
|
43
|
+
return `${local} as ${exported}`;
|
|
25
44
|
}
|
|
26
|
-
|
|
45
|
+
toJson() {
|
|
27
46
|
return {
|
|
28
|
-
|
|
29
|
-
|
|
47
|
+
local: this.local.toJSON(),
|
|
48
|
+
exported: this.exported.toJSON()
|
|
30
49
|
};
|
|
31
50
|
}
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
|
|
51
|
+
};
|
|
52
|
+
ExportSpecifier = ExportSpecifier_1 = __decorate([
|
|
53
|
+
Deserializer('ExportSpecifier'),
|
|
54
|
+
__metadata("design:paramtypes", [Identifier, Identifier])
|
|
55
|
+
], ExportSpecifier);
|
|
56
|
+
export { ExportSpecifier };
|
|
57
|
+
let ExportNamedDeclaration = ExportNamedDeclaration_1 = class ExportNamedDeclaration extends AbstractExpressionNode {
|
|
58
|
+
constructor(specifiers, source, declaration) {
|
|
35
59
|
super();
|
|
36
|
-
this.
|
|
37
|
-
this.
|
|
38
|
-
this.
|
|
39
|
-
this.moduleName = moduleName;
|
|
60
|
+
this.specifiers = specifiers;
|
|
61
|
+
this.source = source;
|
|
62
|
+
this.declaration = declaration;
|
|
40
63
|
}
|
|
41
64
|
static fromJSON(node, deserializer) {
|
|
42
|
-
return new
|
|
65
|
+
return new ExportNamedDeclaration_1(node.specifiers.map(deserializer), node.source ? deserializer(node.source) : void 0, node.declaration ? deserializer(node.declaration) : void 0);
|
|
43
66
|
}
|
|
44
|
-
static visit(node, visitNode
|
|
45
|
-
node.
|
|
46
|
-
node.
|
|
47
|
-
node.
|
|
48
|
-
node.moduleName && visitNode(node.moduleName);
|
|
67
|
+
static visit(node, visitNode) {
|
|
68
|
+
node.specifiers.map(visitNode);
|
|
69
|
+
node.source && visitNode(node.source);
|
|
70
|
+
node.declaration && visitNode(node.declaration);
|
|
49
71
|
}
|
|
50
|
-
|
|
51
|
-
return this.
|
|
72
|
+
getSource() {
|
|
73
|
+
return this.source;
|
|
52
74
|
}
|
|
53
|
-
|
|
54
|
-
return this.
|
|
75
|
+
getSpecifiers() {
|
|
76
|
+
return this.specifiers;
|
|
55
77
|
}
|
|
56
|
-
|
|
57
|
-
return this.
|
|
78
|
+
getDeclaration() {
|
|
79
|
+
return this.declaration;
|
|
58
80
|
}
|
|
59
81
|
shareVariables(scopeList) { }
|
|
60
82
|
set(stack) {
|
|
61
|
-
throw new Error(`
|
|
83
|
+
throw new Error(`ExportNamedDeclaration.#set() has no implementation.`);
|
|
62
84
|
}
|
|
63
85
|
get(stack) {
|
|
64
|
-
|
|
86
|
+
if (this.declaration) {
|
|
87
|
+
this.exportDeclaration(stack);
|
|
88
|
+
}
|
|
89
|
+
else if (this.source) {
|
|
90
|
+
this.exportFromSource(stack);
|
|
91
|
+
}
|
|
92
|
+
else {
|
|
93
|
+
this.exportLocal(stack);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
exportDeclaration(stack) {
|
|
97
|
+
if (!this.declaration) {
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
const declaration = this.declaration.get(stack);
|
|
101
|
+
const declaredName = this.declaration.getDeclarationName();
|
|
102
|
+
if (!declaredName) {
|
|
103
|
+
throw new Error(`Name is not defined for ${declaration.toString()}`);
|
|
104
|
+
}
|
|
105
|
+
stack.getModule().set(declaredName, declaration);
|
|
106
|
+
}
|
|
107
|
+
exportFromSource(stack) {
|
|
108
|
+
if (!this.source) {
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
111
|
+
const sourceModule = stack.importModule(this.source.get());
|
|
112
|
+
const localModule = stack.getModule();
|
|
113
|
+
this.specifiers.forEach(specifier => {
|
|
114
|
+
const localName = specifier.getLocal().get(stack);
|
|
115
|
+
const exportedName = specifier.getExported().get(stack);
|
|
116
|
+
const localValue = sourceModule.get(localName);
|
|
117
|
+
localModule.set(exportedName, localValue);
|
|
118
|
+
const scopeSubscription = sourceModule.subscribe(localName, (newLocalValue, oldLocalValue) => {
|
|
119
|
+
if (newLocalValue !== oldLocalValue) {
|
|
120
|
+
localModule.set(exportedName, newLocalValue);
|
|
121
|
+
}
|
|
122
|
+
});
|
|
123
|
+
stack.onDestroy(() => scopeSubscription.unsubscribe());
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
exportLocal(stack) {
|
|
127
|
+
const localModule = stack.getModule();
|
|
128
|
+
this.specifiers.forEach(specifier => {
|
|
129
|
+
const localName = specifier.getLocal().get(stack);
|
|
130
|
+
const exportedName = specifier.getExported().get(stack);
|
|
131
|
+
const localValue = stack.get(localName);
|
|
132
|
+
localModule.set(exportedName, localValue);
|
|
133
|
+
const scope = stack.findScope(localName);
|
|
134
|
+
if (scope instanceof ReactiveScope) {
|
|
135
|
+
const scopeSubscription = scope.subscribe(localName, (newLocalValue, oldLocalValue) => {
|
|
136
|
+
if (newLocalValue !== oldLocalValue) {
|
|
137
|
+
localModule.set(exportedName, newLocalValue);
|
|
138
|
+
}
|
|
139
|
+
});
|
|
140
|
+
stack.onDestroy(() => scopeSubscription.unsubscribe());
|
|
141
|
+
}
|
|
142
|
+
});
|
|
65
143
|
}
|
|
66
144
|
dependency(computed) {
|
|
67
145
|
return [];
|
|
@@ -70,33 +148,125 @@ let ExportNode = ExportNode_1 = class ExportNode extends AbstractExpressionNode
|
|
|
70
148
|
return [];
|
|
71
149
|
}
|
|
72
150
|
toString() {
|
|
73
|
-
if (this.
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
if (this.starExport && this.moduleName) {
|
|
77
|
-
return `export ${this.starExport.toString()} from '${this.moduleName.toString()}';`;
|
|
78
|
-
}
|
|
79
|
-
if (this.exportList) {
|
|
80
|
-
return `export { ${this.exportList.map(expo => expo.toString()).join(', ')} };`;
|
|
151
|
+
if (this.declaration) {
|
|
152
|
+
const declaration = this.declaration.toString();
|
|
153
|
+
return `export ${declaration}`;
|
|
81
154
|
}
|
|
82
|
-
|
|
83
|
-
|
|
155
|
+
const specifiers = this.specifiers.map(specifier => specifier.toString()).join(',');
|
|
156
|
+
let exportStr = `export {${specifiers}}`;
|
|
157
|
+
if (!this.source) {
|
|
158
|
+
return `${exportStr};`;
|
|
84
159
|
}
|
|
85
|
-
|
|
160
|
+
const source = this.source.toString();
|
|
161
|
+
return `${exportStr} from ${source};`;
|
|
162
|
+
}
|
|
163
|
+
toJson() {
|
|
164
|
+
return {
|
|
165
|
+
specifiers: this.specifiers.map(specifier => specifier.toJSON()),
|
|
166
|
+
source: this.source?.toJSON(),
|
|
167
|
+
declaration: this.declaration?.toJSON(),
|
|
168
|
+
};
|
|
169
|
+
}
|
|
170
|
+
};
|
|
171
|
+
ExportNamedDeclaration = ExportNamedDeclaration_1 = __decorate([
|
|
172
|
+
Deserializer('ExportNamedDeclaration'),
|
|
173
|
+
__metadata("design:paramtypes", [Array, StringLiteral, Object])
|
|
174
|
+
], ExportNamedDeclaration);
|
|
175
|
+
export { ExportNamedDeclaration };
|
|
176
|
+
let ExportDefaultDeclaration = ExportDefaultDeclaration_1 = class ExportDefaultDeclaration extends AbstractExpressionNode {
|
|
177
|
+
constructor(declaration) {
|
|
178
|
+
super();
|
|
179
|
+
this.declaration = declaration;
|
|
180
|
+
}
|
|
181
|
+
static fromJSON(node, deserializer) {
|
|
182
|
+
return new ExportDefaultDeclaration_1(deserializer(node.declaration));
|
|
183
|
+
}
|
|
184
|
+
static visit(node, visitNode) {
|
|
185
|
+
visitNode(node.declaration);
|
|
186
|
+
}
|
|
187
|
+
getDeclaration() {
|
|
188
|
+
return this.declaration;
|
|
189
|
+
}
|
|
190
|
+
shareVariables(scopeList) { }
|
|
191
|
+
set(stack) {
|
|
192
|
+
throw new Error(`ExportDefaultDeclaration.#set() has no implementation.`);
|
|
193
|
+
}
|
|
194
|
+
get(stack) {
|
|
195
|
+
const declaration = this.declaration.get(stack);
|
|
196
|
+
stack.getModule().set('default', declaration);
|
|
197
|
+
}
|
|
198
|
+
dependency(computed) {
|
|
199
|
+
return [];
|
|
200
|
+
}
|
|
201
|
+
dependencyPath(computed) {
|
|
202
|
+
return [];
|
|
203
|
+
}
|
|
204
|
+
toString() {
|
|
205
|
+
const declaration = this.declaration.toString();
|
|
206
|
+
return `export default ${declaration}`;
|
|
207
|
+
}
|
|
208
|
+
toJson() {
|
|
209
|
+
return {
|
|
210
|
+
declaration: this.declaration.toJSON(),
|
|
211
|
+
};
|
|
212
|
+
}
|
|
213
|
+
};
|
|
214
|
+
ExportDefaultDeclaration = ExportDefaultDeclaration_1 = __decorate([
|
|
215
|
+
Deserializer('ExportDefaultDeclaration'),
|
|
216
|
+
__metadata("design:paramtypes", [Object])
|
|
217
|
+
], ExportDefaultDeclaration);
|
|
218
|
+
export { ExportDefaultDeclaration };
|
|
219
|
+
let ExportAllDeclaration = ExportAllDeclaration_1 = class ExportAllDeclaration extends AbstractExpressionNode {
|
|
220
|
+
constructor(source) {
|
|
221
|
+
super();
|
|
222
|
+
this.source = source;
|
|
223
|
+
}
|
|
224
|
+
static fromJSON(node, deserializer) {
|
|
225
|
+
return new ExportAllDeclaration_1(deserializer(node.source));
|
|
226
|
+
}
|
|
227
|
+
static visit(node, visitNode) {
|
|
228
|
+
visitNode(node.source);
|
|
229
|
+
}
|
|
230
|
+
getSource() {
|
|
231
|
+
return this.source;
|
|
232
|
+
}
|
|
233
|
+
shareVariables(scopeList) { }
|
|
234
|
+
set(stack) {
|
|
235
|
+
throw new Error(`ExportDefaultDeclaration.#set() has no implementation.`);
|
|
236
|
+
}
|
|
237
|
+
get(stack) {
|
|
238
|
+
const localModule = stack.getModule();
|
|
239
|
+
const sourceModule = stack.importModule(this.source.get());
|
|
240
|
+
const properties = Object.keys(sourceModule.getContext());
|
|
241
|
+
properties.forEach(property => {
|
|
242
|
+
const localValue = sourceModule.get(property);
|
|
243
|
+
localModule.set(property, localValue);
|
|
244
|
+
const scopeSubscription = sourceModule.subscribe(property, (newLocalValue, oldLocalValue) => {
|
|
245
|
+
if (newLocalValue !== oldLocalValue) {
|
|
246
|
+
localModule.set(property, newLocalValue);
|
|
247
|
+
}
|
|
248
|
+
});
|
|
249
|
+
stack.onDestroy(() => scopeSubscription.unsubscribe());
|
|
250
|
+
});
|
|
251
|
+
}
|
|
252
|
+
dependency(computed) {
|
|
253
|
+
return [];
|
|
254
|
+
}
|
|
255
|
+
dependencyPath(computed) {
|
|
256
|
+
return [];
|
|
257
|
+
}
|
|
258
|
+
toString() {
|
|
259
|
+
return `export * from ${this.source.toString()}`;
|
|
86
260
|
}
|
|
87
261
|
toJson() {
|
|
88
262
|
return {
|
|
89
|
-
|
|
90
|
-
starExport: this.starExport?.toJSON(),
|
|
91
|
-
exportExpression: this.exportExpression?.toJSON(),
|
|
92
|
-
moduleName: this.moduleName?.toJSON(),
|
|
263
|
+
source: this.source.toJSON(),
|
|
93
264
|
};
|
|
94
265
|
}
|
|
95
266
|
};
|
|
96
|
-
|
|
97
|
-
Deserializer('
|
|
98
|
-
__metadata("design:paramtypes", [
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
export { ExportNode };
|
|
267
|
+
ExportAllDeclaration = ExportAllDeclaration_1 = __decorate([
|
|
268
|
+
Deserializer('ExportAllDeclaration'),
|
|
269
|
+
__metadata("design:paramtypes", [StringLiteral])
|
|
270
|
+
], ExportAllDeclaration);
|
|
271
|
+
export { ExportAllDeclaration };
|
|
102
272
|
//# sourceMappingURL=export.js.map
|
package/api/module/export.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"export.js","sourceRoot":"","sources":["../../../../src/expressions/api/module/export.ts"],"names":[],"mappings":";;AAMA,OAAO,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAE7D,MAAM,OAAO,eAAe;IAK3B,YAAmB,UAA0B,EAAY,UAA2B;QAAjE,eAAU,GAAV,UAAU,CAAgB;QAAY,eAAU,GAAV,UAAU,CAAiB;IAAI,CAAC;IAJzF,MAAM,CAAC,KAAK,CAAC,IAAqB,EAAE,SAAwB,EAAE,aAAgC;QAC7F,SAAS,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QAC3B,IAAI,CAAC,S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AAC,UAAU,EAAE,MAAM,EAAE;YACrC,gBAAgB,EAAE,IAAI,CAAC,gBAAgB,EAAE,MAAM,EAAE;YACjD,UAAU,EAAE,IAAI,CAAC,UAAU,EAAE,MAAM,EAAE;SACrC,CAAC;IACH,CAAC;CACD,CAAA;AArEY,UAAU;IADtB,YAAY,CAAC,QAAQ,CAAC;4CAkBA,eAAe;QACT,eAAe;GAlB/B,UAAU,CAqEtB;SArEY,UAAU","sourcesContent":["import type {\n\tNodeDeserializer, ExpressionNode, ExpressionEventPath,\n\tVisitNodeType, VisitNodeListType\n} from '../expression.js';\nimport type { Scope } from '../../scope/scope.js';\nimport type { Stack } from '../../scope/stack.js';\nimport { AbstractExpressionNode } from '../abstract.js';\nimport { Deserializer } from '../deserialize/deserialize.js';\n\nexport class ExportAliasName {\n\tstatic visit(node: ExportAliasName, visitNode: VisitNodeType, visitNodeList: VisitNodeListType): void {\n\t\tvisitNode(node.exportName);\n\t\tnode.aliasName && visitNode(node.aliasName);\n\t}\n\tconstructor(public exportName: ExpressionNode, protected _aliasName?: ExpressionNode) { }\n\n\tpublic get aliasName(): ExpressionNode {\n\t\treturn this._aliasName || this.exportName;\n\t}\n\n\tpublic set aliasName(_aliasName: ExpressionNode) {\n\t\tthis._aliasName = _aliasName;\n\t}\n\n\ttoString() {\n\t\tif (this._aliasName) {\n\t\t\treturn `${this.exportName.toString()} as ${this._aliasName.toString()}`;\n\t\t}\n\t\treturn this.exportName.toString();\n\t}\n\n\ttoJSON() {\n\t\treturn {\n\t\t\texportName: this.exportName.toJSON(),\n\t\t\taliasName: this._aliasName?.toJSON()\n\t\t};\n\t}\n}\n\n/**\n * There are two types of exports:\n * 1- Named Exports (Zero or more exports per module)\n * 2- Default Exports (One per module)\n * \n * // Exporting individual features\n * export let name1, name2, …, nameN; // also var, const\n * export let name1 = …, name2 = …, …, nameN; // also var, const\n * export function functionName(){...}\n * export class ClassName {...}\n * \n * // Export list\n * export { name1, name2, …, nameN };\n * \n * // Renaming exports\n * export { variable1 as name1, variable2 as name2, …, nameN };\n * \n * // Exporting destructed assignments with renaming\n * export const { name1, name2: bar } = o;\n * \n * // Default exports\n * export default expression;\n * export default function (…) { … } // also class, function*\n * export default function name1(…) { … } // also class, function*\n * export { name1 as default, … };\n * \n * // Aggregating modules\n * export * from …; // does not set the default export\n * export * as name1 from …; // Draft ECMAScript® 2O21\n * export { name1, name2, …, nameN } from …;\n * export { import1 as name1, import2 as name2, …, nameN } from …;\n * export { default, … } from …;\n */\n@Deserializer('export')\nexport class ExportNode extends AbstractExpressionNode {\n\tstatic fromJSON(node: ExportNode, deserializer: NodeDeserializer): ExportNode {\n\t\treturn new ExportNode(\n\t\t\tnode.exportList?.map(expo => new ExportAliasName(deserializer(expo.exportName), deserializer(expo.aliasName))),\n\t\t\tnode.starExport ? new ExportAliasName(deserializer(node.starExport.exportName), deserializer(node.starExport.aliasName)) : void 0,\n\t\t\tnode.exportExpression ? new ExportAliasName(deserializer(node.exportExpression.exportName), deserializer(node.exportExpression.aliasName)) : void 0,\n\t\t\tnode.moduleName ? deserializer(node.moduleName) : void 0\n\t\t);\n\t}\n\tstatic visit(node: ExportNode, visitNode: VisitNodeType, visitNodeList: VisitNodeListType): void {\n\t\tnode.exportList?.map(expo => ExportAliasName.visit(expo, visitNode, visitNodeList));\n\t\tnode.starExport && ExportAliasName.visit(node.starExport, visitNode, visitNodeList);\n\t\tnode.exportExpression && ExportAliasName.visit(node.exportExpression, visitNode, visitNodeList);\n\t\tnode.moduleName && visitNode(node.moduleName);\n\t}\n\tconstructor(\n\t\tprivate exportList?: ExportAliasName[],\n\t\tprivate starExport?: ExportAliasName,\n\t\tprivate exportExpression?: ExportAliasName,\n\t\tprivate moduleName?: ExpressionNode) {\n\t\tsuper();\n\t}\n\tgetModuleName() {\n\t\treturn this.moduleName;\n\t}\n\tgetExportExpression() {\n\t\treturn this.exportExpression;\n\t}\n\tgetExportList() {\n\t\treturn this.exportList;\n\t}\n\tshareVariables(scopeList: Scope<any>[]): void { }\n\tset(stack: Stack) {\n\t\tthrow new Error(`ExportNode.#set() has no implementation.`);\n\t}\n\tget(stack: Stack) {\n\t\tthrow new Error(`ExportNode.#get() has no implementation.`);\n\t}\n\tdependency(computed?: true): ExpressionNode[] {\n\t\treturn [];\n\t}\n\tdependencyPath(computed?: true): ExpressionEventPath[] {\n\t\treturn [];\n\t}\n\ttoString() {\n\t\t// Aggregating modules\n\t\tif (this.exportList && this.moduleName) {\n\t\t\treturn `export { ${this.exportList.map(expo => expo.toString()).join(', ')} } from '${this.moduleName.toString()}';`;\n\t\t}\n\t\tif (this.starExport && this.moduleName) {\n\t\t\treturn `export ${this.starExport.toString()} from '${this.moduleName.toString()}';`;\n\t\t}\n\n\t\tif (this.exportList) {\n\t\t\treturn `export { ${this.exportList.map(expo => expo.toString()).join(', ')} };`;\n\t\t}\n\t\tif (this.exportExpression) {\n\t\t\treturn `export ${this.exportExpression.toString()};`;\n\t\t}\n\t\tthrow new Error(`not enough params found,at least 'exportExpression' should be initialized.`);\n\t}\n\ttoJson(): object {\n\t\treturn {\n\t\t\texportList: this.exportList?.map(expression => expression.toJSON()),\n\t\t\tstarExport: this.starExport?.toJSON(),\n\t\t\texportExpression: this.exportExpression?.toJSON(),\n\t\t\tmoduleName: this.moduleName?.toJSON(),\n\t\t};\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"file":"export.js","sourceRoot":"","sources":["../../../../src/expressions/api/module/export.ts"],"names":[],"mappings":";;AAuCA,OAAO,EAAiB,aAAa,EAAS,MAAM,sBAAsB,CAAC;AAE3E,OAAO,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAC7D,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACpE,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAoB9C,IAAa,eAAe,uBAA5B,MAAa,eAAgB,SAAQ,eAAe;IA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AAG,CAAC,QAAQ,EAAE,aAAa,CAAC,CAAC;iBACzC;YACF,CAAC,CAAC,CAAC;YACH,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE,CAAC,iBAAiB,CAAC,WAAW,EAAE,CAAC,CAAC;QACxD,CAAC,CAAC,CAAC;IACJ,CAAC;IACD,UAAU,CAAC,QAAe;QACzB,OAAO,EAAE,CAAC;IACX,CAAC;IACD,cAAc,CAAC,QAAe;QAC7B,OAAO,EAAE,CAAC;IACX,CAAC;IACD,QAAQ;QACP,OAAO,iBAAiB,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE,EAAE,CAAC;IAClD,CAAC;IACD,MAAM;QACL,OAAO;YACN,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE;SAC5B,CAAC;IACH,CAAC;CACD,CAAA;AAjDY,oBAAoB;IADhC,YAAY,CAAC,sBAAsB,CAAC;qCASnB,aAAa;GARlB,oBAAoB,CAiDhC;SAjDY,oBAAoB","sourcesContent":["\n/**\n * There are two types of exports:\n * 1- Named Exports (Zero or more exports per module)\n * 2- Default Exports (One per module)\n * \n * // Exporting individual features\n * export let name1, name2, …, nameN; // also var, const\n * export let name1 = …, name2 = …, …, nameN; // also var, const\n * export function functionName(){...}\n * export class ClassName {...}\n * \n * // Export list\n * export { name1, name2, …, nameN };\n * \n * // Renaming exports\n * export { variable1 as name1, variable2 as name2, …, nameN };\n * \n * // Exporting destructed assignments with renaming\n * export const { name1, name2: bar } = o;\n * \n * // Default exports\n * export default expression;\n * export default function (…) { … } // also class, function*\n * export default function name1(…) { … } // also class, function*\n * export { name1 as default, … };\n * \n * // Aggregating modules\n * export * from …; // does not set the default export\n * export * as name1 from …; // Draft ECMAScript® 2O21\n * export { name1, name2, …, nameN } from …;\n * export { import1 as name1, import2 as name2, …, nameN } from …;\n * export { default, … } from …;\n */\n\nimport type {\n\tNodeDeserializer, ExpressionNode,\n\tExpressionEventPath, VisitNodeType, CanDeclareExpression\n} from '../expression.js';\nimport { ModuleContext, ReactiveScope, Scope } from '../../scope/scope.js';\nimport { Stack } from '../../scope/stack.js';\nimport { AbstractExpressionNode } from '../abstract.js';\nimport { Deserializer } from '../deserialize/deserialize.js';\nimport { Identifier, StringLiteral } from '../definition/values.js';\nimport { ModuleSpecifier } from './import.js';\nimport { FunctionDeclaration } from '../definition/function.js';\nimport { ClassDeclaration } from '../class/class.js';\n\n\n/**\n * An exported variable binding, e.g., `{foo}` in `export {foo}` or `{bar as foo}` in `export {bar as foo}`.\n * \n * The `exported` field refers to the name exported in the module.\n * \n * The `local` field refers to the binding into the local module scope.\n * \n * If it is a basic named export, such as in `export {foo}`, both `exported` and `local` are equivalent `Identifier` nodes;\n * in this case an Identifier node representing `foo`.\n * \n * If it is an aliased export,\n * such as in `export {bar as foo}`, the `exported` field is an `Identifier` node representing `foo`,\n * and the `local` field is an `Identifier` node representing `bar`.\n */\n@Deserializer('ExportSpecifier')\nexport class ExportSpecifier extends ModuleSpecifier {\n\tstatic fromJSON(node: ExportSpecifier, deserializer: NodeDeserializer): ExportSpecifier {\n\t\treturn new ExportSpecifier(\n\t\t\tdeserializer(node.local) as Identifier,\n\t\t\tdeserializer(node.exported) as Identifier\n\t\t);\n\t}\n\tstatic visit(node: ExportSpecifier, visitNode: VisitNodeType): void {\n\t\tvisitNode(node.local);\n\t\tvisitNode(node.exported);\n\t}\n\tconstructor(local: Identifier, private exported: Identifier) {\n\t\tsuper(local);\n\t}\n\tgetExported() {\n\t\treturn this.exported;\n\t}\n\tshareVariables(scopeList: Scope<any>[]): void {\n\n\t}\n\tset(stack: Stack, value: any) {\n\t\tthrow new Error('Method not implemented.');\n\t}\n\tget(stack: Stack, thisContext?: any) {\n\t\tthrow new Error('Method not implemented.');\n\t}\n\tdependency(computed?: true): ExpressionNode[] {\n\t\treturn [];\n\t}\n\tdependencyPath(computed?: true): ExpressionEventPath[] {\n\t\treturn [];\n\t}\n\ttoString(): string {\n\t\tconst local = this.local.toString();\n\t\tconst exported = this.exported.toString();\n\t\tif (local == exported) {\n\t\t\treturn local;\n\t\t}\n\t\treturn `${local} as ${exported}`;\n\t}\n\ttoJson(): object {\n\t\treturn {\n\t\t\tlocal: this.local.toJSON(),\n\t\t\texported: this.exported.toJSON()\n\t\t};\n\t}\n}\n\n\n/**\n * An export named declaration, e.g.,\n * `export {foo, bar};`,\n * `export {foo} from \"mod\";`\n * or `export var foo = 1;`.\n * \n * Note: Having `declaration` populated with non-empty `specifiers` or non-null `source` results in an invalid state.\n */\n@Deserializer('ExportNamedDeclaration')\nexport class ExportNamedDeclaration extends AbstractExpressionNode {\n\tstatic fromJSON(node: ExportNamedDeclaration, deserializer: NodeDeserializer): ExportNamedDeclaration {\n\t\treturn new ExportNamedDeclaration(\n\t\t\tnode.specifiers.map(deserializer) as ExportSpecifier[],\n\t\t\tnode.source ? deserializer(node.source) as StringLiteral : void 0,\n\t\t\tnode.declaration ? deserializer(node.declaration) as CanDeclareExpression : void 0,\n\t\t);\n\t}\n\tstatic visit(node: ExportNamedDeclaration, visitNode: VisitNodeType): void {\n\t\tnode.specifiers.map(visitNode);\n\t\tnode.source && visitNode(node.source);\n\t\tnode.declaration && visitNode(node.declaration);\n\t}\n\tconstructor(\n\t\tprivate specifiers: ExportSpecifier[],\n\t\tprivate source?: StringLiteral,\n\t\tprivate declaration?: CanDeclareExpression) {\n\t\tsuper();\n\t}\n\tgetSource() {\n\t\treturn this.source;\n\t}\n\tgetSpecifiers() {\n\t\treturn this.specifiers;\n\t}\n\tgetDeclaration() {\n\t\treturn this.declaration;\n\t}\n\tshareVariables(scopeList: Scope<any>[]): void { }\n\tset(stack: Stack) {\n\t\tthrow new Error(`ExportNamedDeclaration.#set() has no implementation.`);\n\t}\n\tget(stack: Stack) {\n\t\tif (this.declaration) {\n\t\t\tthis.exportDeclaration(stack);\n\t\t}\n\t\telse if (this.source) {\n\t\t\tthis.exportFromSource(stack);\n\t\t} else {\n\t\t\tthis.exportLocal(stack);\n\t\t}\n\t}\n\n\tprivate exportDeclaration(stack: Stack) {\n\t\tif (!this.declaration) {\n\t\t\treturn\n\t\t}\n\t\tconst declaration = this.declaration.get(stack);\n\t\tconst declaredName = this.declaration.getDeclarationName!();\n\t\tif (!declaredName) {\n\t\t\tthrow new Error(`Name is not defined for ${declaration.toString()}`);\n\t\t}\n\t\tstack.getModule()!.set(declaredName, declaration);\n\t}\n\tprivate exportFromSource(stack: Stack) {\n\t\tif (!this.source) {\n\t\t\treturn;\n\t\t}\n\t\tconst sourceModule = stack.importModule(this.source.get());\n\t\tconst localModule = stack.getModule()!;\n\t\tthis.specifiers.forEach(specifier => {\n\t\t\tconst localName = specifier.getLocal().get(stack);\n\t\t\tconst exportedName = specifier.getExported().get(stack);\n\t\t\tconst localValue = sourceModule.get(localName);\n\t\t\tlocalModule.set(exportedName, localValue);\n\t\t\tconst scopeSubscription = sourceModule.subscribe(localName, (newLocalValue, oldLocalValue) => {\n\t\t\t\tif (newLocalValue !== oldLocalValue) {\n\t\t\t\t\tlocalModule.set(exportedName, newLocalValue);\n\t\t\t\t}\n\t\t\t});\n\t\t\tstack.onDestroy(() => scopeSubscription.unsubscribe());\n\t\t});\n\t}\n\tprivate exportLocal(stack: Stack) {\n\t\tconst localModule = stack.getModule()!;\n\t\tthis.specifiers.forEach(specifier => {\n\t\t\tconst localName = specifier.getLocal().get(stack);\n\t\t\tconst exportedName = specifier.getExported().get(stack);\n\t\t\tconst localValue = stack.get(localName);\n\t\t\tlocalModule.set(exportedName, localValue);\n\t\t\tconst scope = stack.findScope(localName);\n\t\t\tif (scope instanceof ReactiveScope) {\n\t\t\t\tconst scopeSubscription = scope.subscribe(localName, (newLocalValue, oldLocalValue) => {\n\t\t\t\t\tif (newLocalValue !== oldLocalValue) {\n\t\t\t\t\t\tlocalModule.set(exportedName, newLocalValue);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\tstack.onDestroy(() => scopeSubscription.unsubscribe());\n\t\t\t}\n\t\t});\n\t}\n\n\tdependency(computed?: true): ExpressionNode[] {\n\t\treturn [];\n\t}\n\tdependencyPath(computed?: true): ExpressionEventPath[] {\n\t\treturn [];\n\t}\n\ttoString() {\n\t\tif (this.declaration) {\n\t\t\tconst declaration = this.declaration.toString();\n\t\t\treturn `export ${declaration}`;\n\t\t}\n\t\tconst specifiers = this.specifiers.map(specifier => specifier.toString()).join(',');\n\t\tlet exportStr = `export {${specifiers}}`;\n\t\tif (!this.source) {\n\t\t\treturn `${exportStr};`;\n\t\t}\n\t\tconst source = this.source.toString();\n\t\treturn `${exportStr} from ${source};`;\n\t}\n\ttoJson(): object {\n\t\treturn {\n\t\t\tspecifiers: this.specifiers.map(specifier => specifier.toJSON()),\n\t\t\tsource: this.source?.toJSON(),\n\t\t\tdeclaration: this.declaration?.toJSON(),\n\t\t};\n\t}\n}\n\n\n/**\n * An export default declaration, e.g., \n * `export default function () {};`\n * or `export default 1;`.\n */\n@Deserializer('ExportDefaultDeclaration')\nexport class ExportDefaultDeclaration extends AbstractExpressionNode {\n\tstatic fromJSON(node: ExportDefaultDeclaration, deserializer: NodeDeserializer): ExportDefaultDeclaration {\n\t\treturn new ExportDefaultDeclaration(deserializer(node.declaration));\n\t}\n\tstatic visit(node: ExportDefaultDeclaration, visitNode: VisitNodeType): void {\n\t\tvisitNode(node.declaration);\n\t}\n\tconstructor(\n\t\tprivate declaration: FunctionDeclaration | ClassDeclaration | ExpressionNode) {\n\t\tsuper();\n\t}\n\tgetDeclaration() {\n\t\treturn this.declaration;\n\t}\n\tshareVariables(scopeList: Scope<any>[]): void { }\n\tset(stack: Stack) {\n\t\tthrow new Error(`ExportDefaultDeclaration.#set() has no implementation.`);\n\t}\n\tget(stack: Stack) {\n\t\tconst declaration = this.declaration.get(stack);\n\t\tstack.getModule()!.set('default', declaration);\n\t}\n\tdependency(computed?: true): ExpressionNode[] {\n\t\treturn [];\n\t}\n\tdependencyPath(computed?: true): ExpressionEventPath[] {\n\t\treturn [];\n\t}\n\ttoString() {\n\t\tconst declaration = this.declaration.toString();\n\t\treturn `export default ${declaration}`;\n\t}\n\ttoJson(): object {\n\t\treturn {\n\t\t\tdeclaration: this.declaration.toJSON(),\n\t\t};\n\t}\n}\n\n/**\n * An export batch declaration, e.g., `export * from \"mod\";`.\n */\n@Deserializer('ExportAllDeclaration')\nexport class ExportAllDeclaration extends AbstractExpressionNode {\n\tstatic fromJSON(node: ExportAllDeclaration, deserializer: NodeDeserializer): ExportAllDeclaration {\n\t\treturn new ExportAllDeclaration(deserializer(node.source) as StringLiteral);\n\t}\n\tstatic visit(node: ExportAllDeclaration, visitNode: VisitNodeType): void {\n\t\tvisitNode(node.source);\n\t}\n\tconstructor(\n\t\tprivate source: StringLiteral) {\n\t\tsuper();\n\t}\n\tgetSource() {\n\t\treturn this.source;\n\t}\n\tshareVariables(scopeList: Scope<any>[]): void { }\n\tset(stack: Stack) {\n\t\tthrow new Error(`ExportDefaultDeclaration.#set() has no implementation.`);\n\t}\n\tget(stack: Stack) {\n\t\tconst localModule = stack.getModule()!;\n\t\tconst sourceModule = stack.importModule(this.source.get());\n\t\tconst properties = Object.keys(sourceModule.getContext()) as (keyof ModuleContext)[];\n\n\t\tproperties.forEach(property => {\n\n\t\t\tconst localValue = sourceModule.get(property);\n\t\t\tlocalModule.set(property, localValue);\n\t\t\tconst scopeSubscription = sourceModule.subscribe(property, (newLocalValue, oldLocalValue) => {\n\t\t\t\tif (newLocalValue !== oldLocalValue) {\n\t\t\t\t\tlocalModule.set(property, newLocalValue);\n\t\t\t\t}\n\t\t\t});\n\t\t\tstack.onDestroy(() => scopeSubscription.unsubscribe());\n\t\t});\n\t}\n\tdependency(computed?: true): ExpressionNode[] {\n\t\treturn [];\n\t}\n\tdependencyPath(computed?: true): ExpressionEventPath[] {\n\t\treturn [];\n\t}\n\ttoString() {\n\t\treturn `export * from ${this.source.toString()}`;\n\t}\n\ttoJson(): object {\n\t\treturn {\n\t\t\tsource: this.source.toJSON(),\n\t\t};\n\t}\n}\n"]}
|
package/api/module/import.d.ts
CHANGED
|
@@ -1,32 +1,58 @@
|
|
|
1
|
-
import type { NodeDeserializer, ExpressionNode, ExpressionEventPath, VisitNodeType
|
|
2
|
-
import type { Scope } from '../../scope/scope.js';
|
|
1
|
+
import type { NodeDeserializer, ExpressionNode, ExpressionEventPath, VisitNodeType } from '../expression.js';
|
|
2
|
+
import type { ModuleScope, Scope } from '../../scope/scope.js';
|
|
3
3
|
import type { Stack } from '../../scope/stack.js';
|
|
4
4
|
import { AbstractExpressionNode } from '../abstract.js';
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
protected
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
5
|
+
import { Identifier, Literal } from '../definition/values.js';
|
|
6
|
+
export declare abstract class ModuleSpecifier extends AbstractExpressionNode {
|
|
7
|
+
protected local: Identifier;
|
|
8
|
+
constructor(local: Identifier);
|
|
9
|
+
getLocal(): Identifier;
|
|
10
|
+
toJson(): object;
|
|
11
|
+
}
|
|
12
|
+
export declare class ImportSpecifier extends ModuleSpecifier {
|
|
13
|
+
private imported;
|
|
14
|
+
static fromJSON(node: ImportSpecifier, deserializer: NodeDeserializer): ImportSpecifier;
|
|
15
|
+
static visit(node: ImportSpecifier, visitNode: VisitNodeType): void;
|
|
16
|
+
constructor(local: Identifier, imported: Identifier);
|
|
17
|
+
getImported(): Identifier;
|
|
18
|
+
shareVariables(scopeList: Scope<any>[]): void;
|
|
19
|
+
set(stack: Stack, value: any): void;
|
|
20
|
+
get(stack: Stack, thisContext?: any): void;
|
|
21
|
+
dependency(computed?: true): ExpressionNode[];
|
|
22
|
+
dependencyPath(computed?: true): ExpressionEventPath[];
|
|
23
|
+
toString(): string;
|
|
24
|
+
toJson(): object;
|
|
25
|
+
}
|
|
26
|
+
export declare class ImportDefaultSpecifier extends ModuleSpecifier {
|
|
27
|
+
static fromJSON(node: ImportDefaultSpecifier, deserializer: NodeDeserializer): ImportDefaultSpecifier;
|
|
28
|
+
static visit(node: ImportDefaultSpecifier, visitNode: VisitNodeType): void;
|
|
29
|
+
shareVariables(scopeList: Scope<any>[]): void;
|
|
30
|
+
set(stack: Stack, value: any): void;
|
|
31
|
+
get(stack: Stack, thisContext?: any): void;
|
|
32
|
+
dependency(computed?: true): ExpressionNode[];
|
|
33
|
+
dependencyPath(computed?: true): ExpressionEventPath[];
|
|
12
34
|
toString(): string;
|
|
13
|
-
toJSON(): {
|
|
14
|
-
exportName: import("../expression.js").NodeJsonType;
|
|
15
|
-
aliasName: import("../expression.js").NodeJsonType | undefined;
|
|
16
|
-
};
|
|
17
35
|
}
|
|
18
|
-
export declare class
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
36
|
+
export declare class ImportNamespaceSpecifier extends ModuleSpecifier {
|
|
37
|
+
static fromJSON(node: ImportNamespaceSpecifier, deserializer: NodeDeserializer): ImportNamespaceSpecifier;
|
|
38
|
+
static visit(node: ImportNamespaceSpecifier, visitNode: VisitNodeType): void;
|
|
39
|
+
shareVariables(scopeList: Scope<any>[]): void;
|
|
40
|
+
set(stack: Stack, value: any): void;
|
|
41
|
+
get(stack: Stack, thisContext?: any): void;
|
|
42
|
+
dependency(computed?: true): ExpressionNode[];
|
|
43
|
+
dependencyPath(computed?: true): ExpressionEventPath[];
|
|
44
|
+
toString(): string;
|
|
45
|
+
}
|
|
46
|
+
export declare class ImportDeclaration extends AbstractExpressionNode {
|
|
47
|
+
private source;
|
|
48
|
+
private specifiers?;
|
|
49
|
+
private assertions?;
|
|
50
|
+
static fromJSON(node: ImportDeclaration, deserializer: NodeDeserializer): ImportDeclaration;
|
|
51
|
+
static visit(node: ImportDeclaration, visitNode: VisitNodeType): void;
|
|
52
|
+
constructor(source: Literal<string>, specifiers?: (ImportSpecifier | ImportDefaultSpecifier | ImportNamespaceSpecifier)[] | undefined, assertions?: ExpressionNode | undefined);
|
|
53
|
+
getSource(): Literal<string>;
|
|
54
|
+
getSpecifiers(): (ImportSpecifier | ImportDefaultSpecifier | ImportNamespaceSpecifier)[] | undefined;
|
|
55
|
+
getAssertions(): ExpressionNode | undefined;
|
|
30
56
|
shareVariables(scopeList: Scope<any>[]): void;
|
|
31
57
|
set(stack: Stack): void;
|
|
32
58
|
get(stack: Stack): void;
|
|
@@ -35,3 +61,18 @@ export declare class ImportNode extends AbstractExpressionNode {
|
|
|
35
61
|
toString(): string;
|
|
36
62
|
toJson(): object;
|
|
37
63
|
}
|
|
64
|
+
export declare class ImportExpression extends AbstractExpressionNode {
|
|
65
|
+
private source;
|
|
66
|
+
private attributes?;
|
|
67
|
+
static fromJSON(node: ImportExpression, deserializer: NodeDeserializer): ImportExpression;
|
|
68
|
+
static visit(node: ImportExpression, visitNode: VisitNodeType): void;
|
|
69
|
+
constructor(source: Literal<string>, attributes?: ExpressionNode | undefined);
|
|
70
|
+
getSource(): Literal<string>;
|
|
71
|
+
shareVariables(scopeList: Scope<any>[]): void;
|
|
72
|
+
set(stack: Stack): void;
|
|
73
|
+
get(stack: Stack): Promise<ModuleScope>;
|
|
74
|
+
dependency(computed?: true): ExpressionNode[];
|
|
75
|
+
dependencyPath(computed?: true): ExpressionEventPath[];
|
|
76
|
+
toString(): string;
|
|
77
|
+
toJson(): object;
|
|
78
|
+
}
|