@scalable-vector-audio/sva-wasm 0.5.1 → 0.6.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 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.5.1",
5
+ "version": "0.6.0",
6
6
  "license": "MIT",
7
7
  "repository": {
8
8
  "type": "git",
package/sva_wasm.d.ts CHANGED
@@ -11,45 +11,35 @@ export class Checkpoint {
11
11
  export class Composition {
12
12
  free(): void;
13
13
  [Symbol.dispose](): void;
14
- bound_cache(max_bytes: number): void;
15
- /**
16
- * Empties the memory tier only: a persistent pack outlives it by design.
17
- */
18
14
  clear_cache(): void;
19
- clear_volatile(): void;
20
15
  insert(path: string, text: string): void;
21
16
  constructor(name?: string | null);
22
17
  /**
23
- * `name` labels the composition as `new` does; renders persist under `cache` in a dedicated
24
- * worker's private file system, and anywhere none opens, or `cache` is held, memory-only.
18
+ * `"oldest"` evicts what the latest render neither stored nor read, `"forks"` every value
19
+ * fewer than two nodes read.
25
20
  */
26
- static persistent(name: string | null | undefined, cache: string, max_bytes?: number | null): Promise<Composition>;
21
+ prune(policy: string): void;
27
22
  /**
28
23
  * Unset, `target` is `master`; `until` is the horizon in seconds, or `"silent"` to end
29
24
  * where every later sample is provably under `2^-bits` (default the profile's own), by
30
25
  * `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.
26
+ * parameter keeps one value in the store, its last. `cache` overrides `cache_policy`.
32
27
  */
33
- render(target: string | null | undefined, rate: number | null | undefined, until: any, volatile?: string[] | null, bits?: number | null, max_secs?: number | null): Rendering;
28
+ render(target: string | null | undefined, rate: number | null | undefined, until: any, volatile?: string[] | null, bits?: number | null, max_secs?: number | null, cache?: string | null): Rendering;
29
+ set_cache_policy(policy: string): void;
30
+ set_prune_policy(policy: string): void;
34
31
  /**
35
32
  * A stream of `target` (`master` unset) at `rate`, `block` samples a block, each key of
36
33
  * `bindings` a named argument on the target. `until: "silent"` ends it at the first block
37
34
  * whose end proves every later sample under `2^-bits`, throwing past `max_secs`.
38
35
  */
39
36
  stream(target: string | null | undefined, rate: number | null | undefined, block: number, bindings: any, until: any, bits?: number | null, max_secs?: number | null): Stream;
40
- /**
41
- * The memory tier's, as `cache_max_bytes` is; `persistent_bytes` is the pack's.
42
- */
43
37
  readonly cache_bytes: number;
44
- readonly cache_max_bytes: number;
45
- readonly persistent: boolean;
46
- /**
47
- * Zero on a memory-only composition, as `persistent_max_bytes` is.
48
- */
49
- readonly persistent_bytes: number;
50
- readonly persistent_max_bytes: number;
51
- volatile_max_bytes: number;
52
- readonly volatile_bytes: number;
38
+ readonly cache_entries: number;
39
+ readonly cache_evictions: number;
40
+ cache_max_bytes: number;
41
+ readonly cache_policy: string;
42
+ readonly prune_policy: string;
53
43
  }
54
44
 
55
45
  export class Rendering {
@@ -62,7 +52,7 @@ export class Rendering {
62
52
  query(representation: string, from_secs?: number | null, to_secs?: number | null): any;
63
53
  samples(channel: number, from_secs?: number | null, to_secs?: number | null): Float32Array;
64
54
  /**
65
- * The object `sva-cli render` puts under `data.cache.stats`.
55
+ * Every lookup this render made of the composition's store, and what each came to.
66
56
  */
67
57
  stats(): any;
68
58
  work(): any;
@@ -117,22 +107,21 @@ export interface InitOutput {
117
107
  readonly __wbg_stream_free: (a: number, b: number) => void;
118
108
  readonly builtins: () => [number, number, number];
119
109
  readonly checkpoint_position: (a: number) => number;
120
- readonly composition_bound_cache: (a: number, b: number) => void;
121
110
  readonly composition_cache_bytes: (a: number) => number;
111
+ readonly composition_cache_entries: (a: number) => number;
112
+ readonly composition_cache_evictions: (a: number) => number;
122
113
  readonly composition_cache_max_bytes: (a: number) => number;
114
+ readonly composition_cache_policy: (a: number) => [number, number];
123
115
  readonly composition_clear_cache: (a: number) => void;
124
- readonly composition_clear_volatile: (a: number) => void;
125
116
  readonly composition_insert: (a: number, b: number, c: number, d: number, e: number) => void;
126
- readonly composition_is_persistent: (a: number) => number;
127
117
  readonly composition_new: (a: number, b: number) => number;
128
- readonly composition_persistent: (a: number, b: number, c: number, d: number, e: number, f: number) => any;
129
- readonly composition_persistent_bytes: (a: number) => number;
130
- readonly composition_persistent_max_bytes: (a: 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];
132
- readonly composition_set_volatile_max_bytes: (a: number, b: number) => void;
118
+ readonly composition_prune: (a: number, b: number, c: number) => [number, number];
119
+ readonly composition_prune_policy: (a: number) => [number, number];
120
+ readonly composition_render: (a: number, b: number, c: number, d: number, e: any, f: number, g: number, h: number, i: number, j: number, k: number, l: number) => [number, number, number];
121
+ readonly composition_set_cache_max_bytes: (a: number, b: number) => void;
122
+ readonly composition_set_cache_policy: (a: number, b: number, c: number) => [number, number];
123
+ readonly composition_set_prune_policy: (a: number, b: number, c: number) => [number, number];
133
124
  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];
134
- readonly composition_volatile_bytes: (a: number) => number;
135
- readonly composition_volatile_max_bytes: (a: number) => number;
136
125
  readonly outline: (a: number, b: number) => [number, number, number];
137
126
  readonly rendering_channels: (a: number) => number;
138
127
  readonly rendering_duration_secs: (a: number) => number;
@@ -151,14 +140,11 @@ export interface InitOutput {
151
140
  readonly stream_resume: (a: number, b: number, c: any, d: any, e: number, f: number, g: number) => [number, number, number];
152
141
  readonly stream_sample_rate: (a: number) => number;
153
142
  readonly stream_work: (a: number) => [number, number, number];
154
- readonly wasm_bindgen__convert__closures_____invoke__h76bd71bceeca2b95: (a: number, b: number, c: any, d: any) => void;
155
- readonly wasm_bindgen__convert__closures_____invoke__hd55bb211d6a08150: (a: number, b: number, c: any) => [number, number];
156
143
  readonly __wbindgen_malloc: (a: number, b: number) => number;
157
144
  readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
158
145
  readonly __wbindgen_exn_store: (a: number) => void;
159
146
  readonly __externref_table_alloc: () => number;
160
147
  readonly __wbindgen_externrefs: WebAssembly.Table;
161
- readonly __wbindgen_destroy_closure: (a: number, b: number) => void;
162
148
  readonly __externref_table_dealloc: (a: number) => void;
163
149
  readonly __wbindgen_free: (a: number, b: number, c: number) => void;
164
150
  readonly __wbindgen_start: () => void;
package/sva_wasm.js CHANGED
@@ -28,12 +28,6 @@ export class Checkpoint {
28
28
  if (Symbol.dispose) Checkpoint.prototype[Symbol.dispose] = Checkpoint.prototype.free;
29
29
 
30
30
  export class Composition {
31
- static __wrap(ptr) {
32
- const obj = Object.create(Composition.prototype);
33
- obj.__wbg_ptr = ptr;
34
- CompositionFinalization.register(obj, obj.__wbg_ptr, obj);
35
- return obj;
36
- }
37
31
  __destroy_into_raw() {
38
32
  const ptr = this.__wbg_ptr;
39
33
  this.__wbg_ptr = 0;
@@ -45,17 +39,24 @@ export class Composition {
45
39
  wasm.__wbg_composition_free(ptr, 0);
46
40
  }
47
41
  /**
48
- * @param {number} max_bytes
42
+ * @returns {number}
49
43
  */
50
- bound_cache(max_bytes) {
51
- wasm.composition_bound_cache(this.__wbg_ptr, max_bytes);
44
+ get cache_bytes() {
45
+ const ret = wasm.composition_cache_bytes(this.__wbg_ptr);
46
+ return ret;
52
47
  }
53
48
  /**
54
- * The memory tier's, as `cache_max_bytes` is; `persistent_bytes` is the pack's.
55
49
  * @returns {number}
56
50
  */
57
- get cache_bytes() {
58
- const ret = wasm.composition_cache_bytes(this.__wbg_ptr);
51
+ get cache_entries() {
52
+ const ret = wasm.composition_cache_entries(this.__wbg_ptr);
53
+ return ret >>> 0;
54
+ }
55
+ /**
56
+ * @returns {number}
57
+ */
58
+ get cache_evictions() {
59
+ const ret = wasm.composition_cache_evictions(this.__wbg_ptr);
59
60
  return ret;
60
61
  }
61
62
  /**
@@ -66,14 +67,23 @@ export class Composition {
66
67
  return ret;
67
68
  }
68
69
  /**
69
- * Empties the memory tier only: a persistent pack outlives it by design.
70
+ * @returns {string}
70
71
  */
72
+ get cache_policy() {
73
+ let deferred1_0;
74
+ let deferred1_1;
75
+ try {
76
+ const ret = wasm.composition_cache_policy(this.__wbg_ptr);
77
+ deferred1_0 = ret[0];
78
+ deferred1_1 = ret[1];
79
+ return getStringFromWasm0(ret[0], ret[1]);
80
+ } finally {
81
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
82
+ }
83
+ }
71
84
  clear_cache() {
72
85
  wasm.composition_clear_cache(this.__wbg_ptr);
73
86
  }
74
- clear_volatile() {
75
- wasm.composition_clear_volatile(this.__wbg_ptr);
76
- }
77
87
  /**
78
88
  * @param {string} path
79
89
  * @param {string} text
@@ -85,13 +95,6 @@ export class Composition {
85
95
  const len1 = WASM_VECTOR_LEN;
86
96
  wasm.composition_insert(this.__wbg_ptr, ptr0, len0, ptr1, len1);
87
97
  }
88
- /**
89
- * @returns {boolean}
90
- */
91
- get persistent() {
92
- const ret = wasm.composition_is_persistent(this.__wbg_ptr);
93
- return ret !== 0;
94
- }
95
98
  /**
96
99
  * @param {string | null} [name]
97
100
  */
@@ -104,55 +107,55 @@ export class Composition {
104
107
  return this;
105
108
  }
106
109
  /**
107
- * `name` labels the composition as `new` does; renders persist under `cache` in a dedicated
108
- * worker's private file system, and anywhere none opens, or `cache` is held, memory-only.
109
- * @param {string | null | undefined} name
110
- * @param {string} cache
111
- * @param {number | null} [max_bytes]
112
- * @returns {Promise<Composition>}
113
- */
114
- static persistent(name, cache, max_bytes) {
115
- var ptr0 = isLikeNone(name) ? 0 : passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
116
- var len0 = WASM_VECTOR_LEN;
117
- const ptr1 = passStringToWasm0(cache, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
118
- const len1 = WASM_VECTOR_LEN;
119
- const ret = wasm.composition_persistent(ptr0, len0, ptr1, len1, !isLikeNone(max_bytes), isLikeNone(max_bytes) ? 0 : max_bytes);
120
- return ret;
121
- }
122
- /**
123
- * Zero on a memory-only composition, as `persistent_max_bytes` is.
124
- * @returns {number}
110
+ * `"oldest"` evicts what the latest render neither stored nor read, `"forks"` every value
111
+ * fewer than two nodes read.
112
+ * @param {string} policy
125
113
  */
126
- get persistent_bytes() {
127
- const ret = wasm.composition_persistent_bytes(this.__wbg_ptr);
128
- return ret;
114
+ prune(policy) {
115
+ const ptr0 = passStringToWasm0(policy, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
116
+ const len0 = WASM_VECTOR_LEN;
117
+ const ret = wasm.composition_prune(this.__wbg_ptr, ptr0, len0);
118
+ if (ret[1]) {
119
+ throw takeFromExternrefTable0(ret[0]);
120
+ }
129
121
  }
130
122
  /**
131
- * @returns {number}
123
+ * @returns {string}
132
124
  */
133
- get persistent_max_bytes() {
134
- const ret = wasm.composition_persistent_max_bytes(this.__wbg_ptr);
135
- return ret;
125
+ get prune_policy() {
126
+ let deferred1_0;
127
+ let deferred1_1;
128
+ try {
129
+ const ret = wasm.composition_prune_policy(this.__wbg_ptr);
130
+ deferred1_0 = ret[0];
131
+ deferred1_1 = ret[1];
132
+ return getStringFromWasm0(ret[0], ret[1]);
133
+ } finally {
134
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
135
+ }
136
136
  }
137
137
  /**
138
138
  * Unset, `target` is `master`; `until` is the horizon in seconds, or `"silent"` to end
139
139
  * where every later sample is provably under `2^-bits` (default the profile's own), by
140
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.
141
+ * parameter keeps one value in the store, its last. `cache` overrides `cache_policy`.
142
142
  * @param {string | null | undefined} target
143
143
  * @param {number | null | undefined} rate
144
144
  * @param {any} until
145
145
  * @param {string[] | null} [volatile]
146
146
  * @param {number | null} [bits]
147
147
  * @param {number | null} [max_secs]
148
+ * @param {string | null} [cache]
148
149
  * @returns {Rendering}
149
150
  */
150
- render(target, rate, until, volatile, bits, max_secs) {
151
+ render(target, rate, until, volatile, bits, max_secs, cache) {
151
152
  var ptr0 = isLikeNone(target) ? 0 : passStringToWasm0(target, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
152
153
  var len0 = WASM_VECTOR_LEN;
153
154
  var ptr1 = isLikeNone(volatile) ? 0 : passArrayJsValueToWasm0(volatile, wasm.__wbindgen_malloc);
154
155
  var len1 = WASM_VECTOR_LEN;
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);
156
+ var ptr2 = isLikeNone(cache) ? 0 : passStringToWasm0(cache, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
157
+ var len2 = WASM_VECTOR_LEN;
158
+ 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, ptr2, len2);
156
159
  if (ret[2]) {
157
160
  throw takeFromExternrefTable0(ret[1]);
158
161
  }
@@ -161,8 +164,30 @@ export class Composition {
161
164
  /**
162
165
  * @param {number} max_bytes
163
166
  */
164
- set volatile_max_bytes(max_bytes) {
165
- wasm.composition_set_volatile_max_bytes(this.__wbg_ptr, max_bytes);
167
+ set cache_max_bytes(max_bytes) {
168
+ wasm.composition_set_cache_max_bytes(this.__wbg_ptr, max_bytes);
169
+ }
170
+ /**
171
+ * @param {string} policy
172
+ */
173
+ set_cache_policy(policy) {
174
+ const ptr0 = passStringToWasm0(policy, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
175
+ const len0 = WASM_VECTOR_LEN;
176
+ const ret = wasm.composition_set_cache_policy(this.__wbg_ptr, ptr0, len0);
177
+ if (ret[1]) {
178
+ throw takeFromExternrefTable0(ret[0]);
179
+ }
180
+ }
181
+ /**
182
+ * @param {string} policy
183
+ */
184
+ set_prune_policy(policy) {
185
+ const ptr0 = passStringToWasm0(policy, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
186
+ const len0 = WASM_VECTOR_LEN;
187
+ const ret = wasm.composition_set_prune_policy(this.__wbg_ptr, ptr0, len0);
188
+ if (ret[1]) {
189
+ throw takeFromExternrefTable0(ret[0]);
190
+ }
166
191
  }
167
192
  /**
168
193
  * A stream of `target` (`master` unset) at `rate`, `block` samples a block, each key of
@@ -186,20 +211,6 @@ export class Composition {
186
211
  }
187
212
  return Stream.__wrap(ret[0]);
188
213
  }
189
- /**
190
- * @returns {number}
191
- */
192
- get volatile_bytes() {
193
- const ret = wasm.composition_volatile_bytes(this.__wbg_ptr);
194
- return ret;
195
- }
196
- /**
197
- * @returns {number}
198
- */
199
- get volatile_max_bytes() {
200
- const ret = wasm.composition_volatile_max_bytes(this.__wbg_ptr);
201
- return ret;
202
- }
203
214
  }
204
215
  if (Symbol.dispose) Composition.prototype[Symbol.dispose] = Composition.prototype.free;
205
216
 
@@ -273,7 +284,7 @@ export class Rendering {
273
284
  return v1;
274
285
  }
275
286
  /**
276
- * The object `sva-cli render` puts under `data.cache.stats`.
287
+ * Every lookup this render made of the composition's store, and what each came to.
277
288
  * @returns {any}
278
289
  */
279
290
  stats() {
@@ -450,14 +461,6 @@ function __wbg_get_imports() {
450
461
  __wbg___wbindgen_copy_to_typed_array_cccd104be8cf0b8d: function(arg0, arg1, arg2) {
451
462
  new Uint8Array(arg2.buffer, arg2.byteOffset, arg2.byteLength).set(getArrayU8FromWasm0(arg0, arg1));
452
463
  },
453
- __wbg___wbindgen_is_falsy_4502df4d571fca70: function(arg0) {
454
- const ret = !arg0;
455
- return ret;
456
- },
457
- __wbg___wbindgen_is_function_fcda5e3902d732fe: function(arg0) {
458
- const ret = typeof(arg0) === 'function';
459
- return ret;
460
- },
461
464
  __wbg___wbindgen_is_null_5160b3e381865372: function(arg0) {
462
465
  const ret = arg0 === null;
463
466
  return ret;
@@ -483,55 +486,14 @@ function __wbg_get_imports() {
483
486
  __wbg___wbindgen_throw_5d9e815e6fdf150f: function(arg0, arg1) {
484
487
  throw new Error(getStringFromWasm0(arg0, arg1));
485
488
  },
486
- __wbg__wbg_cb_unref_997e73d32238e655: function(arg0) {
487
- arg0._wbg_cb_unref();
488
- },
489
- __wbg_call_6bcf8d3e20937e46: function() { return handleError(function (arg0, arg1, arg2) {
490
- const ret = arg0.call(arg1, arg2);
491
- return ret;
492
- }, arguments); },
493
- __wbg_close_1d55410e47fc11c8: function(arg0) {
494
- arg0.close();
495
- },
496
- __wbg_composition_new: function(arg0) {
497
- const ret = Composition.__wrap(arg0);
498
- return ret;
499
- },
500
- __wbg_createSyncAccessHandle_f2f0452f71047cd7: function(arg0) {
501
- const ret = arg0.createSyncAccessHandle();
502
- return ret;
503
- },
504
489
  __wbg_entries_972a87586902cf87: function(arg0) {
505
490
  const ret = Object.entries(arg0);
506
491
  return ret;
507
492
  },
508
- __wbg_flush_91458c8278aae724: function() { return handleError(function (arg0) {
509
- arg0.flush();
510
- }, arguments); },
511
493
  __wbg_from_a39669ce566077da: function(arg0) {
512
494
  const ret = Array.from(arg0);
513
495
  return ret;
514
496
  },
515
- __wbg_getDirectoryHandle_df6fb6f1fc6240ed: function(arg0, arg1, arg2, arg3) {
516
- const ret = arg0.getDirectoryHandle(getStringFromWasm0(arg1, arg2), arg3);
517
- return ret;
518
- },
519
- __wbg_getDirectory_31689baa30c0e94c: function(arg0) {
520
- const ret = arg0.getDirectory();
521
- return ret;
522
- },
523
- __wbg_getFileHandle_fbeae17e3423535f: function(arg0, arg1, arg2, arg3) {
524
- const ret = arg0.getFileHandle(getStringFromWasm0(arg1, arg2), arg3);
525
- return ret;
526
- },
527
- __wbg_getSize_479486b8ac438f8e: function() { return handleError(function (arg0) {
528
- const ret = arg0.getSize();
529
- return ret;
530
- }, arguments); },
531
- __wbg_get_989d0a1309644f2b: function() { return handleError(function (arg0, arg1) {
532
- const ret = Reflect.get(arg0, arg1);
533
- return ret;
534
- }, arguments); },
535
497
  __wbg_get_b1f0ab13c737f856: function(arg0, arg1) {
536
498
  const ret = arg0[arg1 >>> 0];
537
499
  return ret;
@@ -540,26 +502,6 @@ function __wbg_get_imports() {
540
502
  const ret = arg0[arg1 >>> 0];
541
503
  return ret;
542
504
  },
543
- __wbg_instanceof_FileSystemDirectoryHandle_a5c1bdaafba684ca: function(arg0) {
544
- let result;
545
- try {
546
- result = arg0 instanceof FileSystemDirectoryHandle;
547
- } catch (_) {
548
- result = false;
549
- }
550
- const ret = result;
551
- return ret;
552
- },
553
- __wbg_instanceof_FileSystemFileHandle_aba527fd4c84a882: function(arg0) {
554
- let result;
555
- try {
556
- result = arg0 instanceof FileSystemFileHandle;
557
- } catch (_) {
558
- result = false;
559
- }
560
- const ret = result;
561
- return ret;
562
- },
563
505
  __wbg_instanceof_Object_87732cb922ac2e2c: function(arg0) {
564
506
  let result;
565
507
  try {
@@ -570,155 +512,25 @@ function __wbg_get_imports() {
570
512
  const ret = result;
571
513
  return ret;
572
514
  },
573
- __wbg_instanceof_WorkerGlobalScope_0c1a6411473b843f: function(arg0) {
574
- let result;
575
- try {
576
- result = arg0 instanceof WorkerGlobalScope;
577
- } catch (_) {
578
- result = false;
579
- }
580
- const ret = result;
581
- return ret;
582
- },
583
- __wbg_keys_4d3b6ee519555a72: function(arg0) {
584
- const ret = arg0.keys();
585
- return ret;
586
- },
587
515
  __wbg_length_4e1adc0d42e23620: function(arg0) {
588
516
  const ret = arg0.length;
589
517
  return ret;
590
518
  },
591
- __wbg_navigator_d25c0f071226f233: function(arg0) {
592
- const ret = arg0.navigator;
593
- return ret;
594
- },
595
- __wbg_new_27e74e58f1461a9c: function(arg0, arg1) {
519
+ __wbg_new_26350c3c2446a215: function(arg0, arg1) {
596
520
  const ret = new Error(getStringFromWasm0(arg0, arg1));
597
521
  return ret;
598
522
  },
599
- __wbg_new_8f72ed7c652bf5a2: function(arg0, arg1) {
600
- try {
601
- var state0 = {a: arg0, b: arg1};
602
- var cb0 = (arg0, arg1) => {
603
- const a = state0.a;
604
- state0.a = 0;
605
- try {
606
- return wasm_bindgen__convert__closures_____invoke__h76bd71bceeca2b95(a, state0.b, arg0, arg1);
607
- } finally {
608
- state0.a = a;
609
- }
610
- };
611
- const ret = new Promise(cb0);
612
- return ret;
613
- } finally {
614
- state0.a = 0;
615
- }
616
- },
617
- __wbg_new_bebc3f4757acf305: function() {
618
- const ret = new Object();
619
- return ret;
620
- },
621
- __wbg_new_typed_6f8b0d724fe26c07: function(arg0, arg1) {
622
- try {
623
- var state0 = {a: arg0, b: arg1};
624
- var cb0 = (arg0, arg1) => {
625
- const a = state0.a;
626
- state0.a = 0;
627
- try {
628
- return wasm_bindgen__convert__closures_____invoke__h76bd71bceeca2b95(a, state0.b, arg0, arg1);
629
- } finally {
630
- state0.a = a;
631
- }
632
- };
633
- const ret = new Promise(cb0);
634
- return ret;
635
- } finally {
636
- state0.a = 0;
637
- }
638
- },
639
- __wbg_next_a128c458fd40a0a5: function() { return handleError(function (arg0) {
640
- const ret = arg0.next();
641
- return ret;
642
- }, arguments); },
643
- __wbg_parse_74b31fef7234e333: function() { return handleError(function (arg0, arg1) {
523
+ __wbg_parse_e158b3a26b0b7727: function() { return handleError(function (arg0, arg1) {
644
524
  const ret = JSON.parse(getStringFromWasm0(arg0, arg1));
645
525
  return ret;
646
526
  }, arguments); },
647
- __wbg_queueMicrotask_85c90f6987555d65: function(arg0) {
648
- const ret = arg0.queueMicrotask;
649
- return ret;
650
- },
651
- __wbg_queueMicrotask_f6a1fa10b81d1fc0: function(arg0) {
652
- queueMicrotask(arg0);
653
- },
654
- __wbg_read_259baab664b5f318: function() { return handleError(function (arg0, arg1, arg2, arg3) {
655
- const ret = arg0.read(getArrayU8FromWasm0(arg1, arg2), arg3);
656
- return ret;
657
- }, arguments); },
658
- __wbg_removeEntry_c72a6de718a4679d: function(arg0, arg1, arg2) {
659
- const ret = arg0.removeEntry(getStringFromWasm0(arg1, arg2));
660
- return ret;
661
- },
662
- __wbg_resolve_35ec7e0c6af4c82c: function(arg0) {
663
- const ret = Promise.resolve(arg0);
664
- return ret;
665
- },
666
- __wbg_setTimeout_68c2cba08a966520: function() { return handleError(function (arg0, arg1, arg2) {
667
- const ret = arg0.setTimeout(arg1, arg2);
668
- return ret;
669
- }, arguments); },
670
- __wbg_set_at_40af7269bbcce291: function(arg0, arg1) {
671
- arg0.at = arg1;
672
- },
673
- __wbg_set_create_389985224a53c83d: function(arg0, arg1) {
674
- arg0.create = arg1 !== 0;
675
- },
676
- __wbg_set_create_8c556c6febf6436c: function(arg0, arg1) {
677
- arg0.create = arg1 !== 0;
678
- },
679
- __wbg_set_name_fb6171210e935eeb: function(arg0, arg1, arg2) {
527
+ __wbg_set_name_2739c17d34a6a152: function(arg0, arg1, arg2) {
680
528
  arg0.name = getStringFromWasm0(arg1, arg2);
681
529
  },
682
- __wbg_set_refusal_a80f0d1c079e712a: function(arg0, arg1) {
530
+ __wbg_set_refusal_b6aab88e0790b056: function(arg0, arg1) {
683
531
  arg0.refusal = arg1;
684
532
  },
685
- __wbg_static_accessor_GLOBAL_8eb4cd83130a11a0: function() {
686
- const ret = typeof global === 'undefined' ? null : global;
687
- return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
688
- },
689
- __wbg_static_accessor_GLOBAL_THIS_1e7044f654e934db: function() {
690
- const ret = typeof globalThis === 'undefined' ? null : globalThis;
691
- return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
692
- },
693
- __wbg_static_accessor_SELF_d8b50611246a6d92: function() {
694
- const ret = typeof self === 'undefined' ? null : self;
695
- return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
696
- },
697
- __wbg_static_accessor_WINDOW_fd0bc376bf0f8b42: function() {
698
- const ret = typeof window === 'undefined' ? null : window;
699
- return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
700
- },
701
- __wbg_then_7a850dae4493f353: function(arg0, arg1, arg2) {
702
- const ret = arg0.then(arg1, arg2);
703
- return ret;
704
- },
705
- __wbg_then_b830475380919203: function(arg0, arg1) {
706
- const ret = arg0.then(arg1);
707
- return ret;
708
- },
709
- __wbg_truncate_2ed7d68b99bcc8f6: function() { return handleError(function (arg0, arg1) {
710
- arg0.truncate(arg1);
711
- }, arguments); },
712
- __wbg_write_3e78f5b3224d701e: function() { return handleError(function (arg0, arg1, arg2, arg3) {
713
- const ret = arg0.write(getArrayU8FromWasm0(arg1, arg2), arg3);
714
- return ret;
715
- }, arguments); },
716
533
  __wbindgen_generic_0000000000000001: function(arg0, arg1) {
717
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 98, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
718
- const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__hd55bb211d6a08150);
719
- return ret;
720
- },
721
- __wbindgen_generic_0000000000000002: function(arg0, arg1) {
722
534
  // Cast intrinsic for `Ref(String) -> Externref`.
723
535
  const ret = getStringFromWasm0(arg0, arg1);
724
536
  return ret;
@@ -739,17 +551,6 @@ function __wbg_get_imports() {
739
551
  };
740
552
  }
741
553
 
742
- function wasm_bindgen__convert__closures_____invoke__hd55bb211d6a08150(arg0, arg1, arg2) {
743
- const ret = wasm.wasm_bindgen__convert__closures_____invoke__hd55bb211d6a08150(arg0, arg1, arg2);
744
- if (ret[1]) {
745
- throw takeFromExternrefTable0(ret[0]);
746
- }
747
- }
748
-
749
- function wasm_bindgen__convert__closures_____invoke__h76bd71bceeca2b95(arg0, arg1, arg2, arg3) {
750
- wasm.wasm_bindgen__convert__closures_____invoke__h76bd71bceeca2b95(arg0, arg1, arg2, arg3);
751
- }
752
-
753
554
  const CheckpointFinalization = (typeof FinalizationRegistry === 'undefined')
754
555
  ? { register: () => {}, unregister: () => {} }
755
556
  : new FinalizationRegistry(ptr => wasm.__wbg_checkpoint_free(ptr, 1));
@@ -775,10 +576,6 @@ function _assertClass(instance, klass) {
775
576
  }
776
577
  }
777
578
 
778
- const CLOSURE_DTORS = (typeof FinalizationRegistry === 'undefined')
779
- ? { register: () => {}, unregister: () => {} }
780
- : new FinalizationRegistry(state => wasm.__wbindgen_destroy_closure(state.a, state.b));
781
-
782
579
  function getArrayF32FromWasm0(ptr, len) {
783
580
  ptr = ptr >>> 0;
784
581
  return getFloat32ArrayMemory0().subarray(ptr / 4, ptr / 4 + len);
@@ -830,34 +627,6 @@ function isLikeNone(x) {
830
627
  return x === undefined || x === null;
831
628
  }
832
629
 
833
- function makeMutClosure(arg0, arg1, f) {
834
- const state = { a: arg0, b: arg1, cnt: 1 };
835
- const real = (...args) => {
836
-
837
- // First up with a closure we increment the internal reference
838
- // count. This ensures that the Rust closure environment won't
839
- // be deallocated while we're invoking it.
840
- state.cnt++;
841
- const a = state.a;
842
- state.a = 0;
843
- try {
844
- return f(a, state.b, ...args);
845
- } finally {
846
- state.a = a;
847
- real._wbg_cb_unref();
848
- }
849
- };
850
- real._wbg_cb_unref = () => {
851
- if (--state.cnt === 0) {
852
- wasm.__wbindgen_destroy_closure(state.a, state.b);
853
- state.a = 0;
854
- CLOSURE_DTORS.unregister(state);
855
- }
856
- };
857
- CLOSURE_DTORS.register(real, state, state);
858
- return real;
859
- }
860
-
861
630
  function passArrayF32ToWasm0(arg, malloc) {
862
631
  const ptr = malloc(arg.length * 4, 4) >>> 0;
863
632
  getFloat32ArrayMemory0().set(arg, ptr / 4);
package/sva_wasm_bg.wasm CHANGED
Binary file