@onda-lang/wasm-compiler 0.5.4 → 0.7.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/README.md +63 -7
- package/bin/onda-wasm.js +1 -1
- package/dist/backend/artifact.d.ts +2 -0
- package/dist/backend/constants.js +1 -1
- package/dist/backend/index.d.ts +2 -0
- package/dist/backend/index.js +2639 -317
- package/dist/build.json +3 -3
- package/dist/frontend/README.md +20 -7
- package/dist/frontend/onda_compiler_web.d.ts +120 -9
- package/dist/frontend/onda_compiler_web.js +556 -42
- package/dist/frontend/onda_compiler_web_bg.wasm +0 -0
- package/dist/frontend/onda_compiler_web_bg.wasm.d.ts +42 -5
- package/dist/frontend/package.json +1 -1
- package/dist/version.js +1 -1
- package/package.json +2 -2
- package/src/index.d.ts +119 -5
- package/src/index.js +455 -26
- package/src/worker.js +63 -6
|
@@ -1,5 +1,131 @@
|
|
|
1
1
|
/* @ts-self-types="./onda_compiler_web.d.ts" */
|
|
2
2
|
|
|
3
|
+
export class FrontendJsonCompilation {
|
|
4
|
+
static __wrap(ptr) {
|
|
5
|
+
ptr = ptr >>> 0;
|
|
6
|
+
const obj = Object.create(FrontendJsonCompilation.prototype);
|
|
7
|
+
obj.__wbg_ptr = ptr;
|
|
8
|
+
FrontendJsonCompilationFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
9
|
+
return obj;
|
|
10
|
+
}
|
|
11
|
+
__destroy_into_raw() {
|
|
12
|
+
const ptr = this.__wbg_ptr;
|
|
13
|
+
this.__wbg_ptr = 0;
|
|
14
|
+
FrontendJsonCompilationFinalization.unregister(this);
|
|
15
|
+
return ptr;
|
|
16
|
+
}
|
|
17
|
+
free() {
|
|
18
|
+
const ptr = this.__destroy_into_raw();
|
|
19
|
+
wasm.__wbg_frontendjsoncompilation_free(ptr, 0);
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* @returns {string}
|
|
23
|
+
*/
|
|
24
|
+
source_files_json() {
|
|
25
|
+
let deferred1_0;
|
|
26
|
+
let deferred1_1;
|
|
27
|
+
try {
|
|
28
|
+
const ret = wasm.frontendjsoncompilation_source_files_json(this.__wbg_ptr);
|
|
29
|
+
deferred1_0 = ret[0];
|
|
30
|
+
deferred1_1 = ret[1];
|
|
31
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
32
|
+
} finally {
|
|
33
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* @returns {string}
|
|
38
|
+
*/
|
|
39
|
+
source_image_json() {
|
|
40
|
+
let deferred1_0;
|
|
41
|
+
let deferred1_1;
|
|
42
|
+
try {
|
|
43
|
+
const ret = wasm.frontendjsoncompilation_source_image_json(this.__wbg_ptr);
|
|
44
|
+
deferred1_0 = ret[0];
|
|
45
|
+
deferred1_1 = ret[1];
|
|
46
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
47
|
+
} finally {
|
|
48
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* @returns {string}
|
|
53
|
+
*/
|
|
54
|
+
take_mir() {
|
|
55
|
+
let deferred1_0;
|
|
56
|
+
let deferred1_1;
|
|
57
|
+
try {
|
|
58
|
+
const ret = wasm.frontendjsoncompilation_take_mir(this.__wbg_ptr);
|
|
59
|
+
deferred1_0 = ret[0];
|
|
60
|
+
deferred1_1 = ret[1];
|
|
61
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
62
|
+
} finally {
|
|
63
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
if (Symbol.dispose) FrontendJsonCompilation.prototype[Symbol.dispose] = FrontendJsonCompilation.prototype.free;
|
|
68
|
+
|
|
69
|
+
export class FrontendMessagePackCompilation {
|
|
70
|
+
static __wrap(ptr) {
|
|
71
|
+
ptr = ptr >>> 0;
|
|
72
|
+
const obj = Object.create(FrontendMessagePackCompilation.prototype);
|
|
73
|
+
obj.__wbg_ptr = ptr;
|
|
74
|
+
FrontendMessagePackCompilationFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
75
|
+
return obj;
|
|
76
|
+
}
|
|
77
|
+
__destroy_into_raw() {
|
|
78
|
+
const ptr = this.__wbg_ptr;
|
|
79
|
+
this.__wbg_ptr = 0;
|
|
80
|
+
FrontendMessagePackCompilationFinalization.unregister(this);
|
|
81
|
+
return ptr;
|
|
82
|
+
}
|
|
83
|
+
free() {
|
|
84
|
+
const ptr = this.__destroy_into_raw();
|
|
85
|
+
wasm.__wbg_frontendmessagepackcompilation_free(ptr, 0);
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* @returns {string}
|
|
89
|
+
*/
|
|
90
|
+
source_files_json() {
|
|
91
|
+
let deferred1_0;
|
|
92
|
+
let deferred1_1;
|
|
93
|
+
try {
|
|
94
|
+
const ret = wasm.frontendmessagepackcompilation_source_files_json(this.__wbg_ptr);
|
|
95
|
+
deferred1_0 = ret[0];
|
|
96
|
+
deferred1_1 = ret[1];
|
|
97
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
98
|
+
} finally {
|
|
99
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* @returns {string}
|
|
104
|
+
*/
|
|
105
|
+
source_image_json() {
|
|
106
|
+
let deferred1_0;
|
|
107
|
+
let deferred1_1;
|
|
108
|
+
try {
|
|
109
|
+
const ret = wasm.frontendmessagepackcompilation_source_image_json(this.__wbg_ptr);
|
|
110
|
+
deferred1_0 = ret[0];
|
|
111
|
+
deferred1_1 = ret[1];
|
|
112
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
113
|
+
} finally {
|
|
114
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* @returns {Uint8Array}
|
|
119
|
+
*/
|
|
120
|
+
take_mir() {
|
|
121
|
+
const ret = wasm.frontendmessagepackcompilation_take_mir(this.__wbg_ptr);
|
|
122
|
+
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
123
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
124
|
+
return v1;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
if (Symbol.dispose) FrontendMessagePackCompilation.prototype[Symbol.dispose] = FrontendMessagePackCompilation.prototype.free;
|
|
128
|
+
|
|
3
129
|
/**
|
|
4
130
|
* Stateful `onda lsp` server for browser Worker transports.
|
|
5
131
|
*/
|
|
@@ -59,34 +185,293 @@ export class OndaLsp {
|
|
|
59
185
|
}
|
|
60
186
|
if (Symbol.dispose) OndaLsp.prototype[Symbol.dispose] = OndaLsp.prototype.free;
|
|
61
187
|
|
|
188
|
+
export class WebDecodedBufferAsset {
|
|
189
|
+
static __wrap(ptr) {
|
|
190
|
+
ptr = ptr >>> 0;
|
|
191
|
+
const obj = Object.create(WebDecodedBufferAsset.prototype);
|
|
192
|
+
obj.__wbg_ptr = ptr;
|
|
193
|
+
WebDecodedBufferAssetFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
194
|
+
return obj;
|
|
195
|
+
}
|
|
196
|
+
__destroy_into_raw() {
|
|
197
|
+
const ptr = this.__wbg_ptr;
|
|
198
|
+
this.__wbg_ptr = 0;
|
|
199
|
+
WebDecodedBufferAssetFinalization.unregister(this);
|
|
200
|
+
return ptr;
|
|
201
|
+
}
|
|
202
|
+
free() {
|
|
203
|
+
const ptr = this.__destroy_into_raw();
|
|
204
|
+
wasm.__wbg_webdecodedbufferasset_free(ptr, 0);
|
|
205
|
+
}
|
|
206
|
+
/**
|
|
207
|
+
* @returns {Uint8Array}
|
|
208
|
+
*/
|
|
209
|
+
canonical_payload() {
|
|
210
|
+
const ret = wasm.webdecodedbufferasset_canonical_payload(this.__wbg_ptr);
|
|
211
|
+
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
212
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
213
|
+
return v1;
|
|
214
|
+
}
|
|
215
|
+
/**
|
|
216
|
+
* @returns {number}
|
|
217
|
+
*/
|
|
218
|
+
channels() {
|
|
219
|
+
const ret = wasm.webdecodedbufferasset_channels(this.__wbg_ptr);
|
|
220
|
+
return ret >>> 0;
|
|
221
|
+
}
|
|
222
|
+
/**
|
|
223
|
+
* @returns {string}
|
|
224
|
+
*/
|
|
225
|
+
element() {
|
|
226
|
+
let deferred1_0;
|
|
227
|
+
let deferred1_1;
|
|
228
|
+
try {
|
|
229
|
+
const ret = wasm.webdecodedbufferasset_element(this.__wbg_ptr);
|
|
230
|
+
deferred1_0 = ret[0];
|
|
231
|
+
deferred1_1 = ret[1];
|
|
232
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
233
|
+
} finally {
|
|
234
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
/**
|
|
238
|
+
* @returns {number}
|
|
239
|
+
*/
|
|
240
|
+
frames() {
|
|
241
|
+
const ret = wasm.webdecodedbufferasset_frames(this.__wbg_ptr);
|
|
242
|
+
return ret >>> 0;
|
|
243
|
+
}
|
|
244
|
+
/**
|
|
245
|
+
* @returns {number}
|
|
246
|
+
*/
|
|
247
|
+
sample_rate() {
|
|
248
|
+
const ret = wasm.webdecodedbufferasset_sample_rate(this.__wbg_ptr);
|
|
249
|
+
return ret;
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
if (Symbol.dispose) WebDecodedBufferAsset.prototype[Symbol.dispose] = WebDecodedBufferAsset.prototype.free;
|
|
253
|
+
|
|
254
|
+
export class WebMaterializedProjectBuilder {
|
|
255
|
+
__destroy_into_raw() {
|
|
256
|
+
const ptr = this.__wbg_ptr;
|
|
257
|
+
this.__wbg_ptr = 0;
|
|
258
|
+
WebMaterializedProjectBuilderFinalization.unregister(this);
|
|
259
|
+
return ptr;
|
|
260
|
+
}
|
|
261
|
+
free() {
|
|
262
|
+
const ptr = this.__destroy_into_raw();
|
|
263
|
+
wasm.__wbg_webmaterializedprojectbuilder_free(ptr, 0);
|
|
264
|
+
}
|
|
265
|
+
/**
|
|
266
|
+
* @param {string} path
|
|
267
|
+
* @param {Uint8Array} bytes
|
|
268
|
+
*/
|
|
269
|
+
add_file(path, bytes) {
|
|
270
|
+
const ptr0 = passStringToWasm0(path, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
271
|
+
const len0 = WASM_VECTOR_LEN;
|
|
272
|
+
const ptr1 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
273
|
+
const len1 = WASM_VECTOR_LEN;
|
|
274
|
+
const ret = wasm.webmaterializedprojectbuilder_add_file(this.__wbg_ptr, ptr0, len0, ptr1, len1);
|
|
275
|
+
if (ret[1]) {
|
|
276
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
constructor() {
|
|
280
|
+
const ret = wasm.webmaterializedprojectbuilder_new();
|
|
281
|
+
this.__wbg_ptr = ret >>> 0;
|
|
282
|
+
WebMaterializedProjectBuilderFinalization.register(this, this.__wbg_ptr, this);
|
|
283
|
+
return this;
|
|
284
|
+
}
|
|
285
|
+
/**
|
|
286
|
+
* @param {string} manifest_path
|
|
287
|
+
*/
|
|
288
|
+
select_project(manifest_path) {
|
|
289
|
+
const ptr0 = passStringToWasm0(manifest_path, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
290
|
+
const len0 = WASM_VECTOR_LEN;
|
|
291
|
+
const ret = wasm.webmaterializedprojectbuilder_select_project(this.__wbg_ptr, ptr0, len0);
|
|
292
|
+
if (ret[1]) {
|
|
293
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
/**
|
|
297
|
+
* @returns {Uint8Array}
|
|
298
|
+
*/
|
|
299
|
+
serialize() {
|
|
300
|
+
const ret = wasm.webmaterializedprojectbuilder_serialize(this.__wbg_ptr);
|
|
301
|
+
if (ret[3]) {
|
|
302
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
303
|
+
}
|
|
304
|
+
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
305
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
306
|
+
return v1;
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
if (Symbol.dispose) WebMaterializedProjectBuilder.prototype[Symbol.dispose] = WebMaterializedProjectBuilder.prototype.free;
|
|
310
|
+
|
|
311
|
+
export class WebProjectImageBuilder {
|
|
312
|
+
__destroy_into_raw() {
|
|
313
|
+
const ptr = this.__wbg_ptr;
|
|
314
|
+
this.__wbg_ptr = 0;
|
|
315
|
+
WebProjectImageBuilderFinalization.unregister(this);
|
|
316
|
+
return ptr;
|
|
317
|
+
}
|
|
318
|
+
free() {
|
|
319
|
+
const ptr = this.__destroy_into_raw();
|
|
320
|
+
wasm.__wbg_webprojectimagebuilder_free(ptr, 0);
|
|
321
|
+
}
|
|
322
|
+
/**
|
|
323
|
+
* @param {string} name
|
|
324
|
+
* @param {Uint8Array} ondabuffer_bytes
|
|
325
|
+
*/
|
|
326
|
+
add_buffer(name, ondabuffer_bytes) {
|
|
327
|
+
const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
328
|
+
const len0 = WASM_VECTOR_LEN;
|
|
329
|
+
const ptr1 = passArray8ToWasm0(ondabuffer_bytes, wasm.__wbindgen_malloc);
|
|
330
|
+
const len1 = WASM_VECTOR_LEN;
|
|
331
|
+
const ret = wasm.webprojectimagebuilder_add_buffer(this.__wbg_ptr, ptr0, len0, ptr1, len1);
|
|
332
|
+
if (ret[1]) {
|
|
333
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
/**
|
|
337
|
+
* @param {string} source_image_json
|
|
338
|
+
*/
|
|
339
|
+
constructor(source_image_json) {
|
|
340
|
+
const ptr0 = passStringToWasm0(source_image_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
341
|
+
const len0 = WASM_VECTOR_LEN;
|
|
342
|
+
const ret = wasm.webprojectimagebuilder_new(ptr0, len0);
|
|
343
|
+
if (ret[2]) {
|
|
344
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
345
|
+
}
|
|
346
|
+
this.__wbg_ptr = ret[0] >>> 0;
|
|
347
|
+
WebProjectImageBuilderFinalization.register(this, this.__wbg_ptr, this);
|
|
348
|
+
return this;
|
|
349
|
+
}
|
|
350
|
+
/**
|
|
351
|
+
* @returns {Uint8Array}
|
|
352
|
+
*/
|
|
353
|
+
serialize() {
|
|
354
|
+
const ret = wasm.webprojectimagebuilder_serialize(this.__wbg_ptr);
|
|
355
|
+
if (ret[3]) {
|
|
356
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
357
|
+
}
|
|
358
|
+
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
359
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
360
|
+
return v1;
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
if (Symbol.dispose) WebProjectImageBuilder.prototype[Symbol.dispose] = WebProjectImageBuilder.prototype.free;
|
|
364
|
+
|
|
365
|
+
export class WebProjectMaterializationPlan {
|
|
366
|
+
static __wrap(ptr) {
|
|
367
|
+
ptr = ptr >>> 0;
|
|
368
|
+
const obj = Object.create(WebProjectMaterializationPlan.prototype);
|
|
369
|
+
obj.__wbg_ptr = ptr;
|
|
370
|
+
WebProjectMaterializationPlanFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
371
|
+
return obj;
|
|
372
|
+
}
|
|
373
|
+
__destroy_into_raw() {
|
|
374
|
+
const ptr = this.__wbg_ptr;
|
|
375
|
+
this.__wbg_ptr = 0;
|
|
376
|
+
WebProjectMaterializationPlanFinalization.unregister(this);
|
|
377
|
+
return ptr;
|
|
378
|
+
}
|
|
379
|
+
free() {
|
|
380
|
+
const ptr = this.__destroy_into_raw();
|
|
381
|
+
wasm.__wbg_webprojectmaterializationplan_free(ptr, 0);
|
|
382
|
+
}
|
|
383
|
+
/**
|
|
384
|
+
* @returns {string}
|
|
385
|
+
*/
|
|
386
|
+
directories_json() {
|
|
387
|
+
let deferred1_0;
|
|
388
|
+
let deferred1_1;
|
|
389
|
+
try {
|
|
390
|
+
const ret = wasm.webprojectmaterializationplan_directories_json(this.__wbg_ptr);
|
|
391
|
+
deferred1_0 = ret[0];
|
|
392
|
+
deferred1_1 = ret[1];
|
|
393
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
394
|
+
} finally {
|
|
395
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
/**
|
|
399
|
+
* @param {number} index
|
|
400
|
+
* @returns {Uint8Array | undefined}
|
|
401
|
+
*/
|
|
402
|
+
file_bytes(index) {
|
|
403
|
+
const ret = wasm.webprojectmaterializationplan_file_bytes(this.__wbg_ptr, index);
|
|
404
|
+
let v1;
|
|
405
|
+
if (ret[0] !== 0) {
|
|
406
|
+
v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
407
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
408
|
+
}
|
|
409
|
+
return v1;
|
|
410
|
+
}
|
|
411
|
+
/**
|
|
412
|
+
* @returns {number}
|
|
413
|
+
*/
|
|
414
|
+
file_count() {
|
|
415
|
+
const ret = wasm.webprojectmaterializationplan_file_count(this.__wbg_ptr);
|
|
416
|
+
return ret >>> 0;
|
|
417
|
+
}
|
|
418
|
+
/**
|
|
419
|
+
* @param {number} index
|
|
420
|
+
* @returns {string | undefined}
|
|
421
|
+
*/
|
|
422
|
+
file_path(index) {
|
|
423
|
+
const ret = wasm.webprojectmaterializationplan_file_path(this.__wbg_ptr, index);
|
|
424
|
+
let v1;
|
|
425
|
+
if (ret[0] !== 0) {
|
|
426
|
+
v1 = getStringFromWasm0(ret[0], ret[1]).slice();
|
|
427
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
428
|
+
}
|
|
429
|
+
return v1;
|
|
430
|
+
}
|
|
431
|
+
}
|
|
432
|
+
if (Symbol.dispose) WebProjectMaterializationPlan.prototype[Symbol.dispose] = WebProjectMaterializationPlan.prototype.free;
|
|
433
|
+
|
|
434
|
+
/**
|
|
435
|
+
* @returns {number}
|
|
436
|
+
*/
|
|
437
|
+
export function buffer_asset_format_version() {
|
|
438
|
+
const ret = wasm.buffer_asset_format_version();
|
|
439
|
+
return ret >>> 0;
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
/**
|
|
443
|
+
* @param {Uint8Array} image_bytes
|
|
444
|
+
* @param {number} sample_rate
|
|
445
|
+
* @param {number} block_size
|
|
446
|
+
* @returns {FrontendMessagePackCompilation}
|
|
447
|
+
*/
|
|
448
|
+
export function compile_project_image_to_mir_messagepack(image_bytes, sample_rate, block_size) {
|
|
449
|
+
const ptr0 = passArray8ToWasm0(image_bytes, wasm.__wbindgen_malloc);
|
|
450
|
+
const len0 = WASM_VECTOR_LEN;
|
|
451
|
+
const ret = wasm.compile_project_image_to_mir_messagepack(ptr0, len0, sample_rate, block_size);
|
|
452
|
+
if (ret[2]) {
|
|
453
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
454
|
+
}
|
|
455
|
+
return FrontendMessagePackCompilation.__wrap(ret[0]);
|
|
456
|
+
}
|
|
457
|
+
|
|
62
458
|
/**
|
|
63
459
|
* @param {string} entry_path
|
|
64
460
|
* @param {string} sources_json
|
|
65
461
|
* @param {number} sample_rate
|
|
66
462
|
* @param {number} block_size
|
|
67
|
-
* @returns {
|
|
463
|
+
* @returns {FrontendJsonCompilation}
|
|
68
464
|
*/
|
|
69
|
-
export function
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
const ret = wasm.compile_project_to_mir_json(ptr0, len0, ptr1, len1, sample_rate, block_size);
|
|
78
|
-
var ptr3 = ret[0];
|
|
79
|
-
var len3 = ret[1];
|
|
80
|
-
if (ret[3]) {
|
|
81
|
-
ptr3 = 0; len3 = 0;
|
|
82
|
-
throw takeFromExternrefTable0(ret[2]);
|
|
83
|
-
}
|
|
84
|
-
deferred4_0 = ptr3;
|
|
85
|
-
deferred4_1 = len3;
|
|
86
|
-
return getStringFromWasm0(ptr3, len3);
|
|
87
|
-
} finally {
|
|
88
|
-
wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
|
|
465
|
+
export function compile_source_workspace_to_mir_json(entry_path, sources_json, sample_rate, block_size) {
|
|
466
|
+
const ptr0 = passStringToWasm0(entry_path, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
467
|
+
const len0 = WASM_VECTOR_LEN;
|
|
468
|
+
const ptr1 = passStringToWasm0(sources_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
469
|
+
const len1 = WASM_VECTOR_LEN;
|
|
470
|
+
const ret = wasm.compile_source_workspace_to_mir_json(ptr0, len0, ptr1, len1, sample_rate, block_size);
|
|
471
|
+
if (ret[2]) {
|
|
472
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
89
473
|
}
|
|
474
|
+
return FrontendJsonCompilation.__wrap(ret[0]);
|
|
90
475
|
}
|
|
91
476
|
|
|
92
477
|
/**
|
|
@@ -94,14 +479,113 @@ export function compile_project_to_mir_json(entry_path, sources_json, sample_rat
|
|
|
94
479
|
* @param {string} sources_json
|
|
95
480
|
* @param {number} sample_rate
|
|
96
481
|
* @param {number} block_size
|
|
97
|
-
* @returns {
|
|
482
|
+
* @returns {FrontendMessagePackCompilation}
|
|
98
483
|
*/
|
|
99
|
-
export function
|
|
484
|
+
export function compile_source_workspace_to_mir_messagepack(entry_path, sources_json, sample_rate, block_size) {
|
|
100
485
|
const ptr0 = passStringToWasm0(entry_path, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
101
486
|
const len0 = WASM_VECTOR_LEN;
|
|
102
487
|
const ptr1 = passStringToWasm0(sources_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
103
488
|
const len1 = WASM_VECTOR_LEN;
|
|
104
|
-
const ret = wasm.
|
|
489
|
+
const ret = wasm.compile_source_workspace_to_mir_messagepack(ptr0, len0, ptr1, len1, sample_rate, block_size);
|
|
490
|
+
if (ret[2]) {
|
|
491
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
492
|
+
}
|
|
493
|
+
return FrontendMessagePackCompilation.__wrap(ret[0]);
|
|
494
|
+
}
|
|
495
|
+
|
|
496
|
+
/**
|
|
497
|
+
* @param {string} source
|
|
498
|
+
* @param {number} sample_rate
|
|
499
|
+
* @param {number} block_size
|
|
500
|
+
* @returns {FrontendJsonCompilation}
|
|
501
|
+
*/
|
|
502
|
+
export function compile_to_mir_json(source, sample_rate, block_size) {
|
|
503
|
+
const ptr0 = passStringToWasm0(source, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
504
|
+
const len0 = WASM_VECTOR_LEN;
|
|
505
|
+
const ret = wasm.compile_to_mir_json(ptr0, len0, sample_rate, block_size);
|
|
506
|
+
if (ret[2]) {
|
|
507
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
508
|
+
}
|
|
509
|
+
return FrontendJsonCompilation.__wrap(ret[0]);
|
|
510
|
+
}
|
|
511
|
+
|
|
512
|
+
/**
|
|
513
|
+
* @param {string} source
|
|
514
|
+
* @param {number} sample_rate
|
|
515
|
+
* @param {number} block_size
|
|
516
|
+
* @returns {FrontendMessagePackCompilation}
|
|
517
|
+
*/
|
|
518
|
+
export function compile_to_mir_messagepack(source, sample_rate, block_size) {
|
|
519
|
+
const ptr0 = passStringToWasm0(source, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
520
|
+
const len0 = WASM_VECTOR_LEN;
|
|
521
|
+
const ret = wasm.compile_to_mir_messagepack(ptr0, len0, sample_rate, block_size);
|
|
522
|
+
if (ret[2]) {
|
|
523
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
524
|
+
}
|
|
525
|
+
return FrontendMessagePackCompilation.__wrap(ret[0]);
|
|
526
|
+
}
|
|
527
|
+
|
|
528
|
+
/**
|
|
529
|
+
* @returns {string}
|
|
530
|
+
*/
|
|
531
|
+
export function current_stdlib_digest() {
|
|
532
|
+
let deferred1_0;
|
|
533
|
+
let deferred1_1;
|
|
534
|
+
try {
|
|
535
|
+
const ret = wasm.current_stdlib_digest();
|
|
536
|
+
deferred1_0 = ret[0];
|
|
537
|
+
deferred1_1 = ret[1];
|
|
538
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
539
|
+
} finally {
|
|
540
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
541
|
+
}
|
|
542
|
+
}
|
|
543
|
+
|
|
544
|
+
/**
|
|
545
|
+
* @param {Uint8Array} ondabuffer_bytes
|
|
546
|
+
* @returns {WebDecodedBufferAsset}
|
|
547
|
+
*/
|
|
548
|
+
export function decode_buffer_asset(ondabuffer_bytes) {
|
|
549
|
+
const ptr0 = passArray8ToWasm0(ondabuffer_bytes, wasm.__wbindgen_malloc);
|
|
550
|
+
const len0 = WASM_VECTOR_LEN;
|
|
551
|
+
const ret = wasm.decode_buffer_asset(ptr0, len0);
|
|
552
|
+
if (ret[2]) {
|
|
553
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
554
|
+
}
|
|
555
|
+
return WebDecodedBufferAsset.__wrap(ret[0]);
|
|
556
|
+
}
|
|
557
|
+
|
|
558
|
+
/**
|
|
559
|
+
* @param {Uint8Array} bytes
|
|
560
|
+
* @param {string} path
|
|
561
|
+
* @returns {WebDecodedBufferAsset}
|
|
562
|
+
*/
|
|
563
|
+
export function decode_buffer_file(bytes, path) {
|
|
564
|
+
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
565
|
+
const len0 = WASM_VECTOR_LEN;
|
|
566
|
+
const ptr1 = passStringToWasm0(path, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
567
|
+
const len1 = WASM_VECTOR_LEN;
|
|
568
|
+
const ret = wasm.decode_buffer_file(ptr0, len0, ptr1, len1);
|
|
569
|
+
if (ret[2]) {
|
|
570
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
571
|
+
}
|
|
572
|
+
return WebDecodedBufferAsset.__wrap(ret[0]);
|
|
573
|
+
}
|
|
574
|
+
|
|
575
|
+
/**
|
|
576
|
+
* @param {string} element
|
|
577
|
+
* @param {number} frames
|
|
578
|
+
* @param {number} channels
|
|
579
|
+
* @param {number} sample_rate
|
|
580
|
+
* @param {Uint8Array} canonical_payload
|
|
581
|
+
* @returns {Uint8Array}
|
|
582
|
+
*/
|
|
583
|
+
export function encode_buffer_asset(element, frames, channels, sample_rate, canonical_payload) {
|
|
584
|
+
const ptr0 = passStringToWasm0(element, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
585
|
+
const len0 = WASM_VECTOR_LEN;
|
|
586
|
+
const ptr1 = passArray8ToWasm0(canonical_payload, wasm.__wbindgen_malloc);
|
|
587
|
+
const len1 = WASM_VECTOR_LEN;
|
|
588
|
+
const ret = wasm.encode_buffer_asset(ptr0, len0, frames, channels, sample_rate, ptr1, len1);
|
|
105
589
|
if (ret[3]) {
|
|
106
590
|
throw takeFromExternrefTable0(ret[2]);
|
|
107
591
|
}
|
|
@@ -111,18 +595,16 @@ export function compile_project_to_mir_messagepack(entry_path, sources_json, sam
|
|
|
111
595
|
}
|
|
112
596
|
|
|
113
597
|
/**
|
|
114
|
-
* @param {
|
|
115
|
-
* @param {number} sample_rate
|
|
116
|
-
* @param {number} block_size
|
|
598
|
+
* @param {Uint8Array} image_bytes
|
|
117
599
|
* @returns {string}
|
|
118
600
|
*/
|
|
119
|
-
export function
|
|
601
|
+
export function inspect_project_image(image_bytes) {
|
|
120
602
|
let deferred3_0;
|
|
121
603
|
let deferred3_1;
|
|
122
604
|
try {
|
|
123
|
-
const ptr0 =
|
|
605
|
+
const ptr0 = passArray8ToWasm0(image_bytes, wasm.__wbindgen_malloc);
|
|
124
606
|
const len0 = WASM_VECTOR_LEN;
|
|
125
|
-
const ret = wasm.
|
|
607
|
+
const ret = wasm.inspect_project_image(ptr0, len0);
|
|
126
608
|
var ptr2 = ret[0];
|
|
127
609
|
var len2 = ret[1];
|
|
128
610
|
if (ret[3]) {
|
|
@@ -138,21 +620,20 @@ export function compile_to_mir_json(source, sample_rate, block_size) {
|
|
|
138
620
|
}
|
|
139
621
|
|
|
140
622
|
/**
|
|
141
|
-
* @param {
|
|
142
|
-
* @param {
|
|
143
|
-
* @
|
|
144
|
-
* @returns {Uint8Array}
|
|
623
|
+
* @param {Uint8Array} image_bytes
|
|
624
|
+
* @param {string} asset_file_names_json
|
|
625
|
+
* @returns {WebProjectMaterializationPlan}
|
|
145
626
|
*/
|
|
146
|
-
export function
|
|
147
|
-
const ptr0 =
|
|
627
|
+
export function materialize_project_image(image_bytes, asset_file_names_json) {
|
|
628
|
+
const ptr0 = passArray8ToWasm0(image_bytes, wasm.__wbindgen_malloc);
|
|
148
629
|
const len0 = WASM_VECTOR_LEN;
|
|
149
|
-
const
|
|
150
|
-
|
|
151
|
-
|
|
630
|
+
const ptr1 = passStringToWasm0(asset_file_names_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
631
|
+
const len1 = WASM_VECTOR_LEN;
|
|
632
|
+
const ret = wasm.materialize_project_image(ptr0, len0, ptr1, len1);
|
|
633
|
+
if (ret[2]) {
|
|
634
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
152
635
|
}
|
|
153
|
-
|
|
154
|
-
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
155
|
-
return v2;
|
|
636
|
+
return WebProjectMaterializationPlan.__wrap(ret[0]);
|
|
156
637
|
}
|
|
157
638
|
|
|
158
639
|
/**
|
|
@@ -163,6 +644,14 @@ export function mir_schema_version() {
|
|
|
163
644
|
return ret >>> 0;
|
|
164
645
|
}
|
|
165
646
|
|
|
647
|
+
/**
|
|
648
|
+
* @returns {number}
|
|
649
|
+
*/
|
|
650
|
+
export function project_image_format_version() {
|
|
651
|
+
const ret = wasm.project_image_format_version();
|
|
652
|
+
return ret >>> 0;
|
|
653
|
+
}
|
|
654
|
+
|
|
166
655
|
function __wbg_get_imports() {
|
|
167
656
|
const import0 = {
|
|
168
657
|
__proto__: null,
|
|
@@ -190,9 +679,27 @@ function __wbg_get_imports() {
|
|
|
190
679
|
};
|
|
191
680
|
}
|
|
192
681
|
|
|
682
|
+
const FrontendJsonCompilationFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
683
|
+
? { register: () => {}, unregister: () => {} }
|
|
684
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_frontendjsoncompilation_free(ptr >>> 0, 1));
|
|
685
|
+
const FrontendMessagePackCompilationFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
686
|
+
? { register: () => {}, unregister: () => {} }
|
|
687
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_frontendmessagepackcompilation_free(ptr >>> 0, 1));
|
|
193
688
|
const OndaLspFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
194
689
|
? { register: () => {}, unregister: () => {} }
|
|
195
690
|
: new FinalizationRegistry(ptr => wasm.__wbg_ondalsp_free(ptr >>> 0, 1));
|
|
691
|
+
const WebDecodedBufferAssetFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
692
|
+
? { register: () => {}, unregister: () => {} }
|
|
693
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_webdecodedbufferasset_free(ptr >>> 0, 1));
|
|
694
|
+
const WebMaterializedProjectBuilderFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
695
|
+
? { register: () => {}, unregister: () => {} }
|
|
696
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_webmaterializedprojectbuilder_free(ptr >>> 0, 1));
|
|
697
|
+
const WebProjectImageBuilderFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
698
|
+
? { register: () => {}, unregister: () => {} }
|
|
699
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_webprojectimagebuilder_free(ptr >>> 0, 1));
|
|
700
|
+
const WebProjectMaterializationPlanFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
701
|
+
? { register: () => {}, unregister: () => {} }
|
|
702
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_webprojectmaterializationplan_free(ptr >>> 0, 1));
|
|
196
703
|
|
|
197
704
|
function getArrayU8FromWasm0(ptr, len) {
|
|
198
705
|
ptr = ptr >>> 0;
|
|
@@ -212,6 +719,13 @@ function getUint8ArrayMemory0() {
|
|
|
212
719
|
return cachedUint8ArrayMemory0;
|
|
213
720
|
}
|
|
214
721
|
|
|
722
|
+
function passArray8ToWasm0(arg, malloc) {
|
|
723
|
+
const ptr = malloc(arg.length * 1, 1) >>> 0;
|
|
724
|
+
getUint8ArrayMemory0().set(arg, ptr / 1);
|
|
725
|
+
WASM_VECTOR_LEN = arg.length;
|
|
726
|
+
return ptr;
|
|
727
|
+
}
|
|
728
|
+
|
|
215
729
|
function passStringToWasm0(arg, malloc, realloc) {
|
|
216
730
|
if (realloc === undefined) {
|
|
217
731
|
const buf = cachedTextEncoder.encode(arg);
|
|
Binary file
|