macroforge 0.1.78 → 0.1.80
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 +28 -51
- package/js/buildtime/index.d.ts +107 -0
- package/js/buildtime/index.mjs +65 -0
- package/js/buildtime/index.ts +176 -0
- package/js/cli/svelte-check-wrapper.js +177 -0
- package/js/cli/tsc-wrapper.js +198 -0
- package/js/rules/index.d.ts +94 -0
- package/js/rules/index.mjs +9 -0
- package/js/rules/index.ts +109 -0
- package/package.json +73 -86
- package/pkg/macroforge_ts.d.ts +132 -0
- package/pkg/macroforge_ts.js +1197 -0
- package/pkg/macroforge_ts_bg.wasm +0 -0
- package/pkg/macroforge_ts_bg.wasm.d.ts +69 -0
- package/index.d.ts +0 -1341
- package/index.js +0 -605
|
@@ -0,0 +1,1197 @@
|
|
|
1
|
+
/* @ts-self-types="./macroforge_ts.d.ts" */
|
|
2
|
+
|
|
3
|
+
function Clone() {
|
|
4
|
+
wasm.Clone();
|
|
5
|
+
}
|
|
6
|
+
exports.Clone = Clone;
|
|
7
|
+
|
|
8
|
+
function Debug() {
|
|
9
|
+
wasm.Debug();
|
|
10
|
+
}
|
|
11
|
+
exports.Debug = Debug;
|
|
12
|
+
|
|
13
|
+
function Default() {
|
|
14
|
+
wasm.Default();
|
|
15
|
+
}
|
|
16
|
+
exports.Default = Default;
|
|
17
|
+
|
|
18
|
+
function Derive() {
|
|
19
|
+
wasm.Derive();
|
|
20
|
+
}
|
|
21
|
+
exports.Derive = Derive;
|
|
22
|
+
|
|
23
|
+
function Deserialize() {
|
|
24
|
+
wasm.Deserialize();
|
|
25
|
+
}
|
|
26
|
+
exports.Deserialize = Deserialize;
|
|
27
|
+
|
|
28
|
+
function Hash() {
|
|
29
|
+
wasm.Hash();
|
|
30
|
+
}
|
|
31
|
+
exports.Hash = Hash;
|
|
32
|
+
|
|
33
|
+
class NativeMapper {
|
|
34
|
+
static __wrap(ptr) {
|
|
35
|
+
ptr = ptr >>> 0;
|
|
36
|
+
const obj = Object.create(NativeMapper.prototype);
|
|
37
|
+
obj.__wbg_ptr = ptr;
|
|
38
|
+
NativeMapperFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
39
|
+
return obj;
|
|
40
|
+
}
|
|
41
|
+
__destroy_into_raw() {
|
|
42
|
+
const ptr = this.__wbg_ptr;
|
|
43
|
+
this.__wbg_ptr = 0;
|
|
44
|
+
NativeMapperFinalization.unregister(this);
|
|
45
|
+
return ptr;
|
|
46
|
+
}
|
|
47
|
+
free() {
|
|
48
|
+
const ptr = this.__destroy_into_raw();
|
|
49
|
+
wasm.__wbg_nativemapper_free(ptr, 0);
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* @param {number} pos
|
|
53
|
+
* @returns {number | undefined}
|
|
54
|
+
*/
|
|
55
|
+
expandedToOriginal(pos) {
|
|
56
|
+
const ret = wasm.nativemapper_expandedToOriginal(this.__wbg_ptr, pos);
|
|
57
|
+
return ret === 0x100000001 ? undefined : ret;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* @param {number} pos
|
|
61
|
+
* @returns {string | undefined}
|
|
62
|
+
*/
|
|
63
|
+
generatedBy(pos) {
|
|
64
|
+
const ret = wasm.nativemapper_generatedBy(this.__wbg_ptr, pos);
|
|
65
|
+
let v1;
|
|
66
|
+
if (ret[0] !== 0) {
|
|
67
|
+
v1 = getStringFromWasm0(ret[0], ret[1]).slice();
|
|
68
|
+
wasm.__wbindgen_free_command_export(ret[0], ret[1] * 1, 1);
|
|
69
|
+
}
|
|
70
|
+
return v1;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* @returns {boolean}
|
|
74
|
+
*/
|
|
75
|
+
isEmpty() {
|
|
76
|
+
const ret = wasm.nativemapper_isEmpty(this.__wbg_ptr);
|
|
77
|
+
return ret !== 0;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* @param {number} pos
|
|
81
|
+
* @returns {boolean}
|
|
82
|
+
*/
|
|
83
|
+
isInGenerated(pos) {
|
|
84
|
+
const ret = wasm.nativemapper_isInGenerated(this.__wbg_ptr, pos);
|
|
85
|
+
return ret !== 0;
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* @param {number} start
|
|
89
|
+
* @param {number} length
|
|
90
|
+
* @returns {any}
|
|
91
|
+
*/
|
|
92
|
+
mapSpanToExpanded(start, length) {
|
|
93
|
+
const ret = wasm.nativemapper_mapSpanToExpanded(this.__wbg_ptr, start, length);
|
|
94
|
+
return ret;
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* @param {number} start
|
|
98
|
+
* @param {number} length
|
|
99
|
+
* @returns {any}
|
|
100
|
+
*/
|
|
101
|
+
mapSpanToOriginal(start, length) {
|
|
102
|
+
const ret = wasm.nativemapper_mapSpanToOriginal(this.__wbg_ptr, start, length);
|
|
103
|
+
return ret;
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* @param {number} pos
|
|
107
|
+
* @returns {number}
|
|
108
|
+
*/
|
|
109
|
+
originalToExpanded(pos) {
|
|
110
|
+
const ret = wasm.nativemapper_originalToExpanded(this.__wbg_ptr, pos);
|
|
111
|
+
return ret >>> 0;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
if (Symbol.dispose) NativeMapper.prototype[Symbol.dispose] = NativeMapper.prototype.free;
|
|
115
|
+
exports.NativeMapper = NativeMapper;
|
|
116
|
+
|
|
117
|
+
class NativePlugin {
|
|
118
|
+
__destroy_into_raw() {
|
|
119
|
+
const ptr = this.__wbg_ptr;
|
|
120
|
+
this.__wbg_ptr = 0;
|
|
121
|
+
NativePluginFinalization.unregister(this);
|
|
122
|
+
return ptr;
|
|
123
|
+
}
|
|
124
|
+
free() {
|
|
125
|
+
const ptr = this.__destroy_into_raw();
|
|
126
|
+
wasm.__wbg_nativeplugin_free(ptr, 0);
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* @param {string} code
|
|
130
|
+
* @param {string} filepath
|
|
131
|
+
* @param {any} options
|
|
132
|
+
* @returns {any}
|
|
133
|
+
*/
|
|
134
|
+
expandSync(code, filepath, options) {
|
|
135
|
+
const ptr0 = passStringToWasm0(code, wasm.__wbindgen_malloc_command_export, wasm.__wbindgen_realloc_command_export);
|
|
136
|
+
const len0 = WASM_VECTOR_LEN;
|
|
137
|
+
const ptr1 = passStringToWasm0(filepath, wasm.__wbindgen_malloc_command_export, wasm.__wbindgen_realloc_command_export);
|
|
138
|
+
const len1 = WASM_VECTOR_LEN;
|
|
139
|
+
const ret = wasm.nativeplugin_expandSync(this.__wbg_ptr, ptr0, len0, ptr1, len1, options);
|
|
140
|
+
if (ret[2]) {
|
|
141
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
142
|
+
}
|
|
143
|
+
return takeFromExternrefTable0(ret[0]);
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* @param {string} filepath
|
|
147
|
+
* @returns {NativeMapper | undefined}
|
|
148
|
+
*/
|
|
149
|
+
getMapper(filepath) {
|
|
150
|
+
const ptr0 = passStringToWasm0(filepath, wasm.__wbindgen_malloc_command_export, wasm.__wbindgen_realloc_command_export);
|
|
151
|
+
const len0 = WASM_VECTOR_LEN;
|
|
152
|
+
const ret = wasm.nativeplugin_getMapper(this.__wbg_ptr, ptr0, len0);
|
|
153
|
+
return ret === 0 ? undefined : NativeMapper.__wrap(ret);
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* @param {string} _message
|
|
157
|
+
*/
|
|
158
|
+
log(_message) {
|
|
159
|
+
const ptr0 = passStringToWasm0(_message, wasm.__wbindgen_malloc_command_export, wasm.__wbindgen_realloc_command_export);
|
|
160
|
+
const len0 = WASM_VECTOR_LEN;
|
|
161
|
+
wasm.nativeplugin_log(this.__wbg_ptr, ptr0, len0);
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* @param {string} filepath
|
|
165
|
+
* @param {any} diags
|
|
166
|
+
* @returns {any}
|
|
167
|
+
*/
|
|
168
|
+
mapDiagnostics(filepath, diags) {
|
|
169
|
+
const ptr0 = passStringToWasm0(filepath, wasm.__wbindgen_malloc_command_export, wasm.__wbindgen_realloc_command_export);
|
|
170
|
+
const len0 = WASM_VECTOR_LEN;
|
|
171
|
+
const ret = wasm.nativeplugin_mapDiagnostics(this.__wbg_ptr, ptr0, len0, diags);
|
|
172
|
+
if (ret[2]) {
|
|
173
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
174
|
+
}
|
|
175
|
+
return takeFromExternrefTable0(ret[0]);
|
|
176
|
+
}
|
|
177
|
+
constructor() {
|
|
178
|
+
const ret = wasm.nativeplugin_new();
|
|
179
|
+
this.__wbg_ptr = ret >>> 0;
|
|
180
|
+
NativePluginFinalization.register(this, this.__wbg_ptr, this);
|
|
181
|
+
return this;
|
|
182
|
+
}
|
|
183
|
+
/**
|
|
184
|
+
* @param {string} filepath
|
|
185
|
+
* @param {string} code
|
|
186
|
+
* @param {any} options
|
|
187
|
+
* @returns {any}
|
|
188
|
+
*/
|
|
189
|
+
processFile(filepath, code, options) {
|
|
190
|
+
const ptr0 = passStringToWasm0(filepath, wasm.__wbindgen_malloc_command_export, wasm.__wbindgen_realloc_command_export);
|
|
191
|
+
const len0 = WASM_VECTOR_LEN;
|
|
192
|
+
const ptr1 = passStringToWasm0(code, wasm.__wbindgen_malloc_command_export, wasm.__wbindgen_realloc_command_export);
|
|
193
|
+
const len1 = WASM_VECTOR_LEN;
|
|
194
|
+
const ret = wasm.nativeplugin_processFile(this.__wbg_ptr, ptr0, len0, ptr1, len1, options);
|
|
195
|
+
if (ret[2]) {
|
|
196
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
197
|
+
}
|
|
198
|
+
return takeFromExternrefTable0(ret[0]);
|
|
199
|
+
}
|
|
200
|
+
/**
|
|
201
|
+
* @param {string} code
|
|
202
|
+
* @param {string} filepath
|
|
203
|
+
* @returns {any}
|
|
204
|
+
*/
|
|
205
|
+
transformSync(code, filepath) {
|
|
206
|
+
const ptr0 = passStringToWasm0(code, wasm.__wbindgen_malloc_command_export, wasm.__wbindgen_realloc_command_export);
|
|
207
|
+
const len0 = WASM_VECTOR_LEN;
|
|
208
|
+
const ptr1 = passStringToWasm0(filepath, wasm.__wbindgen_malloc_command_export, wasm.__wbindgen_realloc_command_export);
|
|
209
|
+
const len1 = WASM_VECTOR_LEN;
|
|
210
|
+
const ret = wasm.nativeplugin_transformSync(this.__wbg_ptr, ptr0, len0, ptr1, len1);
|
|
211
|
+
if (ret[2]) {
|
|
212
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
213
|
+
}
|
|
214
|
+
return takeFromExternrefTable0(ret[0]);
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
if (Symbol.dispose) NativePlugin.prototype[Symbol.dispose] = NativePlugin.prototype.free;
|
|
218
|
+
exports.NativePlugin = NativePlugin;
|
|
219
|
+
|
|
220
|
+
class NativePositionMapper {
|
|
221
|
+
__destroy_into_raw() {
|
|
222
|
+
const ptr = this.__wbg_ptr;
|
|
223
|
+
this.__wbg_ptr = 0;
|
|
224
|
+
NativePositionMapperFinalization.unregister(this);
|
|
225
|
+
return ptr;
|
|
226
|
+
}
|
|
227
|
+
free() {
|
|
228
|
+
const ptr = this.__destroy_into_raw();
|
|
229
|
+
wasm.__wbg_nativepositionmapper_free(ptr, 0);
|
|
230
|
+
}
|
|
231
|
+
/**
|
|
232
|
+
* @param {number} _line
|
|
233
|
+
* @param {number} _column
|
|
234
|
+
* @returns {any}
|
|
235
|
+
*/
|
|
236
|
+
mapToExpanded(_line, _column) {
|
|
237
|
+
const ret = wasm.nativepositionmapper_mapToExpanded(this.__wbg_ptr, _line, _column);
|
|
238
|
+
return ret;
|
|
239
|
+
}
|
|
240
|
+
/**
|
|
241
|
+
* @param {number} _line
|
|
242
|
+
* @param {number} _column
|
|
243
|
+
* @returns {any}
|
|
244
|
+
*/
|
|
245
|
+
mapToOriginal(_line, _column) {
|
|
246
|
+
const ret = wasm.nativepositionmapper_mapToOriginal(this.__wbg_ptr, _line, _column);
|
|
247
|
+
return ret;
|
|
248
|
+
}
|
|
249
|
+
/**
|
|
250
|
+
* @param {any} _mapping
|
|
251
|
+
*/
|
|
252
|
+
constructor(_mapping) {
|
|
253
|
+
const ret = wasm.nativepositionmapper_new(_mapping);
|
|
254
|
+
this.__wbg_ptr = ret >>> 0;
|
|
255
|
+
NativePositionMapperFinalization.register(this, this.__wbg_ptr, this);
|
|
256
|
+
return this;
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
if (Symbol.dispose) NativePositionMapper.prototype[Symbol.dispose] = NativePositionMapper.prototype.free;
|
|
260
|
+
exports.NativePositionMapper = NativePositionMapper;
|
|
261
|
+
|
|
262
|
+
function Ord() {
|
|
263
|
+
wasm.Ord();
|
|
264
|
+
}
|
|
265
|
+
exports.Ord = Ord;
|
|
266
|
+
|
|
267
|
+
function PartialEq() {
|
|
268
|
+
wasm.PartialEq();
|
|
269
|
+
}
|
|
270
|
+
exports.PartialEq = PartialEq;
|
|
271
|
+
|
|
272
|
+
function PartialOrd() {
|
|
273
|
+
wasm.PartialOrd();
|
|
274
|
+
}
|
|
275
|
+
exports.PartialOrd = PartialOrd;
|
|
276
|
+
|
|
277
|
+
function Serialize() {
|
|
278
|
+
wasm.Serialize();
|
|
279
|
+
}
|
|
280
|
+
exports.Serialize = Serialize;
|
|
281
|
+
|
|
282
|
+
/**
|
|
283
|
+
* @returns {any}
|
|
284
|
+
*/
|
|
285
|
+
function __macroforgeDebugDescriptors() {
|
|
286
|
+
const ret = wasm.__macroforgeDebugDescriptors();
|
|
287
|
+
if (ret[2]) {
|
|
288
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
289
|
+
}
|
|
290
|
+
return takeFromExternrefTable0(ret[0]);
|
|
291
|
+
}
|
|
292
|
+
exports.__macroforgeDebugDescriptors = __macroforgeDebugDescriptors;
|
|
293
|
+
|
|
294
|
+
/**
|
|
295
|
+
* @returns {any}
|
|
296
|
+
*/
|
|
297
|
+
function __macroforgeDebugGetModules() {
|
|
298
|
+
const ret = wasm.__macroforgeDebugGetModules();
|
|
299
|
+
if (ret[2]) {
|
|
300
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
301
|
+
}
|
|
302
|
+
return takeFromExternrefTable0(ret[0]);
|
|
303
|
+
}
|
|
304
|
+
exports.__macroforgeDebugGetModules = __macroforgeDebugGetModules;
|
|
305
|
+
|
|
306
|
+
/**
|
|
307
|
+
* @param {string} module
|
|
308
|
+
* @param {string} name
|
|
309
|
+
* @returns {string}
|
|
310
|
+
*/
|
|
311
|
+
function __macroforgeDebugLookup(module, name) {
|
|
312
|
+
let deferred3_0;
|
|
313
|
+
let deferred3_1;
|
|
314
|
+
try {
|
|
315
|
+
const ptr0 = passStringToWasm0(module, wasm.__wbindgen_malloc_command_export, wasm.__wbindgen_realloc_command_export);
|
|
316
|
+
const len0 = WASM_VECTOR_LEN;
|
|
317
|
+
const ptr1 = passStringToWasm0(name, wasm.__wbindgen_malloc_command_export, wasm.__wbindgen_realloc_command_export);
|
|
318
|
+
const len1 = WASM_VECTOR_LEN;
|
|
319
|
+
const ret = wasm.__macroforgeDebugLookup(ptr0, len0, ptr1, len1);
|
|
320
|
+
deferred3_0 = ret[0];
|
|
321
|
+
deferred3_1 = ret[1];
|
|
322
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
323
|
+
} finally {
|
|
324
|
+
wasm.__wbindgen_free_command_export(deferred3_0, deferred3_1, 1);
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
exports.__macroforgeDebugLookup = __macroforgeDebugLookup;
|
|
328
|
+
|
|
329
|
+
/**
|
|
330
|
+
* @returns {any}
|
|
331
|
+
*/
|
|
332
|
+
function __macroforgeGetMacroNames() {
|
|
333
|
+
const ret = wasm.__macroforgeGetMacroNames();
|
|
334
|
+
if (ret[2]) {
|
|
335
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
336
|
+
}
|
|
337
|
+
return takeFromExternrefTable0(ret[0]);
|
|
338
|
+
}
|
|
339
|
+
exports.__macroforgeGetMacroNames = __macroforgeGetMacroNames;
|
|
340
|
+
|
|
341
|
+
/**
|
|
342
|
+
* @returns {any}
|
|
343
|
+
*/
|
|
344
|
+
function __macroforgeGetManifest() {
|
|
345
|
+
const ret = wasm.__macroforgeGetManifest();
|
|
346
|
+
if (ret[2]) {
|
|
347
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
348
|
+
}
|
|
349
|
+
return takeFromExternrefTable0(ret[0]);
|
|
350
|
+
}
|
|
351
|
+
exports.__macroforgeGetManifest = __macroforgeGetManifest;
|
|
352
|
+
|
|
353
|
+
/**
|
|
354
|
+
* @returns {boolean}
|
|
355
|
+
*/
|
|
356
|
+
function __macroforgeIsMacroPackage() {
|
|
357
|
+
const ret = wasm.__macroforgeIsMacroPackage();
|
|
358
|
+
return ret !== 0;
|
|
359
|
+
}
|
|
360
|
+
exports.__macroforgeIsMacroPackage = __macroforgeIsMacroPackage;
|
|
361
|
+
|
|
362
|
+
/**
|
|
363
|
+
* @param {string} context_json
|
|
364
|
+
* @returns {string}
|
|
365
|
+
*/
|
|
366
|
+
function __macroforgeRunClone(context_json) {
|
|
367
|
+
let deferred3_0;
|
|
368
|
+
let deferred3_1;
|
|
369
|
+
try {
|
|
370
|
+
const ptr0 = passStringToWasm0(context_json, wasm.__wbindgen_malloc_command_export, wasm.__wbindgen_realloc_command_export);
|
|
371
|
+
const len0 = WASM_VECTOR_LEN;
|
|
372
|
+
const ret = wasm.__macroforgeRunClone(ptr0, len0);
|
|
373
|
+
var ptr2 = ret[0];
|
|
374
|
+
var len2 = ret[1];
|
|
375
|
+
if (ret[3]) {
|
|
376
|
+
ptr2 = 0; len2 = 0;
|
|
377
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
378
|
+
}
|
|
379
|
+
deferred3_0 = ptr2;
|
|
380
|
+
deferred3_1 = len2;
|
|
381
|
+
return getStringFromWasm0(ptr2, len2);
|
|
382
|
+
} finally {
|
|
383
|
+
wasm.__wbindgen_free_command_export(deferred3_0, deferred3_1, 1);
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
exports.__macroforgeRunClone = __macroforgeRunClone;
|
|
387
|
+
|
|
388
|
+
/**
|
|
389
|
+
* @param {string} context_json
|
|
390
|
+
* @returns {string}
|
|
391
|
+
*/
|
|
392
|
+
function __macroforgeRunDebug(context_json) {
|
|
393
|
+
let deferred3_0;
|
|
394
|
+
let deferred3_1;
|
|
395
|
+
try {
|
|
396
|
+
const ptr0 = passStringToWasm0(context_json, wasm.__wbindgen_malloc_command_export, wasm.__wbindgen_realloc_command_export);
|
|
397
|
+
const len0 = WASM_VECTOR_LEN;
|
|
398
|
+
const ret = wasm.__macroforgeRunDebug(ptr0, len0);
|
|
399
|
+
var ptr2 = ret[0];
|
|
400
|
+
var len2 = ret[1];
|
|
401
|
+
if (ret[3]) {
|
|
402
|
+
ptr2 = 0; len2 = 0;
|
|
403
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
404
|
+
}
|
|
405
|
+
deferred3_0 = ptr2;
|
|
406
|
+
deferred3_1 = len2;
|
|
407
|
+
return getStringFromWasm0(ptr2, len2);
|
|
408
|
+
} finally {
|
|
409
|
+
wasm.__wbindgen_free_command_export(deferred3_0, deferred3_1, 1);
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
exports.__macroforgeRunDebug = __macroforgeRunDebug;
|
|
413
|
+
|
|
414
|
+
/**
|
|
415
|
+
* @param {string} context_json
|
|
416
|
+
* @returns {string}
|
|
417
|
+
*/
|
|
418
|
+
function __macroforgeRunDefault(context_json) {
|
|
419
|
+
let deferred3_0;
|
|
420
|
+
let deferred3_1;
|
|
421
|
+
try {
|
|
422
|
+
const ptr0 = passStringToWasm0(context_json, wasm.__wbindgen_malloc_command_export, wasm.__wbindgen_realloc_command_export);
|
|
423
|
+
const len0 = WASM_VECTOR_LEN;
|
|
424
|
+
const ret = wasm.__macroforgeRunDefault(ptr0, len0);
|
|
425
|
+
var ptr2 = ret[0];
|
|
426
|
+
var len2 = ret[1];
|
|
427
|
+
if (ret[3]) {
|
|
428
|
+
ptr2 = 0; len2 = 0;
|
|
429
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
430
|
+
}
|
|
431
|
+
deferred3_0 = ptr2;
|
|
432
|
+
deferred3_1 = len2;
|
|
433
|
+
return getStringFromWasm0(ptr2, len2);
|
|
434
|
+
} finally {
|
|
435
|
+
wasm.__wbindgen_free_command_export(deferred3_0, deferred3_1, 1);
|
|
436
|
+
}
|
|
437
|
+
}
|
|
438
|
+
exports.__macroforgeRunDefault = __macroforgeRunDefault;
|
|
439
|
+
|
|
440
|
+
/**
|
|
441
|
+
* @param {string} context_json
|
|
442
|
+
* @returns {string}
|
|
443
|
+
*/
|
|
444
|
+
function __macroforgeRunDeserialize(context_json) {
|
|
445
|
+
let deferred3_0;
|
|
446
|
+
let deferred3_1;
|
|
447
|
+
try {
|
|
448
|
+
const ptr0 = passStringToWasm0(context_json, wasm.__wbindgen_malloc_command_export, wasm.__wbindgen_realloc_command_export);
|
|
449
|
+
const len0 = WASM_VECTOR_LEN;
|
|
450
|
+
const ret = wasm.__macroforgeRunDeserialize(ptr0, len0);
|
|
451
|
+
var ptr2 = ret[0];
|
|
452
|
+
var len2 = ret[1];
|
|
453
|
+
if (ret[3]) {
|
|
454
|
+
ptr2 = 0; len2 = 0;
|
|
455
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
456
|
+
}
|
|
457
|
+
deferred3_0 = ptr2;
|
|
458
|
+
deferred3_1 = len2;
|
|
459
|
+
return getStringFromWasm0(ptr2, len2);
|
|
460
|
+
} finally {
|
|
461
|
+
wasm.__wbindgen_free_command_export(deferred3_0, deferred3_1, 1);
|
|
462
|
+
}
|
|
463
|
+
}
|
|
464
|
+
exports.__macroforgeRunDeserialize = __macroforgeRunDeserialize;
|
|
465
|
+
|
|
466
|
+
/**
|
|
467
|
+
* @param {string} context_json
|
|
468
|
+
* @returns {string}
|
|
469
|
+
*/
|
|
470
|
+
function __macroforgeRunHash(context_json) {
|
|
471
|
+
let deferred3_0;
|
|
472
|
+
let deferred3_1;
|
|
473
|
+
try {
|
|
474
|
+
const ptr0 = passStringToWasm0(context_json, wasm.__wbindgen_malloc_command_export, wasm.__wbindgen_realloc_command_export);
|
|
475
|
+
const len0 = WASM_VECTOR_LEN;
|
|
476
|
+
const ret = wasm.__macroforgeRunHash(ptr0, len0);
|
|
477
|
+
var ptr2 = ret[0];
|
|
478
|
+
var len2 = ret[1];
|
|
479
|
+
if (ret[3]) {
|
|
480
|
+
ptr2 = 0; len2 = 0;
|
|
481
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
482
|
+
}
|
|
483
|
+
deferred3_0 = ptr2;
|
|
484
|
+
deferred3_1 = len2;
|
|
485
|
+
return getStringFromWasm0(ptr2, len2);
|
|
486
|
+
} finally {
|
|
487
|
+
wasm.__wbindgen_free_command_export(deferred3_0, deferred3_1, 1);
|
|
488
|
+
}
|
|
489
|
+
}
|
|
490
|
+
exports.__macroforgeRunHash = __macroforgeRunHash;
|
|
491
|
+
|
|
492
|
+
/**
|
|
493
|
+
* @param {string} context_json
|
|
494
|
+
* @returns {string}
|
|
495
|
+
*/
|
|
496
|
+
function __macroforgeRunOrd(context_json) {
|
|
497
|
+
let deferred3_0;
|
|
498
|
+
let deferred3_1;
|
|
499
|
+
try {
|
|
500
|
+
const ptr0 = passStringToWasm0(context_json, wasm.__wbindgen_malloc_command_export, wasm.__wbindgen_realloc_command_export);
|
|
501
|
+
const len0 = WASM_VECTOR_LEN;
|
|
502
|
+
const ret = wasm.__macroforgeRunOrd(ptr0, len0);
|
|
503
|
+
var ptr2 = ret[0];
|
|
504
|
+
var len2 = ret[1];
|
|
505
|
+
if (ret[3]) {
|
|
506
|
+
ptr2 = 0; len2 = 0;
|
|
507
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
508
|
+
}
|
|
509
|
+
deferred3_0 = ptr2;
|
|
510
|
+
deferred3_1 = len2;
|
|
511
|
+
return getStringFromWasm0(ptr2, len2);
|
|
512
|
+
} finally {
|
|
513
|
+
wasm.__wbindgen_free_command_export(deferred3_0, deferred3_1, 1);
|
|
514
|
+
}
|
|
515
|
+
}
|
|
516
|
+
exports.__macroforgeRunOrd = __macroforgeRunOrd;
|
|
517
|
+
|
|
518
|
+
/**
|
|
519
|
+
* @param {string} context_json
|
|
520
|
+
* @returns {string}
|
|
521
|
+
*/
|
|
522
|
+
function __macroforgeRunPartialEq(context_json) {
|
|
523
|
+
let deferred3_0;
|
|
524
|
+
let deferred3_1;
|
|
525
|
+
try {
|
|
526
|
+
const ptr0 = passStringToWasm0(context_json, wasm.__wbindgen_malloc_command_export, wasm.__wbindgen_realloc_command_export);
|
|
527
|
+
const len0 = WASM_VECTOR_LEN;
|
|
528
|
+
const ret = wasm.__macroforgeRunPartialEq(ptr0, len0);
|
|
529
|
+
var ptr2 = ret[0];
|
|
530
|
+
var len2 = ret[1];
|
|
531
|
+
if (ret[3]) {
|
|
532
|
+
ptr2 = 0; len2 = 0;
|
|
533
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
534
|
+
}
|
|
535
|
+
deferred3_0 = ptr2;
|
|
536
|
+
deferred3_1 = len2;
|
|
537
|
+
return getStringFromWasm0(ptr2, len2);
|
|
538
|
+
} finally {
|
|
539
|
+
wasm.__wbindgen_free_command_export(deferred3_0, deferred3_1, 1);
|
|
540
|
+
}
|
|
541
|
+
}
|
|
542
|
+
exports.__macroforgeRunPartialEq = __macroforgeRunPartialEq;
|
|
543
|
+
|
|
544
|
+
/**
|
|
545
|
+
* @param {string} context_json
|
|
546
|
+
* @returns {string}
|
|
547
|
+
*/
|
|
548
|
+
function __macroforgeRunPartialOrd(context_json) {
|
|
549
|
+
let deferred3_0;
|
|
550
|
+
let deferred3_1;
|
|
551
|
+
try {
|
|
552
|
+
const ptr0 = passStringToWasm0(context_json, wasm.__wbindgen_malloc_command_export, wasm.__wbindgen_realloc_command_export);
|
|
553
|
+
const len0 = WASM_VECTOR_LEN;
|
|
554
|
+
const ret = wasm.__macroforgeRunPartialOrd(ptr0, len0);
|
|
555
|
+
var ptr2 = ret[0];
|
|
556
|
+
var len2 = ret[1];
|
|
557
|
+
if (ret[3]) {
|
|
558
|
+
ptr2 = 0; len2 = 0;
|
|
559
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
560
|
+
}
|
|
561
|
+
deferred3_0 = ptr2;
|
|
562
|
+
deferred3_1 = len2;
|
|
563
|
+
return getStringFromWasm0(ptr2, len2);
|
|
564
|
+
} finally {
|
|
565
|
+
wasm.__wbindgen_free_command_export(deferred3_0, deferred3_1, 1);
|
|
566
|
+
}
|
|
567
|
+
}
|
|
568
|
+
exports.__macroforgeRunPartialOrd = __macroforgeRunPartialOrd;
|
|
569
|
+
|
|
570
|
+
/**
|
|
571
|
+
* @param {string} context_json
|
|
572
|
+
* @returns {string}
|
|
573
|
+
*/
|
|
574
|
+
function __macroforgeRunSerialize(context_json) {
|
|
575
|
+
let deferred3_0;
|
|
576
|
+
let deferred3_1;
|
|
577
|
+
try {
|
|
578
|
+
const ptr0 = passStringToWasm0(context_json, wasm.__wbindgen_malloc_command_export, wasm.__wbindgen_realloc_command_export);
|
|
579
|
+
const len0 = WASM_VECTOR_LEN;
|
|
580
|
+
const ret = wasm.__macroforgeRunSerialize(ptr0, len0);
|
|
581
|
+
var ptr2 = ret[0];
|
|
582
|
+
var len2 = ret[1];
|
|
583
|
+
if (ret[3]) {
|
|
584
|
+
ptr2 = 0; len2 = 0;
|
|
585
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
586
|
+
}
|
|
587
|
+
deferred3_0 = ptr2;
|
|
588
|
+
deferred3_1 = len2;
|
|
589
|
+
return getStringFromWasm0(ptr2, len2);
|
|
590
|
+
} finally {
|
|
591
|
+
wasm.__wbindgen_free_command_export(deferred3_0, deferred3_1, 1);
|
|
592
|
+
}
|
|
593
|
+
}
|
|
594
|
+
exports.__macroforgeRunSerialize = __macroforgeRunSerialize;
|
|
595
|
+
|
|
596
|
+
/**
|
|
597
|
+
* @param {string} code
|
|
598
|
+
* @param {string} filepath
|
|
599
|
+
* @returns {any}
|
|
600
|
+
*/
|
|
601
|
+
function checkSyntax(code, filepath) {
|
|
602
|
+
const ptr0 = passStringToWasm0(code, wasm.__wbindgen_malloc_command_export, wasm.__wbindgen_realloc_command_export);
|
|
603
|
+
const len0 = WASM_VECTOR_LEN;
|
|
604
|
+
const ptr1 = passStringToWasm0(filepath, wasm.__wbindgen_malloc_command_export, wasm.__wbindgen_realloc_command_export);
|
|
605
|
+
const len1 = WASM_VECTOR_LEN;
|
|
606
|
+
const ret = wasm.checkSyntax(ptr0, len0, ptr1, len1);
|
|
607
|
+
if (ret[2]) {
|
|
608
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
609
|
+
}
|
|
610
|
+
return takeFromExternrefTable0(ret[0]);
|
|
611
|
+
}
|
|
612
|
+
exports.checkSyntax = checkSyntax;
|
|
613
|
+
|
|
614
|
+
function clearConfigCache() {
|
|
615
|
+
wasm.clearConfigCache();
|
|
616
|
+
}
|
|
617
|
+
exports.clearConfigCache = clearConfigCache;
|
|
618
|
+
|
|
619
|
+
function clearScanCache() {
|
|
620
|
+
wasm.clearScanCache();
|
|
621
|
+
}
|
|
622
|
+
exports.clearScanCache = clearScanCache;
|
|
623
|
+
|
|
624
|
+
/**
|
|
625
|
+
* @param {string} code
|
|
626
|
+
* @param {string} filepath
|
|
627
|
+
* @param {any} options
|
|
628
|
+
* @returns {any}
|
|
629
|
+
*/
|
|
630
|
+
function expandSync(code, filepath, options) {
|
|
631
|
+
const ptr0 = passStringToWasm0(code, wasm.__wbindgen_malloc_command_export, wasm.__wbindgen_realloc_command_export);
|
|
632
|
+
const len0 = WASM_VECTOR_LEN;
|
|
633
|
+
const ptr1 = passStringToWasm0(filepath, wasm.__wbindgen_malloc_command_export, wasm.__wbindgen_realloc_command_export);
|
|
634
|
+
const len1 = WASM_VECTOR_LEN;
|
|
635
|
+
const ret = wasm.expandSync(ptr0, len0, ptr1, len1, options);
|
|
636
|
+
if (ret[2]) {
|
|
637
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
638
|
+
}
|
|
639
|
+
return takeFromExternrefTable0(ret[0]);
|
|
640
|
+
}
|
|
641
|
+
exports.expandSync = expandSync;
|
|
642
|
+
|
|
643
|
+
/**
|
|
644
|
+
* Phase 17 — scan cache invalidation. WASM cannot access the
|
|
645
|
+
* filesystem, so there is no scan cache to invalidate on that
|
|
646
|
+
* target. These shims are here so the JS side of the plugin can
|
|
647
|
+
* call them uniformly across NAPI and WASM backends.
|
|
648
|
+
* @param {string} path
|
|
649
|
+
* @returns {boolean}
|
|
650
|
+
*/
|
|
651
|
+
function invalidateScanCacheEntry(path) {
|
|
652
|
+
const ptr0 = passStringToWasm0(path, wasm.__wbindgen_malloc_command_export, wasm.__wbindgen_realloc_command_export);
|
|
653
|
+
const len0 = WASM_VECTOR_LEN;
|
|
654
|
+
const ret = wasm.invalidateScanCacheEntry(ptr0, len0);
|
|
655
|
+
return ret !== 0;
|
|
656
|
+
}
|
|
657
|
+
exports.invalidateScanCacheEntry = invalidateScanCacheEntry;
|
|
658
|
+
|
|
659
|
+
/**
|
|
660
|
+
* @param {string} content
|
|
661
|
+
* @param {string} filepath
|
|
662
|
+
* @returns {any}
|
|
663
|
+
*/
|
|
664
|
+
function loadConfig(content, filepath) {
|
|
665
|
+
const ptr0 = passStringToWasm0(content, wasm.__wbindgen_malloc_command_export, wasm.__wbindgen_realloc_command_export);
|
|
666
|
+
const len0 = WASM_VECTOR_LEN;
|
|
667
|
+
const ptr1 = passStringToWasm0(filepath, wasm.__wbindgen_malloc_command_export, wasm.__wbindgen_realloc_command_export);
|
|
668
|
+
const len1 = WASM_VECTOR_LEN;
|
|
669
|
+
const ret = wasm.loadConfig(ptr0, len0, ptr1, len1);
|
|
670
|
+
if (ret[2]) {
|
|
671
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
672
|
+
}
|
|
673
|
+
return takeFromExternrefTable0(ret[0]);
|
|
674
|
+
}
|
|
675
|
+
exports.loadConfig = loadConfig;
|
|
676
|
+
|
|
677
|
+
/**
|
|
678
|
+
* @param {string} code
|
|
679
|
+
* @param {string} filepath
|
|
680
|
+
* @returns {any}
|
|
681
|
+
*/
|
|
682
|
+
function parseImportSources(code, filepath) {
|
|
683
|
+
const ptr0 = passStringToWasm0(code, wasm.__wbindgen_malloc_command_export, wasm.__wbindgen_realloc_command_export);
|
|
684
|
+
const len0 = WASM_VECTOR_LEN;
|
|
685
|
+
const ptr1 = passStringToWasm0(filepath, wasm.__wbindgen_malloc_command_export, wasm.__wbindgen_realloc_command_export);
|
|
686
|
+
const len1 = WASM_VECTOR_LEN;
|
|
687
|
+
const ret = wasm.parseImportSources(ptr0, len0, ptr1, len1);
|
|
688
|
+
if (ret[2]) {
|
|
689
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
690
|
+
}
|
|
691
|
+
return takeFromExternrefTable0(ret[0]);
|
|
692
|
+
}
|
|
693
|
+
exports.parseImportSources = parseImportSources;
|
|
694
|
+
|
|
695
|
+
/**
|
|
696
|
+
* @param {string} root_dir
|
|
697
|
+
* @param {any} options
|
|
698
|
+
* @returns {any}
|
|
699
|
+
*/
|
|
700
|
+
function scanProjectSync(root_dir, options) {
|
|
701
|
+
const ptr0 = passStringToWasm0(root_dir, wasm.__wbindgen_malloc_command_export, wasm.__wbindgen_realloc_command_export);
|
|
702
|
+
const len0 = WASM_VECTOR_LEN;
|
|
703
|
+
const ret = wasm.scanProjectSync(ptr0, len0, options);
|
|
704
|
+
if (ret[2]) {
|
|
705
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
706
|
+
}
|
|
707
|
+
return takeFromExternrefTable0(ret[0]);
|
|
708
|
+
}
|
|
709
|
+
exports.scanProjectSync = scanProjectSync;
|
|
710
|
+
|
|
711
|
+
/**
|
|
712
|
+
* Register JS callbacks that bridge `buildtime.fs.*` to the host
|
|
713
|
+
* filesystem. Called once at startup by the Vite plugin (and any
|
|
714
|
+
* other JS host). Subsequent calls are ignored.
|
|
715
|
+
* @param {Function} read_text
|
|
716
|
+
* @param {Function} exists
|
|
717
|
+
* @param {Function} list_dir
|
|
718
|
+
*/
|
|
719
|
+
function setupBuildtimeFs(read_text, exists, list_dir) {
|
|
720
|
+
wasm.setupBuildtimeFs(read_text, exists, list_dir);
|
|
721
|
+
}
|
|
722
|
+
exports.setupBuildtimeFs = setupBuildtimeFs;
|
|
723
|
+
|
|
724
|
+
/**
|
|
725
|
+
* Register JS callbacks for resolving and running external (user-defined) macros.
|
|
726
|
+
*
|
|
727
|
+
* Required for WASM builds. The native (NAPI) build resolves external macros
|
|
728
|
+
* by spawning a Node subprocess, but WASM cannot spawn processes. Instead, the
|
|
729
|
+
* host JS environment must provide two callbacks:
|
|
730
|
+
*
|
|
731
|
+
* resolve: Given a package path, return an array of decorator names exported by that package.
|
|
732
|
+
*
|
|
733
|
+
* run: Given a JSON-serialized MacroContextIR, execute the external macro and return a JSON-serialized MacroResult.
|
|
734
|
+
*
|
|
735
|
+
* Must be called before expandSync if the source uses import macro comments.
|
|
736
|
+
* Does not exist on NAPI builds, so guard the call.
|
|
737
|
+
* @param {Function} resolve
|
|
738
|
+
* @param {Function} run
|
|
739
|
+
*/
|
|
740
|
+
function setupExternalMacros(resolve, run) {
|
|
741
|
+
wasm.setupExternalMacros(resolve, run);
|
|
742
|
+
}
|
|
743
|
+
exports.setupExternalMacros = setupExternalMacros;
|
|
744
|
+
|
|
745
|
+
/**
|
|
746
|
+
* @param {string} code
|
|
747
|
+
* @param {string} filepath
|
|
748
|
+
* @returns {any}
|
|
749
|
+
*/
|
|
750
|
+
function transformSync(code, filepath) {
|
|
751
|
+
const ptr0 = passStringToWasm0(code, wasm.__wbindgen_malloc_command_export, wasm.__wbindgen_realloc_command_export);
|
|
752
|
+
const len0 = WASM_VECTOR_LEN;
|
|
753
|
+
const ptr1 = passStringToWasm0(filepath, wasm.__wbindgen_malloc_command_export, wasm.__wbindgen_realloc_command_export);
|
|
754
|
+
const len1 = WASM_VECTOR_LEN;
|
|
755
|
+
const ret = wasm.transformSync(ptr0, len0, ptr1, len1);
|
|
756
|
+
if (ret[2]) {
|
|
757
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
758
|
+
}
|
|
759
|
+
return takeFromExternrefTable0(ret[0]);
|
|
760
|
+
}
|
|
761
|
+
exports.transformSync = transformSync;
|
|
762
|
+
|
|
763
|
+
function __wbg_get_imports() {
|
|
764
|
+
const import0 = {
|
|
765
|
+
__proto__: null,
|
|
766
|
+
__wbg_Error_2e59b1b37a9a34c3: function(arg0, arg1) {
|
|
767
|
+
const ret = Error(getStringFromWasm0(arg0, arg1));
|
|
768
|
+
return ret;
|
|
769
|
+
},
|
|
770
|
+
__wbg_Number_e6ffdb596c888833: function(arg0) {
|
|
771
|
+
const ret = Number(arg0);
|
|
772
|
+
return ret;
|
|
773
|
+
},
|
|
774
|
+
__wbg_String_8564e559799eccda: function(arg0, arg1) {
|
|
775
|
+
const ret = String(arg1);
|
|
776
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc_command_export, wasm.__wbindgen_realloc_command_export);
|
|
777
|
+
const len1 = WASM_VECTOR_LEN;
|
|
778
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
779
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
780
|
+
},
|
|
781
|
+
__wbg___wbindgen_boolean_get_a86c216575a75c30: function(arg0) {
|
|
782
|
+
const v = arg0;
|
|
783
|
+
const ret = typeof(v) === 'boolean' ? v : undefined;
|
|
784
|
+
return isLikeNone(ret) ? 0xFFFFFF : ret ? 1 : 0;
|
|
785
|
+
},
|
|
786
|
+
__wbg___wbindgen_debug_string_dd5d2d07ce9e6c57: function(arg0, arg1) {
|
|
787
|
+
const ret = debugString(arg1);
|
|
788
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc_command_export, wasm.__wbindgen_realloc_command_export);
|
|
789
|
+
const len1 = WASM_VECTOR_LEN;
|
|
790
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
791
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
792
|
+
},
|
|
793
|
+
__wbg___wbindgen_in_4bd7a57e54337366: function(arg0, arg1) {
|
|
794
|
+
const ret = arg0 in arg1;
|
|
795
|
+
return ret;
|
|
796
|
+
},
|
|
797
|
+
__wbg___wbindgen_is_function_49868bde5eb1e745: function(arg0) {
|
|
798
|
+
const ret = typeof(arg0) === 'function';
|
|
799
|
+
return ret;
|
|
800
|
+
},
|
|
801
|
+
__wbg___wbindgen_is_null_344c8750a8525473: function(arg0) {
|
|
802
|
+
const ret = arg0 === null;
|
|
803
|
+
return ret;
|
|
804
|
+
},
|
|
805
|
+
__wbg___wbindgen_is_object_40c5a80572e8f9d3: function(arg0) {
|
|
806
|
+
const val = arg0;
|
|
807
|
+
const ret = typeof(val) === 'object' && val !== null;
|
|
808
|
+
return ret;
|
|
809
|
+
},
|
|
810
|
+
__wbg___wbindgen_is_string_b29b5c5a8065ba1a: function(arg0) {
|
|
811
|
+
const ret = typeof(arg0) === 'string';
|
|
812
|
+
return ret;
|
|
813
|
+
},
|
|
814
|
+
__wbg___wbindgen_is_undefined_c0cca72b82b86f4d: function(arg0) {
|
|
815
|
+
const ret = arg0 === undefined;
|
|
816
|
+
return ret;
|
|
817
|
+
},
|
|
818
|
+
__wbg___wbindgen_jsval_loose_eq_3a72ae764d46d944: function(arg0, arg1) {
|
|
819
|
+
const ret = arg0 == arg1;
|
|
820
|
+
return ret;
|
|
821
|
+
},
|
|
822
|
+
__wbg___wbindgen_number_get_7579aab02a8a620c: function(arg0, arg1) {
|
|
823
|
+
const obj = arg1;
|
|
824
|
+
const ret = typeof(obj) === 'number' ? obj : undefined;
|
|
825
|
+
getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
|
|
826
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
|
|
827
|
+
},
|
|
828
|
+
__wbg___wbindgen_string_get_914df97fcfa788f2: function(arg0, arg1) {
|
|
829
|
+
const obj = arg1;
|
|
830
|
+
const ret = typeof(obj) === 'string' ? obj : undefined;
|
|
831
|
+
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc_command_export, wasm.__wbindgen_realloc_command_export);
|
|
832
|
+
var len1 = WASM_VECTOR_LEN;
|
|
833
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
834
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
835
|
+
},
|
|
836
|
+
__wbg___wbindgen_throw_81fc77679af83bc6: function(arg0, arg1) {
|
|
837
|
+
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
838
|
+
},
|
|
839
|
+
__wbg_call_7f2987183bb62793: function() { return handleError(function (arg0, arg1) {
|
|
840
|
+
const ret = arg0.call(arg1);
|
|
841
|
+
return ret;
|
|
842
|
+
}, arguments); },
|
|
843
|
+
__wbg_call_d578befcc3145dee: function() { return handleError(function (arg0, arg1, arg2) {
|
|
844
|
+
const ret = arg0.call(arg1, arg2);
|
|
845
|
+
return ret;
|
|
846
|
+
}, arguments); },
|
|
847
|
+
__wbg_done_547d467e97529006: function(arg0) {
|
|
848
|
+
const ret = arg0.done;
|
|
849
|
+
return ret;
|
|
850
|
+
},
|
|
851
|
+
__wbg_entries_616b1a459b85be0b: function(arg0) {
|
|
852
|
+
const ret = Object.entries(arg0);
|
|
853
|
+
return ret;
|
|
854
|
+
},
|
|
855
|
+
__wbg_from_741da0f916ab74aa: function(arg0) {
|
|
856
|
+
const ret = Array.from(arg0);
|
|
857
|
+
return ret;
|
|
858
|
+
},
|
|
859
|
+
__wbg_getRandomValues_3f44b700395062e5: function() { return handleError(function (arg0, arg1) {
|
|
860
|
+
globalThis.crypto.getRandomValues(getArrayU8FromWasm0(arg0, arg1));
|
|
861
|
+
}, arguments); },
|
|
862
|
+
__wbg_get_4848e350b40afc16: function(arg0, arg1) {
|
|
863
|
+
const ret = arg0[arg1 >>> 0];
|
|
864
|
+
return ret;
|
|
865
|
+
},
|
|
866
|
+
__wbg_get_ed0642c4b9d31ddf: function() { return handleError(function (arg0, arg1) {
|
|
867
|
+
const ret = Reflect.get(arg0, arg1);
|
|
868
|
+
return ret;
|
|
869
|
+
}, arguments); },
|
|
870
|
+
__wbg_get_unchecked_7d7babe32e9e6a54: function(arg0, arg1) {
|
|
871
|
+
const ret = arg0[arg1 >>> 0];
|
|
872
|
+
return ret;
|
|
873
|
+
},
|
|
874
|
+
__wbg_get_with_ref_key_6412cf3094599694: function(arg0, arg1) {
|
|
875
|
+
const ret = arg0[arg1];
|
|
876
|
+
return ret;
|
|
877
|
+
},
|
|
878
|
+
__wbg_instanceof_ArrayBuffer_ff7c1337a5e3b33a: function(arg0) {
|
|
879
|
+
let result;
|
|
880
|
+
try {
|
|
881
|
+
result = arg0 instanceof ArrayBuffer;
|
|
882
|
+
} catch (_) {
|
|
883
|
+
result = false;
|
|
884
|
+
}
|
|
885
|
+
const ret = result;
|
|
886
|
+
return ret;
|
|
887
|
+
},
|
|
888
|
+
__wbg_instanceof_Uint8Array_4b8da683deb25d72: function(arg0) {
|
|
889
|
+
let result;
|
|
890
|
+
try {
|
|
891
|
+
result = arg0 instanceof Uint8Array;
|
|
892
|
+
} catch (_) {
|
|
893
|
+
result = false;
|
|
894
|
+
}
|
|
895
|
+
const ret = result;
|
|
896
|
+
return ret;
|
|
897
|
+
},
|
|
898
|
+
__wbg_isArray_db61795ad004c139: function(arg0) {
|
|
899
|
+
const ret = Array.isArray(arg0);
|
|
900
|
+
return ret;
|
|
901
|
+
},
|
|
902
|
+
__wbg_isSafeInteger_ea83862ba994770c: function(arg0) {
|
|
903
|
+
const ret = Number.isSafeInteger(arg0);
|
|
904
|
+
return ret;
|
|
905
|
+
},
|
|
906
|
+
__wbg_iterator_de403ef31815a3e6: function() {
|
|
907
|
+
const ret = Symbol.iterator;
|
|
908
|
+
return ret;
|
|
909
|
+
},
|
|
910
|
+
__wbg_length_0c32cb8543c8e4c8: function(arg0) {
|
|
911
|
+
const ret = arg0.length;
|
|
912
|
+
return ret;
|
|
913
|
+
},
|
|
914
|
+
__wbg_length_6e821edde497a532: function(arg0) {
|
|
915
|
+
const ret = arg0.length;
|
|
916
|
+
return ret;
|
|
917
|
+
},
|
|
918
|
+
__wbg_new_4f9fafbb3909af72: function() {
|
|
919
|
+
const ret = new Object();
|
|
920
|
+
return ret;
|
|
921
|
+
},
|
|
922
|
+
__wbg_new_a560378ea1240b14: function(arg0) {
|
|
923
|
+
const ret = new Uint8Array(arg0);
|
|
924
|
+
return ret;
|
|
925
|
+
},
|
|
926
|
+
__wbg_new_f3c9df4f38f3f798: function() {
|
|
927
|
+
const ret = new Array();
|
|
928
|
+
return ret;
|
|
929
|
+
},
|
|
930
|
+
__wbg_next_01132ed6134b8ef5: function(arg0) {
|
|
931
|
+
const ret = arg0.next;
|
|
932
|
+
return ret;
|
|
933
|
+
},
|
|
934
|
+
__wbg_next_b3713ec761a9dbfd: function() { return handleError(function (arg0) {
|
|
935
|
+
const ret = arg0.next();
|
|
936
|
+
return ret;
|
|
937
|
+
}, arguments); },
|
|
938
|
+
__wbg_now_88621c9c9a4f3ffc: function() {
|
|
939
|
+
const ret = Date.now();
|
|
940
|
+
return ret;
|
|
941
|
+
},
|
|
942
|
+
__wbg_now_e7c6795a7f81e10f: function(arg0) {
|
|
943
|
+
const ret = arg0.now();
|
|
944
|
+
return ret;
|
|
945
|
+
},
|
|
946
|
+
__wbg_performance_3fcf6e32a7e1ed0a: function(arg0) {
|
|
947
|
+
const ret = arg0.performance;
|
|
948
|
+
return ret;
|
|
949
|
+
},
|
|
950
|
+
__wbg_prototypesetcall_3e05eb9545565046: function(arg0, arg1, arg2) {
|
|
951
|
+
Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), arg2);
|
|
952
|
+
},
|
|
953
|
+
__wbg_set_6be42768c690e380: function(arg0, arg1, arg2) {
|
|
954
|
+
arg0[arg1] = arg2;
|
|
955
|
+
},
|
|
956
|
+
__wbg_set_6c60b2e8ad0e9383: function(arg0, arg1, arg2) {
|
|
957
|
+
arg0[arg1 >>> 0] = arg2;
|
|
958
|
+
},
|
|
959
|
+
__wbg_set_8ee2d34facb8466e: function() { return handleError(function (arg0, arg1, arg2) {
|
|
960
|
+
const ret = Reflect.set(arg0, arg1, arg2);
|
|
961
|
+
return ret;
|
|
962
|
+
}, arguments); },
|
|
963
|
+
__wbg_static_accessor_GLOBAL_THIS_a1248013d790bf5f: function() {
|
|
964
|
+
const ret = typeof globalThis === 'undefined' ? null : globalThis;
|
|
965
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
966
|
+
},
|
|
967
|
+
__wbg_static_accessor_GLOBAL_f2e0f995a21329ff: function() {
|
|
968
|
+
const ret = typeof global === 'undefined' ? null : global;
|
|
969
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
970
|
+
},
|
|
971
|
+
__wbg_static_accessor_SELF_24f78b6d23f286ea: function() {
|
|
972
|
+
const ret = typeof self === 'undefined' ? null : self;
|
|
973
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
974
|
+
},
|
|
975
|
+
__wbg_static_accessor_WINDOW_59fd959c540fe405: function() {
|
|
976
|
+
const ret = typeof window === 'undefined' ? null : window;
|
|
977
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
978
|
+
},
|
|
979
|
+
__wbg_value_7f6052747ccf940f: function(arg0) {
|
|
980
|
+
const ret = arg0.value;
|
|
981
|
+
return ret;
|
|
982
|
+
},
|
|
983
|
+
__wbindgen_cast_0000000000000001: function(arg0) {
|
|
984
|
+
// Cast intrinsic for `F64 -> Externref`.
|
|
985
|
+
const ret = arg0;
|
|
986
|
+
return ret;
|
|
987
|
+
},
|
|
988
|
+
__wbindgen_cast_0000000000000002: function(arg0, arg1) {
|
|
989
|
+
// Cast intrinsic for `Ref(String) -> Externref`.
|
|
990
|
+
const ret = getStringFromWasm0(arg0, arg1);
|
|
991
|
+
return ret;
|
|
992
|
+
},
|
|
993
|
+
__wbindgen_init_externref_table: function() {
|
|
994
|
+
const table = wasm.__wbindgen_externrefs;
|
|
995
|
+
const offset = table.grow(4);
|
|
996
|
+
table.set(0, undefined);
|
|
997
|
+
table.set(offset + 0, undefined);
|
|
998
|
+
table.set(offset + 1, null);
|
|
999
|
+
table.set(offset + 2, true);
|
|
1000
|
+
table.set(offset + 3, false);
|
|
1001
|
+
},
|
|
1002
|
+
};
|
|
1003
|
+
return {
|
|
1004
|
+
__proto__: null,
|
|
1005
|
+
"./macroforge_ts_bg.js": import0,
|
|
1006
|
+
};
|
|
1007
|
+
}
|
|
1008
|
+
|
|
1009
|
+
const NativePluginFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1010
|
+
? { register: () => {}, unregister: () => {} }
|
|
1011
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_nativeplugin_free(ptr >>> 0, 1));
|
|
1012
|
+
const NativePositionMapperFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1013
|
+
? { register: () => {}, unregister: () => {} }
|
|
1014
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_nativepositionmapper_free(ptr >>> 0, 1));
|
|
1015
|
+
const NativeMapperFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1016
|
+
? { register: () => {}, unregister: () => {} }
|
|
1017
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_nativemapper_free(ptr >>> 0, 1));
|
|
1018
|
+
|
|
1019
|
+
function addToExternrefTable0(obj) {
|
|
1020
|
+
const idx = wasm.__externref_table_alloc_command_export();
|
|
1021
|
+
wasm.__wbindgen_externrefs.set(idx, obj);
|
|
1022
|
+
return idx;
|
|
1023
|
+
}
|
|
1024
|
+
|
|
1025
|
+
function debugString(val) {
|
|
1026
|
+
// primitive types
|
|
1027
|
+
const type = typeof val;
|
|
1028
|
+
if (type == 'number' || type == 'boolean' || val == null) {
|
|
1029
|
+
return `${val}`;
|
|
1030
|
+
}
|
|
1031
|
+
if (type == 'string') {
|
|
1032
|
+
return `"${val}"`;
|
|
1033
|
+
}
|
|
1034
|
+
if (type == 'symbol') {
|
|
1035
|
+
const description = val.description;
|
|
1036
|
+
if (description == null) {
|
|
1037
|
+
return 'Symbol';
|
|
1038
|
+
} else {
|
|
1039
|
+
return `Symbol(${description})`;
|
|
1040
|
+
}
|
|
1041
|
+
}
|
|
1042
|
+
if (type == 'function') {
|
|
1043
|
+
const name = val.name;
|
|
1044
|
+
if (typeof name == 'string' && name.length > 0) {
|
|
1045
|
+
return `Function(${name})`;
|
|
1046
|
+
} else {
|
|
1047
|
+
return 'Function';
|
|
1048
|
+
}
|
|
1049
|
+
}
|
|
1050
|
+
// objects
|
|
1051
|
+
if (Array.isArray(val)) {
|
|
1052
|
+
const length = val.length;
|
|
1053
|
+
let debug = '[';
|
|
1054
|
+
if (length > 0) {
|
|
1055
|
+
debug += debugString(val[0]);
|
|
1056
|
+
}
|
|
1057
|
+
for(let i = 1; i < length; i++) {
|
|
1058
|
+
debug += ', ' + debugString(val[i]);
|
|
1059
|
+
}
|
|
1060
|
+
debug += ']';
|
|
1061
|
+
return debug;
|
|
1062
|
+
}
|
|
1063
|
+
// Test for built-in
|
|
1064
|
+
const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
|
|
1065
|
+
let className;
|
|
1066
|
+
if (builtInMatches && builtInMatches.length > 1) {
|
|
1067
|
+
className = builtInMatches[1];
|
|
1068
|
+
} else {
|
|
1069
|
+
// Failed to match the standard '[object ClassName]'
|
|
1070
|
+
return toString.call(val);
|
|
1071
|
+
}
|
|
1072
|
+
if (className == 'Object') {
|
|
1073
|
+
// we're a user defined class or Object
|
|
1074
|
+
// JSON.stringify avoids problems with cycles, and is generally much
|
|
1075
|
+
// easier than looping through ownProperties of `val`.
|
|
1076
|
+
try {
|
|
1077
|
+
return 'Object(' + JSON.stringify(val) + ')';
|
|
1078
|
+
} catch (_) {
|
|
1079
|
+
return 'Object';
|
|
1080
|
+
}
|
|
1081
|
+
}
|
|
1082
|
+
// errors
|
|
1083
|
+
if (val instanceof Error) {
|
|
1084
|
+
return `${val.name}: ${val.message}\n${val.stack}`;
|
|
1085
|
+
}
|
|
1086
|
+
// TODO we could test for more things here, like `Set`s and `Map`s.
|
|
1087
|
+
return className;
|
|
1088
|
+
}
|
|
1089
|
+
|
|
1090
|
+
function getArrayU8FromWasm0(ptr, len) {
|
|
1091
|
+
ptr = ptr >>> 0;
|
|
1092
|
+
return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
|
|
1093
|
+
}
|
|
1094
|
+
|
|
1095
|
+
let cachedDataViewMemory0 = null;
|
|
1096
|
+
function getDataViewMemory0() {
|
|
1097
|
+
if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
|
|
1098
|
+
cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
|
|
1099
|
+
}
|
|
1100
|
+
return cachedDataViewMemory0;
|
|
1101
|
+
}
|
|
1102
|
+
|
|
1103
|
+
function getStringFromWasm0(ptr, len) {
|
|
1104
|
+
ptr = ptr >>> 0;
|
|
1105
|
+
return decodeText(ptr, len);
|
|
1106
|
+
}
|
|
1107
|
+
|
|
1108
|
+
let cachedUint8ArrayMemory0 = null;
|
|
1109
|
+
function getUint8ArrayMemory0() {
|
|
1110
|
+
if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
|
|
1111
|
+
cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
|
|
1112
|
+
}
|
|
1113
|
+
return cachedUint8ArrayMemory0;
|
|
1114
|
+
}
|
|
1115
|
+
|
|
1116
|
+
function handleError(f, args) {
|
|
1117
|
+
try {
|
|
1118
|
+
return f.apply(this, args);
|
|
1119
|
+
} catch (e) {
|
|
1120
|
+
const idx = addToExternrefTable0(e);
|
|
1121
|
+
wasm.__wbindgen_exn_store_command_export(idx);
|
|
1122
|
+
}
|
|
1123
|
+
}
|
|
1124
|
+
|
|
1125
|
+
function isLikeNone(x) {
|
|
1126
|
+
return x === undefined || x === null;
|
|
1127
|
+
}
|
|
1128
|
+
|
|
1129
|
+
function passStringToWasm0(arg, malloc, realloc) {
|
|
1130
|
+
if (realloc === undefined) {
|
|
1131
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
1132
|
+
const ptr = malloc(buf.length, 1) >>> 0;
|
|
1133
|
+
getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
|
|
1134
|
+
WASM_VECTOR_LEN = buf.length;
|
|
1135
|
+
return ptr;
|
|
1136
|
+
}
|
|
1137
|
+
|
|
1138
|
+
let len = arg.length;
|
|
1139
|
+
let ptr = malloc(len, 1) >>> 0;
|
|
1140
|
+
|
|
1141
|
+
const mem = getUint8ArrayMemory0();
|
|
1142
|
+
|
|
1143
|
+
let offset = 0;
|
|
1144
|
+
|
|
1145
|
+
for (; offset < len; offset++) {
|
|
1146
|
+
const code = arg.charCodeAt(offset);
|
|
1147
|
+
if (code > 0x7F) break;
|
|
1148
|
+
mem[ptr + offset] = code;
|
|
1149
|
+
}
|
|
1150
|
+
if (offset !== len) {
|
|
1151
|
+
if (offset !== 0) {
|
|
1152
|
+
arg = arg.slice(offset);
|
|
1153
|
+
}
|
|
1154
|
+
ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
|
|
1155
|
+
const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
|
|
1156
|
+
const ret = cachedTextEncoder.encodeInto(arg, view);
|
|
1157
|
+
|
|
1158
|
+
offset += ret.written;
|
|
1159
|
+
ptr = realloc(ptr, len, offset, 1) >>> 0;
|
|
1160
|
+
}
|
|
1161
|
+
|
|
1162
|
+
WASM_VECTOR_LEN = offset;
|
|
1163
|
+
return ptr;
|
|
1164
|
+
}
|
|
1165
|
+
|
|
1166
|
+
function takeFromExternrefTable0(idx) {
|
|
1167
|
+
const value = wasm.__wbindgen_externrefs.get(idx);
|
|
1168
|
+
wasm.__externref_table_dealloc_command_export(idx);
|
|
1169
|
+
return value;
|
|
1170
|
+
}
|
|
1171
|
+
|
|
1172
|
+
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
1173
|
+
cachedTextDecoder.decode();
|
|
1174
|
+
function decodeText(ptr, len) {
|
|
1175
|
+
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
1176
|
+
}
|
|
1177
|
+
|
|
1178
|
+
const cachedTextEncoder = new TextEncoder();
|
|
1179
|
+
|
|
1180
|
+
if (!('encodeInto' in cachedTextEncoder)) {
|
|
1181
|
+
cachedTextEncoder.encodeInto = function (arg, view) {
|
|
1182
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
1183
|
+
view.set(buf);
|
|
1184
|
+
return {
|
|
1185
|
+
read: arg.length,
|
|
1186
|
+
written: buf.length
|
|
1187
|
+
};
|
|
1188
|
+
};
|
|
1189
|
+
}
|
|
1190
|
+
|
|
1191
|
+
let WASM_VECTOR_LEN = 0;
|
|
1192
|
+
|
|
1193
|
+
const wasmPath = `${__dirname}/macroforge_ts_bg.wasm`;
|
|
1194
|
+
const wasmBytes = require('fs').readFileSync(wasmPath);
|
|
1195
|
+
const wasmModule = new WebAssembly.Module(wasmBytes);
|
|
1196
|
+
let wasm = new WebAssembly.Instance(wasmModule, __wbg_get_imports()).exports;
|
|
1197
|
+
wasm.__wbindgen_start();
|