@spooky-sync/ssp-wasm 0.0.1-canary.11

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 ADDED
@@ -0,0 +1,27 @@
1
+ {
2
+ "name": "@spooky-sync/ssp-wasm",
3
+ "version": "0.0.1-canary.11",
4
+ "main": "pkg/ssp_wasm.js",
5
+ "types": "pkg/ssp_wasm.d.ts",
6
+ "files": [
7
+ "pkg"
8
+ ],
9
+ "repository": {
10
+ "type": "git",
11
+ "url": "https://github.com/mono424/spooky.git",
12
+ "directory": "packages/ssp-wasm"
13
+ },
14
+ "publishConfig": {
15
+ "access": "public"
16
+ },
17
+ "scripts": {
18
+ "build": "wasm-pack build --target web --out-dir pkg",
19
+ "test": "vitest run",
20
+ "test:watch": "vitest"
21
+ },
22
+ "devDependencies": {
23
+ "typescript": "^5.0.0",
24
+ "vitest": "^3.0.0",
25
+ "wasm-pack": "^0.13.1"
26
+ }
27
+ }
@@ -0,0 +1,17 @@
1
+ {
2
+ "name": "ssp-wasm",
3
+ "type": "module",
4
+ "description": "WASM bindings for ssp",
5
+ "version": "0.1.0",
6
+ "license": "MIT",
7
+ "files": [
8
+ "ssp_wasm_bg.wasm",
9
+ "ssp_wasm.js",
10
+ "ssp_wasm.d.ts"
11
+ ],
12
+ "main": "ssp_wasm.js",
13
+ "types": "ssp_wasm.d.ts",
14
+ "sideEffects": [
15
+ "./snippets/*"
16
+ ]
17
+ }
@@ -0,0 +1,108 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+
4
+ export interface WasmViewUpdate {
5
+ query_id: string;
6
+ result_hash: string;
7
+ result_data: [string, number][];
8
+ delta: {
9
+ additions: [string, number][];
10
+ removals: string[];
11
+ updates: [string, number][];
12
+ };
13
+ }
14
+
15
+ export interface WasmViewConfig {
16
+ id: string;
17
+ surql: string;
18
+ params?: Record<string, any>;
19
+ clientId: string;
20
+ ttl: string;
21
+ lastActiveAt: string;
22
+ safe_params?: Record<string, any>;
23
+ format?: 'flat' | 'tree' | 'streaming';
24
+ }
25
+
26
+ export interface WasmIngestItem {
27
+ table: string;
28
+ op: string;
29
+ id: string;
30
+ record: any;
31
+ }
32
+
33
+
34
+
35
+ export class SpookyProcessor {
36
+ free(): void;
37
+ [Symbol.dispose](): void;
38
+ /**
39
+ * Load circuit state from a JSON string
40
+ */
41
+ load_state(state: string): void;
42
+ /**
43
+ * Save the current circuit state as a JSON string
44
+ */
45
+ save_state(): string;
46
+ /**
47
+ * Register a new materialized view
48
+ */
49
+ register_view(config: any): any;
50
+ /**
51
+ * Unregister a view by ID
52
+ */
53
+ unregister_view(id: string): void;
54
+ constructor();
55
+ /**
56
+ * Ingest a record into the stream processor
57
+ */
58
+ ingest(table: string, op: string, id: string, record: any): any;
59
+ }
60
+
61
+ /**
62
+ * Called when WASM module is loaded
63
+ */
64
+ export function init(): void;
65
+
66
+ export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
67
+
68
+ export interface InitOutput {
69
+ readonly memory: WebAssembly.Memory;
70
+ readonly __wbg_spookyprocessor_free: (a: number, b: number) => void;
71
+ readonly init: () => void;
72
+ readonly spookyprocessor_ingest: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: any) => [number, number, number];
73
+ readonly spookyprocessor_load_state: (a: number, b: number, c: number) => [number, number];
74
+ readonly spookyprocessor_new: () => number;
75
+ readonly spookyprocessor_register_view: (a: number, b: any) => [number, number, number];
76
+ readonly spookyprocessor_save_state: (a: number) => [number, number, number, number];
77
+ readonly spookyprocessor_unregister_view: (a: number, b: number, c: number) => void;
78
+ readonly __wbindgen_malloc: (a: number, b: number) => number;
79
+ readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
80
+ readonly __wbindgen_exn_store: (a: number) => void;
81
+ readonly __externref_table_alloc: () => number;
82
+ readonly __wbindgen_externrefs: WebAssembly.Table;
83
+ readonly __externref_table_dealloc: (a: number) => void;
84
+ readonly __wbindgen_free: (a: number, b: number, c: number) => void;
85
+ readonly __wbindgen_start: () => void;
86
+ }
87
+
88
+ export type SyncInitInput = BufferSource | WebAssembly.Module;
89
+
90
+ /**
91
+ * Instantiates the given `module`, which can either be bytes or
92
+ * a precompiled `WebAssembly.Module`.
93
+ *
94
+ * @param {{ module: SyncInitInput }} module - Passing `SyncInitInput` directly is deprecated.
95
+ *
96
+ * @returns {InitOutput}
97
+ */
98
+ export function initSync(module: { module: SyncInitInput } | SyncInitInput): InitOutput;
99
+
100
+ /**
101
+ * If `module_or_path` is {RequestInfo} or {URL}, makes a request and
102
+ * for everything else, calls `WebAssembly.instantiate` directly.
103
+ *
104
+ * @param {{ module_or_path: InitInput | Promise<InitInput> }} module_or_path - Passing `InitInput` directly is deprecated.
105
+ *
106
+ * @returns {Promise<InitOutput>}
107
+ */
108
+ export default function __wbg_init (module_or_path?: { module_or_path: InitInput | Promise<InitInput> } | InitInput | Promise<InitInput>): Promise<InitOutput>;
@@ -0,0 +1,595 @@
1
+ let wasm;
2
+
3
+ function addToExternrefTable0(obj) {
4
+ const idx = wasm.__externref_table_alloc();
5
+ wasm.__wbindgen_externrefs.set(idx, obj);
6
+ return idx;
7
+ }
8
+
9
+ function debugString(val) {
10
+ // primitive types
11
+ const type = typeof val;
12
+ if (type == 'number' || type == 'boolean' || val == null) {
13
+ return `${val}`;
14
+ }
15
+ if (type == 'string') {
16
+ return `"${val}"`;
17
+ }
18
+ if (type == 'symbol') {
19
+ const description = val.description;
20
+ if (description == null) {
21
+ return 'Symbol';
22
+ } else {
23
+ return `Symbol(${description})`;
24
+ }
25
+ }
26
+ if (type == 'function') {
27
+ const name = val.name;
28
+ if (typeof name == 'string' && name.length > 0) {
29
+ return `Function(${name})`;
30
+ } else {
31
+ return 'Function';
32
+ }
33
+ }
34
+ // objects
35
+ if (Array.isArray(val)) {
36
+ const length = val.length;
37
+ let debug = '[';
38
+ if (length > 0) {
39
+ debug += debugString(val[0]);
40
+ }
41
+ for(let i = 1; i < length; i++) {
42
+ debug += ', ' + debugString(val[i]);
43
+ }
44
+ debug += ']';
45
+ return debug;
46
+ }
47
+ // Test for built-in
48
+ const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
49
+ let className;
50
+ if (builtInMatches && builtInMatches.length > 1) {
51
+ className = builtInMatches[1];
52
+ } else {
53
+ // Failed to match the standard '[object ClassName]'
54
+ return toString.call(val);
55
+ }
56
+ if (className == 'Object') {
57
+ // we're a user defined class or Object
58
+ // JSON.stringify avoids problems with cycles, and is generally much
59
+ // easier than looping through ownProperties of `val`.
60
+ try {
61
+ return 'Object(' + JSON.stringify(val) + ')';
62
+ } catch (_) {
63
+ return 'Object';
64
+ }
65
+ }
66
+ // errors
67
+ if (val instanceof Error) {
68
+ return `${val.name}: ${val.message}\n${val.stack}`;
69
+ }
70
+ // TODO we could test for more things here, like `Set`s and `Map`s.
71
+ return className;
72
+ }
73
+
74
+ function getArrayU8FromWasm0(ptr, len) {
75
+ ptr = ptr >>> 0;
76
+ return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
77
+ }
78
+
79
+ let cachedDataViewMemory0 = null;
80
+ function getDataViewMemory0() {
81
+ if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
82
+ cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
83
+ }
84
+ return cachedDataViewMemory0;
85
+ }
86
+
87
+ function getStringFromWasm0(ptr, len) {
88
+ ptr = ptr >>> 0;
89
+ return decodeText(ptr, len);
90
+ }
91
+
92
+ let cachedUint8ArrayMemory0 = null;
93
+ function getUint8ArrayMemory0() {
94
+ if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
95
+ cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
96
+ }
97
+ return cachedUint8ArrayMemory0;
98
+ }
99
+
100
+ function handleError(f, args) {
101
+ try {
102
+ return f.apply(this, args);
103
+ } catch (e) {
104
+ const idx = addToExternrefTable0(e);
105
+ wasm.__wbindgen_exn_store(idx);
106
+ }
107
+ }
108
+
109
+ function isLikeNone(x) {
110
+ return x === undefined || x === null;
111
+ }
112
+
113
+ function passStringToWasm0(arg, malloc, realloc) {
114
+ if (realloc === undefined) {
115
+ const buf = cachedTextEncoder.encode(arg);
116
+ const ptr = malloc(buf.length, 1) >>> 0;
117
+ getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
118
+ WASM_VECTOR_LEN = buf.length;
119
+ return ptr;
120
+ }
121
+
122
+ let len = arg.length;
123
+ let ptr = malloc(len, 1) >>> 0;
124
+
125
+ const mem = getUint8ArrayMemory0();
126
+
127
+ let offset = 0;
128
+
129
+ for (; offset < len; offset++) {
130
+ const code = arg.charCodeAt(offset);
131
+ if (code > 0x7F) break;
132
+ mem[ptr + offset] = code;
133
+ }
134
+ if (offset !== len) {
135
+ if (offset !== 0) {
136
+ arg = arg.slice(offset);
137
+ }
138
+ ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
139
+ const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
140
+ const ret = cachedTextEncoder.encodeInto(arg, view);
141
+
142
+ offset += ret.written;
143
+ ptr = realloc(ptr, len, offset, 1) >>> 0;
144
+ }
145
+
146
+ WASM_VECTOR_LEN = offset;
147
+ return ptr;
148
+ }
149
+
150
+ function takeFromExternrefTable0(idx) {
151
+ const value = wasm.__wbindgen_externrefs.get(idx);
152
+ wasm.__externref_table_dealloc(idx);
153
+ return value;
154
+ }
155
+
156
+ let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
157
+ cachedTextDecoder.decode();
158
+ const MAX_SAFARI_DECODE_BYTES = 2146435072;
159
+ let numBytesDecoded = 0;
160
+ function decodeText(ptr, len) {
161
+ numBytesDecoded += len;
162
+ if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
163
+ cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
164
+ cachedTextDecoder.decode();
165
+ numBytesDecoded = len;
166
+ }
167
+ return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
168
+ }
169
+
170
+ const cachedTextEncoder = new TextEncoder();
171
+
172
+ if (!('encodeInto' in cachedTextEncoder)) {
173
+ cachedTextEncoder.encodeInto = function (arg, view) {
174
+ const buf = cachedTextEncoder.encode(arg);
175
+ view.set(buf);
176
+ return {
177
+ read: arg.length,
178
+ written: buf.length
179
+ };
180
+ }
181
+ }
182
+
183
+ let WASM_VECTOR_LEN = 0;
184
+
185
+ const SpookyProcessorFinalization = (typeof FinalizationRegistry === 'undefined')
186
+ ? { register: () => {}, unregister: () => {} }
187
+ : new FinalizationRegistry(ptr => wasm.__wbg_spookyprocessor_free(ptr >>> 0, 1));
188
+
189
+ export class SpookyProcessor {
190
+ __destroy_into_raw() {
191
+ const ptr = this.__wbg_ptr;
192
+ this.__wbg_ptr = 0;
193
+ SpookyProcessorFinalization.unregister(this);
194
+ return ptr;
195
+ }
196
+ free() {
197
+ const ptr = this.__destroy_into_raw();
198
+ wasm.__wbg_spookyprocessor_free(ptr, 0);
199
+ }
200
+ /**
201
+ * Load circuit state from a JSON string
202
+ * @param {string} state
203
+ */
204
+ load_state(state) {
205
+ const ptr0 = passStringToWasm0(state, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
206
+ const len0 = WASM_VECTOR_LEN;
207
+ const ret = wasm.spookyprocessor_load_state(this.__wbg_ptr, ptr0, len0);
208
+ if (ret[1]) {
209
+ throw takeFromExternrefTable0(ret[0]);
210
+ }
211
+ }
212
+ /**
213
+ * Save the current circuit state as a JSON string
214
+ * @returns {string}
215
+ */
216
+ save_state() {
217
+ let deferred2_0;
218
+ let deferred2_1;
219
+ try {
220
+ const ret = wasm.spookyprocessor_save_state(this.__wbg_ptr);
221
+ var ptr1 = ret[0];
222
+ var len1 = ret[1];
223
+ if (ret[3]) {
224
+ ptr1 = 0; len1 = 0;
225
+ throw takeFromExternrefTable0(ret[2]);
226
+ }
227
+ deferred2_0 = ptr1;
228
+ deferred2_1 = len1;
229
+ return getStringFromWasm0(ptr1, len1);
230
+ } finally {
231
+ wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
232
+ }
233
+ }
234
+ /**
235
+ * Register a new materialized view
236
+ * @param {any} config
237
+ * @returns {any}
238
+ */
239
+ register_view(config) {
240
+ const ret = wasm.spookyprocessor_register_view(this.__wbg_ptr, config);
241
+ if (ret[2]) {
242
+ throw takeFromExternrefTable0(ret[1]);
243
+ }
244
+ return takeFromExternrefTable0(ret[0]);
245
+ }
246
+ /**
247
+ * Unregister a view by ID
248
+ * @param {string} id
249
+ */
250
+ unregister_view(id) {
251
+ const ptr0 = passStringToWasm0(id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
252
+ const len0 = WASM_VECTOR_LEN;
253
+ wasm.spookyprocessor_unregister_view(this.__wbg_ptr, ptr0, len0);
254
+ }
255
+ constructor() {
256
+ const ret = wasm.spookyprocessor_new();
257
+ this.__wbg_ptr = ret >>> 0;
258
+ SpookyProcessorFinalization.register(this, this.__wbg_ptr, this);
259
+ return this;
260
+ }
261
+ /**
262
+ * Ingest a record into the stream processor
263
+ * @param {string} table
264
+ * @param {string} op
265
+ * @param {string} id
266
+ * @param {any} record
267
+ * @returns {any}
268
+ */
269
+ ingest(table, op, id, record) {
270
+ const ptr0 = passStringToWasm0(table, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
271
+ const len0 = WASM_VECTOR_LEN;
272
+ const ptr1 = passStringToWasm0(op, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
273
+ const len1 = WASM_VECTOR_LEN;
274
+ const ptr2 = passStringToWasm0(id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
275
+ const len2 = WASM_VECTOR_LEN;
276
+ const ret = wasm.spookyprocessor_ingest(this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2, record);
277
+ if (ret[2]) {
278
+ throw takeFromExternrefTable0(ret[1]);
279
+ }
280
+ return takeFromExternrefTable0(ret[0]);
281
+ }
282
+ }
283
+ if (Symbol.dispose) SpookyProcessor.prototype[Symbol.dispose] = SpookyProcessor.prototype.free;
284
+
285
+ /**
286
+ * Called when WASM module is loaded
287
+ */
288
+ export function init() {
289
+ wasm.init();
290
+ }
291
+
292
+ const EXPECTED_RESPONSE_TYPES = new Set(['basic', 'cors', 'default']);
293
+
294
+ async function __wbg_load(module, imports) {
295
+ if (typeof Response === 'function' && module instanceof Response) {
296
+ if (typeof WebAssembly.instantiateStreaming === 'function') {
297
+ try {
298
+ return await WebAssembly.instantiateStreaming(module, imports);
299
+ } catch (e) {
300
+ const validResponse = module.ok && EXPECTED_RESPONSE_TYPES.has(module.type);
301
+
302
+ if (validResponse && module.headers.get('Content-Type') !== 'application/wasm') {
303
+ console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n", e);
304
+
305
+ } else {
306
+ throw e;
307
+ }
308
+ }
309
+ }
310
+
311
+ const bytes = await module.arrayBuffer();
312
+ return await WebAssembly.instantiate(bytes, imports);
313
+ } else {
314
+ const instance = await WebAssembly.instantiate(module, imports);
315
+
316
+ if (instance instanceof WebAssembly.Instance) {
317
+ return { instance, module };
318
+ } else {
319
+ return instance;
320
+ }
321
+ }
322
+ }
323
+
324
+ function __wbg_get_imports() {
325
+ const imports = {};
326
+ imports.wbg = {};
327
+ imports.wbg.__wbg_Error_52673b7de5a0ca89 = function(arg0, arg1) {
328
+ const ret = Error(getStringFromWasm0(arg0, arg1));
329
+ return ret;
330
+ };
331
+ imports.wbg.__wbg_String_8f0eb39a4a4c2f66 = function(arg0, arg1) {
332
+ const ret = String(arg1);
333
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
334
+ const len1 = WASM_VECTOR_LEN;
335
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
336
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
337
+ };
338
+ imports.wbg.__wbg___wbindgen_bigint_get_as_i64_6e32f5e6aff02e1d = function(arg0, arg1) {
339
+ const v = arg1;
340
+ const ret = typeof(v) === 'bigint' ? v : undefined;
341
+ getDataViewMemory0().setBigInt64(arg0 + 8 * 1, isLikeNone(ret) ? BigInt(0) : ret, true);
342
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
343
+ };
344
+ imports.wbg.__wbg___wbindgen_boolean_get_dea25b33882b895b = function(arg0) {
345
+ const v = arg0;
346
+ const ret = typeof(v) === 'boolean' ? v : undefined;
347
+ return isLikeNone(ret) ? 0xFFFFFF : ret ? 1 : 0;
348
+ };
349
+ imports.wbg.__wbg___wbindgen_debug_string_adfb662ae34724b6 = function(arg0, arg1) {
350
+ const ret = debugString(arg1);
351
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
352
+ const len1 = WASM_VECTOR_LEN;
353
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
354
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
355
+ };
356
+ imports.wbg.__wbg___wbindgen_in_0d3e1e8f0c669317 = function(arg0, arg1) {
357
+ const ret = arg0 in arg1;
358
+ return ret;
359
+ };
360
+ imports.wbg.__wbg___wbindgen_is_bigint_0e1a2e3f55cfae27 = function(arg0) {
361
+ const ret = typeof(arg0) === 'bigint';
362
+ return ret;
363
+ };
364
+ imports.wbg.__wbg___wbindgen_is_function_8d400b8b1af978cd = function(arg0) {
365
+ const ret = typeof(arg0) === 'function';
366
+ return ret;
367
+ };
368
+ imports.wbg.__wbg___wbindgen_is_object_ce774f3490692386 = function(arg0) {
369
+ const val = arg0;
370
+ const ret = typeof(val) === 'object' && val !== null;
371
+ return ret;
372
+ };
373
+ imports.wbg.__wbg___wbindgen_jsval_eq_b6101cc9cef1fe36 = function(arg0, arg1) {
374
+ const ret = arg0 === arg1;
375
+ return ret;
376
+ };
377
+ imports.wbg.__wbg___wbindgen_jsval_loose_eq_766057600fdd1b0d = function(arg0, arg1) {
378
+ const ret = arg0 == arg1;
379
+ return ret;
380
+ };
381
+ imports.wbg.__wbg___wbindgen_number_get_9619185a74197f95 = function(arg0, arg1) {
382
+ const obj = arg1;
383
+ const ret = typeof(obj) === 'number' ? obj : undefined;
384
+ getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
385
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
386
+ };
387
+ imports.wbg.__wbg___wbindgen_string_get_a2a31e16edf96e42 = function(arg0, arg1) {
388
+ const obj = arg1;
389
+ const ret = typeof(obj) === 'string' ? obj : undefined;
390
+ var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
391
+ var len1 = WASM_VECTOR_LEN;
392
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
393
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
394
+ };
395
+ imports.wbg.__wbg___wbindgen_throw_dd24417ed36fc46e = function(arg0, arg1) {
396
+ throw new Error(getStringFromWasm0(arg0, arg1));
397
+ };
398
+ imports.wbg.__wbg_call_abb4ff46ce38be40 = function() { return handleError(function (arg0, arg1) {
399
+ const ret = arg0.call(arg1);
400
+ return ret;
401
+ }, arguments) };
402
+ imports.wbg.__wbg_done_62ea16af4ce34b24 = function(arg0) {
403
+ const ret = arg0.done;
404
+ return ret;
405
+ };
406
+ imports.wbg.__wbg_entries_83c79938054e065f = function(arg0) {
407
+ const ret = Object.entries(arg0);
408
+ return ret;
409
+ };
410
+ imports.wbg.__wbg_get_6b7bd52aca3f9671 = function(arg0, arg1) {
411
+ const ret = arg0[arg1 >>> 0];
412
+ return ret;
413
+ };
414
+ imports.wbg.__wbg_get_af9dab7e9603ea93 = function() { return handleError(function (arg0, arg1) {
415
+ const ret = Reflect.get(arg0, arg1);
416
+ return ret;
417
+ }, arguments) };
418
+ imports.wbg.__wbg_instanceof_ArrayBuffer_f3320d2419cd0355 = function(arg0) {
419
+ let result;
420
+ try {
421
+ result = arg0 instanceof ArrayBuffer;
422
+ } catch (_) {
423
+ result = false;
424
+ }
425
+ const ret = result;
426
+ return ret;
427
+ };
428
+ imports.wbg.__wbg_instanceof_Map_084be8da74364158 = function(arg0) {
429
+ let result;
430
+ try {
431
+ result = arg0 instanceof Map;
432
+ } catch (_) {
433
+ result = false;
434
+ }
435
+ const ret = result;
436
+ return ret;
437
+ };
438
+ imports.wbg.__wbg_instanceof_Uint8Array_da54ccc9d3e09434 = function(arg0) {
439
+ let result;
440
+ try {
441
+ result = arg0 instanceof Uint8Array;
442
+ } catch (_) {
443
+ result = false;
444
+ }
445
+ const ret = result;
446
+ return ret;
447
+ };
448
+ imports.wbg.__wbg_isArray_51fd9e6422c0a395 = function(arg0) {
449
+ const ret = Array.isArray(arg0);
450
+ return ret;
451
+ };
452
+ imports.wbg.__wbg_isSafeInteger_ae7d3f054d55fa16 = function(arg0) {
453
+ const ret = Number.isSafeInteger(arg0);
454
+ return ret;
455
+ };
456
+ imports.wbg.__wbg_iterator_27b7c8b35ab3e86b = function() {
457
+ const ret = Symbol.iterator;
458
+ return ret;
459
+ };
460
+ imports.wbg.__wbg_length_22ac23eaec9d8053 = function(arg0) {
461
+ const ret = arg0.length;
462
+ return ret;
463
+ };
464
+ imports.wbg.__wbg_length_d45040a40c570362 = function(arg0) {
465
+ const ret = arg0.length;
466
+ return ret;
467
+ };
468
+ imports.wbg.__wbg_log_1d990106d99dacb7 = function(arg0) {
469
+ console.log(arg0);
470
+ };
471
+ imports.wbg.__wbg_new_1ba21ce319a06297 = function() {
472
+ const ret = new Object();
473
+ return ret;
474
+ };
475
+ imports.wbg.__wbg_new_25f239778d6112b9 = function() {
476
+ const ret = new Array();
477
+ return ret;
478
+ };
479
+ imports.wbg.__wbg_new_6421f6084cc5bc5a = function(arg0) {
480
+ const ret = new Uint8Array(arg0);
481
+ return ret;
482
+ };
483
+ imports.wbg.__wbg_next_138a17bbf04e926c = function(arg0) {
484
+ const ret = arg0.next;
485
+ return ret;
486
+ };
487
+ imports.wbg.__wbg_next_3cfe5c0fe2a4cc53 = function() { return handleError(function (arg0) {
488
+ const ret = arg0.next();
489
+ return ret;
490
+ }, arguments) };
491
+ imports.wbg.__wbg_prototypesetcall_dfe9b766cdc1f1fd = function(arg0, arg1, arg2) {
492
+ Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), arg2);
493
+ };
494
+ imports.wbg.__wbg_set_3f1d0b984ed272ed = function(arg0, arg1, arg2) {
495
+ arg0[arg1] = arg2;
496
+ };
497
+ imports.wbg.__wbg_set_7df433eea03a5c14 = function(arg0, arg1, arg2) {
498
+ arg0[arg1 >>> 0] = arg2;
499
+ };
500
+ imports.wbg.__wbg_value_57b7b035e117f7ee = function(arg0) {
501
+ const ret = arg0.value;
502
+ return ret;
503
+ };
504
+ imports.wbg.__wbindgen_cast_2241b6af4c4b2941 = function(arg0, arg1) {
505
+ // Cast intrinsic for `Ref(String) -> Externref`.
506
+ const ret = getStringFromWasm0(arg0, arg1);
507
+ return ret;
508
+ };
509
+ imports.wbg.__wbindgen_cast_4625c577ab2ec9ee = function(arg0) {
510
+ // Cast intrinsic for `U64 -> Externref`.
511
+ const ret = BigInt.asUintN(64, arg0);
512
+ return ret;
513
+ };
514
+ imports.wbg.__wbindgen_cast_9ae0607507abb057 = function(arg0) {
515
+ // Cast intrinsic for `I64 -> Externref`.
516
+ const ret = arg0;
517
+ return ret;
518
+ };
519
+ imports.wbg.__wbindgen_cast_d6cd19b81560fd6e = function(arg0) {
520
+ // Cast intrinsic for `F64 -> Externref`.
521
+ const ret = arg0;
522
+ return ret;
523
+ };
524
+ imports.wbg.__wbindgen_init_externref_table = function() {
525
+ const table = wasm.__wbindgen_externrefs;
526
+ const offset = table.grow(4);
527
+ table.set(0, undefined);
528
+ table.set(offset + 0, undefined);
529
+ table.set(offset + 1, null);
530
+ table.set(offset + 2, true);
531
+ table.set(offset + 3, false);
532
+ };
533
+
534
+ return imports;
535
+ }
536
+
537
+ function __wbg_finalize_init(instance, module) {
538
+ wasm = instance.exports;
539
+ __wbg_init.__wbindgen_wasm_module = module;
540
+ cachedDataViewMemory0 = null;
541
+ cachedUint8ArrayMemory0 = null;
542
+
543
+
544
+ wasm.__wbindgen_start();
545
+ return wasm;
546
+ }
547
+
548
+ function initSync(module) {
549
+ if (wasm !== undefined) return wasm;
550
+
551
+
552
+ if (typeof module !== 'undefined') {
553
+ if (Object.getPrototypeOf(module) === Object.prototype) {
554
+ ({module} = module)
555
+ } else {
556
+ console.warn('using deprecated parameters for `initSync()`; pass a single object instead')
557
+ }
558
+ }
559
+
560
+ const imports = __wbg_get_imports();
561
+ if (!(module instanceof WebAssembly.Module)) {
562
+ module = new WebAssembly.Module(module);
563
+ }
564
+ const instance = new WebAssembly.Instance(module, imports);
565
+ return __wbg_finalize_init(instance, module);
566
+ }
567
+
568
+ async function __wbg_init(module_or_path) {
569
+ if (wasm !== undefined) return wasm;
570
+
571
+
572
+ if (typeof module_or_path !== 'undefined') {
573
+ if (Object.getPrototypeOf(module_or_path) === Object.prototype) {
574
+ ({module_or_path} = module_or_path)
575
+ } else {
576
+ console.warn('using deprecated parameters for the initialization function; pass a single object instead')
577
+ }
578
+ }
579
+
580
+ if (typeof module_or_path === 'undefined') {
581
+ module_or_path = new URL('ssp_wasm_bg.wasm', import.meta.url);
582
+ }
583
+ const imports = __wbg_get_imports();
584
+
585
+ if (typeof module_or_path === 'string' || (typeof Request === 'function' && module_or_path instanceof Request) || (typeof URL === 'function' && module_or_path instanceof URL)) {
586
+ module_or_path = fetch(module_or_path);
587
+ }
588
+
589
+ const { instance, module } = await __wbg_load(await module_or_path, imports);
590
+
591
+ return __wbg_finalize_init(instance, module);
592
+ }
593
+
594
+ export { initSync };
595
+ export default __wbg_init;
Binary file
@@ -0,0 +1,19 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ export const memory: WebAssembly.Memory;
4
+ export const __wbg_spookyprocessor_free: (a: number, b: number) => void;
5
+ export const init: () => void;
6
+ export const spookyprocessor_ingest: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: any) => [number, number, number];
7
+ export const spookyprocessor_load_state: (a: number, b: number, c: number) => [number, number];
8
+ export const spookyprocessor_new: () => number;
9
+ export const spookyprocessor_register_view: (a: number, b: any) => [number, number, number];
10
+ export const spookyprocessor_save_state: (a: number) => [number, number, number, number];
11
+ export const spookyprocessor_unregister_view: (a: number, b: number, c: number) => void;
12
+ export const __wbindgen_malloc: (a: number, b: number) => number;
13
+ export const __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
14
+ export const __wbindgen_exn_store: (a: number) => void;
15
+ export const __externref_table_alloc: () => number;
16
+ export const __wbindgen_externrefs: WebAssembly.Table;
17
+ export const __externref_table_dealloc: (a: number) => void;
18
+ export const __wbindgen_free: (a: number, b: number, c: number) => void;
19
+ export const __wbindgen_start: () => void;