@scalable-vector-audio/sva-wasm 0.1.1 → 0.3.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/package.json +1 -1
- package/sva_wasm.d.ts +31 -2
- package/sva_wasm.js +331 -4
- package/sva_wasm_bg.wasm +0 -0
package/package.json
CHANGED
package/sva_wasm.d.ts
CHANGED
|
@@ -5,15 +5,32 @@ export class Composition {
|
|
|
5
5
|
free(): void;
|
|
6
6
|
[Symbol.dispose](): void;
|
|
7
7
|
bound_cache(max_bytes: number): void;
|
|
8
|
+
/**
|
|
9
|
+
* Empties the memory tier only: a persistent pack outlives it by design.
|
|
10
|
+
*/
|
|
8
11
|
clear_cache(): void;
|
|
9
12
|
insert(path: string, text: string): void;
|
|
10
13
|
constructor(name?: string | null);
|
|
14
|
+
/**
|
|
15
|
+
* `name` labels the composition as `new` does; renders persist under `cache` in a dedicated
|
|
16
|
+
* worker's private file system, and anywhere none opens, or `cache` is held, memory-only.
|
|
17
|
+
*/
|
|
18
|
+
static persistent(name: string | null | undefined, cache: string, max_bytes?: number | null): Promise<Composition>;
|
|
11
19
|
/**
|
|
12
20
|
* Unset, `target` is `master`; `seconds` is the horizon and `rate` the observation rate.
|
|
13
21
|
*/
|
|
14
22
|
render(target?: string | null, rate?: number | null, seconds?: number | null): Rendering;
|
|
23
|
+
/**
|
|
24
|
+
* The memory tier's, as `cache_max_bytes` is; `persistent_bytes` is the pack's.
|
|
25
|
+
*/
|
|
15
26
|
readonly cache_bytes: number;
|
|
16
27
|
readonly cache_max_bytes: number;
|
|
28
|
+
readonly persistent: boolean;
|
|
29
|
+
/**
|
|
30
|
+
* Zero on a memory-only composition, as `persistent_max_bytes` is.
|
|
31
|
+
*/
|
|
32
|
+
readonly persistent_bytes: number;
|
|
33
|
+
readonly persistent_max_bytes: number;
|
|
17
34
|
}
|
|
18
35
|
|
|
19
36
|
export class Rendering {
|
|
@@ -25,6 +42,10 @@ export class Rendering {
|
|
|
25
42
|
*/
|
|
26
43
|
query(representation: string, from_secs?: number | null, to_secs?: number | null): any;
|
|
27
44
|
samples(channel: number, from_secs?: number | null, to_secs?: number | null): Float32Array;
|
|
45
|
+
/**
|
|
46
|
+
* The object `sva-cli render` puts under `data.cache.stats`.
|
|
47
|
+
*/
|
|
48
|
+
stats(): any;
|
|
28
49
|
readonly channels: number;
|
|
29
50
|
readonly duration_secs: number;
|
|
30
51
|
readonly sample_rate: number;
|
|
@@ -42,19 +63,27 @@ export interface InitOutput {
|
|
|
42
63
|
readonly composition_cache_max_bytes: (a: number) => number;
|
|
43
64
|
readonly composition_clear_cache: (a: number) => void;
|
|
44
65
|
readonly composition_insert: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
66
|
+
readonly composition_is_persistent: (a: number) => number;
|
|
45
67
|
readonly composition_new: (a: number, b: number) => number;
|
|
68
|
+
readonly composition_persistent: (a: number, b: number, c: number, d: number, e: number, f: number) => any;
|
|
69
|
+
readonly composition_persistent_bytes: (a: number) => number;
|
|
70
|
+
readonly composition_persistent_max_bytes: (a: number) => number;
|
|
46
71
|
readonly composition_render: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number, number];
|
|
47
72
|
readonly rendering_channels: (a: number) => number;
|
|
48
73
|
readonly rendering_duration_secs: (a: number) => number;
|
|
49
74
|
readonly rendering_query: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => [number, number, number];
|
|
50
75
|
readonly rendering_sample_rate: (a: number) => number;
|
|
51
76
|
readonly rendering_samples: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number, number, number];
|
|
77
|
+
readonly rendering_stats: (a: number) => [number, number, number];
|
|
52
78
|
readonly rendering_target: (a: number) => [number, number];
|
|
79
|
+
readonly wasm_bindgen__convert__closures_____invoke__h76bd71bceeca2b95: (a: number, b: number, c: any, d: any) => void;
|
|
80
|
+
readonly wasm_bindgen__convert__closures_____invoke__hd55bb211d6a08150: (a: number, b: number, c: any) => [number, number];
|
|
81
|
+
readonly __wbindgen_malloc: (a: number, b: number) => number;
|
|
82
|
+
readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|
|
53
83
|
readonly __wbindgen_exn_store: (a: number) => void;
|
|
54
84
|
readonly __externref_table_alloc: () => number;
|
|
55
85
|
readonly __wbindgen_externrefs: WebAssembly.Table;
|
|
56
|
-
readonly
|
|
57
|
-
readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|
|
86
|
+
readonly __wbindgen_destroy_closure: (a: number, b: number) => void;
|
|
58
87
|
readonly __externref_table_dealloc: (a: number) => void;
|
|
59
88
|
readonly __wbindgen_free: (a: number, b: number, c: number) => void;
|
|
60
89
|
readonly __wbindgen_start: () => void;
|
package/sva_wasm.js
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
/* @ts-self-types="./sva_wasm.d.ts" */
|
|
2
2
|
|
|
3
3
|
export class Composition {
|
|
4
|
+
static __wrap(ptr) {
|
|
5
|
+
const obj = Object.create(Composition.prototype);
|
|
6
|
+
obj.__wbg_ptr = ptr;
|
|
7
|
+
CompositionFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
8
|
+
return obj;
|
|
9
|
+
}
|
|
4
10
|
__destroy_into_raw() {
|
|
5
11
|
const ptr = this.__wbg_ptr;
|
|
6
12
|
this.__wbg_ptr = 0;
|
|
@@ -18,6 +24,7 @@ export class Composition {
|
|
|
18
24
|
wasm.composition_bound_cache(this.__wbg_ptr, max_bytes);
|
|
19
25
|
}
|
|
20
26
|
/**
|
|
27
|
+
* The memory tier's, as `cache_max_bytes` is; `persistent_bytes` is the pack's.
|
|
21
28
|
* @returns {number}
|
|
22
29
|
*/
|
|
23
30
|
get cache_bytes() {
|
|
@@ -31,6 +38,9 @@ export class Composition {
|
|
|
31
38
|
const ret = wasm.composition_cache_max_bytes(this.__wbg_ptr);
|
|
32
39
|
return ret;
|
|
33
40
|
}
|
|
41
|
+
/**
|
|
42
|
+
* Empties the memory tier only: a persistent pack outlives it by design.
|
|
43
|
+
*/
|
|
34
44
|
clear_cache() {
|
|
35
45
|
wasm.composition_clear_cache(this.__wbg_ptr);
|
|
36
46
|
}
|
|
@@ -45,6 +55,13 @@ export class Composition {
|
|
|
45
55
|
const len1 = WASM_VECTOR_LEN;
|
|
46
56
|
wasm.composition_insert(this.__wbg_ptr, ptr0, len0, ptr1, len1);
|
|
47
57
|
}
|
|
58
|
+
/**
|
|
59
|
+
* @returns {boolean}
|
|
60
|
+
*/
|
|
61
|
+
get persistent() {
|
|
62
|
+
const ret = wasm.composition_is_persistent(this.__wbg_ptr);
|
|
63
|
+
return ret !== 0;
|
|
64
|
+
}
|
|
48
65
|
/**
|
|
49
66
|
* @param {string | null} [name]
|
|
50
67
|
*/
|
|
@@ -56,6 +73,37 @@ export class Composition {
|
|
|
56
73
|
CompositionFinalization.register(this, this.__wbg_ptr, this);
|
|
57
74
|
return this;
|
|
58
75
|
}
|
|
76
|
+
/**
|
|
77
|
+
* `name` labels the composition as `new` does; renders persist under `cache` in a dedicated
|
|
78
|
+
* worker's private file system, and anywhere none opens, or `cache` is held, memory-only.
|
|
79
|
+
* @param {string | null | undefined} name
|
|
80
|
+
* @param {string} cache
|
|
81
|
+
* @param {number | null} [max_bytes]
|
|
82
|
+
* @returns {Promise<Composition>}
|
|
83
|
+
*/
|
|
84
|
+
static persistent(name, cache, max_bytes) {
|
|
85
|
+
var ptr0 = isLikeNone(name) ? 0 : passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
86
|
+
var len0 = WASM_VECTOR_LEN;
|
|
87
|
+
const ptr1 = passStringToWasm0(cache, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
88
|
+
const len1 = WASM_VECTOR_LEN;
|
|
89
|
+
const ret = wasm.composition_persistent(ptr0, len0, ptr1, len1, !isLikeNone(max_bytes), isLikeNone(max_bytes) ? 0 : max_bytes);
|
|
90
|
+
return ret;
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Zero on a memory-only composition, as `persistent_max_bytes` is.
|
|
94
|
+
* @returns {number}
|
|
95
|
+
*/
|
|
96
|
+
get persistent_bytes() {
|
|
97
|
+
const ret = wasm.composition_persistent_bytes(this.__wbg_ptr);
|
|
98
|
+
return ret;
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* @returns {number}
|
|
102
|
+
*/
|
|
103
|
+
get persistent_max_bytes() {
|
|
104
|
+
const ret = wasm.composition_persistent_max_bytes(this.__wbg_ptr);
|
|
105
|
+
return ret;
|
|
106
|
+
}
|
|
59
107
|
/**
|
|
60
108
|
* Unset, `target` is `master`; `seconds` is the horizon and `rate` the observation rate.
|
|
61
109
|
* @param {string | null} [target]
|
|
@@ -144,6 +192,17 @@ export class Rendering {
|
|
|
144
192
|
wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
|
|
145
193
|
return v1;
|
|
146
194
|
}
|
|
195
|
+
/**
|
|
196
|
+
* The object `sva-cli render` puts under `data.cache.stats`.
|
|
197
|
+
* @returns {any}
|
|
198
|
+
*/
|
|
199
|
+
stats() {
|
|
200
|
+
const ret = wasm.rendering_stats(this.__wbg_ptr);
|
|
201
|
+
if (ret[2]) {
|
|
202
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
203
|
+
}
|
|
204
|
+
return takeFromExternrefTable0(ret[0]);
|
|
205
|
+
}
|
|
147
206
|
/**
|
|
148
207
|
* @returns {string}
|
|
149
208
|
*/
|
|
@@ -164,24 +223,235 @@ if (Symbol.dispose) Rendering.prototype[Symbol.dispose] = Rendering.prototype.fr
|
|
|
164
223
|
function __wbg_get_imports() {
|
|
165
224
|
const import0 = {
|
|
166
225
|
__proto__: null,
|
|
226
|
+
__wbg___wbindgen_is_falsy_4502df4d571fca70: function(arg0) {
|
|
227
|
+
const ret = !arg0;
|
|
228
|
+
return ret;
|
|
229
|
+
},
|
|
230
|
+
__wbg___wbindgen_is_function_fcda5e3902d732fe: function(arg0) {
|
|
231
|
+
const ret = typeof(arg0) === 'function';
|
|
232
|
+
return ret;
|
|
233
|
+
},
|
|
234
|
+
__wbg___wbindgen_is_undefined_8c687d0b90d5b524: function(arg0) {
|
|
235
|
+
const ret = arg0 === undefined;
|
|
236
|
+
return ret;
|
|
237
|
+
},
|
|
238
|
+
__wbg___wbindgen_string_get_92ab86bb19cbc12f: function(arg0, arg1) {
|
|
239
|
+
const obj = arg1;
|
|
240
|
+
const ret = typeof(obj) === 'string' ? obj : undefined;
|
|
241
|
+
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
242
|
+
var len1 = WASM_VECTOR_LEN;
|
|
243
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
244
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
245
|
+
},
|
|
167
246
|
__wbg___wbindgen_throw_5d9e815e6fdf150f: function(arg0, arg1) {
|
|
168
247
|
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
169
248
|
},
|
|
170
|
-
|
|
249
|
+
__wbg__wbg_cb_unref_997e73d32238e655: function(arg0) {
|
|
250
|
+
arg0._wbg_cb_unref();
|
|
251
|
+
},
|
|
252
|
+
__wbg_call_6bcf8d3e20937e46: function() { return handleError(function (arg0, arg1, arg2) {
|
|
253
|
+
const ret = arg0.call(arg1, arg2);
|
|
254
|
+
return ret;
|
|
255
|
+
}, arguments); },
|
|
256
|
+
__wbg_close_1d55410e47fc11c8: function(arg0) {
|
|
257
|
+
arg0.close();
|
|
258
|
+
},
|
|
259
|
+
__wbg_composition_new: function(arg0) {
|
|
260
|
+
const ret = Composition.__wrap(arg0);
|
|
261
|
+
return ret;
|
|
262
|
+
},
|
|
263
|
+
__wbg_createSyncAccessHandle_f2f0452f71047cd7: function(arg0) {
|
|
264
|
+
const ret = arg0.createSyncAccessHandle();
|
|
265
|
+
return ret;
|
|
266
|
+
},
|
|
267
|
+
__wbg_flush_91458c8278aae724: function() { return handleError(function (arg0) {
|
|
268
|
+
arg0.flush();
|
|
269
|
+
}, arguments); },
|
|
270
|
+
__wbg_getDirectoryHandle_df6fb6f1fc6240ed: function(arg0, arg1, arg2, arg3) {
|
|
271
|
+
const ret = arg0.getDirectoryHandle(getStringFromWasm0(arg1, arg2), arg3);
|
|
272
|
+
return ret;
|
|
273
|
+
},
|
|
274
|
+
__wbg_getDirectory_31689baa30c0e94c: function(arg0) {
|
|
275
|
+
const ret = arg0.getDirectory();
|
|
276
|
+
return ret;
|
|
277
|
+
},
|
|
278
|
+
__wbg_getFileHandle_fbeae17e3423535f: function(arg0, arg1, arg2, arg3) {
|
|
279
|
+
const ret = arg0.getFileHandle(getStringFromWasm0(arg1, arg2), arg3);
|
|
280
|
+
return ret;
|
|
281
|
+
},
|
|
282
|
+
__wbg_getSize_479486b8ac438f8e: function() { return handleError(function (arg0) {
|
|
283
|
+
const ret = arg0.getSize();
|
|
284
|
+
return ret;
|
|
285
|
+
}, arguments); },
|
|
286
|
+
__wbg_get_989d0a1309644f2b: function() { return handleError(function (arg0, arg1) {
|
|
287
|
+
const ret = Reflect.get(arg0, arg1);
|
|
288
|
+
return ret;
|
|
289
|
+
}, arguments); },
|
|
290
|
+
__wbg_instanceof_FileSystemDirectoryHandle_a5c1bdaafba684ca: function(arg0) {
|
|
291
|
+
let result;
|
|
292
|
+
try {
|
|
293
|
+
result = arg0 instanceof FileSystemDirectoryHandle;
|
|
294
|
+
} catch (_) {
|
|
295
|
+
result = false;
|
|
296
|
+
}
|
|
297
|
+
const ret = result;
|
|
298
|
+
return ret;
|
|
299
|
+
},
|
|
300
|
+
__wbg_instanceof_FileSystemFileHandle_aba527fd4c84a882: function(arg0) {
|
|
301
|
+
let result;
|
|
302
|
+
try {
|
|
303
|
+
result = arg0 instanceof FileSystemFileHandle;
|
|
304
|
+
} catch (_) {
|
|
305
|
+
result = false;
|
|
306
|
+
}
|
|
307
|
+
const ret = result;
|
|
308
|
+
return ret;
|
|
309
|
+
},
|
|
310
|
+
__wbg_instanceof_WorkerGlobalScope_0c1a6411473b843f: function(arg0) {
|
|
311
|
+
let result;
|
|
312
|
+
try {
|
|
313
|
+
result = arg0 instanceof WorkerGlobalScope;
|
|
314
|
+
} catch (_) {
|
|
315
|
+
result = false;
|
|
316
|
+
}
|
|
317
|
+
const ret = result;
|
|
318
|
+
return ret;
|
|
319
|
+
},
|
|
320
|
+
__wbg_keys_4d3b6ee519555a72: function(arg0) {
|
|
321
|
+
const ret = arg0.keys();
|
|
322
|
+
return ret;
|
|
323
|
+
},
|
|
324
|
+
__wbg_navigator_d25c0f071226f233: function(arg0) {
|
|
325
|
+
const ret = arg0.navigator;
|
|
326
|
+
return ret;
|
|
327
|
+
},
|
|
328
|
+
__wbg_new_8f72ed7c652bf5a2: function(arg0, arg1) {
|
|
329
|
+
try {
|
|
330
|
+
var state0 = {a: arg0, b: arg1};
|
|
331
|
+
var cb0 = (arg0, arg1) => {
|
|
332
|
+
const a = state0.a;
|
|
333
|
+
state0.a = 0;
|
|
334
|
+
try {
|
|
335
|
+
return wasm_bindgen__convert__closures_____invoke__h76bd71bceeca2b95(a, state0.b, arg0, arg1);
|
|
336
|
+
} finally {
|
|
337
|
+
state0.a = a;
|
|
338
|
+
}
|
|
339
|
+
};
|
|
340
|
+
const ret = new Promise(cb0);
|
|
341
|
+
return ret;
|
|
342
|
+
} finally {
|
|
343
|
+
state0.a = 0;
|
|
344
|
+
}
|
|
345
|
+
},
|
|
346
|
+
__wbg_new_bebc3f4757acf305: function() {
|
|
347
|
+
const ret = new Object();
|
|
348
|
+
return ret;
|
|
349
|
+
},
|
|
350
|
+
__wbg_new_f7a98796d439afd7: function(arg0, arg1) {
|
|
171
351
|
const ret = new Error(getStringFromWasm0(arg0, arg1));
|
|
172
352
|
return ret;
|
|
173
353
|
},
|
|
174
|
-
|
|
354
|
+
__wbg_new_typed_6f8b0d724fe26c07: function(arg0, arg1) {
|
|
355
|
+
try {
|
|
356
|
+
var state0 = {a: arg0, b: arg1};
|
|
357
|
+
var cb0 = (arg0, arg1) => {
|
|
358
|
+
const a = state0.a;
|
|
359
|
+
state0.a = 0;
|
|
360
|
+
try {
|
|
361
|
+
return wasm_bindgen__convert__closures_____invoke__h76bd71bceeca2b95(a, state0.b, arg0, arg1);
|
|
362
|
+
} finally {
|
|
363
|
+
state0.a = a;
|
|
364
|
+
}
|
|
365
|
+
};
|
|
366
|
+
const ret = new Promise(cb0);
|
|
367
|
+
return ret;
|
|
368
|
+
} finally {
|
|
369
|
+
state0.a = 0;
|
|
370
|
+
}
|
|
371
|
+
},
|
|
372
|
+
__wbg_next_a128c458fd40a0a5: function() { return handleError(function (arg0) {
|
|
373
|
+
const ret = arg0.next();
|
|
374
|
+
return ret;
|
|
375
|
+
}, arguments); },
|
|
376
|
+
__wbg_parse_e8916f82998e362d: function() { return handleError(function (arg0, arg1) {
|
|
175
377
|
const ret = JSON.parse(getStringFromWasm0(arg0, arg1));
|
|
176
378
|
return ret;
|
|
177
379
|
}, arguments); },
|
|
178
|
-
|
|
380
|
+
__wbg_queueMicrotask_85c90f6987555d65: function(arg0) {
|
|
381
|
+
const ret = arg0.queueMicrotask;
|
|
382
|
+
return ret;
|
|
383
|
+
},
|
|
384
|
+
__wbg_queueMicrotask_f6a1fa10b81d1fc0: function(arg0) {
|
|
385
|
+
queueMicrotask(arg0);
|
|
386
|
+
},
|
|
387
|
+
__wbg_read_259baab664b5f318: function() { return handleError(function (arg0, arg1, arg2, arg3) {
|
|
388
|
+
const ret = arg0.read(getArrayU8FromWasm0(arg1, arg2), arg3);
|
|
389
|
+
return ret;
|
|
390
|
+
}, arguments); },
|
|
391
|
+
__wbg_removeEntry_c72a6de718a4679d: function(arg0, arg1, arg2) {
|
|
392
|
+
const ret = arg0.removeEntry(getStringFromWasm0(arg1, arg2));
|
|
393
|
+
return ret;
|
|
394
|
+
},
|
|
395
|
+
__wbg_resolve_35ec7e0c6af4c82c: function(arg0) {
|
|
396
|
+
const ret = Promise.resolve(arg0);
|
|
397
|
+
return ret;
|
|
398
|
+
},
|
|
399
|
+
__wbg_setTimeout_68c2cba08a966520: function() { return handleError(function (arg0, arg1, arg2) {
|
|
400
|
+
const ret = arg0.setTimeout(arg1, arg2);
|
|
401
|
+
return ret;
|
|
402
|
+
}, arguments); },
|
|
403
|
+
__wbg_set_at_40af7269bbcce291: function(arg0, arg1) {
|
|
404
|
+
arg0.at = arg1;
|
|
405
|
+
},
|
|
406
|
+
__wbg_set_create_389985224a53c83d: function(arg0, arg1) {
|
|
407
|
+
arg0.create = arg1 !== 0;
|
|
408
|
+
},
|
|
409
|
+
__wbg_set_create_8c556c6febf6436c: function(arg0, arg1) {
|
|
410
|
+
arg0.create = arg1 !== 0;
|
|
411
|
+
},
|
|
412
|
+
__wbg_set_name_460fb691696dcf5e: function(arg0, arg1, arg2) {
|
|
179
413
|
arg0.name = getStringFromWasm0(arg1, arg2);
|
|
180
414
|
},
|
|
181
|
-
|
|
415
|
+
__wbg_set_refusal_29174eeccc76b2a2: function(arg0, arg1) {
|
|
182
416
|
arg0.refusal = arg1;
|
|
183
417
|
},
|
|
418
|
+
__wbg_static_accessor_GLOBAL_8eb4cd83130a11a0: function() {
|
|
419
|
+
const ret = typeof global === 'undefined' ? null : global;
|
|
420
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
421
|
+
},
|
|
422
|
+
__wbg_static_accessor_GLOBAL_THIS_1e7044f654e934db: function() {
|
|
423
|
+
const ret = typeof globalThis === 'undefined' ? null : globalThis;
|
|
424
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
425
|
+
},
|
|
426
|
+
__wbg_static_accessor_SELF_d8b50611246a6d92: function() {
|
|
427
|
+
const ret = typeof self === 'undefined' ? null : self;
|
|
428
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
429
|
+
},
|
|
430
|
+
__wbg_static_accessor_WINDOW_fd0bc376bf0f8b42: function() {
|
|
431
|
+
const ret = typeof window === 'undefined' ? null : window;
|
|
432
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
433
|
+
},
|
|
434
|
+
__wbg_then_7a850dae4493f353: function(arg0, arg1, arg2) {
|
|
435
|
+
const ret = arg0.then(arg1, arg2);
|
|
436
|
+
return ret;
|
|
437
|
+
},
|
|
438
|
+
__wbg_then_b830475380919203: function(arg0, arg1) {
|
|
439
|
+
const ret = arg0.then(arg1);
|
|
440
|
+
return ret;
|
|
441
|
+
},
|
|
442
|
+
__wbg_truncate_2ed7d68b99bcc8f6: function() { return handleError(function (arg0, arg1) {
|
|
443
|
+
arg0.truncate(arg1);
|
|
444
|
+
}, arguments); },
|
|
445
|
+
__wbg_write_3e78f5b3224d701e: function() { return handleError(function (arg0, arg1, arg2, arg3) {
|
|
446
|
+
const ret = arg0.write(getArrayU8FromWasm0(arg1, arg2), arg3);
|
|
447
|
+
return ret;
|
|
448
|
+
}, arguments); },
|
|
184
449
|
__wbindgen_generic_0000000000000001: function(arg0, arg1) {
|
|
450
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 94, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
|
|
451
|
+
const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__hd55bb211d6a08150);
|
|
452
|
+
return ret;
|
|
453
|
+
},
|
|
454
|
+
__wbindgen_generic_0000000000000002: function(arg0, arg1) {
|
|
185
455
|
// Cast intrinsic for `Ref(String) -> Externref`.
|
|
186
456
|
const ret = getStringFromWasm0(arg0, arg1);
|
|
187
457
|
return ret;
|
|
@@ -202,6 +472,17 @@ function __wbg_get_imports() {
|
|
|
202
472
|
};
|
|
203
473
|
}
|
|
204
474
|
|
|
475
|
+
function wasm_bindgen__convert__closures_____invoke__hd55bb211d6a08150(arg0, arg1, arg2) {
|
|
476
|
+
const ret = wasm.wasm_bindgen__convert__closures_____invoke__hd55bb211d6a08150(arg0, arg1, arg2);
|
|
477
|
+
if (ret[1]) {
|
|
478
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
479
|
+
}
|
|
480
|
+
}
|
|
481
|
+
|
|
482
|
+
function wasm_bindgen__convert__closures_____invoke__h76bd71bceeca2b95(arg0, arg1, arg2, arg3) {
|
|
483
|
+
wasm.wasm_bindgen__convert__closures_____invoke__h76bd71bceeca2b95(arg0, arg1, arg2, arg3);
|
|
484
|
+
}
|
|
485
|
+
|
|
205
486
|
const CompositionFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
206
487
|
? { register: () => {}, unregister: () => {} }
|
|
207
488
|
: new FinalizationRegistry(ptr => wasm.__wbg_composition_free(ptr, 1));
|
|
@@ -215,11 +496,28 @@ function addToExternrefTable0(obj) {
|
|
|
215
496
|
return idx;
|
|
216
497
|
}
|
|
217
498
|
|
|
499
|
+
const CLOSURE_DTORS = (typeof FinalizationRegistry === 'undefined')
|
|
500
|
+
? { register: () => {}, unregister: () => {} }
|
|
501
|
+
: new FinalizationRegistry(state => wasm.__wbindgen_destroy_closure(state.a, state.b));
|
|
502
|
+
|
|
218
503
|
function getArrayF32FromWasm0(ptr, len) {
|
|
219
504
|
ptr = ptr >>> 0;
|
|
220
505
|
return getFloat32ArrayMemory0().subarray(ptr / 4, ptr / 4 + len);
|
|
221
506
|
}
|
|
222
507
|
|
|
508
|
+
function getArrayU8FromWasm0(ptr, len) {
|
|
509
|
+
ptr = ptr >>> 0;
|
|
510
|
+
return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
|
|
511
|
+
}
|
|
512
|
+
|
|
513
|
+
let cachedDataViewMemory0 = null;
|
|
514
|
+
function getDataViewMemory0() {
|
|
515
|
+
if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
|
|
516
|
+
cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
|
|
517
|
+
}
|
|
518
|
+
return cachedDataViewMemory0;
|
|
519
|
+
}
|
|
520
|
+
|
|
223
521
|
let cachedFloat32ArrayMemory0 = null;
|
|
224
522
|
function getFloat32ArrayMemory0() {
|
|
225
523
|
if (cachedFloat32ArrayMemory0 === null || cachedFloat32ArrayMemory0.byteLength === 0) {
|
|
@@ -253,6 +551,34 @@ function isLikeNone(x) {
|
|
|
253
551
|
return x === undefined || x === null;
|
|
254
552
|
}
|
|
255
553
|
|
|
554
|
+
function makeMutClosure(arg0, arg1, f) {
|
|
555
|
+
const state = { a: arg0, b: arg1, cnt: 1 };
|
|
556
|
+
const real = (...args) => {
|
|
557
|
+
|
|
558
|
+
// First up with a closure we increment the internal reference
|
|
559
|
+
// count. This ensures that the Rust closure environment won't
|
|
560
|
+
// be deallocated while we're invoking it.
|
|
561
|
+
state.cnt++;
|
|
562
|
+
const a = state.a;
|
|
563
|
+
state.a = 0;
|
|
564
|
+
try {
|
|
565
|
+
return f(a, state.b, ...args);
|
|
566
|
+
} finally {
|
|
567
|
+
state.a = a;
|
|
568
|
+
real._wbg_cb_unref();
|
|
569
|
+
}
|
|
570
|
+
};
|
|
571
|
+
real._wbg_cb_unref = () => {
|
|
572
|
+
if (--state.cnt === 0) {
|
|
573
|
+
wasm.__wbindgen_destroy_closure(state.a, state.b);
|
|
574
|
+
state.a = 0;
|
|
575
|
+
CLOSURE_DTORS.unregister(state);
|
|
576
|
+
}
|
|
577
|
+
};
|
|
578
|
+
CLOSURE_DTORS.register(real, state, state);
|
|
579
|
+
return real;
|
|
580
|
+
}
|
|
581
|
+
|
|
256
582
|
function passStringToWasm0(arg, malloc, realloc) {
|
|
257
583
|
if (realloc === undefined) {
|
|
258
584
|
const buf = cachedTextEncoder.encode(arg);
|
|
@@ -330,6 +656,7 @@ function __wbg_finalize_init(instance, module) {
|
|
|
330
656
|
wasmInstance = instance;
|
|
331
657
|
wasm = instance.exports;
|
|
332
658
|
wasmModule = module;
|
|
659
|
+
cachedDataViewMemory0 = null;
|
|
333
660
|
cachedFloat32ArrayMemory0 = null;
|
|
334
661
|
cachedUint8ArrayMemory0 = null;
|
|
335
662
|
wasm.__wbindgen_start();
|
package/sva_wasm_bg.wasm
CHANGED
|
Binary file
|