@scalable-vector-audio/sva-wasm 0.5.0 → 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.0",
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,9 +52,10 @@ 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;
58
+ work(): any;
68
59
  readonly channels: number;
69
60
  readonly duration_secs: number;
70
61
  readonly sample_rate: number;
@@ -88,6 +79,10 @@ export class Stream {
88
79
  * `until` as `stream` takes it, `max_secs` counted from the checkpoint.
89
80
  */
90
81
  resume(checkpoint: Checkpoint, bindings: any, until: any, bits?: number | null, max_secs?: number | null): Stream;
82
+ /**
83
+ * `{ samples, proofs, priced_flops, waves }` since it opened or resumed.
84
+ */
85
+ work(): any;
91
86
  readonly block: number;
92
87
  readonly channels: number;
93
88
  readonly end: number | undefined;
@@ -112,22 +107,21 @@ export interface InitOutput {
112
107
  readonly __wbg_stream_free: (a: number, b: number) => void;
113
108
  readonly builtins: () => [number, number, number];
114
109
  readonly checkpoint_position: (a: number) => number;
115
- readonly composition_bound_cache: (a: number, b: number) => void;
116
110
  readonly composition_cache_bytes: (a: number) => number;
111
+ readonly composition_cache_entries: (a: number) => number;
112
+ readonly composition_cache_evictions: (a: number) => number;
117
113
  readonly composition_cache_max_bytes: (a: number) => number;
114
+ readonly composition_cache_policy: (a: number) => [number, number];
118
115
  readonly composition_clear_cache: (a: number) => void;
119
- readonly composition_clear_volatile: (a: number) => void;
120
116
  readonly composition_insert: (a: number, b: number, c: number, d: number, e: number) => void;
121
- readonly composition_is_persistent: (a: number) => number;
122
117
  readonly composition_new: (a: number, b: number) => number;
123
- readonly composition_persistent: (a: number, b: number, c: number, d: number, e: number, f: number) => any;
124
- readonly composition_persistent_bytes: (a: number) => number;
125
- readonly composition_persistent_max_bytes: (a: number) => number;
126
- 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];
127
- 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];
128
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];
129
- readonly composition_volatile_bytes: (a: number) => number;
130
- readonly composition_volatile_max_bytes: (a: number) => number;
131
125
  readonly outline: (a: number, b: number) => [number, number, number];
132
126
  readonly rendering_channels: (a: number) => number;
133
127
  readonly rendering_duration_secs: (a: number) => number;
@@ -136,6 +130,7 @@ export interface InitOutput {
136
130
  readonly rendering_samples: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number, number, number];
137
131
  readonly rendering_stats: (a: number) => [number, number, number];
138
132
  readonly rendering_target: (a: number) => [number, number];
133
+ readonly rendering_work: (a: number) => [number, number, number];
139
134
  readonly stream_block: (a: number) => number;
140
135
  readonly stream_channels: (a: number) => number;
141
136
  readonly stream_checkpoint: (a: number) => number;
@@ -144,14 +139,12 @@ export interface InitOutput {
144
139
  readonly stream_position: (a: number) => number;
145
140
  readonly stream_resume: (a: number, b: number, c: any, d: any, e: number, f: number, g: number) => [number, number, number];
146
141
  readonly stream_sample_rate: (a: number) => number;
147
- readonly wasm_bindgen__convert__closures_____invoke__h76bd71bceeca2b95: (a: number, b: number, c: any, d: any) => void;
148
- readonly wasm_bindgen__convert__closures_____invoke__hd55bb211d6a08150: (a: number, b: number, c: any) => [number, number];
142
+ readonly stream_work: (a: number) => [number, number, number];
149
143
  readonly __wbindgen_malloc: (a: number, b: number) => number;
150
144
  readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
151
145
  readonly __wbindgen_exn_store: (a: number) => void;
152
146
  readonly __externref_table_alloc: () => number;
153
147
  readonly __wbindgen_externrefs: WebAssembly.Table;
154
- readonly __wbindgen_destroy_closure: (a: number, b: number) => void;
155
148
  readonly __externref_table_dealloc: (a: number) => void;
156
149
  readonly __wbindgen_free: (a: number, b: number, c: number) => void;
157
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() {
@@ -298,6 +309,16 @@ export class Rendering {
298
309
  wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
299
310
  }
300
311
  }
312
+ /**
313
+ * @returns {any}
314
+ */
315
+ work() {
316
+ const ret = wasm.rendering_work(this.__wbg_ptr);
317
+ if (ret[2]) {
318
+ throw takeFromExternrefTable0(ret[1]);
319
+ }
320
+ return takeFromExternrefTable0(ret[0]);
321
+ }
301
322
  }
