@onda-lang/wasm-compiler 0.6.0 → 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 +52 -3
- package/bin/onda-wasm.js +1 -1
- package/dist/backend/constants.js +1 -1
- package/dist/backend/index.js +2427 -342
- package/dist/build.json +3 -3
- package/dist/frontend/README.md +12 -3
- package/dist/frontend/onda_compiler_web.d.ts +94 -5
- package/dist/frontend/onda_compiler_web.js +442 -4
- package/dist/frontend/onda_compiler_web_bg.wasm +0 -0
- package/dist/frontend/onda_compiler_web_bg.wasm.d.ts +34 -3
- package/dist/frontend/package.json +1 -1
- package/dist/version.js +1 -1
- package/package.json +2 -2
- package/src/index.d.ts +106 -3
- package/src/index.js +400 -19
- package/src/worker.js +58 -3
|
@@ -33,6 +33,21 @@ export class FrontendJsonCompilation {
|
|
|
33
33
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
34
34
|
}
|
|
35
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
|
+
}
|
|
36
51
|
/**
|
|
37
52
|
* @returns {string}
|
|
38
53
|
*/
|
|
@@ -84,6 +99,21 @@ export class FrontendMessagePackCompilation {
|
|
|
84
99
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
85
100
|
}
|
|
86
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
|
+
}
|
|
87
117
|
/**
|
|
88
118
|
* @returns {Uint8Array}
|
|
89
119
|
*/
|
|
@@ -155,6 +185,276 @@ export class OndaLsp {
|
|
|
155
185
|
}
|
|
156
186
|
if (Symbol.dispose) OndaLsp.prototype[Symbol.dispose] = OndaLsp.prototype.free;
|
|
157
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
|
+
|
|
158
458
|
/**
|
|
159
459
|
* @param {string} entry_path
|
|
160
460
|
* @param {string} sources_json
|
|
@@ -162,12 +462,12 @@ if (Symbol.dispose) OndaLsp.prototype[Symbol.dispose] = OndaLsp.prototype.free;
|
|
|
162
462
|
* @param {number} block_size
|
|
163
463
|
* @returns {FrontendJsonCompilation}
|
|
164
464
|
*/
|
|
165
|
-
export function
|
|
465
|
+
export function compile_source_workspace_to_mir_json(entry_path, sources_json, sample_rate, block_size) {
|
|
166
466
|
const ptr0 = passStringToWasm0(entry_path, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
167
467
|
const len0 = WASM_VECTOR_LEN;
|
|
168
468
|
const ptr1 = passStringToWasm0(sources_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
169
469
|
const len1 = WASM_VECTOR_LEN;
|
|
170
|
-
const ret = wasm.
|
|
470
|
+
const ret = wasm.compile_source_workspace_to_mir_json(ptr0, len0, ptr1, len1, sample_rate, block_size);
|
|
171
471
|
if (ret[2]) {
|
|
172
472
|
throw takeFromExternrefTable0(ret[1]);
|
|
173
473
|
}
|
|
@@ -181,12 +481,12 @@ export function compile_project_to_mir_json(entry_path, sources_json, sample_rat
|
|
|
181
481
|
* @param {number} block_size
|
|
182
482
|
* @returns {FrontendMessagePackCompilation}
|
|
183
483
|
*/
|
|
184
|
-
export function
|
|
484
|
+
export function compile_source_workspace_to_mir_messagepack(entry_path, sources_json, sample_rate, block_size) {
|
|
185
485
|
const ptr0 = passStringToWasm0(entry_path, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
186
486
|
const len0 = WASM_VECTOR_LEN;
|
|
187
487
|
const ptr1 = passStringToWasm0(sources_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
188
488
|
const len1 = WASM_VECTOR_LEN;
|
|
189
|
-
const ret = wasm.
|
|
489
|
+
const ret = wasm.compile_source_workspace_to_mir_messagepack(ptr0, len0, ptr1, len1, sample_rate, block_size);
|
|
190
490
|
if (ret[2]) {
|
|
191
491
|
throw takeFromExternrefTable0(ret[1]);
|
|
192
492
|
}
|
|
@@ -225,6 +525,117 @@ export function compile_to_mir_messagepack(source, sample_rate, block_size) {
|
|
|
225
525
|
return FrontendMessagePackCompilation.__wrap(ret[0]);
|
|
226
526
|
}
|
|
227
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);
|
|
589
|
+
if (ret[3]) {
|
|
590
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
591
|
+
}
|
|
592
|
+
var v3 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
593
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
594
|
+
return v3;
|
|
595
|
+
}
|
|
596
|
+
|
|
597
|
+
/**
|
|
598
|
+
* @param {Uint8Array} image_bytes
|
|
599
|
+
* @returns {string}
|
|
600
|
+
*/
|
|
601
|
+
export function inspect_project_image(image_bytes) {
|
|
602
|
+
let deferred3_0;
|
|
603
|
+
let deferred3_1;
|
|
604
|
+
try {
|
|
605
|
+
const ptr0 = passArray8ToWasm0(image_bytes, wasm.__wbindgen_malloc);
|
|
606
|
+
const len0 = WASM_VECTOR_LEN;
|
|
607
|
+
const ret = wasm.inspect_project_image(ptr0, len0);
|
|
608
|
+
var ptr2 = ret[0];
|
|
609
|
+
var len2 = ret[1];
|
|
610
|
+
if (ret[3]) {
|
|
611
|
+
ptr2 = 0; len2 = 0;
|
|
612
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
613
|
+
}
|
|
614
|
+
deferred3_0 = ptr2;
|
|
615
|
+
deferred3_1 = len2;
|
|
616
|
+
return getStringFromWasm0(ptr2, len2);
|
|
617
|
+
} finally {
|
|
618
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
619
|
+
}
|
|
620
|
+
}
|
|
621
|
+
|
|
622
|
+
/**
|
|
623
|
+
* @param {Uint8Array} image_bytes
|
|
624
|
+
* @param {string} asset_file_names_json
|
|
625
|
+
* @returns {WebProjectMaterializationPlan}
|
|
626
|
+
*/
|
|
627
|
+
export function materialize_project_image(image_bytes, asset_file_names_json) {
|
|
628
|
+
const ptr0 = passArray8ToWasm0(image_bytes, wasm.__wbindgen_malloc);
|
|
629
|
+
const len0 = WASM_VECTOR_LEN;
|
|
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]);
|
|
635
|
+
}
|
|
636
|
+
return WebProjectMaterializationPlan.__wrap(ret[0]);
|
|
637
|
+
}
|
|
638
|
+
|
|
228
639
|
/**
|
|
229
640
|
* @returns {number}
|
|
230
641
|
*/
|
|
@@ -233,6 +644,14 @@ export function mir_schema_version() {
|
|
|
233
644
|
return ret >>> 0;
|
|
234
645
|
}
|
|
235
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
|
+
|
|
236
655
|
function __wbg_get_imports() {
|
|
237
656
|
const import0 = {
|
|
238
657
|
__proto__: null,
|
|
@@ -269,6 +688,18 @@ const FrontendMessagePackCompilationFinalization = (typeof FinalizationRegistry
|
|
|
269
688
|
const OndaLspFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
270
689
|
? { register: () => {}, unregister: () => {} }
|
|
271
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));
|
|
272
703
|
|
|
273
704
|
function getArrayU8FromWasm0(ptr, len) {
|
|
274
705
|
ptr = ptr >>> 0;
|
|
@@ -288,6 +719,13 @@ function getUint8ArrayMemory0() {
|
|
|
288
719
|
return cachedUint8ArrayMemory0;
|
|
289
720
|
}
|
|
290
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
|
+
|
|
291
729
|
function passStringToWasm0(arg, malloc, realloc) {
|
|
292
730
|
if (realloc === undefined) {
|
|
293
731
|
const buf = cachedTextEncoder.encode(arg);
|
|
Binary file
|
|
@@ -4,21 +4,52 @@ export const memory: WebAssembly.Memory;
|
|
|
4
4
|
export const __wbg_frontendjsoncompilation_free: (a: number, b: number) => void;
|
|
5
5
|
export const __wbg_frontendmessagepackcompilation_free: (a: number, b: number) => void;
|
|
6
6
|
export const __wbg_ondalsp_free: (a: number, b: number) => void;
|
|
7
|
-
export const
|
|
8
|
-
export const
|
|
7
|
+
export const __wbg_webdecodedbufferasset_free: (a: number, b: number) => void;
|
|
8
|
+
export const __wbg_webmaterializedprojectbuilder_free: (a: number, b: number) => void;
|
|
9
|
+
export const __wbg_webprojectimagebuilder_free: (a: number, b: number) => void;
|
|
10
|
+
export const __wbg_webprojectmaterializationplan_free: (a: number, b: number) => void;
|
|
11
|
+
export const buffer_asset_format_version: () => number;
|
|
12
|
+
export const compile_project_image_to_mir_messagepack: (a: number, b: number, c: number, d: number) => [number, number, number];
|
|
13
|
+
export const compile_source_workspace_to_mir_json: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number, number];
|
|
14
|
+
export const compile_source_workspace_to_mir_messagepack: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number, number];
|
|
9
15
|
export const compile_to_mir_json: (a: number, b: number, c: number, d: number) => [number, number, number];
|
|
10
16
|
export const compile_to_mir_messagepack: (a: number, b: number, c: number, d: number) => [number, number, number];
|
|
17
|
+
export const current_stdlib_digest: () => [number, number];
|
|
18
|
+
export const decode_buffer_asset: (a: number, b: number) => [number, number, number];
|
|
19
|
+
export const decode_buffer_file: (a: number, b: number, c: number, d: number) => [number, number, number];
|
|
20
|
+
export const encode_buffer_asset: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => [number, number, number, number];
|
|
11
21
|
export const frontendjsoncompilation_source_files_json: (a: number) => [number, number];
|
|
22
|
+
export const frontendjsoncompilation_source_image_json: (a: number) => [number, number];
|
|
12
23
|
export const frontendjsoncompilation_take_mir: (a: number) => [number, number];
|
|
13
24
|
export const frontendmessagepackcompilation_source_files_json: (a: number) => [number, number];
|
|
25
|
+
export const frontendmessagepackcompilation_source_image_json: (a: number) => [number, number];
|
|
26
|
+
export const inspect_project_image: (a: number, b: number) => [number, number, number, number];
|
|
27
|
+
export const materialize_project_image: (a: number, b: number, c: number, d: number) => [number, number, number];
|
|
14
28
|
export const mir_schema_version: () => number;
|
|
15
29
|
export const ondalsp_handle_message: (a: number, b: number, c: number) => [number, number, number, number];
|
|
16
30
|
export const ondalsp_new: () => number;
|
|
17
31
|
export const ondalsp_set_analysis_options: (a: number, b: number, c: number) => [number, number];
|
|
32
|
+
export const webdecodedbufferasset_canonical_payload: (a: number) => [number, number];
|
|
33
|
+
export const webdecodedbufferasset_channels: (a: number) => number;
|
|
34
|
+
export const webdecodedbufferasset_element: (a: number) => [number, number];
|
|
35
|
+
export const webdecodedbufferasset_frames: (a: number) => number;
|
|
36
|
+
export const webdecodedbufferasset_sample_rate: (a: number) => number;
|
|
37
|
+
export const webmaterializedprojectbuilder_add_file: (a: number, b: number, c: number, d: number, e: number) => [number, number];
|
|
38
|
+
export const webmaterializedprojectbuilder_new: () => number;
|
|
39
|
+
export const webmaterializedprojectbuilder_select_project: (a: number, b: number, c: number) => [number, number];
|
|
40
|
+
export const webmaterializedprojectbuilder_serialize: (a: number) => [number, number, number, number];
|
|
41
|
+
export const webprojectimagebuilder_add_buffer: (a: number, b: number, c: number, d: number, e: number) => [number, number];
|
|
42
|
+
export const webprojectimagebuilder_new: (a: number, b: number) => [number, number, number];
|
|
43
|
+
export const webprojectimagebuilder_serialize: (a: number) => [number, number, number, number];
|
|
44
|
+
export const webprojectmaterializationplan_directories_json: (a: number) => [number, number];
|
|
45
|
+
export const webprojectmaterializationplan_file_bytes: (a: number, b: number) => [number, number];
|
|
46
|
+
export const webprojectmaterializationplan_file_count: (a: number) => number;
|
|
47
|
+
export const webprojectmaterializationplan_file_path: (a: number, b: number) => [number, number];
|
|
48
|
+
export const project_image_format_version: () => number;
|
|
18
49
|
export const frontendmessagepackcompilation_take_mir: (a: number) => [number, number];
|
|
19
50
|
export const __wbindgen_externrefs: WebAssembly.Table;
|
|
20
51
|
export const __wbindgen_malloc: (a: number, b: number) => number;
|
|
21
|
-
export const __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|
|
22
52
|
export const __externref_table_dealloc: (a: number) => void;
|
|
53
|
+
export const __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|
|
23
54
|
export const __wbindgen_free: (a: number, b: number, c: number) => void;
|
|
24
55
|
export const __wbindgen_start: () => void;
|
package/dist/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const ONDA_VERSION = "0.
|
|
1
|
+
export const ONDA_VERSION = "0.7.0";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@onda-lang/wasm-compiler",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Onda source-to-WebAssembly compiler for browsers and Node.js",
|
|
6
6
|
"license": "MIT",
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"prepack": "npm run build"
|
|
60
60
|
},
|
|
61
61
|
"dependencies": {
|
|
62
|
-
"@onda-lang/processor-abi": "0.
|
|
62
|
+
"@onda-lang/processor-abi": "0.7.0",
|
|
63
63
|
"binaryen": "130.0.0"
|
|
64
64
|
},
|
|
65
65
|
"publishConfig": {
|