@trust0/ridb-core 1.6.1 → 1.7.0-rc.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/pkg/ridb_core.js DELETED
@@ -1,3125 +0,0 @@
1
- let wasm;
2
-
3
- const heap = new Array(128).fill(undefined);
4
-
5
- heap.push(undefined, null, true, false);
6
-
7
- function getObject(idx) { return heap[idx]; }
8
-
9
- let heap_next = heap.length;
10
-
11
- function dropObject(idx) {
12
- if (idx < 132) return;
13
- heap[idx] = heap_next;
14
- heap_next = idx;
15
- }
16
-
17
- function takeObject(idx) {
18
- const ret = getObject(idx);
19
- dropObject(idx);
20
- return ret;
21
- }
22
-
23
- function addHeapObject(obj) {
24
- if (heap_next === heap.length) heap.push(heap.length + 1);
25
- const idx = heap_next;
26
- heap_next = heap[idx];
27
-
28
- heap[idx] = obj;
29
- return idx;
30
- }
31
-
32
- const cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }) : { decode: () => { throw Error('TextDecoder not available') } } );
33
-
34
- if (typeof TextDecoder !== 'undefined') { cachedTextDecoder.decode(); };
35
-
36
- let cachedUint8Memory0 = null;
37
-
38
- function getUint8Memory0() {
39
- if (cachedUint8Memory0 === null || cachedUint8Memory0.byteLength === 0) {
40
- cachedUint8Memory0 = new Uint8Array(wasm.memory.buffer);
41
- }
42
- return cachedUint8Memory0;
43
- }
44
-
45
- function getStringFromWasm0(ptr, len) {
46
- ptr = ptr >>> 0;
47
- return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
48
- }
49
-
50
- let WASM_VECTOR_LEN = 0;
51
-
52
- const cachedTextEncoder = (typeof TextEncoder !== 'undefined' ? new TextEncoder('utf-8') : { encode: () => { throw Error('TextEncoder not available') } } );
53
-
54
- const encodeString = (typeof cachedTextEncoder.encodeInto === 'function'
55
- ? function (arg, view) {
56
- return cachedTextEncoder.encodeInto(arg, view);
57
- }
58
- : function (arg, view) {
59
- const buf = cachedTextEncoder.encode(arg);
60
- view.set(buf);
61
- return {
62
- read: arg.length,
63
- written: buf.length
64
- };
65
- });
66
-
67
- function passStringToWasm0(arg, malloc, realloc) {
68
-
69
- if (realloc === undefined) {
70
- const buf = cachedTextEncoder.encode(arg);
71
- const ptr = malloc(buf.length, 1) >>> 0;
72
- getUint8Memory0().subarray(ptr, ptr + buf.length).set(buf);
73
- WASM_VECTOR_LEN = buf.length;
74
- return ptr;
75
- }
76
-
77
- let len = arg.length;
78
- let ptr = malloc(len, 1) >>> 0;
79
-
80
- const mem = getUint8Memory0();
81
-
82
- let offset = 0;
83
-
84
- for (; offset < len; offset++) {
85
- const code = arg.charCodeAt(offset);
86
- if (code > 0x7F) break;
87
- mem[ptr + offset] = code;
88
- }
89
-
90
- if (offset !== len) {
91
- if (offset !== 0) {
92
- arg = arg.slice(offset);
93
- }
94
- ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
95
- const view = getUint8Memory0().subarray(ptr + offset, ptr + len);
96
- const ret = encodeString(arg, view);
97
-
98
- offset += ret.written;
99
- ptr = realloc(ptr, len, offset, 1) >>> 0;
100
- }
101
-
102
- WASM_VECTOR_LEN = offset;
103
- return ptr;
104
- }
105
-
106
- function isLikeNone(x) {
107
- return x === undefined || x === null;
108
- }
109
-
110
- let cachedInt32Memory0 = null;
111
-
112
- function getInt32Memory0() {
113
- if (cachedInt32Memory0 === null || cachedInt32Memory0.byteLength === 0) {
114
- cachedInt32Memory0 = new Int32Array(wasm.memory.buffer);
115
- }
116
- return cachedInt32Memory0;
117
- }
118
-
119
- let cachedFloat64Memory0 = null;
120
-
121
- function getFloat64Memory0() {
122
- if (cachedFloat64Memory0 === null || cachedFloat64Memory0.byteLength === 0) {
123
- cachedFloat64Memory0 = new Float64Array(wasm.memory.buffer);
124
- }
125
- return cachedFloat64Memory0;
126
- }
127
-
128
- let cachedBigInt64Memory0 = null;
129
-
130
- function getBigInt64Memory0() {
131
- if (cachedBigInt64Memory0 === null || cachedBigInt64Memory0.byteLength === 0) {
132
- cachedBigInt64Memory0 = new BigInt64Array(wasm.memory.buffer);
133
- }
134
- return cachedBigInt64Memory0;
135
- }
136
-
137
- function debugString(val) {
138
- // primitive types
139
- const type = typeof val;
140
- if (type == 'number' || type == 'boolean' || val == null) {
141
- return `${val}`;
142
- }
143
- if (type == 'string') {
144
- return `"${val}"`;
145
- }
146
- if (type == 'symbol') {
147
- const description = val.description;
148
- if (description == null) {
149
- return 'Symbol';
150
- } else {
151
- return `Symbol(${description})`;
152
- }
153
- }
154
- if (type == 'function') {
155
- const name = val.name;
156
- if (typeof name == 'string' && name.length > 0) {
157
- return `Function(${name})`;
158
- } else {
159
- return 'Function';
160
- }
161
- }
162
- // objects
163
- if (Array.isArray(val)) {
164
- const length = val.length;
165
- let debug = '[';
166
- if (length > 0) {
167
- debug += debugString(val[0]);
168
- }
169
- for(let i = 1; i < length; i++) {
170
- debug += ', ' + debugString(val[i]);
171
- }
172
- debug += ']';
173
- return debug;
174
- }
175
- // Test for built-in
176
- const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
177
- let className;
178
- if (builtInMatches.length > 1) {
179
- className = builtInMatches[1];
180
- } else {
181
- // Failed to match the standard '[object ClassName]'
182
- return toString.call(val);
183
- }
184
- if (className == 'Object') {
185
- // we're a user defined class or Object
186
- // JSON.stringify avoids problems with cycles, and is generally much
187
- // easier than looping through ownProperties of `val`.
188
- try {
189
- return 'Object(' + JSON.stringify(val) + ')';
190
- } catch (_) {
191
- return 'Object';
192
- }
193
- }
194
- // errors
195
- if (val instanceof Error) {
196
- return `${val.name}: ${val.message}\n${val.stack}`;
197
- }
198
- // TODO we could test for more things here, like `Set`s and `Map`s.
199
- return className;
200
- }
201
-
202
- const CLOSURE_DTORS = (typeof FinalizationRegistry === 'undefined')
203
- ? { register: () => {}, unregister: () => {} }
204
- : new FinalizationRegistry(state => {
205
- wasm.__wbindgen_export_2.get(state.dtor)(state.a, state.b)
206
- });
207
-
208
- function makeClosure(arg0, arg1, dtor, f) {
209
- const state = { a: arg0, b: arg1, cnt: 1, dtor };
210
- const real = (...args) => {
211
- // First up with a closure we increment the internal reference
212
- // count. This ensures that the Rust closure environment won't
213
- // be deallocated while we're invoking it.
214
- state.cnt++;
215
- try {
216
- return f(state.a, state.b, ...args);
217
- } finally {
218
- if (--state.cnt === 0) {
219
- wasm.__wbindgen_export_2.get(state.dtor)(state.a, state.b);
220
- state.a = 0;
221
- CLOSURE_DTORS.unregister(state);
222
- }
223
- }
224
- };
225
- real.original = state;
226
- CLOSURE_DTORS.register(real, state, state);
227
- return real;
228
- }
229
- function __wbg_adapter_56(arg0, arg1, arg2, arg3, arg4) {
230
- try {
231
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
232
- wasm._dyn_core__ops__function__Fn__A_B_C___Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__hbbd70d909398e1ba(retptr, arg0, arg1, addHeapObject(arg2), addHeapObject(arg3), addHeapObject(arg4));
233
- var r0 = getInt32Memory0()[retptr / 4 + 0];
234
- var r1 = getInt32Memory0()[retptr / 4 + 1];
235
- var r2 = getInt32Memory0()[retptr / 4 + 2];
236
- if (r2) {
237
- throw takeObject(r1);
238
- }
239
- return takeObject(r0);
240
- } finally {
241
- wasm.__wbindgen_add_to_stack_pointer(16);
242
- }
243
- }
244
-
245
- function makeMutClosure(arg0, arg1, dtor, f) {
246
- const state = { a: arg0, b: arg1, cnt: 1, dtor };
247
- const real = (...args) => {
248
- // First up with a closure we increment the internal reference
249
- // count. This ensures that the Rust closure environment won't
250
- // be deallocated while we're invoking it.
251
- state.cnt++;
252
- const a = state.a;
253
- state.a = 0;
254
- try {
255
- return f(a, state.b, ...args);
256
- } finally {
257
- if (--state.cnt === 0) {
258
- wasm.__wbindgen_export_2.get(state.dtor)(a, state.b);
259
- CLOSURE_DTORS.unregister(state);
260
- } else {
261
- state.a = a;
262
- }
263
- }
264
- };
265
- real.original = state;
266
- CLOSURE_DTORS.register(real, state, state);
267
- return real;
268
- }
269
- function __wbg_adapter_59(arg0, arg1, arg2) {
270
- const ret = wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__hc5f5145da16b26e4(arg0, arg1, addHeapObject(arg2));
271
- return takeObject(ret);
272
- }
273
-
274
- function __wbg_adapter_62(arg0, arg1, arg2) {
275
- wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__hbe98bae341e12bb6(arg0, arg1, addHeapObject(arg2));
276
- }
277
-
278
- function __wbg_adapter_65(arg0, arg1, arg2) {
279
- wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h80ee32fc34c22e0b(arg0, arg1, addHeapObject(arg2));
280
- }
281
-
282
- function _assertClass(instance, klass) {
283
- if (!(instance instanceof klass)) {
284
- throw new Error(`expected instance of ${klass.name}`);
285
- }
286
- return instance.ptr;
287
- }
288
-
289
- let cachedUint32Memory0 = null;
290
-
291
- function getUint32Memory0() {
292
- if (cachedUint32Memory0 === null || cachedUint32Memory0.byteLength === 0) {
293
- cachedUint32Memory0 = new Uint32Array(wasm.memory.buffer);
294
- }
295
- return cachedUint32Memory0;
296
- }
297
-
298
- function getArrayJsValueFromWasm0(ptr, len) {
299
- ptr = ptr >>> 0;
300
- const mem = getUint32Memory0();
301
- const slice = mem.subarray(ptr / 4, ptr / 4 + len);
302
- const result = [];
303
- for (let i = 0; i < slice.length; i++) {
304
- result.push(takeObject(slice[i]));
305
- }
306
- return result;
307
- }
308
-
309
- let stack_pointer = 128;
310
-
311
- function addBorrowedObject(obj) {
312
- if (stack_pointer == 1) throw new Error('out of js stack');
313
- heap[--stack_pointer] = obj;
314
- return stack_pointer;
315
- }
316
- /**
317
- */
318
- export function main_js() {
319
- wasm.main_js();
320
- }
321
-
322
- /**
323
- * @returns {boolean}
324
- */
325
- export function is_debug_mode() {
326
- const ret = wasm.is_debug_mode();
327
- return ret !== 0;
328
- }
329
-
330
- function handleError(f, args) {
331
- try {
332
- return f.apply(this, args);
333
- } catch (e) {
334
- wasm.__wbindgen_exn_store(addHeapObject(e));
335
- }
336
- }
337
-
338
- function passArrayJsValueToWasm0(array, malloc) {
339
- const ptr = malloc(array.length * 4, 4) >>> 0;
340
- const mem = getUint32Memory0();
341
- for (let i = 0; i < array.length; i++) {
342
- mem[ptr / 4 + i] = addHeapObject(array[i]);
343
- }
344
- WASM_VECTOR_LEN = array.length;
345
- return ptr;
346
- }
347
- /**
348
- * Handler for `console.log` invocations.
349
- *
350
- * If a test is currently running it takes the `args` array and stringifies
351
- * it and appends it to the current output of the test. Otherwise it passes
352
- * the arguments to the original `console.log` function, psased as
353
- * `original`.
354
- * @param {Array<any>} args
355
- */
356
- export function __wbgtest_console_log(args) {
357
- try {
358
- wasm.__wbgtest_console_log(addBorrowedObject(args));
359
- } finally {
360
- heap[stack_pointer++] = undefined;
361
- }
362
- }
363
-
364
- /**
365
- * Handler for `console.debug` invocations. See above.
366
- * @param {Array<any>} args
367
- */
368
- export function __wbgtest_console_debug(args) {
369
- try {
370
- wasm.__wbgtest_console_debug(addBorrowedObject(args));
371
- } finally {
372
- heap[stack_pointer++] = undefined;
373
- }
374
- }
375
-
376
- /**
377
- * Handler for `console.info` invocations. See above.
378
- * @param {Array<any>} args
379
- */
380
- export function __wbgtest_console_info(args) {
381
- try {
382
- wasm.__wbgtest_console_info(addBorrowedObject(args));
383
- } finally {
384
- heap[stack_pointer++] = undefined;
385
- }
386
- }
387
-
388
- /**
389
- * Handler for `console.warn` invocations. See above.
390
- * @param {Array<any>} args
391
- */
392
- export function __wbgtest_console_warn(args) {
393
- try {
394
- wasm.__wbgtest_console_warn(addBorrowedObject(args));
395
- } finally {
396
- heap[stack_pointer++] = undefined;
397
- }
398
- }
399
-
400
- /**
401
- * Handler for `console.error` invocations. See above.
402
- * @param {Array<any>} args
403
- */
404
- export function __wbgtest_console_error(args) {
405
- try {
406
- wasm.__wbgtest_console_error(addBorrowedObject(args));
407
- } finally {
408
- heap[stack_pointer++] = undefined;
409
- }
410
- }
411
-
412
- function __wbg_adapter_290(arg0, arg1) {
413
- wasm.wasm_bindgen__convert__closures__invoke0_mut__h84bd533389574f4d(arg0, arg1);
414
- }
415
-
416
- function __wbg_adapter_333(arg0, arg1, arg2, arg3, arg4) {
417
- wasm.wasm_bindgen__convert__closures__invoke3_mut__h3608a0bbf7229368(arg0, arg1, addHeapObject(arg2), arg3, addHeapObject(arg4));
418
- }
419
-
420
- function __wbg_adapter_384(arg0, arg1, arg2, arg3) {
421
- wasm.wasm_bindgen__convert__closures__invoke2_mut__h0b860a6b6d5d8826(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
422
- }
423
-
424
- /**
425
- * Represents the type of operation to be performed on the collection.
426
- */
427
- export const OpType = Object.freeze({
428
- /**
429
- * Create operation.
430
- */
431
- CREATE:0,"0":"CREATE",
432
- /**
433
- * Update operation.
434
- */
435
- UPDATE:1,"1":"UPDATE",
436
- /**
437
- * Delete operation.
438
- */
439
- DELETE:2,"2":"DELETE",
440
- /**
441
- * Query Operation.
442
- */
443
- QUERY:3,"3":"QUERY",
444
- /**
445
- * Count Operation.
446
- */
447
- COUNT:4,"4":"COUNT", });
448
- /**
449
- */
450
- export const Errors = Object.freeze({ Error:0,"0":"Error",HookError:1,"1":"HookError",QueryError:2,"2":"QueryError",SerializationError:3,"3":"SerializationError",ValidationError:4,"4":"ValidationError",AuthenticationError:5,"5":"AuthenticationError", });
451
-
452
- const BasePluginFinalization = (typeof FinalizationRegistry === 'undefined')
453
- ? { register: () => {}, unregister: () => {} }
454
- : new FinalizationRegistry(ptr => wasm.__wbg_baseplugin_free(ptr >>> 0));
455
- /**
456
- */
457
- export class BasePlugin {
458
-
459
- __destroy_into_raw() {
460
- const ptr = this.__wbg_ptr;
461
- this.__wbg_ptr = 0;
462
- BasePluginFinalization.unregister(this);
463
- return ptr;
464
- }
465
-
466
- free() {
467
- const ptr = this.__destroy_into_raw();
468
- wasm.__wbg_baseplugin_free(ptr);
469
- }
470
- /**
471
- * @param {string} name
472
- */
473
- constructor(name) {
474
- try {
475
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
476
- const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
477
- const len0 = WASM_VECTOR_LEN;
478
- wasm.baseplugin_new(retptr, ptr0, len0);
479
- var r0 = getInt32Memory0()[retptr / 4 + 0];
480
- var r1 = getInt32Memory0()[retptr / 4 + 1];
481
- var r2 = getInt32Memory0()[retptr / 4 + 2];
482
- if (r2) {
483
- throw takeObject(r1);
484
- }
485
- this.__wbg_ptr = r0 >>> 0;
486
- return this;
487
- } finally {
488
- wasm.__wbindgen_add_to_stack_pointer(16);
489
- }
490
- }
491
- /**
492
- * @returns {any}
493
- */
494
- get name() {
495
- const ret = wasm.baseplugin_name(this.__wbg_ptr);
496
- return takeObject(ret);
497
- }
498
- /**
499
- * @returns {any}
500
- */
501
- get docCreateHook() {
502
- const ret = wasm.baseplugin_get_doc_create_hook(this.__wbg_ptr);
503
- return takeObject(ret);
504
- }
505
- /**
506
- * @returns {any}
507
- */
508
- get docRecoverHook() {
509
- const ret = wasm.baseplugin_get_doc_recover_hook(this.__wbg_ptr);
510
- return takeObject(ret);
511
- }
512
- /**
513
- * @param {any} hook
514
- */
515
- set docCreateHook(hook) {
516
- wasm.baseplugin_set_doc_create_hook(this.__wbg_ptr, addHeapObject(hook));
517
- }
518
- /**
519
- * @param {any} hook
520
- */
521
- set docRecoverHook(hook) {
522
- wasm.baseplugin_set_doc_recover_hook(this.__wbg_ptr, addHeapObject(hook));
523
- }
524
- }
525
-
526
- const BaseStorageFinalization = (typeof FinalizationRegistry === 'undefined')
527
- ? { register: () => {}, unregister: () => {} }
528
- : new FinalizationRegistry(ptr => wasm.__wbg_basestorage_free(ptr >>> 0));
529
- /**
530
- * Represents the base storage with a name and schema.
531
- */
532
- export class BaseStorage {
533
-
534
- __destroy_into_raw() {
535
- const ptr = this.__wbg_ptr;
536
- this.__wbg_ptr = 0;
537
- BaseStorageFinalization.unregister(this);
538
- return ptr;
539
- }
540
-
541
- free() {
542
- const ptr = this.__destroy_into_raw();
543
- wasm.__wbg_basestorage_free(ptr);
544
- }
545
- /**
546
- * Creates a new `BaseStorage` instance with the provided name and schema type.
547
- *
548
- * # Arguments
549
- *
550
- * * `name` - The name of the storage.
551
- * * `schema_type` - The schema type in `JsValue` format.
552
- *
553
- * # Returns
554
- *
555
- * * `Result<BaseStorage, JsValue>` - A result containing the new `BaseStorage` instance or an error.
556
- * @param {string} name
557
- * @param {object} schemas_js
558
- * @param {object | undefined} [options]
559
- */
560
- constructor(name, schemas_js, options) {
561
- try {
562
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
563
- const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
564
- const len0 = WASM_VECTOR_LEN;
565
- wasm.basestorage_new(retptr, ptr0, len0, addHeapObject(schemas_js), isLikeNone(options) ? 0 : addHeapObject(options));
566
- var r0 = getInt32Memory0()[retptr / 4 + 0];
567
- var r1 = getInt32Memory0()[retptr / 4 + 1];
568
- var r2 = getInt32Memory0()[retptr / 4 + 2];
569
- if (r2) {
570
- throw takeObject(r1);
571
- }
572
- this.__wbg_ptr = r0 >>> 0;
573
- return this;
574
- } finally {
575
- wasm.__wbindgen_add_to_stack_pointer(16);
576
- }
577
- }
578
- /**
579
- * @returns {any}
580
- */
581
- addIndexSchemas() {
582
- try {
583
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
584
- wasm.basestorage_addIndexSchemas(retptr, this.__wbg_ptr);
585
- var r0 = getInt32Memory0()[retptr / 4 + 0];
586
- var r1 = getInt32Memory0()[retptr / 4 + 1];
587
- var r2 = getInt32Memory0()[retptr / 4 + 2];
588
- if (r2) {
589
- throw takeObject(r1);
590
- }
591
- return takeObject(r0);
592
- } finally {
593
- wasm.__wbindgen_add_to_stack_pointer(16);
594
- }
595
- }
596
- /**
597
- * @param {string} name
598
- * @returns {any}
599
- */
600
- getOption(name) {
601
- try {
602
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
603
- const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
604
- const len0 = WASM_VECTOR_LEN;
605
- wasm.basestorage_getOption(retptr, this.__wbg_ptr, ptr0, len0);
606
- var r0 = getInt32Memory0()[retptr / 4 + 0];
607
- var r1 = getInt32Memory0()[retptr / 4 + 1];
608
- var r2 = getInt32Memory0()[retptr / 4 + 2];
609
- if (r2) {
610
- throw takeObject(r1);
611
- }
612
- return takeObject(r0);
613
- } finally {
614
- wasm.__wbindgen_add_to_stack_pointer(16);
615
- }
616
- }
617
- /**
618
- * @param {string} name
619
- * @returns {Schema}
620
- */
621
- getSchema(name) {
622
- try {
623
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
624
- const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
625
- const len0 = WASM_VECTOR_LEN;
626
- wasm.basestorage_getSchema(retptr, this.__wbg_ptr, ptr0, len0);
627
- var r0 = getInt32Memory0()[retptr / 4 + 0];
628
- var r1 = getInt32Memory0()[retptr / 4 + 1];
629
- var r2 = getInt32Memory0()[retptr / 4 + 2];
630
- if (r2) {
631
- throw takeObject(r1);
632
- }
633
- return Schema.__wrap(r0);
634
- } finally {
635
- wasm.__wbindgen_add_to_stack_pointer(16);
636
- }
637
- }
638
- /**
639
- * @returns {CoreStorage}
640
- */
641
- get core() {
642
- try {
643
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
644
- wasm.basestorage_core(retptr, this.__wbg_ptr);
645
- var r0 = getInt32Memory0()[retptr / 4 + 0];
646
- var r1 = getInt32Memory0()[retptr / 4 + 1];
647
- var r2 = getInt32Memory0()[retptr / 4 + 2];
648
- if (r2) {
649
- throw takeObject(r1);
650
- }
651
- return CoreStorage.__wrap(r0);
652
- } finally {
653
- wasm.__wbindgen_add_to_stack_pointer(16);
654
- }
655
- }
656
- }
657
-
658
- const CollectionFinalization = (typeof FinalizationRegistry === 'undefined')
659
- ? { register: () => {}, unregister: () => {} }
660
- : new FinalizationRegistry(ptr => wasm.__wbg_collection_free(ptr >>> 0));
661
- /**
662
- */
663
- export class Collection {
664
-
665
- static __wrap(ptr) {
666
- ptr = ptr >>> 0;
667
- const obj = Object.create(Collection.prototype);
668
- obj.__wbg_ptr = ptr;
669
- CollectionFinalization.register(obj, obj.__wbg_ptr, obj);
670
- return obj;
671
- }
672
-
673
- __destroy_into_raw() {
674
- const ptr = this.__wbg_ptr;
675
- this.__wbg_ptr = 0;
676
- CollectionFinalization.unregister(this);
677
- return ptr;
678
- }
679
-
680
- free() {
681
- const ptr = this.__destroy_into_raw();
682
- wasm.__wbg_collection_free(ptr);
683
- }
684
- /**
685
- * @returns {string}
686
- */
687
- get name() {
688
- let deferred1_0;
689
- let deferred1_1;
690
- try {
691
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
692
- wasm.collection_name(retptr, this.__wbg_ptr);
693
- var r0 = getInt32Memory0()[retptr / 4 + 0];
694
- var r1 = getInt32Memory0()[retptr / 4 + 1];
695
- deferred1_0 = r0;
696
- deferred1_1 = r1;
697
- return getStringFromWasm0(r0, r1);
698
- } finally {
699
- wasm.__wbindgen_add_to_stack_pointer(16);
700
- wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
701
- }
702
- }
703
- /**
704
- * @returns {Schema}
705
- */
706
- get schema() {
707
- try {
708
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
709
- wasm.collection_schema(retptr, this.__wbg_ptr);
710
- var r0 = getInt32Memory0()[retptr / 4 + 0];
711
- var r1 = getInt32Memory0()[retptr / 4 + 1];
712
- var r2 = getInt32Memory0()[retptr / 4 + 2];
713
- if (r2) {
714
- throw takeObject(r1);
715
- }
716
- return Schema.__wrap(r0);
717
- } finally {
718
- wasm.__wbindgen_add_to_stack_pointer(16);
719
- }
720
- }
721
- /**
722
- * Finds and returns all documents in the collection.
723
- *
724
- * This function is asynchronous and returns a `JsValue` representing
725
- * the documents found in the collection.
726
- * @param {any} query_js
727
- * @param {any} options_js
728
- * @returns {Promise<any>}
729
- */
730
- find(query_js, options_js) {
731
- const ret = wasm.collection_find(this.__wbg_ptr, addHeapObject(query_js), addHeapObject(options_js));
732
- return takeObject(ret);
733
- }
734
- /**
735
- * @param {any} options
736
- * @returns {QueryOptions}
737
- */
738
- parse_query_options(options) {
739
- try {
740
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
741
- wasm.collection_parse_query_options(retptr, this.__wbg_ptr, addHeapObject(options));
742
- var r0 = getInt32Memory0()[retptr / 4 + 0];
743
- var r1 = getInt32Memory0()[retptr / 4 + 1];
744
- var r2 = getInt32Memory0()[retptr / 4 + 2];
745
- if (r2) {
746
- throw takeObject(r1);
747
- }
748
- return QueryOptions.__wrap(r0);
749
- } finally {
750
- wasm.__wbindgen_add_to_stack_pointer(16);
751
- }
752
- }
753
- /**
754
- * counts and returns all documents in the collection.
755
- *
756
- * This function is asynchronous and returns a `Schema` representing
757
- * the documents found in the collection.
758
- * @param {any} query_js
759
- * @param {any} options_js
760
- * @returns {Promise<any>}
761
- */
762
- count(query_js, options_js) {
763
- const ret = wasm.collection_count(this.__wbg_ptr, addHeapObject(query_js), addHeapObject(options_js));
764
- return takeObject(ret);
765
- }
766
- /**
767
- * Finds and returns a single document in the collection by its ID.
768
- *
769
- * This function is asynchronous.
770
- * @param {any} primary_key
771
- * @returns {Promise<any>}
772
- */
773
- findById(primary_key) {
774
- const ret = wasm.collection_findById(this.__wbg_ptr, addHeapObject(primary_key));
775
- return takeObject(ret);
776
- }
777
- /**
778
- * Updates a document in the collection with the given data.
779
- *
780
- * This function is asynchronous and returns a `Result` indicating success or failure.
781
- *
782
- * # Arguments
783
- *
784
- * * `document` - A `JsValue` representing the partial document to update.
785
- * @param {any} document
786
- * @returns {Promise<any>}
787
- */
788
- update(document) {
789
- const ret = wasm.collection_update(this.__wbg_ptr, addHeapObject(document));
790
- return takeObject(ret);
791
- }
792
- /**
793
- * Creates a new document in the collection.
794
- *
795
- * This function is asynchronous and returns a `Result` indicating success or failure.
796
- *
797
- * # Arguments
798
- *
799
- * * `document` - A `JsValue` representing the document to create.
800
- * @param {any} document
801
- * @returns {Promise<any>}
802
- */
803
- create(document) {
804
- const ret = wasm.collection_create(this.__wbg_ptr, addHeapObject(document));
805
- return takeObject(ret);
806
- }
807
- /**
808
- * Deletes a document from the collection by its ID.
809
- *
810
- * This function is asynchronous.
811
- * @param {any} primary_key
812
- * @returns {Promise<any>}
813
- */
814
- delete(primary_key) {
815
- const ret = wasm.collection_delete(this.__wbg_ptr, addHeapObject(primary_key));
816
- return takeObject(ret);
817
- }
818
- }
819
-
820
- const CoreStorageFinalization = (typeof FinalizationRegistry === 'undefined')
821
- ? { register: () => {}, unregister: () => {} }
822
- : new FinalizationRegistry(ptr => wasm.__wbg_corestorage_free(ptr >>> 0));
823
- /**
824
- */
825
- export class CoreStorage {
826
-
827
- static __wrap(ptr) {
828
- ptr = ptr >>> 0;
829
- const obj = Object.create(CoreStorage.prototype);
830
- obj.__wbg_ptr = ptr;
831
- CoreStorageFinalization.register(obj, obj.__wbg_ptr, obj);
832
- return obj;
833
- }
834
-
835
- __destroy_into_raw() {
836
- const ptr = this.__wbg_ptr;
837
- this.__wbg_ptr = 0;
838
- CoreStorageFinalization.unregister(this);
839
- return ptr;
840
- }
841
-
842
- free() {
843
- const ptr = this.__destroy_into_raw();
844
- wasm.__wbg_corestorage_free(ptr);
845
- }
846
- /**
847
- */
848
- constructor() {
849
- const ret = wasm.corestorage_new();
850
- this.__wbg_ptr = ret >>> 0;
851
- return this;
852
- }
853
- /**
854
- * @param {any} value
855
- * @returns {string}
856
- */
857
- getPrimaryKeyTyped(value) {
858
- let deferred2_0;
859
- let deferred2_1;
860
- try {
861
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
862
- wasm.corestorage_getPrimaryKeyTyped(retptr, this.__wbg_ptr, addHeapObject(value));
863
- var r0 = getInt32Memory0()[retptr / 4 + 0];
864
- var r1 = getInt32Memory0()[retptr / 4 + 1];
865
- var r2 = getInt32Memory0()[retptr / 4 + 2];
866
- var r3 = getInt32Memory0()[retptr / 4 + 3];
867
- var ptr1 = r0;
868
- var len1 = r1;
869
- if (r3) {
870
- ptr1 = 0; len1 = 0;
871
- throw takeObject(r2);
872
- }
873
- deferred2_0 = ptr1;
874
- deferred2_1 = len1;
875
- return getStringFromWasm0(ptr1, len1);
876
- } finally {
877
- wasm.__wbindgen_add_to_stack_pointer(16);
878
- wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
879
- }
880
- }
881
- /**
882
- * @param {Schema} schema
883
- * @param {Operation} op
884
- * @returns {(string)[]}
885
- */
886
- getIndexes(schema, op) {
887
- try {
888
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
889
- _assertClass(schema, Schema);
890
- _assertClass(op, Operation);
891
- wasm.corestorage_getIndexes(retptr, this.__wbg_ptr, schema.__wbg_ptr, op.__wbg_ptr);
892
- var r0 = getInt32Memory0()[retptr / 4 + 0];
893
- var r1 = getInt32Memory0()[retptr / 4 + 1];
894
- var r2 = getInt32Memory0()[retptr / 4 + 2];
895
- var r3 = getInt32Memory0()[retptr / 4 + 3];
896
- if (r3) {
897
- throw takeObject(r2);
898
- }
899
- var v1 = getArrayJsValueFromWasm0(r0, r1).slice();
900
- wasm.__wbindgen_free(r0, r1 * 4, 4);
901
- return v1;
902
- } finally {
903
- wasm.__wbindgen_add_to_stack_pointer(16);
904
- }
905
- }
906
- /**
907
- * @param {any} document
908
- * @param {Query} query
909
- * @returns {boolean}
910
- */
911
- matchesQuery(document, query) {
912
- try {
913
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
914
- _assertClass(query, Query);
915
- var ptr0 = query.__destroy_into_raw();
916
- wasm.corestorage_matchesQuery(retptr, this.__wbg_ptr, addBorrowedObject(document), ptr0);
917
- var r0 = getInt32Memory0()[retptr / 4 + 0];
918
- var r1 = getInt32Memory0()[retptr / 4 + 1];
919
- var r2 = getInt32Memory0()[retptr / 4 + 2];
920
- if (r2) {
921
- throw takeObject(r1);
922
- }
923
- return r0 !== 0;
924
- } finally {
925
- wasm.__wbindgen_add_to_stack_pointer(16);
926
- heap[stack_pointer++] = undefined;
927
- }
928
- }
929
- }
930
-
931
- const DatabaseFinalization = (typeof FinalizationRegistry === 'undefined')
932
- ? { register: () => {}, unregister: () => {} }
933
- : new FinalizationRegistry(ptr => wasm.__wbg_database_free(ptr >>> 0));
934
- /**
935
- * Represents a database with collections of documents.
936
- */
937
- export class Database {
938
-
939
- static __wrap(ptr) {
940
- ptr = ptr >>> 0;
941
- const obj = Object.create(Database.prototype);
942
- obj.__wbg_ptr = ptr;
943
- DatabaseFinalization.register(obj, obj.__wbg_ptr, obj);
944
- return obj;
945
- }
946
-
947
- __destroy_into_raw() {
948
- const ptr = this.__wbg_ptr;
949
- this.__wbg_ptr = 0;
950
- DatabaseFinalization.unregister(this);
951
- return ptr;
952
- }
953
-
954
- free() {
955
- const ptr = this.__destroy_into_raw();
956
- wasm.__wbg_database_free(ptr);
957
- }
958
- /**
959
- * @returns {Promise<any>}
960
- */
961
- start() {
962
- const ret = wasm.database_start(this.__wbg_ptr);
963
- return takeObject(ret);
964
- }
965
- /**
966
- * @returns {Promise<any>}
967
- */
968
- close() {
969
- const ptr = this.__destroy_into_raw();
970
- const ret = wasm.database_close(ptr);
971
- return takeObject(ret);
972
- }
973
- /**
974
- * @returns {boolean}
975
- */
976
- get started() {
977
- const ret = wasm.database_started(this.__wbg_ptr);
978
- return ret !== 0;
979
- }
980
- /**
981
- * @param {string} password
982
- * @returns {Promise<boolean>}
983
- */
984
- authenticate(password) {
985
- const ptr0 = passStringToWasm0(password, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
986
- const len0 = WASM_VECTOR_LEN;
987
- const ret = wasm.database_authenticate(this.__wbg_ptr, ptr0, len0);
988
- return takeObject(ret);
989
- }
990
- /**
991
- * Retrieves the collections in the database.
992
- *
993
- * This function returns an `Object` containing the collections.
994
- *
995
- * # Returns
996
- *
997
- * * `Result<Object, JsValue>` - A result containing an `Object` with the collections or an error.
998
- * @returns {object}
999
- */
1000
- get collections() {
1001
- try {
1002
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1003
- wasm.database_collections(retptr, this.__wbg_ptr);
1004
- var r0 = getInt32Memory0()[retptr / 4 + 0];
1005
- var r1 = getInt32Memory0()[retptr / 4 + 1];
1006
- var r2 = getInt32Memory0()[retptr / 4 + 2];
1007
- if (r2) {
1008
- throw takeObject(r1);
1009
- }
1010
- return takeObject(r0);
1011
- } finally {
1012
- wasm.__wbindgen_add_to_stack_pointer(16);
1013
- }
1014
- }
1015
- /**
1016
- * @param {string} db_name
1017
- * @param {object} schemas_js
1018
- * @param {object} migrations_js
1019
- * @param {Array<any>} plugins
1020
- * @param {any} module
1021
- * @param {string | undefined} [password]
1022
- * @param {any | undefined} [storage]
1023
- * @returns {Promise<Database>}
1024
- */
1025
- static create(db_name, schemas_js, migrations_js, plugins, module, password, storage) {
1026
- const ptr0 = passStringToWasm0(db_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1027
- const len0 = WASM_VECTOR_LEN;
1028
- var ptr1 = isLikeNone(password) ? 0 : passStringToWasm0(password, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1029
- var len1 = WASM_VECTOR_LEN;
1030
- const ret = wasm.database_create(ptr0, len0, addHeapObject(schemas_js), addHeapObject(migrations_js), addHeapObject(plugins), addHeapObject(module), ptr1, len1, isLikeNone(storage) ? 0 : addHeapObject(storage));
1031
- return takeObject(ret);
1032
- }
1033
- }
1034
-
1035
- const InMemoryFinalization = (typeof FinalizationRegistry === 'undefined')
1036
- ? { register: () => {}, unregister: () => {} }
1037
- : new FinalizationRegistry(ptr => wasm.__wbg_inmemory_free(ptr >>> 0));
1038
- /**
1039
- */
1040
- export class InMemory {
1041
-
1042
- static __wrap(ptr) {
1043
- ptr = ptr >>> 0;
1044
- const obj = Object.create(InMemory.prototype);
1045
- obj.__wbg_ptr = ptr;
1046
- InMemoryFinalization.register(obj, obj.__wbg_ptr, obj);
1047
- return obj;
1048
- }
1049
-
1050
- __destroy_into_raw() {
1051
- const ptr = this.__wbg_ptr;
1052
- this.__wbg_ptr = 0;
1053
- InMemoryFinalization.unregister(this);
1054
- return ptr;
1055
- }
1056
-
1057
- free() {
1058
- const ptr = this.__destroy_into_raw();
1059
- wasm.__wbg_inmemory_free(ptr);
1060
- }
1061
- /**
1062
- * @param {string} name
1063
- * @param {object} schemas_js
1064
- * @returns {Promise<InMemory>}
1065
- */
1066
- static create(name, schemas_js) {
1067
- const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1068
- const len0 = WASM_VECTOR_LEN;
1069
- const ret = wasm.inmemory_create(ptr0, len0, addHeapObject(schemas_js));
1070
- return takeObject(ret);
1071
- }
1072
- /**
1073
- * @param {Operation} op
1074
- * @returns {Promise<any>}
1075
- */
1076
- write(op) {
1077
- _assertClass(op, Operation);
1078
- var ptr0 = op.__destroy_into_raw();
1079
- const ret = wasm.inmemory_write(this.__wbg_ptr, ptr0);
1080
- return takeObject(ret);
1081
- }
1082
- /**
1083
- * @param {string} collection_name
1084
- * @param {any} query_js
1085
- * @param {QueryOptions} options
1086
- * @returns {Promise<any>}
1087
- */
1088
- find(collection_name, query_js, options) {
1089
- const ptr0 = passStringToWasm0(collection_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1090
- const len0 = WASM_VECTOR_LEN;
1091
- _assertClass(options, QueryOptions);
1092
- var ptr1 = options.__destroy_into_raw();
1093
- const ret = wasm.inmemory_find(this.__wbg_ptr, ptr0, len0, addHeapObject(query_js), ptr1);
1094
- return takeObject(ret);
1095
- }
1096
- /**
1097
- * @param {string} collection_name
1098
- * @param {any} primary_key
1099
- * @returns {Promise<any>}
1100
- */
1101
- findDocumentById(collection_name, primary_key) {
1102
- const ptr0 = passStringToWasm0(collection_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1103
- const len0 = WASM_VECTOR_LEN;
1104
- const ret = wasm.inmemory_findDocumentById(this.__wbg_ptr, ptr0, len0, addHeapObject(primary_key));
1105
- return takeObject(ret);
1106
- }
1107
- /**
1108
- * @param {string} collection_name
1109
- * @param {any} query_js
1110
- * @param {QueryOptions} options
1111
- * @returns {Promise<any>}
1112
- */
1113
- count(collection_name, query_js, options) {
1114
- const ptr0 = passStringToWasm0(collection_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1115
- const len0 = WASM_VECTOR_LEN;
1116
- _assertClass(options, QueryOptions);
1117
- var ptr1 = options.__destroy_into_raw();
1118
- const ret = wasm.inmemory_count(this.__wbg_ptr, ptr0, len0, addHeapObject(query_js), ptr1);
1119
- return takeObject(ret);
1120
- }
1121
- /**
1122
- * @returns {Promise<any>}
1123
- */
1124
- close() {
1125
- const ret = wasm.inmemory_close(this.__wbg_ptr);
1126
- return takeObject(ret);
1127
- }
1128
- /**
1129
- * @returns {Promise<any>}
1130
- */
1131
- start() {
1132
- const ret = wasm.inmemory_start(this.__wbg_ptr);
1133
- return takeObject(ret);
1134
- }
1135
- }
1136
-
1137
- const IndexDBFinalization = (typeof FinalizationRegistry === 'undefined')
1138
- ? { register: () => {}, unregister: () => {} }
1139
- : new FinalizationRegistry(ptr => wasm.__wbg_indexdb_free(ptr >>> 0));
1140
- /**
1141
- */
1142
- export class IndexDB {
1143
-
1144
- static __wrap(ptr) {
1145
- ptr = ptr >>> 0;
1146
- const obj = Object.create(IndexDB.prototype);
1147
- obj.__wbg_ptr = ptr;
1148
- IndexDBFinalization.register(obj, obj.__wbg_ptr, obj);
1149
- return obj;
1150
- }
1151
-
1152
- __destroy_into_raw() {
1153
- const ptr = this.__wbg_ptr;
1154
- this.__wbg_ptr = 0;
1155
- IndexDBFinalization.unregister(this);
1156
- return ptr;
1157
- }
1158
-
1159
- free() {
1160
- const ptr = this.__destroy_into_raw();
1161
- wasm.__wbg_indexdb_free(ptr);
1162
- }
1163
- /**
1164
- * Fetch documents by opening an IndexedDB cursor (on an index or store),
1165
- * then apply inline filtering and offset/limit constraints.
1166
- * @returns {(string)[]}
1167
- */
1168
- get_stores() {
1169
- try {
1170
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1171
- wasm.indexdb_get_stores(retptr, this.__wbg_ptr);
1172
- var r0 = getInt32Memory0()[retptr / 4 + 0];
1173
- var r1 = getInt32Memory0()[retptr / 4 + 1];
1174
- var v1 = getArrayJsValueFromWasm0(r0, r1).slice();
1175
- wasm.__wbindgen_free(r0, r1 * 4, 4);
1176
- return v1;
1177
- } finally {
1178
- wasm.__wbindgen_add_to_stack_pointer(16);
1179
- }
1180
- }
1181
- /**
1182
- * @param {string} store_name
1183
- * @returns {IDBObjectStore}
1184
- */
1185
- get_store(store_name) {
1186
- try {
1187
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1188
- const ptr0 = passStringToWasm0(store_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1189
- const len0 = WASM_VECTOR_LEN;
1190
- wasm.indexdb_get_store(retptr, this.__wbg_ptr, ptr0, len0);
1191
- var r0 = getInt32Memory0()[retptr / 4 + 0];
1192
- var r1 = getInt32Memory0()[retptr / 4 + 1];
1193
- var r2 = getInt32Memory0()[retptr / 4 + 2];
1194
- if (r2) {
1195
- throw takeObject(r1);
1196
- }
1197
- return takeObject(r0);
1198
- } finally {
1199
- wasm.__wbindgen_add_to_stack_pointer(16);
1200
- }
1201
- }
1202
- /**
1203
- * @param {string} name
1204
- * @param {object} schemas_js
1205
- * @returns {Promise<IndexDB>}
1206
- */
1207
- static create(name, schemas_js) {
1208
- const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1209
- const len0 = WASM_VECTOR_LEN;
1210
- const ret = wasm.indexdb_create(ptr0, len0, addHeapObject(schemas_js));
1211
- return takeObject(ret);
1212
- }
1213
- /**
1214
- * @param {Operation} op
1215
- * @returns {Promise<any>}
1216
- */
1217
- write(op) {
1218
- _assertClass(op, Operation);
1219
- var ptr0 = op.__destroy_into_raw();
1220
- const ret = wasm.indexdb_write(this.__wbg_ptr, ptr0);
1221
- return takeObject(ret);
1222
- }
1223
- /**
1224
- * @param {string} collection_name
1225
- * @param {any} query
1226
- * @param {QueryOptions} options
1227
- * @returns {Promise<any>}
1228
- */
1229
- find(collection_name, query, options) {
1230
- const ptr0 = passStringToWasm0(collection_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1231
- const len0 = WASM_VECTOR_LEN;
1232
- _assertClass(options, QueryOptions);
1233
- var ptr1 = options.__destroy_into_raw();
1234
- const ret = wasm.indexdb_find(this.__wbg_ptr, ptr0, len0, addHeapObject(query), ptr1);
1235
- return takeObject(ret);
1236
- }
1237
- /**
1238
- * @param {string} collection_name
1239
- * @param {any} primary_key
1240
- * @returns {Promise<any>}
1241
- */
1242
- findDocumentById(collection_name, primary_key) {
1243
- const ptr0 = passStringToWasm0(collection_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1244
- const len0 = WASM_VECTOR_LEN;
1245
- const ret = wasm.indexdb_findDocumentById(this.__wbg_ptr, ptr0, len0, addHeapObject(primary_key));
1246
- return takeObject(ret);
1247
- }
1248
- /**
1249
- * @param {string} collection_name
1250
- * @param {any} query
1251
- * @param {QueryOptions} options
1252
- * @returns {Promise<any>}
1253
- */
1254
- count(collection_name, query, options) {
1255
- const ptr0 = passStringToWasm0(collection_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1256
- const len0 = WASM_VECTOR_LEN;
1257
- _assertClass(options, QueryOptions);
1258
- var ptr1 = options.__destroy_into_raw();
1259
- const ret = wasm.indexdb_count(this.__wbg_ptr, ptr0, len0, addHeapObject(query), ptr1);
1260
- return takeObject(ret);
1261
- }
1262
- /**
1263
- * @returns {Promise<any>}
1264
- */
1265
- close() {
1266
- const ret = wasm.indexdb_close(this.__wbg_ptr);
1267
- return takeObject(ret);
1268
- }
1269
- /**
1270
- * @returns {Promise<any>}
1271
- */
1272
- start() {
1273
- const ret = wasm.indexdb_start(this.__wbg_ptr);
1274
- return takeObject(ret);
1275
- }
1276
- }
1277
-
1278
- const OperationFinalization = (typeof FinalizationRegistry === 'undefined')
1279
- ? { register: () => {}, unregister: () => {} }
1280
- : new FinalizationRegistry(ptr => wasm.__wbg_operation_free(ptr >>> 0));
1281
- /**
1282
- * Represents an operation to be performed on a collection.
1283
- */
1284
- export class Operation {
1285
-
1286
- static __wrap(ptr) {
1287
- ptr = ptr >>> 0;
1288
- const obj = Object.create(Operation.prototype);
1289
- obj.__wbg_ptr = ptr;
1290
- OperationFinalization.register(obj, obj.__wbg_ptr, obj);
1291
- return obj;
1292
- }
1293
-
1294
- __destroy_into_raw() {
1295
- const ptr = this.__wbg_ptr;
1296
- this.__wbg_ptr = 0;
1297
- OperationFinalization.unregister(this);
1298
- return ptr;
1299
- }
1300
-
1301
- free() {
1302
- const ptr = this.__destroy_into_raw();
1303
- wasm.__wbg_operation_free(ptr);
1304
- }
1305
- /**
1306
- * Retrieves the name of the collection.
1307
- *
1308
- * # Returns
1309
- *
1310
- * * `String` - The name of the collection.
1311
- * @returns {string}
1312
- */
1313
- get collection() {
1314
- let deferred1_0;
1315
- let deferred1_1;
1316
- try {
1317
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1318
- wasm.operation_collection(retptr, this.__wbg_ptr);
1319
- var r0 = getInt32Memory0()[retptr / 4 + 0];
1320
- var r1 = getInt32Memory0()[retptr / 4 + 1];
1321
- deferred1_0 = r0;
1322
- deferred1_1 = r1;
1323
- return getStringFromWasm0(r0, r1);
1324
- } finally {
1325
- wasm.__wbindgen_add_to_stack_pointer(16);
1326
- wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
1327
- }
1328
- }
1329
- /**
1330
- * Retrieves the type of operation.
1331
- *
1332
- * # Returns
1333
- *
1334
- * * `OpType` - The type of operation.
1335
- * @returns {OpType}
1336
- */
1337
- get opType() {
1338
- const ret = wasm.operation_opType(this.__wbg_ptr);
1339
- return ret;
1340
- }
1341
- /**
1342
- * Retrieves the data involved in the operation.
1343
- *
1344
- * # Returns
1345
- *
1346
- * * `JsValue` - The data involved in the operation.
1347
- * @returns {any}
1348
- */
1349
- get data() {
1350
- const ret = wasm.operation_data(this.__wbg_ptr);
1351
- return takeObject(ret);
1352
- }
1353
- /**
1354
- * Retrieves the primary key field of the current collection.
1355
- *
1356
- * # Returns
1357
- *
1358
- * * `Option<String>` - The primary key field of the current collection.
1359
- * @returns {any}
1360
- */
1361
- get primaryKeyField() {
1362
- const ret = wasm.operation_primaryKeyField(this.__wbg_ptr);
1363
- return takeObject(ret);
1364
- }
1365
- /**
1366
- * Retrieves the primary key value of the current data.
1367
- *
1368
- * # Returns
1369
- *
1370
- * * `Option<JsValue>` - The primary key value of the current data.
1371
- * @returns {any}
1372
- */
1373
- get primaryKey() {
1374
- const ret = wasm.operation_primaryKey(this.__wbg_ptr);
1375
- return takeObject(ret);
1376
- }
1377
- /**
1378
- * @returns {string}
1379
- */
1380
- get primaryKeyIndex() {
1381
- let deferred2_0;
1382
- let deferred2_1;
1383
- try {
1384
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1385
- wasm.operation_primaryKeyIndex(retptr, this.__wbg_ptr);
1386
- var r0 = getInt32Memory0()[retptr / 4 + 0];
1387
- var r1 = getInt32Memory0()[retptr / 4 + 1];
1388
- var r2 = getInt32Memory0()[retptr / 4 + 2];
1389
- var r3 = getInt32Memory0()[retptr / 4 + 3];
1390
- var ptr1 = r0;
1391
- var len1 = r1;
1392
- if (r3) {
1393
- ptr1 = 0; len1 = 0;
1394
- throw takeObject(r2);
1395
- }
1396
- deferred2_0 = ptr1;
1397
- deferred2_1 = len1;
1398
- return getStringFromWasm0(ptr1, len1);
1399
- } finally {
1400
- wasm.__wbindgen_add_to_stack_pointer(16);
1401
- wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
1402
- }
1403
- }
1404
- }
1405
-
1406
- const PropertyFinalization = (typeof FinalizationRegistry === 'undefined')
1407
- ? { register: () => {}, unregister: () => {} }
1408
- : new FinalizationRegistry(ptr => wasm.__wbg_property_free(ptr >>> 0));
1409
- /**
1410
- * Represents a property within a schema, including type, items, length constraints, and other attributes.
1411
- */
1412
- export class Property {
1413
-
1414
- __destroy_into_raw() {
1415
- const ptr = this.__wbg_ptr;
1416
- this.__wbg_ptr = 0;
1417
- PropertyFinalization.unregister(this);
1418
- return ptr;
1419
- }
1420
-
1421
- free() {
1422
- const ptr = this.__destroy_into_raw();
1423
- wasm.__wbg_property_free(ptr);
1424
- }
1425
- /**
1426
- * Checks is the schema is valid.
1427
- *
1428
- * # Returns
1429
- *
1430
- * Throws exception if not valid
1431
- * @returns {boolean}
1432
- */
1433
- is_valid() {
1434
- try {
1435
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1436
- wasm.property_is_valid(retptr, this.__wbg_ptr);
1437
- var r0 = getInt32Memory0()[retptr / 4 + 0];
1438
- var r1 = getInt32Memory0()[retptr / 4 + 1];
1439
- var r2 = getInt32Memory0()[retptr / 4 + 2];
1440
- if (r2) {
1441
- throw takeObject(r1);
1442
- }
1443
- return r0 !== 0;
1444
- } finally {
1445
- wasm.__wbindgen_add_to_stack_pointer(16);
1446
- }
1447
- }
1448
- /**
1449
- * Retrieves the type of the property.
1450
- *
1451
- * # Returns
1452
- *
1453
- * * `PropertyType` - The type of the property.
1454
- * @returns {any}
1455
- */
1456
- get type() {
1457
- const ret = wasm.property_type(this.__wbg_ptr);
1458
- return takeObject(ret);
1459
- }
1460
- /**
1461
- * Retrieves the items of the property.
1462
- *
1463
- * # Returns
1464
- *
1465
- * * `Result<JsValue, JsValue>` - A result containing the items as a `JsValue` or an error.
1466
- * @returns {any}
1467
- */
1468
- get items() {
1469
- try {
1470
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1471
- wasm.property_items(retptr, this.__wbg_ptr);
1472
- var r0 = getInt32Memory0()[retptr / 4 + 0];
1473
- var r1 = getInt32Memory0()[retptr / 4 + 1];
1474
- var r2 = getInt32Memory0()[retptr / 4 + 2];
1475
- if (r2) {
1476
- throw takeObject(r1);
1477
- }
1478
- return takeObject(r0);
1479
- } finally {
1480
- wasm.__wbindgen_add_to_stack_pointer(16);
1481
- }
1482
- }
1483
- /**
1484
- * Retrieves the maximum number of items of the property.
1485
- *
1486
- * # Returns
1487
- *
1488
- * * `Result<JsValue, JsValue>` - A result containing the maximum number of items as a `JsValue` or an error.
1489
- * @returns {any}
1490
- */
1491
- get maxItems() {
1492
- try {
1493
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1494
- wasm.property_maxItems(retptr, this.__wbg_ptr);
1495
- var r0 = getInt32Memory0()[retptr / 4 + 0];
1496
- var r1 = getInt32Memory0()[retptr / 4 + 1];
1497
- var r2 = getInt32Memory0()[retptr / 4 + 2];
1498
- if (r2) {
1499
- throw takeObject(r1);
1500
- }
1501
- return takeObject(r0);
1502
- } finally {
1503
- wasm.__wbindgen_add_to_stack_pointer(16);
1504
- }
1505
- }
1506
- /**
1507
- * Retrieves the minimum number of items of the property.
1508
- *
1509
- * # Returns
1510
- *
1511
- * * `Result<JsValue, JsValue>` - A result containing the minimum number of items as a `JsValue` or an error.
1512
- * @returns {any}
1513
- */
1514
- get minItems() {
1515
- try {
1516
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1517
- wasm.property_minItems(retptr, this.__wbg_ptr);
1518
- var r0 = getInt32Memory0()[retptr / 4 + 0];
1519
- var r1 = getInt32Memory0()[retptr / 4 + 1];
1520
- var r2 = getInt32Memory0()[retptr / 4 + 2];
1521
- if (r2) {
1522
- throw takeObject(r1);
1523
- }
1524
- return takeObject(r0);
1525
- } finally {
1526
- wasm.__wbindgen_add_to_stack_pointer(16);
1527
- }
1528
- }
1529
- /**
1530
- * Retrieves the maximum length of the property.
1531
- *
1532
- * # Returns
1533
- *
1534
- * * `Result<JsValue, JsValue>` - A result containing the maximum length as a `JsValue` or an error.
1535
- * @returns {any}
1536
- */
1537
- get maxLength() {
1538
- try {
1539
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1540
- wasm.property_maxLength(retptr, this.__wbg_ptr);
1541
- var r0 = getInt32Memory0()[retptr / 4 + 0];
1542
- var r1 = getInt32Memory0()[retptr / 4 + 1];
1543
- var r2 = getInt32Memory0()[retptr / 4 + 2];
1544
- if (r2) {
1545
- throw takeObject(r1);
1546
- }
1547
- return takeObject(r0);
1548
- } finally {
1549
- wasm.__wbindgen_add_to_stack_pointer(16);
1550
- }
1551
- }
1552
- /**
1553
- * Retrieves the minimum length of the property.
1554
- *
1555
- * # Returns
1556
- *
1557
- * * `Result<JsValue, JsValue>` - A result containing the minimum length as a `JsValue` or an error.
1558
- * @returns {any}
1559
- */
1560
- get minLength() {
1561
- try {
1562
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1563
- wasm.property_minLength(retptr, this.__wbg_ptr);
1564
- var r0 = getInt32Memory0()[retptr / 4 + 0];
1565
- var r1 = getInt32Memory0()[retptr / 4 + 1];
1566
- var r2 = getInt32Memory0()[retptr / 4 + 2];
1567
- if (r2) {
1568
- throw takeObject(r1);
1569
- }
1570
- return takeObject(r0);
1571
- } finally {
1572
- wasm.__wbindgen_add_to_stack_pointer(16);
1573
- }
1574
- }
1575
- /**
1576
- * Retrieves the nested properties of the property.
1577
- *
1578
- * # Returns
1579
- *
1580
- * * `Result<JsValue, JsValue>` - A result containing the nested properties as a `JsValue` or an error.
1581
- * @returns {any}
1582
- */
1583
- get properties() {
1584
- try {
1585
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1586
- wasm.property_properties(retptr, this.__wbg_ptr);
1587
- var r0 = getInt32Memory0()[retptr / 4 + 0];
1588
- var r1 = getInt32Memory0()[retptr / 4 + 1];
1589
- var r2 = getInt32Memory0()[retptr / 4 + 2];
1590
- if (r2) {
1591
- throw takeObject(r1);
1592
- }
1593
- return takeObject(r0);
1594
- } finally {
1595
- wasm.__wbindgen_add_to_stack_pointer(16);
1596
- }
1597
- }
1598
- }
1599
-
1600
- const QueryFinalization = (typeof FinalizationRegistry === 'undefined')
1601
- ? { register: () => {}, unregister: () => {} }
1602
- : new FinalizationRegistry(ptr => wasm.__wbg_query_free(ptr >>> 0));
1603
- /**
1604
- */
1605
- export class Query {
1606
-
1607
- __destroy_into_raw() {
1608
- const ptr = this.__wbg_ptr;
1609
- this.__wbg_ptr = 0;
1610
- QueryFinalization.unregister(this);
1611
- return ptr;
1612
- }
1613
-
1614
- free() {
1615
- const ptr = this.__destroy_into_raw();
1616
- wasm.__wbg_query_free(ptr);
1617
- }
1618
- /**
1619
- * @param {any} query
1620
- * @param {Schema} schema
1621
- */
1622
- constructor(query, schema) {
1623
- try {
1624
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1625
- _assertClass(schema, Schema);
1626
- var ptr0 = schema.__destroy_into_raw();
1627
- wasm.query_new(retptr, addHeapObject(query), ptr0);
1628
- var r0 = getInt32Memory0()[retptr / 4 + 0];
1629
- var r1 = getInt32Memory0()[retptr / 4 + 1];
1630
- var r2 = getInt32Memory0()[retptr / 4 + 2];
1631
- if (r2) {
1632
- throw takeObject(r1);
1633
- }
1634
- this.__wbg_ptr = r0 >>> 0;
1635
- return this;
1636
- } finally {
1637
- wasm.__wbindgen_add_to_stack_pointer(16);
1638
- }
1639
- }
1640
- /**
1641
- * @returns {any}
1642
- */
1643
- get query() {
1644
- try {
1645
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1646
- wasm.query_query(retptr, this.__wbg_ptr);
1647
- var r0 = getInt32Memory0()[retptr / 4 + 0];
1648
- var r1 = getInt32Memory0()[retptr / 4 + 1];
1649
- var r2 = getInt32Memory0()[retptr / 4 + 2];
1650
- if (r2) {
1651
- throw takeObject(r1);
1652
- }
1653
- return takeObject(r0);
1654
- } finally {
1655
- wasm.__wbindgen_add_to_stack_pointer(16);
1656
- }
1657
- }
1658
- /**
1659
- * Returns the schema properties (fields) that are used in the query.
1660
- * The query may contain operators like $and, $or, $gt, $lt, etc.
1661
- * @returns {(string)[]}
1662
- */
1663
- get_properties() {
1664
- try {
1665
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1666
- wasm.query_get_properties(retptr, this.__wbg_ptr);
1667
- var r0 = getInt32Memory0()[retptr / 4 + 0];
1668
- var r1 = getInt32Memory0()[retptr / 4 + 1];
1669
- var r2 = getInt32Memory0()[retptr / 4 + 2];
1670
- var r3 = getInt32Memory0()[retptr / 4 + 3];
1671
- if (r3) {
1672
- throw takeObject(r2);
1673
- }
1674
- var v1 = getArrayJsValueFromWasm0(r0, r1).slice();
1675
- wasm.__wbindgen_free(r0, r1 * 4, 4);
1676
- return v1;
1677
- } finally {
1678
- wasm.__wbindgen_add_to_stack_pointer(16);
1679
- }
1680
- }
1681
- /**
1682
- * @returns {any}
1683
- */
1684
- parse() {
1685
- try {
1686
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1687
- wasm.query_parse(retptr, this.__wbg_ptr);
1688
- var r0 = getInt32Memory0()[retptr / 4 + 0];
1689
- var r1 = getInt32Memory0()[retptr / 4 + 1];
1690
- var r2 = getInt32Memory0()[retptr / 4 + 2];
1691
- if (r2) {
1692
- throw takeObject(r1);
1693
- }
1694
- return takeObject(r0);
1695
- } finally {
1696
- wasm.__wbindgen_add_to_stack_pointer(16);
1697
- }
1698
- }
1699
- /**
1700
- * @param {any} query
1701
- * @returns {any}
1702
- */
1703
- process_query(query) {
1704
- try {
1705
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1706
- wasm.query_process_query(retptr, this.__wbg_ptr, addBorrowedObject(query));
1707
- var r0 = getInt32Memory0()[retptr / 4 + 0];
1708
- var r1 = getInt32Memory0()[retptr / 4 + 1];
1709
- var r2 = getInt32Memory0()[retptr / 4 + 2];
1710
- if (r2) {
1711
- throw takeObject(r1);
1712
- }
1713
- return takeObject(r0);
1714
- } finally {
1715
- wasm.__wbindgen_add_to_stack_pointer(16);
1716
- heap[stack_pointer++] = undefined;
1717
- }
1718
- }
1719
- /**
1720
- * Returns the value of a property from the (normalized) query by its name.
1721
- * This will scan the normalized query structure (including arrays, $and/$or blocks, etc.)
1722
- * to find the first occurrence of the given property name and return its corresponding value.
1723
- *
1724
- * If not found, an error is returned.
1725
- *
1726
- * Example:
1727
- * let val = query.get("age")?;
1728
- * // val is a JsValue that might be a number, string, boolean, array, or object (e.g., { "$gt": 30 })
1729
- * @param {string} property_name
1730
- * @returns {any}
1731
- */
1732
- get(property_name) {
1733
- try {
1734
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1735
- const ptr0 = passStringToWasm0(property_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1736
- const len0 = WASM_VECTOR_LEN;
1737
- wasm.query_get(retptr, this.__wbg_ptr, ptr0, len0);
1738
- var r0 = getInt32Memory0()[retptr / 4 + 0];
1739
- var r1 = getInt32Memory0()[retptr / 4 + 1];
1740
- var r2 = getInt32Memory0()[retptr / 4 + 2];
1741
- if (r2) {
1742
- throw takeObject(r1);
1743
- }
1744
- return takeObject(r0);
1745
- } finally {
1746
- wasm.__wbindgen_add_to_stack_pointer(16);
1747
- }
1748
- }
1749
- }
1750
-
1751
- const QueryOptionsFinalization = (typeof FinalizationRegistry === 'undefined')
1752
- ? { register: () => {}, unregister: () => {} }
1753
- : new FinalizationRegistry(ptr => wasm.__wbg_queryoptions_free(ptr >>> 0));
1754
- /**
1755
- */
1756
- export class QueryOptions {
1757
-
1758
- static __wrap(ptr) {
1759
- ptr = ptr >>> 0;
1760
- const obj = Object.create(QueryOptions.prototype);
1761
- obj.__wbg_ptr = ptr;
1762
- QueryOptionsFinalization.register(obj, obj.__wbg_ptr, obj);
1763
- return obj;
1764
- }
1765
-
1766
- __destroy_into_raw() {
1767
- const ptr = this.__wbg_ptr;
1768
- this.__wbg_ptr = 0;
1769
- QueryOptionsFinalization.unregister(this);
1770
- return ptr;
1771
- }
1772
-
1773
- free() {
1774
- const ptr = this.__destroy_into_raw();
1775
- wasm.__wbg_queryoptions_free(ptr);
1776
- }
1777
- /**
1778
- * @returns {any}
1779
- */
1780
- get limit() {
1781
- try {
1782
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1783
- wasm.queryoptions_limit(retptr, this.__wbg_ptr);
1784
- var r0 = getInt32Memory0()[retptr / 4 + 0];
1785
- var r1 = getInt32Memory0()[retptr / 4 + 1];
1786
- var r2 = getInt32Memory0()[retptr / 4 + 2];
1787
- if (r2) {
1788
- throw takeObject(r1);
1789
- }
1790
- return takeObject(r0);
1791
- } finally {
1792
- wasm.__wbindgen_add_to_stack_pointer(16);
1793
- }
1794
- }
1795
- /**
1796
- * @returns {any}
1797
- */
1798
- get offset() {
1799
- try {
1800
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1801
- wasm.queryoptions_offset(retptr, this.__wbg_ptr);
1802
- var r0 = getInt32Memory0()[retptr / 4 + 0];
1803
- var r1 = getInt32Memory0()[retptr / 4 + 1];
1804
- var r2 = getInt32Memory0()[retptr / 4 + 2];
1805
- if (r2) {
1806
- throw takeObject(r1);
1807
- }
1808
- return takeObject(r0);
1809
- } finally {
1810
- wasm.__wbindgen_add_to_stack_pointer(16);
1811
- }
1812
- }
1813
- }
1814
-
1815
- const RIDBErrorFinalization = (typeof FinalizationRegistry === 'undefined')
1816
- ? { register: () => {}, unregister: () => {} }
1817
- : new FinalizationRegistry(ptr => wasm.__wbg_ridberror_free(ptr >>> 0));
1818
- /**
1819
- */
1820
- export class RIDBError {
1821
-
1822
- static __wrap(ptr) {
1823
- ptr = ptr >>> 0;
1824
- const obj = Object.create(RIDBError.prototype);
1825
- obj.__wbg_ptr = ptr;
1826
- RIDBErrorFinalization.register(obj, obj.__wbg_ptr, obj);
1827
- return obj;
1828
- }
1829
-
1830
- toJSON() {
1831
- return {
1832
- type: this.type,
1833
- code: this.code,
1834
- message: this.message,
1835
- };
1836
- }
1837
-
1838
- toString() {
1839
- return JSON.stringify(this);
1840
- }
1841
-
1842
- __destroy_into_raw() {
1843
- const ptr = this.__wbg_ptr;
1844
- this.__wbg_ptr = 0;
1845
- RIDBErrorFinalization.unregister(this);
1846
- return ptr;
1847
- }
1848
-
1849
- free() {
1850
- const ptr = this.__destroy_into_raw();
1851
- wasm.__wbg_ridberror_free(ptr);
1852
- }
1853
- /**
1854
- * @param {string} err_type
1855
- * @param {string} message
1856
- * @param {number} code
1857
- */
1858
- constructor(err_type, message, code) {
1859
- const ptr0 = passStringToWasm0(err_type, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1860
- const len0 = WASM_VECTOR_LEN;
1861
- const ptr1 = passStringToWasm0(message, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1862
- const len1 = WASM_VECTOR_LEN;
1863
- const ret = wasm.ridberror_new(ptr0, len0, ptr1, len1, code);
1864
- this.__wbg_ptr = ret >>> 0;
1865
- return this;
1866
- }
1867
- /**
1868
- * @returns {string}
1869
- */
1870
- get type() {
1871
- let deferred1_0;
1872
- let deferred1_1;
1873
- try {
1874
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1875
- wasm.ridberror_type(retptr, this.__wbg_ptr);
1876
- var r0 = getInt32Memory0()[retptr / 4 + 0];
1877
- var r1 = getInt32Memory0()[retptr / 4 + 1];
1878
- deferred1_0 = r0;
1879
- deferred1_1 = r1;
1880
- return getStringFromWasm0(r0, r1);
1881
- } finally {
1882
- wasm.__wbindgen_add_to_stack_pointer(16);
1883
- wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
1884
- }
1885
- }
1886
- /**
1887
- * @returns {any}
1888
- */
1889
- get code() {
1890
- const ret = wasm.ridberror_code(this.__wbg_ptr);
1891
- return takeObject(ret);
1892
- }
1893
- /**
1894
- * @returns {string}
1895
- */
1896
- get message() {
1897
- let deferred1_0;
1898
- let deferred1_1;
1899
- try {
1900
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1901
- wasm.ridberror_message(retptr, this.__wbg_ptr);
1902
- var r0 = getInt32Memory0()[retptr / 4 + 0];
1903
- var r1 = getInt32Memory0()[retptr / 4 + 1];
1904
- deferred1_0 = r0;
1905
- deferred1_1 = r1;
1906
- return getStringFromWasm0(r0, r1);
1907
- } finally {
1908
- wasm.__wbindgen_add_to_stack_pointer(16);
1909
- wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
1910
- }
1911
- }
1912
- /**
1913
- * @param {any} err
1914
- * @returns {RIDBError}
1915
- */
1916
- static from(err) {
1917
- const ret = wasm.ridberror_from(addHeapObject(err));
1918
- return RIDBError.__wrap(ret);
1919
- }
1920
- /**
1921
- * @param {string} err
1922
- * @param {number} code
1923
- * @returns {RIDBError}
1924
- */
1925
- static error(err, code) {
1926
- const ptr0 = passStringToWasm0(err, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1927
- const len0 = WASM_VECTOR_LEN;
1928
- const ret = wasm.ridberror_error(ptr0, len0, code);
1929
- return RIDBError.__wrap(ret);
1930
- }
1931
- /**
1932
- * @param {string} err
1933
- * @param {number} code
1934
- * @returns {RIDBError}
1935
- */
1936
- static query(err, code) {
1937
- const ptr0 = passStringToWasm0(err, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1938
- const len0 = WASM_VECTOR_LEN;
1939
- const ret = wasm.ridberror_query(ptr0, len0, code);
1940
- return RIDBError.__wrap(ret);
1941
- }
1942
- /**
1943
- * @param {string} err
1944
- * @param {number} code
1945
- * @returns {RIDBError}
1946
- */
1947
- static authentication(err, code) {
1948
- const ptr0 = passStringToWasm0(err, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1949
- const len0 = WASM_VECTOR_LEN;
1950
- const ret = wasm.ridberror_authentication(ptr0, len0, code);
1951
- return RIDBError.__wrap(ret);
1952
- }
1953
- /**
1954
- * @param {string} err
1955
- * @param {number} code
1956
- * @returns {RIDBError}
1957
- */
1958
- static serialisation(err, code) {
1959
- const ptr0 = passStringToWasm0(err, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1960
- const len0 = WASM_VECTOR_LEN;
1961
- const ret = wasm.ridberror_serialisation(ptr0, len0, code);
1962
- return RIDBError.__wrap(ret);
1963
- }
1964
- /**
1965
- * @param {string} err
1966
- * @param {number} code
1967
- * @returns {RIDBError}
1968
- */
1969
- static validation(err, code) {
1970
- const ptr0 = passStringToWasm0(err, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1971
- const len0 = WASM_VECTOR_LEN;
1972
- const ret = wasm.ridberror_validation(ptr0, len0, code);
1973
- return RIDBError.__wrap(ret);
1974
- }
1975
- /**
1976
- * @param {string} err
1977
- * @param {number} code
1978
- * @returns {RIDBError}
1979
- */
1980
- static hook(err, code) {
1981
- const ptr0 = passStringToWasm0(err, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1982
- const len0 = WASM_VECTOR_LEN;
1983
- const ret = wasm.ridberror_hook(ptr0, len0, code);
1984
- return RIDBError.__wrap(ret);
1985
- }
1986
- }
1987
-
1988
- const SchemaFinalization = (typeof FinalizationRegistry === 'undefined')
1989
- ? { register: () => {}, unregister: () => {} }
1990
- : new FinalizationRegistry(ptr => wasm.__wbg_schema_free(ptr >>> 0));
1991
- /**
1992
- * Represents the schema of a collection, including version, primary key, type, required fields, properties, and indexes.
1993
- */
1994
- export class Schema {
1995
-
1996
- static __wrap(ptr) {
1997
- ptr = ptr >>> 0;
1998
- const obj = Object.create(Schema.prototype);
1999
- obj.__wbg_ptr = ptr;
2000
- SchemaFinalization.register(obj, obj.__wbg_ptr, obj);
2001
- return obj;
2002
- }
2003
-
2004
- __destroy_into_raw() {
2005
- const ptr = this.__wbg_ptr;
2006
- this.__wbg_ptr = 0;
2007
- SchemaFinalization.unregister(this);
2008
- return ptr;
2009
- }
2010
-
2011
- free() {
2012
- const ptr = this.__destroy_into_raw();
2013
- wasm.__wbg_schema_free(ptr);
2014
- }
2015
- /**
2016
- * @param {any} document
2017
- */
2018
- validate(document) {
2019
- try {
2020
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2021
- wasm.schema_validate(retptr, this.__wbg_ptr, addHeapObject(document));
2022
- var r0 = getInt32Memory0()[retptr / 4 + 0];
2023
- var r1 = getInt32Memory0()[retptr / 4 + 1];
2024
- if (r1) {
2025
- throw takeObject(r0);
2026
- }
2027
- } finally {
2028
- wasm.__wbindgen_add_to_stack_pointer(16);
2029
- }
2030
- }
2031
- /**
2032
- * @returns {boolean}
2033
- */
2034
- is_valid() {
2035
- try {
2036
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2037
- wasm.schema_is_valid(retptr, this.__wbg_ptr);
2038
- var r0 = getInt32Memory0()[retptr / 4 + 0];
2039
- var r1 = getInt32Memory0()[retptr / 4 + 1];
2040
- var r2 = getInt32Memory0()[retptr / 4 + 2];
2041
- if (r2) {
2042
- throw takeObject(r1);
2043
- }
2044
- return r0 !== 0;
2045
- } finally {
2046
- wasm.__wbindgen_add_to_stack_pointer(16);
2047
- }
2048
- }
2049
- /**
2050
- * Creates a new `Schema` instance from a given `JsValue`.
2051
- *
2052
- * # Arguments
2053
- *
2054
- * * `schema` - A `JsValue` representing the schema.
2055
- *
2056
- * # Returns
2057
- *
2058
- * * `Result<Schema, JsValue>` - A result containing the new `Schema` instance or an error.
2059
- * @param {any} schema
2060
- * @returns {Schema}
2061
- */
2062
- static create(schema) {
2063
- try {
2064
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2065
- wasm.schema_create(retptr, addHeapObject(schema));
2066
- var r0 = getInt32Memory0()[retptr / 4 + 0];
2067
- var r1 = getInt32Memory0()[retptr / 4 + 1];
2068
- var r2 = getInt32Memory0()[retptr / 4 + 2];
2069
- if (r2) {
2070
- throw takeObject(r1);
2071
- }
2072
- return Schema.__wrap(r0);
2073
- } finally {
2074
- wasm.__wbindgen_add_to_stack_pointer(16);
2075
- }
2076
- }
2077
- /**
2078
- * Retrieves the version of the schema.
2079
- *
2080
- * # Returns
2081
- *
2082
- * * `i32` - The version of the schema.
2083
- * @returns {number}
2084
- */
2085
- get version() {
2086
- const ret = wasm.schema_version(this.__wbg_ptr);
2087
- return ret;
2088
- }
2089
- /**
2090
- * Retrieves the primary key of the schema.
2091
- *
2092
- * # Returns
2093
- *
2094
- * * `String` - The primary key of the schema.
2095
- * @returns {string}
2096
- */
2097
- get primaryKey() {
2098
- let deferred1_0;
2099
- let deferred1_1;
2100
- try {
2101
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2102
- wasm.schema_primaryKey(retptr, this.__wbg_ptr);
2103
- var r0 = getInt32Memory0()[retptr / 4 + 0];
2104
- var r1 = getInt32Memory0()[retptr / 4 + 1];
2105
- deferred1_0 = r0;
2106
- deferred1_1 = r1;
2107
- return getStringFromWasm0(r0, r1);
2108
- } finally {
2109
- wasm.__wbindgen_add_to_stack_pointer(16);
2110
- wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
2111
- }
2112
- }
2113
- /**
2114
- * Retrieves the type of the schema.
2115
- *
2116
- * # Returns
2117
- *
2118
- * * `String` - The type of the schema.
2119
- * @returns {string}
2120
- */
2121
- get type() {
2122
- let deferred1_0;
2123
- let deferred1_1;
2124
- try {
2125
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2126
- wasm.schema_type(retptr, this.__wbg_ptr);
2127
- var r0 = getInt32Memory0()[retptr / 4 + 0];
2128
- var r1 = getInt32Memory0()[retptr / 4 + 1];
2129
- deferred1_0 = r0;
2130
- deferred1_1 = r1;
2131
- return getStringFromWasm0(r0, r1);
2132
- } finally {
2133
- wasm.__wbindgen_add_to_stack_pointer(16);
2134
- wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
2135
- }
2136
- }
2137
- /**
2138
- * Retrieves the indexes of the schema, if any.
2139
- *
2140
- * # Returns
2141
- *
2142
- * * `Option<Vec<String>>` - The indexes of the schema, if any.
2143
- * @returns {(string)[] | undefined}
2144
- */
2145
- get indexes() {
2146
- try {
2147
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2148
- wasm.schema_indexes(retptr, this.__wbg_ptr);
2149
- var r0 = getInt32Memory0()[retptr / 4 + 0];
2150
- var r1 = getInt32Memory0()[retptr / 4 + 1];
2151
- let v1;
2152
- if (r0 !== 0) {
2153
- v1 = getArrayJsValueFromWasm0(r0, r1).slice();
2154
- wasm.__wbindgen_free(r0, r1 * 4, 4);
2155
- }
2156
- return v1;
2157
- } finally {
2158
- wasm.__wbindgen_add_to_stack_pointer(16);
2159
- }
2160
- }
2161
- /**
2162
- * @returns {(string)[] | undefined}
2163
- */
2164
- get encrypted() {
2165
- try {
2166
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2167
- wasm.schema_encrypted(retptr, this.__wbg_ptr);
2168
- var r0 = getInt32Memory0()[retptr / 4 + 0];
2169
- var r1 = getInt32Memory0()[retptr / 4 + 1];
2170
- let v1;
2171
- if (r0 !== 0) {
2172
- v1 = getArrayJsValueFromWasm0(r0, r1).slice();
2173
- wasm.__wbindgen_free(r0, r1 * 4, 4);
2174
- }
2175
- return v1;
2176
- } finally {
2177
- wasm.__wbindgen_add_to_stack_pointer(16);
2178
- }
2179
- }
2180
- /**
2181
- * Retrieves the properties of the schema.
2182
- *
2183
- * # Returns
2184
- *
2185
- * * `Result<JsValue, JsValue>` - A result containing the properties as a `JsValue` or an error.
2186
- * @returns {any}
2187
- */
2188
- get properties() {
2189
- try {
2190
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2191
- wasm.schema_properties(retptr, this.__wbg_ptr);
2192
- var r0 = getInt32Memory0()[retptr / 4 + 0];
2193
- var r1 = getInt32Memory0()[retptr / 4 + 1];
2194
- var r2 = getInt32Memory0()[retptr / 4 + 2];
2195
- if (r2) {
2196
- throw takeObject(r1);
2197
- }
2198
- return takeObject(r0);
2199
- } finally {
2200
- wasm.__wbindgen_add_to_stack_pointer(16);
2201
- }
2202
- }
2203
- }
2204
-
2205
- const WasmBindgenTestContextFinalization = (typeof FinalizationRegistry === 'undefined')
2206
- ? { register: () => {}, unregister: () => {} }
2207
- : new FinalizationRegistry(ptr => wasm.__wbg_wasmbindgentestcontext_free(ptr >>> 0));
2208
- /**
2209
- * Runtime test harness support instantiated in JS.
2210
- *
2211
- * The node.js entry script instantiates a `Context` here which is used to
2212
- * drive test execution.
2213
- */
2214
- export class WasmBindgenTestContext {
2215
-
2216
- __destroy_into_raw() {
2217
- const ptr = this.__wbg_ptr;
2218
- this.__wbg_ptr = 0;
2219
- WasmBindgenTestContextFinalization.unregister(this);
2220
- return ptr;
2221
- }
2222
-
2223
- free() {
2224
- const ptr = this.__destroy_into_raw();
2225
- wasm.__wbg_wasmbindgentestcontext_free(ptr);
2226
- }
2227
- /**
2228
- * Creates a new context ready to run tests.
2229
- *
2230
- * A `Context` is the main structure through which test execution is
2231
- * coordinated, and this will collect output and results for all executed
2232
- * tests.
2233
- */
2234
- constructor() {
2235
- const ret = wasm.wasmbindgentestcontext_new();
2236
- this.__wbg_ptr = ret >>> 0;
2237
- return this;
2238
- }
2239
- /**
2240
- * Inform this context about runtime arguments passed to the test
2241
- * harness.
2242
- * @param {any[]} args
2243
- */
2244
- args(args) {
2245
- const ptr0 = passArrayJsValueToWasm0(args, wasm.__wbindgen_malloc);
2246
- const len0 = WASM_VECTOR_LEN;
2247
- wasm.wasmbindgentestcontext_args(this.__wbg_ptr, ptr0, len0);
2248
- }
2249
- /**
2250
- * Executes a list of tests, returning a promise representing their
2251
- * eventual completion.
2252
- *
2253
- * This is the main entry point for executing tests. All the tests passed
2254
- * in are the JS `Function` object that was plucked off the
2255
- * `WebAssembly.Instance` exports list.
2256
- *
2257
- * The promise returned resolves to either `true` if all tests passed or
2258
- * `false` if at least one test failed.
2259
- * @param {any[]} tests
2260
- * @returns {Promise<any>}
2261
- */
2262
- run(tests) {
2263
- const ptr0 = passArrayJsValueToWasm0(tests, wasm.__wbindgen_malloc);
2264
- const len0 = WASM_VECTOR_LEN;
2265
- const ret = wasm.wasmbindgentestcontext_run(this.__wbg_ptr, ptr0, len0);
2266
- return takeObject(ret);
2267
- }
2268
- }
2269
-
2270
- async function __wbg_load(module, imports) {
2271
- if (typeof Response === 'function' && module instanceof Response) {
2272
- if (typeof WebAssembly.instantiateStreaming === 'function') {
2273
- try {
2274
- return await WebAssembly.instantiateStreaming(module, imports);
2275
-
2276
- } catch (e) {
2277
- if (module.headers.get('Content-Type') != 'application/wasm') {
2278
- 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);
2279
-
2280
- } else {
2281
- throw e;
2282
- }
2283
- }
2284
- }
2285
-
2286
- const bytes = await module.arrayBuffer();
2287
- return await WebAssembly.instantiate(bytes, imports);
2288
-
2289
- } else {
2290
- const instance = await WebAssembly.instantiate(module, imports);
2291
-
2292
- if (instance instanceof WebAssembly.Instance) {
2293
- return { instance, module };
2294
-
2295
- } else {
2296
- return instance;
2297
- }
2298
- }
2299
- }
2300
-
2301
- function __wbg_get_imports() {
2302
- const imports = {};
2303
- imports.wbg = {};
2304
- imports.wbg.__wbindgen_object_drop_ref = function(arg0) {
2305
- takeObject(arg0);
2306
- };
2307
- imports.wbg.__wbg_ridberror_new = function(arg0) {
2308
- const ret = RIDBError.__wrap(arg0);
2309
- return addHeapObject(ret);
2310
- };
2311
- imports.wbg.__wbg_find_567c5c9f064fe3d2 = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
2312
- const ret = getObject(arg0).find(getStringFromWasm0(arg1, arg2), takeObject(arg3), QueryOptions.__wrap(arg4));
2313
- return addHeapObject(ret);
2314
- }, arguments) };
2315
- imports.wbg.__wbindgen_object_clone_ref = function(arg0) {
2316
- const ret = getObject(arg0);
2317
- return addHeapObject(ret);
2318
- };
2319
- imports.wbg.__wbindgen_string_new = function(arg0, arg1) {
2320
- const ret = getStringFromWasm0(arg0, arg1);
2321
- return addHeapObject(ret);
2322
- };
2323
- imports.wbg.__wbindgen_is_undefined = function(arg0) {
2324
- const ret = getObject(arg0) === undefined;
2325
- return ret;
2326
- };
2327
- imports.wbg.__wbindgen_is_null = function(arg0) {
2328
- const ret = getObject(arg0) === null;
2329
- return ret;
2330
- };
2331
- imports.wbg.__wbg_start_76c138c3b73ae6f8 = function() { return handleError(function (arg0) {
2332
- const ret = getObject(arg0).start();
2333
- return addHeapObject(ret);
2334
- }, arguments) };
2335
- imports.wbg.__wbindgen_number_new = function(arg0) {
2336
- const ret = arg0;
2337
- return addHeapObject(ret);
2338
- };
2339
- imports.wbg.__wbg_close_6384ed3c27ef25c1 = function() { return handleError(function (arg0) {
2340
- const ret = getObject(arg0).close();
2341
- return addHeapObject(ret);
2342
- }, arguments) };
2343
- imports.wbg.__wbindgen_string_get = function(arg0, arg1) {
2344
- const obj = getObject(arg1);
2345
- const ret = typeof(obj) === 'string' ? obj : undefined;
2346
- var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2347
- var len1 = WASM_VECTOR_LEN;
2348
- getInt32Memory0()[arg0 / 4 + 1] = len1;
2349
- getInt32Memory0()[arg0 / 4 + 0] = ptr1;
2350
- };
2351
- imports.wbg.__wbg_apply_9f557eba1534d597 = function() { return handleError(function (arg0, arg1, arg2) {
2352
- const ret = getObject(arg1).apply(takeObject(arg2));
2353
- const ptr1 = passArrayJsValueToWasm0(ret, wasm.__wbindgen_malloc);
2354
- const len1 = WASM_VECTOR_LEN;
2355
- getInt32Memory0()[arg0 / 4 + 1] = len1;
2356
- getInt32Memory0()[arg0 / 4 + 0] = ptr1;
2357
- }, arguments) };
2358
- imports.wbg.__wbg_inmemory_new = function(arg0) {
2359
- const ret = InMemory.__wrap(arg0);
2360
- return addHeapObject(ret);
2361
- };
2362
- imports.wbg.__wbg_count_19db4c3174d573d5 = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
2363
- const ret = getObject(arg0).count(getStringFromWasm0(arg1, arg2), takeObject(arg3), QueryOptions.__wrap(arg4));
2364
- return addHeapObject(ret);
2365
- }, arguments) };
2366
- imports.wbg.__wbindgen_number_get = function(arg0, arg1) {
2367
- const obj = getObject(arg1);
2368
- const ret = typeof(obj) === 'number' ? obj : undefined;
2369
- getFloat64Memory0()[arg0 / 8 + 1] = isLikeNone(ret) ? 0 : ret;
2370
- getInt32Memory0()[arg0 / 4 + 0] = !isLikeNone(ret);
2371
- };
2372
- imports.wbg.__wbindgen_cb_drop = function(arg0) {
2373
- const obj = takeObject(arg0).original;
2374
- if (obj.cnt-- == 1) {
2375
- obj.a = 0;
2376
- return true;
2377
- }
2378
- const ret = false;
2379
- return ret;
2380
- };
2381
- imports.wbg.__wbg_findDocumentById_2edf7350e5f12657 = function() { return handleError(function (arg0, arg1, arg2, arg3) {
2382
- const ret = getObject(arg0).findDocumentById(getStringFromWasm0(arg1, arg2), takeObject(arg3));
2383
- return addHeapObject(ret);
2384
- }, arguments) };
2385
- imports.wbg.__wbg_write_1159c67c07f62020 = function() { return handleError(function (arg0, arg1) {
2386
- const ret = getObject(arg0).write(Operation.__wrap(arg1));
2387
- return addHeapObject(ret);
2388
- }, arguments) };
2389
- imports.wbg.__wbindgen_is_array = function(arg0) {
2390
- const ret = Array.isArray(getObject(arg0));
2391
- return ret;
2392
- };
2393
- imports.wbg.__wbindgen_is_object = function(arg0) {
2394
- const val = getObject(arg0);
2395
- const ret = typeof(val) === 'object' && val !== null;
2396
- return ret;
2397
- };
2398
- imports.wbg.__wbindgen_is_string = function(arg0) {
2399
- const ret = typeof(getObject(arg0)) === 'string';
2400
- return ret;
2401
- };
2402
- imports.wbg.__wbindgen_is_falsy = function(arg0) {
2403
- const ret = !getObject(arg0);
2404
- return ret;
2405
- };
2406
- imports.wbg.__wbg_indexdb_new = function(arg0) {
2407
- const ret = IndexDB.__wrap(arg0);
2408
- return addHeapObject(ret);
2409
- };
2410
- imports.wbg.__wbg_collection_new = function(arg0) {
2411
- const ret = Collection.__wrap(arg0);
2412
- return addHeapObject(ret);
2413
- };
2414
- imports.wbg.__wbg_database_new = function(arg0) {
2415
- const ret = Database.__wrap(arg0);
2416
- return addHeapObject(ret);
2417
- };
2418
- imports.wbg.__wbindgen_boolean_get = function(arg0) {
2419
- const v = getObject(arg0);
2420
- const ret = typeof(v) === 'boolean' ? (v ? 1 : 0) : 2;
2421
- return ret;
2422
- };
2423
- imports.wbg.__wbindgen_is_function = function(arg0) {
2424
- const ret = typeof(getObject(arg0)) === 'function';
2425
- return ret;
2426
- };
2427
- imports.wbg.__wbindgen_is_bigint = function(arg0) {
2428
- const ret = typeof(getObject(arg0)) === 'bigint';
2429
- return ret;
2430
- };
2431
- imports.wbg.__wbindgen_in = function(arg0, arg1) {
2432
- const ret = getObject(arg0) in getObject(arg1);
2433
- return ret;
2434
- };
2435
- imports.wbg.__wbindgen_bigint_from_i64 = function(arg0) {
2436
- const ret = arg0;
2437
- return addHeapObject(ret);
2438
- };
2439
- imports.wbg.__wbindgen_jsval_eq = function(arg0, arg1) {
2440
- const ret = getObject(arg0) === getObject(arg1);
2441
- return ret;
2442
- };
2443
- imports.wbg.__wbindgen_bigint_from_u64 = function(arg0) {
2444
- const ret = BigInt.asUintN(64, arg0);
2445
- return addHeapObject(ret);
2446
- };
2447
- imports.wbg.__wbindgen_error_new = function(arg0, arg1) {
2448
- const ret = new Error(getStringFromWasm0(arg0, arg1));
2449
- return addHeapObject(ret);
2450
- };
2451
- imports.wbg.__wbg_crypto_1d1f22824a6a080c = function(arg0) {
2452
- const ret = getObject(arg0).crypto;
2453
- return addHeapObject(ret);
2454
- };
2455
- imports.wbg.__wbg_process_4a72847cc503995b = function(arg0) {
2456
- const ret = getObject(arg0).process;
2457
- return addHeapObject(ret);
2458
- };
2459
- imports.wbg.__wbg_versions_f686565e586dd935 = function(arg0) {
2460
- const ret = getObject(arg0).versions;
2461
- return addHeapObject(ret);
2462
- };
2463
- imports.wbg.__wbg_node_104a2ff8d6ea03a2 = function(arg0) {
2464
- const ret = getObject(arg0).node;
2465
- return addHeapObject(ret);
2466
- };
2467
- imports.wbg.__wbg_require_cca90b1a94a0255b = function() { return handleError(function () {
2468
- const ret = module.require;
2469
- return addHeapObject(ret);
2470
- }, arguments) };
2471
- imports.wbg.__wbg_msCrypto_eb05e62b530a1508 = function(arg0) {
2472
- const ret = getObject(arg0).msCrypto;
2473
- return addHeapObject(ret);
2474
- };
2475
- imports.wbg.__wbg_randomFillSync_5c9c955aa56b6049 = function() { return handleError(function (arg0, arg1) {
2476
- getObject(arg0).randomFillSync(takeObject(arg1));
2477
- }, arguments) };
2478
- imports.wbg.__wbg_getRandomValues_3aa56aa6edec874c = function() { return handleError(function (arg0, arg1) {
2479
- getObject(arg0).getRandomValues(getObject(arg1));
2480
- }, arguments) };
2481
- imports.wbg.__wbg_instanceof_Window_f401953a2cf86220 = function(arg0) {
2482
- let result;
2483
- try {
2484
- result = getObject(arg0) instanceof Window;
2485
- } catch (_) {
2486
- result = false;
2487
- }
2488
- const ret = result;
2489
- return ret;
2490
- };
2491
- imports.wbg.__wbg_indexedDB_7c51d9056667f4e0 = function() { return handleError(function (arg0) {
2492
- const ret = getObject(arg0).indexedDB;
2493
- return isLikeNone(ret) ? 0 : addHeapObject(ret);
2494
- }, arguments) };
2495
- imports.wbg.__wbg_instanceof_WorkerGlobalScope_46b577f151fad960 = function(arg0) {
2496
- let result;
2497
- try {
2498
- result = getObject(arg0) instanceof WorkerGlobalScope;
2499
- } catch (_) {
2500
- result = false;
2501
- }
2502
- const ret = result;
2503
- return ret;
2504
- };
2505
- imports.wbg.__wbg_indexedDB_d312f95759a15fdc = function() { return handleError(function (arg0) {
2506
- const ret = getObject(arg0).indexedDB;
2507
- return isLikeNone(ret) ? 0 : addHeapObject(ret);
2508
- }, arguments) };
2509
- imports.wbg.__wbg_openCursor_425aba9cbe1d4d39 = function() { return handleError(function (arg0) {
2510
- const ret = getObject(arg0).openCursor();
2511
- return addHeapObject(ret);
2512
- }, arguments) };
2513
- imports.wbg.__wbg_openCursor_e3042770817a8d57 = function() { return handleError(function (arg0, arg1) {
2514
- const ret = getObject(arg0).openCursor(getObject(arg1));
2515
- return addHeapObject(ret);
2516
- }, arguments) };
2517
- imports.wbg.__wbg_createIndex_b8da1f5571f644be = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4, arg5) {
2518
- const ret = getObject(arg0).createIndex(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4), getObject(arg5));
2519
- return addHeapObject(ret);
2520
- }, arguments) };
2521
- imports.wbg.__wbg_delete_f60bba7d0ae59a4f = function() { return handleError(function (arg0, arg1) {
2522
- const ret = getObject(arg0).delete(getObject(arg1));
2523
- return addHeapObject(ret);
2524
- }, arguments) };
2525
- imports.wbg.__wbg_get_5361b64cac0d0826 = function() { return handleError(function (arg0, arg1) {
2526
- const ret = getObject(arg0).get(getObject(arg1));
2527
- return addHeapObject(ret);
2528
- }, arguments) };
2529
- imports.wbg.__wbg_index_383b6812c1508030 = function() { return handleError(function (arg0, arg1, arg2) {
2530
- const ret = getObject(arg0).index(getStringFromWasm0(arg1, arg2));
2531
- return addHeapObject(ret);
2532
- }, arguments) };
2533
- imports.wbg.__wbg_openCursor_30d58ae27a327629 = function() { return handleError(function (arg0) {
2534
- const ret = getObject(arg0).openCursor();
2535
- return addHeapObject(ret);
2536
- }, arguments) };
2537
- imports.wbg.__wbg_openCursor_611b1e488c393dd8 = function() { return handleError(function (arg0, arg1) {
2538
- const ret = getObject(arg0).openCursor(getObject(arg1));
2539
- return addHeapObject(ret);
2540
- }, arguments) };
2541
- imports.wbg.__wbg_put_22792e17580ca18b = function() { return handleError(function (arg0, arg1, arg2) {
2542
- const ret = getObject(arg0).put(getObject(arg1), getObject(arg2));
2543
- return addHeapObject(ret);
2544
- }, arguments) };
2545
- imports.wbg.__wbg_target_2fc177e386c8b7b0 = function(arg0) {
2546
- const ret = getObject(arg0).target;
2547
- return isLikeNone(ret) ? 0 : addHeapObject(ret);
2548
- };
2549
- imports.wbg.__wbg_instanceof_IdbDatabase_db671cf2454a9542 = function(arg0) {
2550
- let result;
2551
- try {
2552
- result = getObject(arg0) instanceof IDBDatabase;
2553
- } catch (_) {
2554
- result = false;
2555
- }
2556
- const ret = result;
2557
- return ret;
2558
- };
2559
- imports.wbg.__wbg_objectStoreNames_588b5924274239fd = function(arg0) {
2560
- const ret = getObject(arg0).objectStoreNames;
2561
- return addHeapObject(ret);
2562
- };
2563
- imports.wbg.__wbg_close_6bfe4ca2fe67cb67 = function(arg0) {
2564
- getObject(arg0).close();
2565
- };
2566
- imports.wbg.__wbg_createObjectStore_882f2f6b1b1ef040 = function() { return handleError(function (arg0, arg1, arg2) {
2567
- const ret = getObject(arg0).createObjectStore(getStringFromWasm0(arg1, arg2));
2568
- return addHeapObject(ret);
2569
- }, arguments) };
2570
- imports.wbg.__wbg_transaction_c32bb10c9c692f4b = function() { return handleError(function (arg0, arg1, arg2) {
2571
- const ret = getObject(arg0).transaction(getStringFromWasm0(arg1, arg2));
2572
- return addHeapObject(ret);
2573
- }, arguments) };
2574
- imports.wbg.__wbg_transaction_1e282a79e9bb7387 = function() { return handleError(function (arg0, arg1, arg2, arg3) {
2575
- const ret = getObject(arg0).transaction(getStringFromWasm0(arg1, arg2), takeObject(arg3));
2576
- return addHeapObject(ret);
2577
- }, arguments) };
2578
- imports.wbg.__wbg_length_9ae5daf9a690cba9 = function(arg0) {
2579
- const ret = getObject(arg0).length;
2580
- return ret;
2581
- };
2582
- imports.wbg.__wbg_contains_c65b44400b549286 = function(arg0, arg1, arg2) {
2583
- const ret = getObject(arg0).contains(getStringFromWasm0(arg1, arg2));
2584
- return ret;
2585
- };
2586
- imports.wbg.__wbg_get_910bbb94abdcf488 = function(arg0, arg1, arg2) {
2587
- const ret = getObject(arg1)[arg2 >>> 0];
2588
- var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2589
- var len1 = WASM_VECTOR_LEN;
2590
- getInt32Memory0()[arg0 / 4 + 1] = len1;
2591
- getInt32Memory0()[arg0 / 4 + 0] = ptr1;
2592
- };
2593
- imports.wbg.__wbg_instanceof_IdbCursorWithValue_abeb44d13d947bc2 = function(arg0) {
2594
- let result;
2595
- try {
2596
- result = getObject(arg0) instanceof IDBCursorWithValue;
2597
- } catch (_) {
2598
- result = false;
2599
- }
2600
- const ret = result;
2601
- return ret;
2602
- };
2603
- imports.wbg.__wbg_value_86d3334f5075b232 = function() { return handleError(function (arg0) {
2604
- const ret = getObject(arg0).value;
2605
- return addHeapObject(ret);
2606
- }, arguments) };
2607
- imports.wbg.__wbg_open_f0d7259fd7e689ce = function() { return handleError(function (arg0, arg1, arg2, arg3) {
2608
- const ret = getObject(arg0).open(getStringFromWasm0(arg1, arg2), arg3 >>> 0);
2609
- return addHeapObject(ret);
2610
- }, arguments) };
2611
- imports.wbg.__wbg_instanceof_IdbOpenDbRequest_3f4a166bc0340578 = function(arg0) {
2612
- let result;
2613
- try {
2614
- result = getObject(arg0) instanceof IDBOpenDBRequest;
2615
- } catch (_) {
2616
- result = false;
2617
- }
2618
- const ret = result;
2619
- return ret;
2620
- };
2621
- imports.wbg.__wbg_setonupgradeneeded_ad7645373c7d5e1b = function(arg0, arg1) {
2622
- getObject(arg0).onupgradeneeded = getObject(arg1);
2623
- };
2624
- imports.wbg.__wbg_instanceof_IdbRequest_93249da04f5370b6 = function(arg0) {
2625
- let result;
2626
- try {
2627
- result = getObject(arg0) instanceof IDBRequest;
2628
- } catch (_) {
2629
- result = false;
2630
- }
2631
- const ret = result;
2632
- return ret;
2633
- };
2634
- imports.wbg.__wbg_result_6cedf5f78600a79c = function() { return handleError(function (arg0) {
2635
- const ret = getObject(arg0).result;
2636
- return addHeapObject(ret);
2637
- }, arguments) };
2638
- imports.wbg.__wbg_error_685b20024dc2d6ca = function() { return handleError(function (arg0) {
2639
- const ret = getObject(arg0).error;
2640
- return isLikeNone(ret) ? 0 : addHeapObject(ret);
2641
- }, arguments) };
2642
- imports.wbg.__wbg_setonsuccess_632ce0a1460455c2 = function(arg0, arg1) {
2643
- getObject(arg0).onsuccess = getObject(arg1);
2644
- };
2645
- imports.wbg.__wbg_setonerror_8479b33e7568a904 = function(arg0, arg1) {
2646
- getObject(arg0).onerror = getObject(arg1);
2647
- };
2648
- imports.wbg.__wbg_setoncomplete_d8e4236665cbf1e2 = function(arg0, arg1) {
2649
- getObject(arg0).oncomplete = getObject(arg1);
2650
- };
2651
- imports.wbg.__wbg_setonerror_da071ec94e148397 = function(arg0, arg1) {
2652
- getObject(arg0).onerror = getObject(arg1);
2653
- };
2654
- imports.wbg.__wbg_objectStore_da468793bd9df17b = function() { return handleError(function (arg0, arg1, arg2) {
2655
- const ret = getObject(arg0).objectStore(getStringFromWasm0(arg1, arg2));
2656
- return addHeapObject(ret);
2657
- }, arguments) };
2658
- imports.wbg.__wbg_continue_f1c3e0815924de62 = function() { return handleError(function (arg0) {
2659
- getObject(arg0).continue();
2660
- }, arguments) };
2661
- imports.wbg.__wbg_only_cacf767244bdc280 = function() { return handleError(function (arg0) {
2662
- const ret = IDBKeyRange.only(getObject(arg0));
2663
- return addHeapObject(ret);
2664
- }, arguments) };
2665
- imports.wbg.__wbindgen_jsval_loose_eq = function(arg0, arg1) {
2666
- const ret = getObject(arg0) == getObject(arg1);
2667
- return ret;
2668
- };
2669
- imports.wbg.__wbindgen_as_number = function(arg0) {
2670
- const ret = +getObject(arg0);
2671
- return ret;
2672
- };
2673
- imports.wbg.__wbg_String_389b54bd9d25375f = function(arg0, arg1) {
2674
- const ret = String(getObject(arg1));
2675
- const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2676
- const len1 = WASM_VECTOR_LEN;
2677
- getInt32Memory0()[arg0 / 4 + 1] = len1;
2678
- getInt32Memory0()[arg0 / 4 + 0] = ptr1;
2679
- };
2680
- imports.wbg.__wbg_getwithrefkey_4a92a5eca60879b9 = function(arg0, arg1) {
2681
- const ret = getObject(arg0)[getObject(arg1)];
2682
- return addHeapObject(ret);
2683
- };
2684
- imports.wbg.__wbg_set_9182712abebf82ef = function(arg0, arg1, arg2) {
2685
- getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
2686
- };
2687
- imports.wbg.__wbg_log_28eee4e6432efd24 = function(arg0, arg1) {
2688
- console.log(getStringFromWasm0(arg0, arg1));
2689
- };
2690
- imports.wbg.__wbg_String_55b8bdc4bc243677 = function(arg0, arg1) {
2691
- const ret = String(getObject(arg1));
2692
- const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2693
- const len1 = WASM_VECTOR_LEN;
2694
- getInt32Memory0()[arg0 / 4 + 1] = len1;
2695
- getInt32Memory0()[arg0 / 4 + 0] = ptr1;
2696
- };
2697
- imports.wbg.__wbg_getElementById_8458f2a6c28467dc = function(arg0, arg1, arg2) {
2698
- const ret = getObject(arg0).getElementById(getStringFromWasm0(arg1, arg2));
2699
- return addHeapObject(ret);
2700
- };
2701
- imports.wbg.__wbg_settextcontent_fc3ff485b96fcb1d = function(arg0, arg1, arg2) {
2702
- getObject(arg0).textContent = getStringFromWasm0(arg1, arg2);
2703
- };
2704
- imports.wbg.__wbg_wbgtestinvoke_8c20f4132af2bded = function() { return handleError(function (arg0, arg1) {
2705
- try {
2706
- var state0 = {a: arg0, b: arg1};
2707
- var cb0 = () => {
2708
- const a = state0.a;
2709
- state0.a = 0;
2710
- try {
2711
- return __wbg_adapter_290(a, state0.b, );
2712
- } finally {
2713
- state0.a = a;
2714
- }
2715
- };
2716
- __wbg_test_invoke(cb0);
2717
- } finally {
2718
- state0.a = state0.b = 0;
2719
- }
2720
- }, arguments) };
2721
- imports.wbg.__wbg_static_accessor_document_d4b6ae7f5578480f = function() {
2722
- const ret = document;
2723
- return addHeapObject(ret);
2724
- };
2725
- imports.wbg.__wbg_self_55106357ec10ecd4 = function(arg0) {
2726
- const ret = getObject(arg0).self;
2727
- return isLikeNone(ret) ? 0 : addHeapObject(ret);
2728
- };
2729
- imports.wbg.__wbg_constructor_fd0d22d60b7dfd72 = function(arg0) {
2730
- const ret = getObject(arg0).constructor;
2731
- return addHeapObject(ret);
2732
- };
2733
- imports.wbg.__wbg_name_7f439d24ff7ba1d3 = function(arg0, arg1) {
2734
- const ret = getObject(arg1).name;
2735
- const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2736
- const len1 = WASM_VECTOR_LEN;
2737
- getInt32Memory0()[arg0 / 4 + 1] = len1;
2738
- getInt32Memory0()[arg0 / 4 + 0] = ptr1;
2739
- };
2740
- imports.wbg.__wbg_stack_17c77e9f5bfe6714 = function(arg0, arg1) {
2741
- const ret = getObject(arg1).stack;
2742
- const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2743
- const len1 = WASM_VECTOR_LEN;
2744
- getInt32Memory0()[arg0 / 4 + 1] = len1;
2745
- getInt32Memory0()[arg0 / 4 + 0] = ptr1;
2746
- };
2747
- imports.wbg.__wbg_textcontent_67e4e811cbdf00fc = function(arg0, arg1) {
2748
- const ret = getObject(arg1).textContent;
2749
- const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2750
- const len1 = WASM_VECTOR_LEN;
2751
- getInt32Memory0()[arg0 / 4 + 1] = len1;
2752
- getInt32Memory0()[arg0 / 4 + 0] = ptr1;
2753
- };
2754
- imports.wbg.__wbg_stack_44743fb7d71926a0 = function(arg0) {
2755
- const ret = getObject(arg0).stack;
2756
- return addHeapObject(ret);
2757
- };
2758
- imports.wbg.__wbg_wbgtestoutputwriteln_4db3bd64914ec955 = function(arg0) {
2759
- __wbg_test_output_writeln(takeObject(arg0));
2760
- };
2761
- imports.wbg.__wbg_stack_436273c21658169b = function(arg0) {
2762
- const ret = getObject(arg0).stack;
2763
- return addHeapObject(ret);
2764
- };
2765
- imports.wbg.__wbg_new_abda76e883ba8a5f = function() {
2766
- const ret = new Error();
2767
- return addHeapObject(ret);
2768
- };
2769
- imports.wbg.__wbg_stack_658279fe44541cf6 = function(arg0, arg1) {
2770
- const ret = getObject(arg1).stack;
2771
- const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2772
- const len1 = WASM_VECTOR_LEN;
2773
- getInt32Memory0()[arg0 / 4 + 1] = len1;
2774
- getInt32Memory0()[arg0 / 4 + 0] = ptr1;
2775
- };
2776
- imports.wbg.__wbg_error_f851667af71bcfc6 = function(arg0, arg1) {
2777
- let deferred0_0;
2778
- let deferred0_1;
2779
- try {
2780
- deferred0_0 = arg0;
2781
- deferred0_1 = arg1;
2782
- console.error(getStringFromWasm0(arg0, arg1));
2783
- } finally {
2784
- wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
2785
- }
2786
- };
2787
- imports.wbg.__wbg_queueMicrotask_481971b0d87f3dd4 = function(arg0) {
2788
- queueMicrotask(getObject(arg0));
2789
- };
2790
- imports.wbg.__wbg_queueMicrotask_3cbae2ec6b6cd3d6 = function(arg0) {
2791
- const ret = getObject(arg0).queueMicrotask;
2792
- return addHeapObject(ret);
2793
- };
2794
- imports.wbg.__wbg_get_bd8e338fbd5f5cc8 = function(arg0, arg1) {
2795
- const ret = getObject(arg0)[arg1 >>> 0];
2796
- return addHeapObject(ret);
2797
- };
2798
- imports.wbg.__wbg_length_cd7af8117672b8b8 = function(arg0) {
2799
- const ret = getObject(arg0).length;
2800
- return ret;
2801
- };
2802
- imports.wbg.__wbg_new_16b304a2cfa7ff4a = function() {
2803
- const ret = new Array();
2804
- return addHeapObject(ret);
2805
- };
2806
- imports.wbg.__wbg_newnoargs_e258087cd0daa0ea = function(arg0, arg1) {
2807
- const ret = new Function(getStringFromWasm0(arg0, arg1));
2808
- return addHeapObject(ret);
2809
- };
2810
- imports.wbg.__wbg_new_d9bc3a0147634640 = function() {
2811
- const ret = new Map();
2812
- return addHeapObject(ret);
2813
- };
2814
- imports.wbg.__wbg_next_40fc327bfc8770e6 = function(arg0) {
2815
- const ret = getObject(arg0).next;
2816
- return addHeapObject(ret);
2817
- };
2818
- imports.wbg.__wbg_next_196c84450b364254 = function() { return handleError(function (arg0) {
2819
- const ret = getObject(arg0).next();
2820
- return addHeapObject(ret);
2821
- }, arguments) };
2822
- imports.wbg.__wbg_done_298b57d23c0fc80c = function(arg0) {
2823
- const ret = getObject(arg0).done;
2824
- return ret;
2825
- };
2826
- imports.wbg.__wbg_value_d93c65011f51a456 = function(arg0) {
2827
- const ret = getObject(arg0).value;
2828
- return addHeapObject(ret);
2829
- };
2830
- imports.wbg.__wbg_iterator_2cee6dadfd956dfa = function() {
2831
- const ret = Symbol.iterator;
2832
- return addHeapObject(ret);
2833
- };
2834
- imports.wbg.__wbg_get_e3c254076557e348 = function() { return handleError(function (arg0, arg1) {
2835
- const ret = Reflect.get(getObject(arg0), getObject(arg1));
2836
- return addHeapObject(ret);
2837
- }, arguments) };
2838
- imports.wbg.__wbg_call_27c0f87801dedf93 = function() { return handleError(function (arg0, arg1) {
2839
- const ret = getObject(arg0).call(getObject(arg1));
2840
- return addHeapObject(ret);
2841
- }, arguments) };
2842
- imports.wbg.__wbg_new_72fb9a18b5ae2624 = function() {
2843
- const ret = new Object();
2844
- return addHeapObject(ret);
2845
- };
2846
- imports.wbg.__wbg_self_ce0dbfc45cf2f5be = function() { return handleError(function () {
2847
- const ret = self.self;
2848
- return addHeapObject(ret);
2849
- }, arguments) };
2850
- imports.wbg.__wbg_window_c6fb939a7f436783 = function() { return handleError(function () {
2851
- const ret = window.window;
2852
- return addHeapObject(ret);
2853
- }, arguments) };
2854
- imports.wbg.__wbg_globalThis_d1e6af4856ba331b = function() { return handleError(function () {
2855
- const ret = globalThis.globalThis;
2856
- return addHeapObject(ret);
2857
- }, arguments) };
2858
- imports.wbg.__wbg_global_207b558942527489 = function() { return handleError(function () {
2859
- const ret = global.global;
2860
- return addHeapObject(ret);
2861
- }, arguments) };
2862
- imports.wbg.__wbg_set_d4638f722068f043 = function(arg0, arg1, arg2) {
2863
- getObject(arg0)[arg1 >>> 0] = takeObject(arg2);
2864
- };
2865
- imports.wbg.__wbg_from_89e3fc3ba5e6fb48 = function(arg0) {
2866
- const ret = Array.from(getObject(arg0));
2867
- return addHeapObject(ret);
2868
- };
2869
- imports.wbg.__wbg_forEach_2be8de7347d63332 = function(arg0, arg1, arg2) {
2870
- try {
2871
- var state0 = {a: arg1, b: arg2};
2872
- var cb0 = (arg0, arg1, arg2) => {
2873
- const a = state0.a;
2874
- state0.a = 0;
2875
- try {
2876
- return __wbg_adapter_333(a, state0.b, arg0, arg1, arg2);
2877
- } finally {
2878
- state0.a = a;
2879
- }
2880
- };
2881
- getObject(arg0).forEach(cb0);
2882
- } finally {
2883
- state0.a = state0.b = 0;
2884
- }
2885
- };
2886
- imports.wbg.__wbg_isArray_2ab64d95e09ea0ae = function(arg0) {
2887
- const ret = Array.isArray(getObject(arg0));
2888
- return ret;
2889
- };
2890
- imports.wbg.__wbg_of_4a2b313a453ec059 = function(arg0) {
2891
- const ret = Array.of(getObject(arg0));
2892
- return addHeapObject(ret);
2893
- };
2894
- imports.wbg.__wbg_push_a5b05aedc7234f9f = function(arg0, arg1) {
2895
- const ret = getObject(arg0).push(getObject(arg1));
2896
- return ret;
2897
- };
2898
- imports.wbg.__wbg_instanceof_ArrayBuffer_836825be07d4c9d2 = function(arg0) {
2899
- let result;
2900
- try {
2901
- result = getObject(arg0) instanceof ArrayBuffer;
2902
- } catch (_) {
2903
- result = false;
2904
- }
2905
- const ret = result;
2906
- return ret;
2907
- };
2908
- imports.wbg.__wbg_message_5bf28016c2b49cfb = function(arg0) {
2909
- const ret = getObject(arg0).message;
2910
- return addHeapObject(ret);
2911
- };
2912
- imports.wbg.__wbg_name_e7429f0dda6079e2 = function(arg0) {
2913
- const ret = getObject(arg0).name;
2914
- return addHeapObject(ret);
2915
- };
2916
- imports.wbg.__wbg_call_b3ca7c6051f9bec1 = function() { return handleError(function (arg0, arg1, arg2) {
2917
- const ret = getObject(arg0).call(getObject(arg1), getObject(arg2));
2918
- return addHeapObject(ret);
2919
- }, arguments) };
2920
- imports.wbg.__wbg_call_938992c832f74314 = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
2921
- const ret = getObject(arg0).call(getObject(arg1), getObject(arg2), getObject(arg3), getObject(arg4));
2922
- return addHeapObject(ret);
2923
- }, arguments) };
2924
- imports.wbg.__wbg_set_8417257aaedc936b = function(arg0, arg1, arg2) {
2925
- const ret = getObject(arg0).set(getObject(arg1), getObject(arg2));
2926
- return addHeapObject(ret);
2927
- };
2928
- imports.wbg.__wbg_isSafeInteger_f7b04ef02296c4d2 = function(arg0) {
2929
- const ret = Number.isSafeInteger(getObject(arg0));
2930
- return ret;
2931
- };
2932
- imports.wbg.__wbg_assign_496d2d14fecafbcf = function(arg0, arg1) {
2933
- const ret = Object.assign(getObject(arg0), getObject(arg1));
2934
- return addHeapObject(ret);
2935
- };
2936
- imports.wbg.__wbg_entries_95cc2c823b285a09 = function(arg0) {
2937
- const ret = Object.entries(getObject(arg0));
2938
- return addHeapObject(ret);
2939
- };
2940
- imports.wbg.__wbg_is_010fdc0f4ab96916 = function(arg0, arg1) {
2941
- const ret = Object.is(getObject(arg0), getObject(arg1));
2942
- return ret;
2943
- };
2944
- imports.wbg.__wbg_keys_91e412b4b222659f = function(arg0) {
2945
- const ret = Object.keys(getObject(arg0));
2946
- return addHeapObject(ret);
2947
- };
2948
- imports.wbg.__wbg_new_81740750da40724f = function(arg0, arg1) {
2949
- try {
2950
- var state0 = {a: arg0, b: arg1};
2951
- var cb0 = (arg0, arg1) => {
2952
- const a = state0.a;
2953
- state0.a = 0;
2954
- try {
2955
- return __wbg_adapter_384(a, state0.b, arg0, arg1);
2956
- } finally {
2957
- state0.a = a;
2958
- }
2959
- };
2960
- const ret = new Promise(cb0);
2961
- return addHeapObject(ret);
2962
- } finally {
2963
- state0.a = state0.b = 0;
2964
- }
2965
- };
2966
- imports.wbg.__wbg_resolve_b0083a7967828ec8 = function(arg0) {
2967
- const ret = Promise.resolve(getObject(arg0));
2968
- return addHeapObject(ret);
2969
- };
2970
- imports.wbg.__wbg_then_0c86a60e8fcfe9f6 = function(arg0, arg1) {
2971
- const ret = getObject(arg0).then(getObject(arg1));
2972
- return addHeapObject(ret);
2973
- };
2974
- imports.wbg.__wbg_then_a73caa9a87991566 = function(arg0, arg1, arg2) {
2975
- const ret = getObject(arg0).then(getObject(arg1), getObject(arg2));
2976
- return addHeapObject(ret);
2977
- };
2978
- imports.wbg.__wbg_buffer_12d079cc21e14bdb = function(arg0) {
2979
- const ret = getObject(arg0).buffer;
2980
- return addHeapObject(ret);
2981
- };
2982
- imports.wbg.__wbg_newwithbyteoffsetandlength_aa4a17c33a06e5cb = function(arg0, arg1, arg2) {
2983
- const ret = new Uint8Array(getObject(arg0), arg1 >>> 0, arg2 >>> 0);
2984
- return addHeapObject(ret);
2985
- };
2986
- imports.wbg.__wbg_new_63b92bc8671ed464 = function(arg0) {
2987
- const ret = new Uint8Array(getObject(arg0));
2988
- return addHeapObject(ret);
2989
- };
2990
- imports.wbg.__wbg_set_a47bac70306a19a7 = function(arg0, arg1, arg2) {
2991
- getObject(arg0).set(getObject(arg1), arg2 >>> 0);
2992
- };
2993
- imports.wbg.__wbg_length_c20a40f15020d68a = function(arg0) {
2994
- const ret = getObject(arg0).length;
2995
- return ret;
2996
- };
2997
- imports.wbg.__wbg_instanceof_Uint8Array_2b3bbecd033d19f6 = function(arg0) {
2998
- let result;
2999
- try {
3000
- result = getObject(arg0) instanceof Uint8Array;
3001
- } catch (_) {
3002
- result = false;
3003
- }
3004
- const ret = result;
3005
- return ret;
3006
- };
3007
- imports.wbg.__wbg_newwithlength_e9b4878cebadb3d3 = function(arg0) {
3008
- const ret = new Uint8Array(arg0 >>> 0);
3009
- return addHeapObject(ret);
3010
- };
3011
- imports.wbg.__wbg_subarray_a1f73cd4b5b42fe1 = function(arg0, arg1, arg2) {
3012
- const ret = getObject(arg0).subarray(arg1 >>> 0, arg2 >>> 0);
3013
- return addHeapObject(ret);
3014
- };
3015
- imports.wbg.__wbg_apply_0a5aa603881e6d79 = function() { return handleError(function (arg0, arg1, arg2) {
3016
- const ret = Reflect.apply(getObject(arg0), getObject(arg1), getObject(arg2));
3017
- return addHeapObject(ret);
3018
- }, arguments) };
3019
- imports.wbg.__wbg_deleteProperty_13e721a56f19e842 = function() { return handleError(function (arg0, arg1) {
3020
- const ret = Reflect.deleteProperty(getObject(arg0), getObject(arg1));
3021
- return ret;
3022
- }, arguments) };
3023
- imports.wbg.__wbg_set_1f9b04f170055d33 = function() { return handleError(function (arg0, arg1, arg2) {
3024
- const ret = Reflect.set(getObject(arg0), getObject(arg1), getObject(arg2));
3025
- return ret;
3026
- }, arguments) };
3027
- imports.wbg.__wbg_parse_66d1801634e099ac = function() { return handleError(function (arg0, arg1) {
3028
- const ret = JSON.parse(getStringFromWasm0(arg0, arg1));
3029
- return addHeapObject(ret);
3030
- }, arguments) };
3031
- imports.wbg.__wbg_stringify_8887fe74e1c50d81 = function() { return handleError(function (arg0) {
3032
- const ret = JSON.stringify(getObject(arg0));
3033
- return addHeapObject(ret);
3034
- }, arguments) };
3035
- imports.wbg.__wbindgen_bigint_get_as_i64 = function(arg0, arg1) {
3036
- const v = getObject(arg1);
3037
- const ret = typeof(v) === 'bigint' ? v : undefined;
3038
- getBigInt64Memory0()[arg0 / 8 + 1] = isLikeNone(ret) ? BigInt(0) : ret;
3039
- getInt32Memory0()[arg0 / 4 + 0] = !isLikeNone(ret);
3040
- };
3041
- imports.wbg.__wbindgen_debug_string = function(arg0, arg1) {
3042
- const ret = debugString(getObject(arg1));
3043
- const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
3044
- const len1 = WASM_VECTOR_LEN;
3045
- getInt32Memory0()[arg0 / 4 + 1] = len1;
3046
- getInt32Memory0()[arg0 / 4 + 0] = ptr1;
3047
- };
3048
- imports.wbg.__wbindgen_throw = function(arg0, arg1) {
3049
- throw new Error(getStringFromWasm0(arg0, arg1));
3050
- };
3051
- imports.wbg.__wbindgen_memory = function() {
3052
- const ret = wasm.memory;
3053
- return addHeapObject(ret);
3054
- };
3055
- imports.wbg.__wbindgen_closure_wrapper625 = function(arg0, arg1, arg2) {
3056
- const ret = makeClosure(arg0, arg1, 260, __wbg_adapter_56);
3057
- return addHeapObject(ret);
3058
- };
3059
- imports.wbg.__wbindgen_closure_wrapper627 = function(arg0, arg1, arg2) {
3060
- const ret = makeMutClosure(arg0, arg1, 260, __wbg_adapter_59);
3061
- return addHeapObject(ret);
3062
- };
3063
- imports.wbg.__wbindgen_closure_wrapper629 = function(arg0, arg1, arg2) {
3064
- const ret = makeMutClosure(arg0, arg1, 260, __wbg_adapter_62);
3065
- return addHeapObject(ret);
3066
- };
3067
- imports.wbg.__wbindgen_closure_wrapper1614 = function(arg0, arg1, arg2) {
3068
- const ret = makeMutClosure(arg0, arg1, 444, __wbg_adapter_65);
3069
- return addHeapObject(ret);
3070
- };
3071
-
3072
- return imports;
3073
- }
3074
-
3075
- function __wbg_init_memory(imports, maybe_memory) {
3076
-
3077
- }
3078
-
3079
- function __wbg_finalize_init(instance, module) {
3080
- wasm = instance.exports;
3081
- __wbg_init.__wbindgen_wasm_module = module;
3082
- cachedBigInt64Memory0 = null;
3083
- cachedFloat64Memory0 = null;
3084
- cachedInt32Memory0 = null;
3085
- cachedUint32Memory0 = null;
3086
- cachedUint8Memory0 = null;
3087
-
3088
- wasm.__wbindgen_start();
3089
- return wasm;
3090
- }
3091
-
3092
- function initSync(module) {
3093
- if (wasm !== undefined) return wasm;
3094
-
3095
- const imports = __wbg_get_imports();
3096
-
3097
- __wbg_init_memory(imports);
3098
-
3099
- if (!(module instanceof WebAssembly.Module)) {
3100
- module = new WebAssembly.Module(module);
3101
- }
3102
-
3103
- const instance = new WebAssembly.Instance(module, imports);
3104
-
3105
- return __wbg_finalize_init(instance, module);
3106
- }
3107
-
3108
- async function __wbg_init(input) {
3109
- if (wasm !== undefined) return wasm;
3110
-
3111
- const imports = __wbg_get_imports();
3112
-
3113
- if (typeof input === 'string' || (typeof Request === 'function' && input instanceof Request) || (typeof URL === 'function' && input instanceof URL)) {
3114
- input = fetch(input);
3115
- }
3116
-
3117
- __wbg_init_memory(imports);
3118
-
3119
- const { instance, module } = await __wbg_load(await input, imports);
3120
-
3121
- return __wbg_finalize_init(instance, module);
3122
- }
3123
-
3124
- export { initSync }
3125
- export default __wbg_init;