302
323
  if (Symbol.dispose) Rendering.prototype[Symbol.dispose] = Rendering.prototype.free;
303
324
 
@@ -395,6 +416,17 @@ export class Stream {
395
416
  const ret = wasm.stream_sample_rate(this.__wbg_ptr);
396
417
  return ret >>> 0;
397
418
  }
419
+ /**
420
+ * `{ samples, proofs, priced_flops, waves }` since it opened or resumed.
421
+ * @returns {any}
422
+ */
423
+ work() {
424
+ const ret = wasm.stream_work(this.__wbg_ptr);
425
+ if (ret[2]) {
426
+ throw takeFromExternrefTable0(ret[1]);
427
+ }
428
+ return takeFromExternrefTable0(ret[0]);
429
+ }
398
430
  }
399
431
  if (Symbol.dispose) Stream.prototype[Symbol.dispose] = Stream.prototype.free;
400
432
 
@@ -429,14 +461,6 @@ function __wbg_get_imports() {
429
461
  __wbg___wbindgen_copy_to_typed_array_cccd104be8cf0b8d: function(arg0, arg1, arg2) {
430
462
  new Uint8Array(arg2.buffer, arg2.byteOffset, arg2.byteLength).set(getArrayU8FromWasm0(arg0, arg1));
431
463
  },
432
- __wbg___wbindgen_is_falsy_4502df4d571fca70: function(arg0) {
433
- const ret = !arg0;
434
- return ret;
435
- },
436
- __wbg___wbindgen_is_function_fcda5e3902d732fe: function(arg0) {
437
- const ret = typeof(arg0) === 'function';
438
- return ret;
439
- },
440
464
  __wbg___wbindgen_is_null_5160b3e381865372: function(arg0) {
441
465
  const ret = arg0 === null;
442
466
  return ret;
@@ -462,55 +486,14 @@ function __wbg_get_imports() {
462
486
  __wbg___wbindgen_throw_5d9e815e6fdf150f: function(arg0, arg1) {
463
487
  throw new Error(getStringFromWasm0(arg0, arg1));
464
488
  },
465
- __wbg__wbg_cb_unref_997e73d32238e655: function(arg0) {
466
- arg0._wbg_cb_unref();
467
- },
468
- __wbg_call_6bcf8d3e20937e46: function() { return handleError(function (arg0, arg1, arg2) {
469
- const ret = arg0.call(arg1, arg2);
470
- return ret;
471
- }, arguments); },
472
- __wbg_close_1d55410e47fc11c8: function(arg0) {
473
- arg0.close();
474
- },
475
- __wbg_composition_new: function(arg0) {
476
- const ret = Composition.__wrap(arg0);
477
- return ret;
478
- },
479
- __wbg_createSyncAccessHandle_f2f0452f71047cd7: function(arg0) {
480
- const ret = arg0.createSyncAccessHandle();
481
- return ret;
482
- },
483
489
  __wbg_entries_972a87586902cf87: function(arg0) {
484
490
  const ret = Object.entries(arg0);
485
491
  return ret;
486
492
  },
487
- __wbg_flush_91458c8278aae724: function() { return handleError(function (arg0) {
488
- arg0.flush();
489
- }, arguments); },
490
493
  __wbg_from_a39669ce566077da: function(arg0) {
491
494
  const ret = Array.from(arg0);
492
495
  return ret;
493
496
  },
494
- __wbg_getDirectoryHandle_df6fb6f1fc6240ed: function(arg0, arg1, arg2, arg3) {
495
- const ret = arg0.getDirectoryHandle(getStringFromWasm0(arg1, arg2), arg3);
496
- return ret;
497
- },
498
- __wbg_getDirectory_31689baa30c0e94c: function(arg0) {
499
- const ret = arg0.getDirectory();
500
- return ret;
501
- },
502
- __wbg_getFileHandle_fbeae17e3423535f: function(arg0, arg1, arg2, arg3) {
503
- const ret = arg0.getFileHandle(getStringFromWasm0(arg1, arg2), arg3);
504
- return ret;
505
- },
506
- __wbg_getSize_479486b8ac438f8e: function() { return handleError(function (arg0) {
507
- const ret = arg0.getSize();
508
- return ret;
509
- }, arguments); },
510
- __wbg_get_989d0a1309644f2b: function() { return handleError(function (arg0, arg1) {
511
- const ret = Reflect.get(arg0, arg1);
512
- return ret;
513
- }, arguments); },
514
497
  __wbg_get_b1f0ab13c737f856: function(arg0, arg1) {
515
498
  const ret = arg0[arg1 >>> 0];
516
499
  return ret;
@@ -519,26 +502,6 @@ function __wbg_get_imports() {
519
502
  const ret = arg0[arg1 >>> 0];
520
503
  return ret;
521
504
  },
522
- __wbg_instanceof_FileSystemDirectoryHandle_a5c1bdaafba684ca: function(arg0) {
523
- let result;
524
- try {
525
- result = arg0 instanceof FileSystemDirectoryHandle;
526
- } catch (_) {
527
- result = false;
528
- }
529
- const ret = result;
530
- return ret;
531
- },
532
- __wbg_instanceof_FileSystemFileHandle_aba527fd4c84a882: function(arg0) {
533
- let result;
534
- try {
535
- result = arg0 instanceof FileSystemFileHandle;
536
- } catch (_) {
537
- result = false;
538
- }
539
- const ret = result;
540
- return ret;
541
- },
542
505
  __wbg_instanceof_Object_87732cb922ac2e2c: function(arg0) {
543
506
  let result;
544
507
  try {
@@ -549,155 +512,25 @@ function __wbg_get_imports() {
549
512
  const ret = result;
550
513
  return ret;
551
514
  },
552
- __wbg_instanceof_WorkerGlobalScope_0c1a6411473b843f: function(arg0) {
553
- let result;
554
- try {
555
- result = arg0 instanceof WorkerGlobalScope;
556
- } catch (_) {
557
- result = false;
558
- }
559
- const ret = result;
560
- return ret;
561
- },
562
- __wbg_keys_4d3b6ee519555a72: function(arg0) {
563
- const ret = arg0.keys();
564
- return ret;
565
- },
566
515
  __wbg_length_4e1adc0d42e23620: function(arg0) {
567
516
  const ret = arg0.length;
568
517
  return ret;
569
518
  },
570
- __wbg_navigator_d25c0f071226f233: function(arg0) {
571
- const ret = arg0.navigator;
572
- return ret;
573
- },
574
- __wbg_new_60a94df323701352: function(arg0, arg1) {
519
+ __wbg_new_26350c3c2446a215: function(arg0, arg1) {
575
520
  const ret = new Error(getStringFromWasm0(arg0, arg1));
576
521
  return ret;
577
522
  },
578
- __wbg_new_8f72ed7c652bf5a2: function(arg0, arg1) {
579
- try {
580
- var state0 = {a: arg0, b: arg1};
581
- var cb0 = (arg0, arg1) => {
582
- const a = state0.a;
583
- state0.a = 0;
584
- try {
585
- return wasm_bindgen__convert__closures_____invoke__h76bd71bceeca2b95(a, state0.b, arg0, arg1);
586
- } finally {
587
- state0.a = a;
588
- }
589
- };
590
- const ret = new Promise(cb0);
591
- return ret;
592
- } finally {
593
- state0.a = 0;
594
- }
595
- },
596
- __wbg_new_bebc3f4757acf305: function() {
597
- const ret = new Object();
598
- return ret;
599
- },
600
- __wbg_new_typed_6f8b0d724fe26c07: function(arg0, arg1) {
601
- try {
602
- var state0 = {a: arg0, b: arg1};
603
- var cb0 = (arg0, arg1) => {
604
- const a = state0.a;
605
- state0.a = 0;
606
- try {
607
- return wasm_bindgen__convert__closures_____invoke__h76bd71bceeca2b95(a, state0.b, arg0, arg1);
608
- } finally {
609
- state0.a = a;
610
- }
611
- };
612
- const ret = new Promise(cb0);
613
- return ret;
614
- } finally {
615
- state0.a = 0;
616
- }
617
- },
618
- __wbg_next_a128c458fd40a0a5: function() { return handleError(function (arg0) {
619
- const ret = arg0.next();
620
- return ret;
621
- }, arguments); },
622
- __wbg_parse_673c654d2b233b97: function() { return handleError(function (arg0, arg1) {
523
+ __wbg_parse_e158b3a26b0b7727: function() { return handleError(function (arg0, arg1) {
623
524
  const ret = JSON.parse(getStringFromWasm0(arg0, arg1));
624
525
  return ret;
625
526
  }, arguments); },
626
- __wbg_queueMicrotask_85c90f6987555d65: function(arg0) {
627
- const ret = arg0.queueMicrotask;
628
- return ret;
629
- },
630
- __wbg_queueMicrotask_f6a1fa10b81d1fc0: function(arg0) {
631
- queueMicrotask(arg0);
632
- },
633
- __wbg_read_259baab664b5f318: function() { return handleError(function (arg0, arg1, arg2, arg3) {
634
- const ret = arg0.read(getArrayU8FromWasm0(arg1, arg2), arg3);
635
- return ret;
636
- }, arguments); },
637
- __wbg_removeEntry_c72a6de718a4679d: function(arg0, arg1, arg2) {
638
- const ret = arg0.removeEntry(getStringFromWasm0(arg1, arg2));
639
- return ret;
640
- },
641
- __wbg_resolve_35ec7e0c6af4c82c: function(arg0) {
642
- const ret = Promise.resolve(arg0);
643
- return ret;
644
- },
645
- __wbg_setTimeout_68c2cba08a966520: function() { return handleError(function (arg0, arg1, arg2) {
646
- const ret = arg0.setTimeout(arg1, arg2);
647
- return ret;
648
- }, arguments); },
649
- __wbg_set_at_40af7269bbcce291: function(arg0, arg1) {
650
- arg0.at = arg1;
651
- },
652
- __wbg_set_create_389985224a53c83d: function(arg0, arg1) {
653
- arg0.create = arg1 !== 0;
654
- },
655
- __wbg_set_create_8c556c6febf6436c: function(arg0, arg1) {
656
- arg0.create = arg1 !== 0;
657
- },
658
- __wbg_set_name_f2e0b4f6b6b3d728: function(arg0, arg1, arg2) {
527
+ __wbg_set_name_2739c17d34a6a152: function(arg0, arg1, arg2) {
659
528
  arg0.name = getStringFromWasm0(arg1, arg2);
660
529
  },
661
- __wbg_set_refusal_0a35a4ef06d51ed7: function(arg0, arg1) {
530
+ __wbg_set_refusal_b6aab88e0790b056: function(arg0, arg1) {
662
531
  arg0.refusal = arg1;
663
532
  },
664
- __wbg_static_accessor_GLOBAL_8eb4cd83130a11a0: function() {
665
- const ret = typeof global === 'undefined' ? null : global;
666
- return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
667
- },
668
- __wbg_static_accessor_GLOBAL_THIS_1e7044f654e934db: function() {
669
- const ret = typeof globalThis === 'undefined' ? null : globalThis;
670
- return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
671
- },
672
- __wbg_static_accessor_SELF_d8b50611246a6d92: function() {
673
- const ret = typeof self === 'undefined' ? null : self;
674
- return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
675
- },
676
- __wbg_static_accessor_WINDOW_fd0bc376bf0f8b42: function() {
677
- const ret = typeof window === 'undefined' ? null : window;
678
- return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
679
- },
680
- __wbg_then_7a850dae4493f353: function(arg0, arg1, arg2) {
681
- const ret = arg0.then(arg1, arg2);
682
- return ret;
683
- },
684
- __wbg_then_b830475380919203: function(arg0, arg1) {
685
- const ret = arg0.then(arg1);
686
- return ret;
687
- },
688
- __wbg_truncate_2ed7d68b99bcc8f6: function() { return handleError(function (arg0, arg1) {
689
- arg0.truncate(arg1);
690
- }, arguments); },
691
- __wbg_write_3e78f5b3224d701e: function() { return handleError(function (arg0, arg1, arg2, arg3) {
692
- const ret = arg0.write(getArrayU8FromWasm0(arg1, arg2), arg3);
693
- return ret;
694
- }, arguments); },
695
533
  __wbindgen_generic_0000000000000001: function(arg0, arg1) {
696
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 99, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
697
- const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__hd55bb211d6a08150);
698
- return ret;
699
- },
700
- __wbindgen_generic_0000000000000002: function(arg0, arg1) {
701
534
  // Cast intrinsic for `Ref(String) -> Externref`.
702
535
  const ret = getStringFromWasm0(arg0, arg1);
703
536
  return ret;
@@ -718,17 +551,6 @@ function __wbg_get_imports() {
718
551
  };
719
552
  }
720
553
 
721
- function wasm_bindgen__convert__closures_____invoke__hd55bb211d6a08150(arg0, arg1, arg2) {
722
- const ret = wasm.wasm_bindgen__convert__closures_____invoke__hd55bb211d6a08150(arg0, arg1, arg2);
723
- if (ret[1]) {
724
- throw takeFromExternrefTable0(ret[0]);
725
- }
726
- }
727
-
728
- function wasm_bindgen__convert__closures_____invoke__h76bd71bceeca2b95(arg0, arg1, arg2, arg3) {
729
- wasm.wasm_bindgen__convert__closures_____invoke__h76bd71bceeca2b95(arg0, arg1, arg2, arg3);
730
- }
731
-
732
554
  const CheckpointFinalization = (typeof FinalizationRegistry === 'undefined')
733
555
  ? { register: () => {}, unregister: () => {} }
734
556
  : new FinalizationRegistry(ptr => wasm.__wbg_checkpoint_free(ptr, 1));
@@ -754,10 +576,6 @@ function _assertClass(instance, klass) {
754
576
  }
755
577
  }
756
578
 
757
- const CLOSURE_DTORS = (typeof FinalizationRegistry === 'undefined')
758
- ? { register: () => {}, unregister: () => {} }
759
- : new FinalizationRegistry(state => wasm.__wbindgen_destroy_closure(state.a, state.b));
760
-
761
579
  function getArrayF32FromWasm0(ptr, len) {
762
580
  ptr = ptr >>> 0;
763
581
  return getFloat32ArrayMemory0().subarray(ptr / 4, ptr / 4 + len);
@@ -809,34 +627,6 @@ function isLikeNone(x) {
809
627
  return x === undefined || x === null;
810
628
  }
811
629
 
812
- function makeMutClosure(arg0, arg1, f) {
813
- const state = { a: arg0, b: arg1, cnt: 1 };
814
- const real = (...args) => {
815
-
816
- // First up with a closure we increment the internal reference
817
- // count. This ensures that the Rust closure environment won't
818
- // be deallocated while we're invoking it.
819
- state.cnt++;
820
- const a = state.a;
821
- state.a = 0;
822
- try {
823
- return f(a, state.b, ...args);
824
- } finally {
825
- state.a = a;
826
- real._wbg_cb_unref();
827
- }
828
- };
829
- real._wbg_cb_unref = () => {
830
- if (--state.cnt === 0) {
831
- wasm.__wbindgen_destroy_closure(state.a, state.b);
832
- state.a = 0;
833
- CLOSURE_DTORS.unregister(state);
834
- }
835
- };
836
- CLOSURE_DTORS.register(real, state, state);
837
- return real;
838
- }
839
-
840
630
  function passArrayF32ToWasm0(arg, malloc) {
841
631
  const ptr = malloc(arg.length * 4, 4) >>> 0;
842
632
  getFloat32ArrayMemory0().set(arg, ptr / 4);
package/sva_wasm_bg.wasm CHANGED
Binary file