@scalable-vector-audio/sva-wasm 0.4.0 → 0.5.1

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 CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@scalable-vector-audio/sva-wasm",
3
3
  "type": "module",
4
4
  "description": "JS bindings: a composition a page fills node by node, rendered in the browser",
5
- "version": "0.4.0",
5
+ "version": "0.5.1",
6
6
  "license": "MIT",
7
7
  "repository": {
8
8
  "type": "git",
package/sva_wasm.d.ts CHANGED
@@ -1,6 +1,13 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
3
 
4
+ export class Checkpoint {
5
+ private constructor();
6
+ free(): void;
7
+ [Symbol.dispose](): void;
8
+ readonly position: number;
9
+ }
10
+
4
11
  export class Composition {
5
12
  free(): void;
6
13
  [Symbol.dispose](): void;
@@ -18,10 +25,18 @@ export class Composition {
18
25
  */
19
26
  static persistent(name: string | null | undefined, cache: string, max_bytes?: number | null): Promise<Composition>;
20
27
  /**
21
- * Unset, `target` is `master`; `seconds` is the horizon and `rate` the observation rate.
22
- * What reads a `volatile` parameter is kept in a slot, never in either store.
28
+ * Unset, `target` is `master`; `until` is the horizon in seconds, or `"silent"` to end
29
+ * where every later sample is provably under `2^-bits` (default the profile's own), by
30
+ * `max_secs` at the latest. `rate` is the observation rate. What reads a `volatile`
31
+ * parameter is kept in a slot, never in either store.
23
32
  */
24
- render(target?: string | null, rate?: number | null, seconds?: number | null, volatile?: string[] | null): Rendering;
33
+ render(target: string | null | undefined, rate: number | null | undefined, until: any, volatile?: string[] | null, bits?: number | null, max_secs?: number | null): Rendering;
34
+ /**
35
+ * A stream of `target` (`master` unset) at `rate`, `block` samples a block, each key of
36
+ * `bindings` a named argument on the target. `until: "silent"` ends it at the first block
37
+ * whose end proves every later sample under `2^-bits`, throwing past `max_secs`.
38
+ */
39
+ stream(target: string | null | undefined, rate: number | null | undefined, block: number, bindings: any, until: any, bits?: number | null, max_secs?: number | null): Stream;
25
40
  /**
26
41
  * The memory tier's, as `cache_max_bytes` is; `persistent_bytes` is the pack's.
27
42
  */
@@ -50,12 +65,41 @@ export class Rendering {
50
65
  * The object `sva-cli render` puts under `data.cache.stats`.
51
66
  */
52
67
  stats(): any;
68
+ work(): any;
53
69
  readonly channels: number;
54
70
  readonly duration_secs: number;
55
71
  readonly sample_rate: number;
56
72
  readonly target: string;
57
73
  }
58
74
 
75
+ /**
76
+ * A target block by block, for a player that cannot know how long a note is held.
77
+ */
78
+ export class Stream {
79
+ private constructor();
80
+ free(): void;
81
+ [Symbol.dispose](): void;
82
+ checkpoint(): Checkpoint;
83
+ /**
84
+ * Writes the next block into `out`, component `c` from `c * block`, and returns the
85
+ * samples each component took: `block`, fewer where silence ends inside it, `0` after.
86
+ */
87
+ next(out: Float32Array): number;
88
+ /**
89
+ * `until` as `stream` takes it, `max_secs` counted from the checkpoint.
90
+ */
91
+ resume(checkpoint: Checkpoint, bindings: any, until: any, bits?: number | null, max_secs?: number | null): Stream;
92
+ /**
93
+ * `{ samples, proofs, priced_flops, waves }` since it opened or resumed.
94
+ */
95
+ work(): any;
96
+ readonly block: number;
97
+ readonly channels: number;
98
+ readonly end: number | undefined;
99
+ readonly position: number;
100
+ readonly sample_rate: number;
101
+ }
102
+
59
103
  export function builtins(): any;
60
104
 
61
105
  /**
@@ -67,9 +111,12 @@ export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembl
67
111
 
68
112
  export interface InitOutput {
69
113
  readonly memory: WebAssembly.Memory;
114
+ readonly __wbg_checkpoint_free: (a: number, b: number) => void;
70
115
  readonly __wbg_composition_free: (a: number, b: number) => void;
71
116
  readonly __wbg_rendering_free: (a: number, b: number) => void;
117
+ readonly __wbg_stream_free: (a: number, b: number) => void;
72
118
  readonly builtins: () => [number, number, number];
119
+ readonly checkpoint_position: (a: number) => number;
73
120
  readonly composition_bound_cache: (a: number, b: number) => void;
74
121
  readonly composition_cache_bytes: (a: number) => number;
75
122
  readonly composition_cache_max_bytes: (a: number) => number;
@@ -81,8 +128,9 @@ export interface InitOutput {
81
128
  readonly composition_persistent: (a: number, b: number, c: number, d: number, e: number, f: number) => any;
82
129
  readonly composition_persistent_bytes: (a: number) => number;
83
130
  readonly composition_persistent_max_bytes: (a: number) => number;
84
- readonly composition_render: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => [number, number, number];
131
+ readonly composition_render: (a: number, b: number, c: number, d: number, e: any, f: number, g: number, h: number, i: number, j: number) => [number, number, number];
85
132
  readonly composition_set_volatile_max_bytes: (a: number, b: number) => void;
133
+ readonly composition_stream: (a: number, b: number, c: number, d: number, e: number, f: any, g: any, h: number, i: number, j: number) => [number, number, number];
86
134
  readonly composition_volatile_bytes: (a: number) => number;
87
135
  readonly composition_volatile_max_bytes: (a: number) => number;
88
136
  readonly outline: (a: number, b: number) => [number, number, number];
@@ -93,6 +141,16 @@ export interface InitOutput {
93
141
  readonly rendering_samples: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number, number, number];
94
142
  readonly rendering_stats: (a: number) => [number, number, number];
95
143
  readonly rendering_target: (a: number) => [number, number];
144
+ readonly rendering_work: (a: number) => [number, number, number];
145
+ readonly stream_block: (a: number) => number;
146
+ readonly stream_channels: (a: number) => number;
147
+ readonly stream_checkpoint: (a: number) => number;
148
+ readonly stream_end: (a: number) => [number, number];
149
+ readonly stream_next: (a: number, b: number, c: number, d: any) => [number, number, number];
150
+ readonly stream_position: (a: number) => number;
151
+ readonly stream_resume: (a: number, b: number, c: any, d: any, e: number, f: number, g: number) => [number, number, number];
152
+ readonly stream_sample_rate: (a: number) => number;
153
+ readonly stream_work: (a: number) => [number, number, number];
96
154
  readonly wasm_bindgen__convert__closures_____invoke__h76bd71bceeca2b95: (a: number, b: number, c: any, d: any) => void;
97
155
  readonly wasm_bindgen__convert__closures_____invoke__hd55bb211d6a08150: (a: number, b: number, c: any) => [number, number];
98
156
  readonly __wbindgen_malloc: (a: number, b: number) => number;
package/sva_wasm.js CHANGED
@@ -1,5 +1,32 @@
1
1
  /* @ts-self-types="./sva_wasm.d.ts" */
2
2
 
3
+ export class Checkpoint {
4
+ static __wrap(ptr) {
5
+ const obj = Object.create(Checkpoint.prototype);
6
+ obj.__wbg_ptr = ptr;
7
+ CheckpointFinalization.register(obj, obj.__wbg_ptr, obj);
8
+ return obj;
9
+ }
10
+ __destroy_into_raw() {
11
+ const ptr = this.__wbg_ptr;
12
+ this.__wbg_ptr = 0;
13
+ CheckpointFinalization.unregister(this);
14
+ return ptr;
15
+ }
16
+ free() {
17
+ const ptr = this.__destroy_into_raw();
18
+ wasm.__wbg_checkpoint_free(ptr, 0);
19
+ }
20
+ /**
21
+ * @returns {number}
22
+ */
23
+ get position() {
24
+ const ret = wasm.checkpoint_position(this.__wbg_ptr);
25
+ return ret;
26
+ }
27
+ }
28
+ if (Symbol.dispose) Checkpoint.prototype[Symbol.dispose] = Checkpoint.prototype.free;
29
+
3
30
  export class Composition {
4
31
  static __wrap(ptr) {
5
32
  const obj = Object.create(Composition.prototype);
@@ -108,20 +135,24 @@ export class Composition {
108
135
  return ret;
109
136
  }
110
137
  /**
111
- * Unset, `target` is `master`; `seconds` is the horizon and `rate` the observation rate.
112
- * What reads a `volatile` parameter is kept in a slot, never in either store.
113
- * @param {string | null} [target]
114
- * @param {number | null} [rate]
115
- * @param {number | null} [seconds]
138
+ * Unset, `target` is `master`; `until` is the horizon in seconds, or `"silent"` to end
139
+ * where every later sample is provably under `2^-bits` (default the profile's own), by
140
+ * `max_secs` at the latest. `rate` is the observation rate. What reads a `volatile`
141
+ * parameter is kept in a slot, never in either store.
142
+ * @param {string | null | undefined} target
143
+ * @param {number | null | undefined} rate
144
+ * @param {any} until
116
145
  * @param {string[] | null} [volatile]
146
+ * @param {number | null} [bits]
147
+ * @param {number | null} [max_secs]
117
148
  * @returns {Rendering}
118
149
  */
119
- render(target, rate, seconds, volatile) {
150
+ render(target, rate, until, volatile, bits, max_secs) {
120
151
  var ptr0 = isLikeNone(target) ? 0 : passStringToWasm0(target, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
121
152
  var len0 = WASM_VECTOR_LEN;
122
153
  var ptr1 = isLikeNone(volatile) ? 0 : passArrayJsValueToWasm0(volatile, wasm.__wbindgen_malloc);
123
154
  var len1 = WASM_VECTOR_LEN;
124
- const ret = wasm.composition_render(this.__wbg_ptr, ptr0, len0, isLikeNone(rate) ? Number.MAX_SAFE_INTEGER : (rate) >>> 0, !isLikeNone(seconds), isLikeNone(seconds) ? 0 : seconds, ptr1, len1);
155
+ const ret = wasm.composition_render(this.__wbg_ptr, ptr0, len0, isLikeNone(rate) ? Number.MAX_SAFE_INTEGER : (rate) >>> 0, until, ptr1, len1, isLikeNone(bits) ? Number.MAX_SAFE_INTEGER : (bits) >>> 0, !isLikeNone(max_secs), isLikeNone(max_secs) ? 0 : max_secs);
125
156
  if (ret[2]) {
126
157
  throw takeFromExternrefTable0(ret[1]);
127
158
  }
@@ -133,6 +164,28 @@ export class Composition {
133
164
  set volatile_max_bytes(max_bytes) {
134
165
  wasm.composition_set_volatile_max_bytes(this.__wbg_ptr, max_bytes);
135
166
  }
167
+ /**
168
+ * A stream of `target` (`master` unset) at `rate`, `block` samples a block, each key of
169
+ * `bindings` a named argument on the target. `until: "silent"` ends it at the first block
170
+ * whose end proves every later sample under `2^-bits`, throwing past `max_secs`.
171
+ * @param {string | null | undefined} target
172
+ * @param {number | null | undefined} rate
173
+ * @param {number} block
174
+ * @param {any} bindings
175
+ * @param {any} until
176
+ * @param {number | null} [bits]
177
+ * @param {number | null} [max_secs]
178
+ * @returns {Stream}
179
+ */
180
+ stream(target, rate, block, bindings, until, bits, max_secs) {
181
+ var ptr0 = isLikeNone(target) ? 0 : passStringToWasm0(target, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
182
+ var len0 = WASM_VECTOR_LEN;
183
+ const ret = wasm.composition_stream(this.__wbg_ptr, ptr0, len0, isLikeNone(rate) ? Number.MAX_SAFE_INTEGER : (rate) >>> 0, block, bindings, until, isLikeNone(bits) ? Number.MAX_SAFE_INTEGER : (bits) >>> 0, !isLikeNone(max_secs), isLikeNone(max_secs) ? 0 : max_secs);
184
+ if (ret[2]) {
185
+ throw takeFromExternrefTable0(ret[1]);
186
+ }
187
+ return Stream.__wrap(ret[0]);
188
+ }
136
189
  /**
137
190
  * @returns {number}
138
191
  */
@@ -245,9 +298,127 @@ export class Rendering {
245
298
  wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
246
299
  }
247
300
  }
301
+ /**
302
+ * @returns {any}
303
+ */
304
+ work() {
305
+ const ret = wasm.rendering_work(this.__wbg_ptr);
306
+ if (ret[2]) {
307
+ throw takeFromExternrefTable0(ret[1]);
308
+ }
309
+ return takeFromExternrefTable0(ret[0]);
310
+ }
248
311
  }
249
312
  if (Symbol.dispose) Rendering.prototype[Symbol.dispose] = Rendering.prototype.free;
250
313
 
314
+ /**
315
+ * A target block by block, for a player that cannot know how long a note is held.
316
+ */
317
+ export class Stream {
318
+ static __wrap(ptr) {
319
+ const obj = Object.create(Stream.prototype);
320
+ obj.__wbg_ptr = ptr;
321
+ StreamFinalization.register(obj, obj.__wbg_ptr, obj);
322
+ return obj;
323
+ }
324
+ __destroy_into_raw() {
325
+ const ptr = this.__wbg_ptr;
326
+ this.__wbg_ptr = 0;
327
+ StreamFinalization.unregister(this);
328
+ return ptr;
329
+ }
330
+ free() {
331
+ const ptr = this.__destroy_into_raw();
332
+ wasm.__wbg_stream_free(ptr, 0);
333
+ }
334
+ /**
335
+ * @returns {number}
336
+ */
337
+ get block() {
338
+ const ret = wasm.stream_block(this.__wbg_ptr);
339
+ return ret >>> 0;
340
+ }
341
+ /**
342
+ * @returns {number}
343
+ */
344
+ get channels() {
345
+ const ret = wasm.stream_channels(this.__wbg_ptr);
346
+ return ret >>> 0;
347
+ }
348
+ /**
349
+ * @returns {Checkpoint}
350
+ */
351
+ checkpoint() {
352
+ const ret = wasm.stream_checkpoint(this.__wbg_ptr);
353
+ return Checkpoint.__wrap(ret);
354
+ }
355
+ /**
356
+ * @returns {number | undefined}
357
+ */
358
+ get end() {
359
+ const ret = wasm.stream_end(this.__wbg_ptr);
360
+ return ret[0] === 0 ? undefined : ret[1];
361
+ }
362
+ /**
363
+ * Writes the next block into `out`, component `c` from `c * block`, and returns the
364
+ * samples each component took: `block`, fewer where silence ends inside it, `0` after.
365
+ * @param {Float32Array} out
366
+ * @returns {number}
367
+ */
368
+ next(out) {
369
+ var ptr0 = passArrayF32ToWasm0(out, wasm.__wbindgen_malloc);
370
+ var len0 = WASM_VECTOR_LEN;
371
+ const ret = wasm.stream_next(this.__wbg_ptr, ptr0, len0, out);
372
+ if (ret[2]) {
373
+ throw takeFromExternrefTable0(ret[1]);
374
+ }
375
+ return ret[0] >>> 0;
376
+ }
377
+ /**
378
+ * @returns {number}
379
+ */
380
+ get position() {
381
+ const ret = wasm.stream_position(this.__wbg_ptr);
382
+ return ret;
383
+ }
384
+ /**
385
+ * `until` as `stream` takes it, `max_secs` counted from the checkpoint.
386
+ * @param {Checkpoint} checkpoint
387
+ * @param {any} bindings
388
+ * @param {any} until
389
+ * @param {number | null} [bits]
390
+ * @param {number | null} [max_secs]
391
+ * @returns {Stream}
392
+ */
393
+ resume(checkpoint, bindings, until, bits, max_secs) {
394
+ _assertClass(checkpoint, Checkpoint);
395
+ const ret = wasm.stream_resume(this.__wbg_ptr, checkpoint.__wbg_ptr, bindings, until, isLikeNone(bits) ? Number.MAX_SAFE_INTEGER : (bits) >>> 0, !isLikeNone(max_secs), isLikeNone(max_secs) ? 0 : max_secs);
396
+ if (ret[2]) {
397
+ throw takeFromExternrefTable0(ret[1]);
398
+ }
399
+ return Stream.__wrap(ret[0]);
400
+ }
401
+ /**
402
+ * @returns {number}
403
+ */
404
+ get sample_rate() {
405
+ const ret = wasm.stream_sample_rate(this.__wbg_ptr);
406
+ return ret >>> 0;
407
+ }
408
+ /**
409
+ * `{ samples, proofs, priced_flops, waves }` since it opened or resumed.
410
+ * @returns {any}
411
+ */
412
+ work() {
413
+ const ret = wasm.stream_work(this.__wbg_ptr);
414
+ if (ret[2]) {
415
+ throw takeFromExternrefTable0(ret[1]);
416
+ }
417
+ return takeFromExternrefTable0(ret[0]);
418
+ }
419
+ }
420
+ if (Symbol.dispose) Stream.prototype[Symbol.dispose] = Stream.prototype.free;
421
+
251
422
  /**
252
423
  * @returns {any}
253
424
  */
@@ -276,6 +447,9 @@ export function outline(text) {
276
447
  function __wbg_get_imports() {
277
448
  const import0 = {
278
449
  __proto__: null,
450
+ __wbg___wbindgen_copy_to_typed_array_cccd104be8cf0b8d: function(arg0, arg1, arg2) {
451
+ new Uint8Array(arg2.buffer, arg2.byteOffset, arg2.byteLength).set(getArrayU8FromWasm0(arg0, arg1));
452
+ },
279
453
  __wbg___wbindgen_is_falsy_4502df4d571fca70: function(arg0) {
280
454
  const ret = !arg0;
281
455
  return ret;
@@ -284,10 +458,20 @@ function __wbg_get_imports() {
284
458
  const ret = typeof(arg0) === 'function';
285
459
  return ret;
286
460
  },
461
+ __wbg___wbindgen_is_null_5160b3e381865372: function(arg0) {
462
+ const ret = arg0 === null;
463
+ return ret;
464
+ },
287
465
  __wbg___wbindgen_is_undefined_8c687d0b90d5b524: function(arg0) {
288
466
  const ret = arg0 === undefined;
289
467
  return ret;
290
468
  },
469
+ __wbg___wbindgen_number_get_1dc732b810cb937c: function(arg0, arg1) {
470
+ const obj = arg1;
471
+ const ret = typeof(obj) === 'number' ? obj : undefined;
472
+ getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
473
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
474
+ },
291
475
  __wbg___wbindgen_string_get_92ab86bb19cbc12f: function(arg0, arg1) {
292
476
  const obj = arg1;
293
477
  const ret = typeof(obj) === 'string' ? obj : undefined;
@@ -317,9 +501,17 @@ function __wbg_get_imports() {
317
501
  const ret = arg0.createSyncAccessHandle();
318
502
  return ret;
319
503
  },
504
+ __wbg_entries_972a87586902cf87: function(arg0) {
505
+ const ret = Object.entries(arg0);
506
+ return ret;
507
+ },
320
508
  __wbg_flush_91458c8278aae724: function() { return handleError(function (arg0) {
321
509
  arg0.flush();
322
510
  }, arguments); },
511
+ __wbg_from_a39669ce566077da: function(arg0) {
512
+ const ret = Array.from(arg0);
513
+ return ret;
514
+ },
323
515
  __wbg_getDirectoryHandle_df6fb6f1fc6240ed: function(arg0, arg1, arg2, arg3) {
324
516
  const ret = arg0.getDirectoryHandle(getStringFromWasm0(arg1, arg2), arg3);
325
517
  return ret;
@@ -340,6 +532,14 @@ function __wbg_get_imports() {
340
532
  const ret = Reflect.get(arg0, arg1);
341
533
  return ret;
342
534
  }, arguments); },
535
+ __wbg_get_b1f0ab13c737f856: function(arg0, arg1) {
536
+ const ret = arg0[arg1 >>> 0];
537
+ return ret;
538
+ },
539
+ __wbg_get_unchecked_363572bdd397d473: function(arg0, arg1) {
540
+ const ret = arg0[arg1 >>> 0];
541
+ return ret;
542
+ },
343
543
  __wbg_instanceof_FileSystemDirectoryHandle_a5c1bdaafba684ca: function(arg0) {
344
544
  let result;
345
545
  try {
@@ -360,6 +560,16 @@ function __wbg_get_imports() {
360
560
  const ret = result;
361
561
  return ret;
362
562
  },
563
+ __wbg_instanceof_Object_87732cb922ac2e2c: function(arg0) {
564
+ let result;
565
+ try {
566
+ result = arg0 instanceof Object;
567
+ } catch (_) {
568
+ result = false;
569
+ }
570
+ const ret = result;
571
+ return ret;
572
+ },
363
573
  __wbg_instanceof_WorkerGlobalScope_0c1a6411473b843f: function(arg0) {
364
574
  let result;
365
575
  try {
@@ -374,11 +584,15 @@ function __wbg_get_imports() {
374
584
  const ret = arg0.keys();
375
585
  return ret;
376
586
  },
587
+ __wbg_length_4e1adc0d42e23620: function(arg0) {
588
+ const ret = arg0.length;
589
+ return ret;
590
+ },
377
591
  __wbg_navigator_d25c0f071226f233: function(arg0) {
378
592
  const ret = arg0.navigator;
379
593
  return ret;
380
594
  },
381
- __wbg_new_7961ad8a1598f803: function(arg0, arg1) {
595
+ __wbg_new_27e74e58f1461a9c: function(arg0, arg1) {
382
596
  const ret = new Error(getStringFromWasm0(arg0, arg1));
383
597
  return ret;
384
598
  },
@@ -426,7 +640,7 @@ function __wbg_get_imports() {
426
640
  const ret = arg0.next();
427
641
  return ret;
428
642
  }, arguments); },
429
- __wbg_parse_37dfa129810c048e: function() { return handleError(function (arg0, arg1) {
643
+ __wbg_parse_74b31fef7234e333: function() { return handleError(function (arg0, arg1) {
430
644
  const ret = JSON.parse(getStringFromWasm0(arg0, arg1));
431
645
  return ret;
432
646
  }, arguments); },
@@ -462,10 +676,10 @@ function __wbg_get_imports() {
462
676
  __wbg_set_create_8c556c6febf6436c: function(arg0, arg1) {
463
677
  arg0.create = arg1 !== 0;
464
678
  },
465
- __wbg_set_name_2c19c7bdf9770241: function(arg0, arg1, arg2) {
679
+ __wbg_set_name_fb6171210e935eeb: function(arg0, arg1, arg2) {
466
680
  arg0.name = getStringFromWasm0(arg1, arg2);
467
681
  },
468
- __wbg_set_refusal_2ebfe380b15aaa4a: function(arg0, arg1) {
682
+ __wbg_set_refusal_a80f0d1c079e712a: function(arg0, arg1) {
469
683
  arg0.refusal = arg1;
470
684
  },
471
685
  __wbg_static_accessor_GLOBAL_8eb4cd83130a11a0: function() {
@@ -536,12 +750,18 @@ function wasm_bindgen__convert__closures_____invoke__h76bd71bceeca2b95(arg0, arg
536
750
  wasm.wasm_bindgen__convert__closures_____invoke__h76bd71bceeca2b95(arg0, arg1, arg2, arg3);
537
751
  }
538
752
 
753
+ const CheckpointFinalization = (typeof FinalizationRegistry === 'undefined')
754
+ ? { register: () => {}, unregister: () => {} }
755
+ : new FinalizationRegistry(ptr => wasm.__wbg_checkpoint_free(ptr, 1));
539
756
  const CompositionFinalization = (typeof FinalizationRegistry === 'undefined')
540
757
  ? { register: () => {}, unregister: () => {} }
541
758
  : new FinalizationRegistry(ptr => wasm.__wbg_composition_free(ptr, 1));
542
759
  const RenderingFinalization = (typeof FinalizationRegistry === 'undefined')
543
760
  ? { register: () => {}, unregister: () => {} }
544
761
  : new FinalizationRegistry(ptr => wasm.__wbg_rendering_free(ptr, 1));
762
+ const StreamFinalization = (typeof FinalizationRegistry === 'undefined')
763
+ ? { register: () => {}, unregister: () => {} }
764
+ : new FinalizationRegistry(ptr => wasm.__wbg_stream_free(ptr, 1));
545
765
 
546
766
  function addToExternrefTable0(obj) {
547
767
  const idx = wasm.__externref_table_alloc();
@@ -549,6 +769,12 @@ function addToExternrefTable0(obj) {
549
769
  return idx;
550
770
  }
551
771
 
772
+ function _assertClass(instance, klass) {
773
+ if (!(instance instanceof klass)) {
774
+ throw new Error(`expected instance of ${klass.name}`);
775
+ }
776
+ }
777
+
552
778
  const CLOSURE_DTORS = (typeof FinalizationRegistry === 'undefined')
553
779
  ? { register: () => {}, unregister: () => {} }
554
780
  : new FinalizationRegistry(state => wasm.__wbindgen_destroy_closure(state.a, state.b));
@@ -632,6 +858,13 @@ function makeMutClosure(arg0, arg1, f) {
632
858
  return real;
633
859
  }
634
860
 
861
+ function passArrayF32ToWasm0(arg, malloc) {
862
+ const ptr = malloc(arg.length * 4, 4) >>> 0;
863
+ getFloat32ArrayMemory0().set(arg, ptr / 4);
864
+ WASM_VECTOR_LEN = arg.length;
865
+ return ptr;
866
+ }
867
+
635
868
  function passArrayJsValueToWasm0(array, malloc) {
636
869
  const ptr = malloc(array.length * 4, 4) >>> 0;
637
870
  for (let i = 0; i < array.length; i++) {
package/sva_wasm_bg.wasm CHANGED
Binary file