@trust0/ridb-core 1.0.0-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +201 -0
- package/README.md +63 -0
- package/package.json +24 -0
- package/pkg/ridb_core.d.ts +860 -0
- package/pkg/ridb_core.js +2640 -0
- package/pkg/ridb_core_bg.wasm +0 -0
package/pkg/ridb_core.js
ADDED
|
@@ -0,0 +1,2640 @@
|
|
|
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
|
+
const cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }) : { decode: () => { throw Error('TextDecoder not available') } } );
|
|
24
|
+
|
|
25
|
+
if (typeof TextDecoder !== 'undefined') { cachedTextDecoder.decode(); };
|
|
26
|
+
|
|
27
|
+
let cachedUint8Memory0 = null;
|
|
28
|
+
|
|
29
|
+
function getUint8Memory0() {
|
|
30
|
+
if (cachedUint8Memory0 === null || cachedUint8Memory0.byteLength === 0) {
|
|
31
|
+
cachedUint8Memory0 = new Uint8Array(wasm.memory.buffer);
|
|
32
|
+
}
|
|
33
|
+
return cachedUint8Memory0;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
function getStringFromWasm0(ptr, len) {
|
|
37
|
+
ptr = ptr >>> 0;
|
|
38
|
+
return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
function addHeapObject(obj) {
|
|
42
|
+
if (heap_next === heap.length) heap.push(heap.length + 1);
|
|
43
|
+
const idx = heap_next;
|
|
44
|
+
heap_next = heap[idx];
|
|
45
|
+
|
|
46
|
+
heap[idx] = obj;
|
|
47
|
+
return idx;
|
|
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 makeMutClosure(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
|
+
const a = state.a;
|
|
216
|
+
state.a = 0;
|
|
217
|
+
try {
|
|
218
|
+
return f(a, state.b, ...args);
|
|
219
|
+
} finally {
|
|
220
|
+
if (--state.cnt === 0) {
|
|
221
|
+
wasm.__wbindgen_export_2.get(state.dtor)(a, state.b);
|
|
222
|
+
CLOSURE_DTORS.unregister(state);
|
|
223
|
+
} else {
|
|
224
|
+
state.a = a;
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
};
|
|
228
|
+
real.original = state;
|
|
229
|
+
CLOSURE_DTORS.register(real, state, state);
|
|
230
|
+
return real;
|
|
231
|
+
}
|
|
232
|
+
function __wbg_adapter_56(arg0, arg1, arg2) {
|
|
233
|
+
wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h4279c525cebb26f2(arg0, arg1, addHeapObject(arg2));
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
function __wbg_adapter_61(arg0, arg1, arg2) {
|
|
237
|
+
const ret = wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h8fc6c6f4e4fe440c(arg0, arg1, addHeapObject(arg2));
|
|
238
|
+
return takeObject(ret);
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
function makeClosure(arg0, arg1, dtor, f) {
|
|
242
|
+
const state = { a: arg0, b: arg1, cnt: 1, dtor };
|
|
243
|
+
const real = (...args) => {
|
|
244
|
+
// First up with a closure we increment the internal reference
|
|
245
|
+
// count. This ensures that the Rust closure environment won't
|
|
246
|
+
// be deallocated while we're invoking it.
|
|
247
|
+
state.cnt++;
|
|
248
|
+
try {
|
|
249
|
+
return f(state.a, state.b, ...args);
|
|
250
|
+
} finally {
|
|
251
|
+
if (--state.cnt === 0) {
|
|
252
|
+
wasm.__wbindgen_export_2.get(state.dtor)(state.a, state.b);
|
|
253
|
+
state.a = 0;
|
|
254
|
+
CLOSURE_DTORS.unregister(state);
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
};
|
|
258
|
+
real.original = state;
|
|
259
|
+
CLOSURE_DTORS.register(real, state, state);
|
|
260
|
+
return real;
|
|
261
|
+
}
|
|
262
|
+
function __wbg_adapter_64(arg0, arg1, arg2, arg3, arg4) {
|
|
263
|
+
try {
|
|
264
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
265
|
+
wasm._dyn_core__ops__function__Fn__A_B_C___Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h80335dc7fe1c3f7e(retptr, arg0, arg1, addHeapObject(arg2), addHeapObject(arg3), addHeapObject(arg4));
|
|
266
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
267
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
268
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
269
|
+
if (r2) {
|
|
270
|
+
throw takeObject(r1);
|
|
271
|
+
}
|
|
272
|
+
return takeObject(r0);
|
|
273
|
+
} finally {
|
|
274
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
function __wbg_adapter_67(arg0, arg1, arg2) {
|
|
279
|
+
wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__ha1155a5e1cc6e1e8(arg0, arg1, addHeapObject(arg2));
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
let stack_pointer = 128;
|
|
283
|
+
|
|
284
|
+
function addBorrowedObject(obj) {
|
|
285
|
+
if (stack_pointer == 1) throw new Error('out of js stack');
|
|
286
|
+
heap[--stack_pointer] = obj;
|
|
287
|
+
return stack_pointer;
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
function _assertClass(instance, klass) {
|
|
291
|
+
if (!(instance instanceof klass)) {
|
|
292
|
+
throw new Error(`expected instance of ${klass.name}`);
|
|
293
|
+
}
|
|
294
|
+
return instance.ptr;
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
let cachedUint32Memory0 = null;
|
|
298
|
+
|
|
299
|
+
function getUint32Memory0() {
|
|
300
|
+
if (cachedUint32Memory0 === null || cachedUint32Memory0.byteLength === 0) {
|
|
301
|
+
cachedUint32Memory0 = new Uint32Array(wasm.memory.buffer);
|
|
302
|
+
}
|
|
303
|
+
return cachedUint32Memory0;
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
function passArrayJsValueToWasm0(array, malloc) {
|
|
307
|
+
const ptr = malloc(array.length * 4, 4) >>> 0;
|
|
308
|
+
const mem = getUint32Memory0();
|
|
309
|
+
for (let i = 0; i < array.length; i++) {
|
|
310
|
+
mem[ptr / 4 + i] = addHeapObject(array[i]);
|
|
311
|
+
}
|
|
312
|
+
WASM_VECTOR_LEN = array.length;
|
|
313
|
+
return ptr;
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
function handleError(f, args) {
|
|
317
|
+
try {
|
|
318
|
+
return f.apply(this, args);
|
|
319
|
+
} catch (e) {
|
|
320
|
+
wasm.__wbindgen_exn_store(addHeapObject(e));
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
/**
|
|
324
|
+
*/
|
|
325
|
+
export function main_js() {
|
|
326
|
+
wasm.main_js();
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
/**
|
|
330
|
+
* @returns {boolean}
|
|
331
|
+
*/
|
|
332
|
+
export function is_debug_mode() {
|
|
333
|
+
const ret = wasm.is_debug_mode();
|
|
334
|
+
return ret !== 0;
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
function getArrayJsValueFromWasm0(ptr, len) {
|
|
338
|
+
ptr = ptr >>> 0;
|
|
339
|
+
const mem = getUint32Memory0();
|
|
340
|
+
const slice = mem.subarray(ptr / 4, ptr / 4 + len);
|
|
341
|
+
const result = [];
|
|
342
|
+
for (let i = 0; i < slice.length; i++) {
|
|
343
|
+
result.push(takeObject(slice[i]));
|
|
344
|
+
}
|
|
345
|
+
return result;
|
|
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_253(arg0, arg1) {
|
|
413
|
+
wasm.wasm_bindgen__convert__closures__invoke0_mut__h19fc1620bec787be(arg0, arg1);
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
function __wbg_adapter_296(arg0, arg1, arg2, arg3, arg4) {
|
|
417
|
+
wasm.wasm_bindgen__convert__closures__invoke3_mut__h7b738c7e28e951e8(arg0, arg1, addHeapObject(arg2), arg3, addHeapObject(arg4));
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
function __wbg_adapter_349(arg0, arg1, arg2, arg3) {
|
|
421
|
+
wasm.wasm_bindgen__convert__closures__invoke2_mut__h3a3f5f08be32a04a(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
|
+
const BasePluginFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
450
|
+
? { register: () => {}, unregister: () => {} }
|
|
451
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_baseplugin_free(ptr >>> 0));
|
|
452
|
+
/**
|
|
453
|
+
*/
|
|
454
|
+
export class BasePlugin {
|
|
455
|
+
|
|
456
|
+
__destroy_into_raw() {
|
|
457
|
+
const ptr = this.__wbg_ptr;
|
|
458
|
+
this.__wbg_ptr = 0;
|
|
459
|
+
BasePluginFinalization.unregister(this);
|
|
460
|
+
return ptr;
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
free() {
|
|
464
|
+
const ptr = this.__destroy_into_raw();
|
|
465
|
+
wasm.__wbg_baseplugin_free(ptr);
|
|
466
|
+
}
|
|
467
|
+
/**
|
|
468
|
+
* @param {string} name
|
|
469
|
+
*/
|
|
470
|
+
constructor(name) {
|
|
471
|
+
try {
|
|
472
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
473
|
+
const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
474
|
+
const len0 = WASM_VECTOR_LEN;
|
|
475
|
+
wasm.baseplugin_new(retptr, ptr0, len0);
|
|
476
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
477
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
478
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
479
|
+
if (r2) {
|
|
480
|
+
throw takeObject(r1);
|
|
481
|
+
}
|
|
482
|
+
this.__wbg_ptr = r0 >>> 0;
|
|
483
|
+
return this;
|
|
484
|
+
} finally {
|
|
485
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
486
|
+
}
|
|
487
|
+
}
|
|
488
|
+
/**
|
|
489
|
+
* @returns {any}
|
|
490
|
+
*/
|
|
491
|
+
get name() {
|
|
492
|
+
const ret = wasm.baseplugin_name(this.__wbg_ptr);
|
|
493
|
+
return takeObject(ret);
|
|
494
|
+
}
|
|
495
|
+
/**
|
|
496
|
+
* @returns {any}
|
|
497
|
+
*/
|
|
498
|
+
get docCreateHook() {
|
|
499
|
+
const ret = wasm.baseplugin_get_doc_create_hook(this.__wbg_ptr);
|
|
500
|
+
return takeObject(ret);
|
|
501
|
+
}
|
|
502
|
+
/**
|
|
503
|
+
* @returns {any}
|
|
504
|
+
*/
|
|
505
|
+
get docRecoverHook() {
|
|
506
|
+
const ret = wasm.baseplugin_get_doc_recover_hook(this.__wbg_ptr);
|
|
507
|
+
return takeObject(ret);
|
|
508
|
+
}
|
|
509
|
+
/**
|
|
510
|
+
* @param {any} hook
|
|
511
|
+
*/
|
|
512
|
+
set docCreateHook(hook) {
|
|
513
|
+
wasm.baseplugin_set_doc_create_hook(this.__wbg_ptr, addHeapObject(hook));
|
|
514
|
+
}
|
|
515
|
+
/**
|
|
516
|
+
* @param {any} hook
|
|
517
|
+
*/
|
|
518
|
+
set docRecoverHook(hook) {
|
|
519
|
+
wasm.baseplugin_set_doc_recover_hook(this.__wbg_ptr, addHeapObject(hook));
|
|
520
|
+
}
|
|
521
|
+
}
|
|
522
|
+
|
|
523
|
+
const BaseStorageFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
524
|
+
? { register: () => {}, unregister: () => {} }
|
|
525
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_basestorage_free(ptr >>> 0));
|
|
526
|
+
/**
|
|
527
|
+
* Represents the base storage with a name and schema.
|
|
528
|
+
*/
|
|
529
|
+
export class BaseStorage {
|
|
530
|
+
|
|
531
|
+
__destroy_into_raw() {
|
|
532
|
+
const ptr = this.__wbg_ptr;
|
|
533
|
+
this.__wbg_ptr = 0;
|
|
534
|
+
BaseStorageFinalization.unregister(this);
|
|
535
|
+
return ptr;
|
|
536
|
+
}
|
|
537
|
+
|
|
538
|
+
free() {
|
|
539
|
+
const ptr = this.__destroy_into_raw();
|
|
540
|
+
wasm.__wbg_basestorage_free(ptr);
|
|
541
|
+
}
|
|
542
|
+
/**
|
|
543
|
+
* Creates a new `BaseStorage` instance with the provided name and schema type.
|
|
544
|
+
*
|
|
545
|
+
* # Arguments
|
|
546
|
+
*
|
|
547
|
+
* * `name` - The name of the storage.
|
|
548
|
+
* * `schema_type` - The schema type in `JsValue` format.
|
|
549
|
+
*
|
|
550
|
+
* # Returns
|
|
551
|
+
*
|
|
552
|
+
* * `Result<BaseStorage, JsValue>` - A result containing the new `BaseStorage` instance or an error.
|
|
553
|
+
* @param {string} name
|
|
554
|
+
* @param {object} schemas_js
|
|
555
|
+
* @param {object | undefined} [options]
|
|
556
|
+
*/
|
|
557
|
+
constructor(name, schemas_js, options) {
|
|
558
|
+
try {
|
|
559
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
560
|
+
const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
561
|
+
const len0 = WASM_VECTOR_LEN;
|
|
562
|
+
wasm.basestorage_new(retptr, ptr0, len0, addHeapObject(schemas_js), isLikeNone(options) ? 0 : addHeapObject(options));
|
|
563
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
564
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
565
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
566
|
+
if (r2) {
|
|
567
|
+
throw takeObject(r1);
|
|
568
|
+
}
|
|
569
|
+
this.__wbg_ptr = r0 >>> 0;
|
|
570
|
+
return this;
|
|
571
|
+
} finally {
|
|
572
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
573
|
+
}
|
|
574
|
+
}
|
|
575
|
+
/**
|
|
576
|
+
* @param {string} name
|
|
577
|
+
* @returns {any}
|
|
578
|
+
*/
|
|
579
|
+
getOption(name) {
|
|
580
|
+
try {
|
|
581
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
582
|
+
const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
583
|
+
const len0 = WASM_VECTOR_LEN;
|
|
584
|
+
wasm.basestorage_getOption(retptr, this.__wbg_ptr, ptr0, len0);
|
|
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 {Schema}
|
|
599
|
+
*/
|
|
600
|
+
getSchema(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_getSchema(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 Schema.__wrap(r0);
|
|
613
|
+
} finally {
|
|
614
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
615
|
+
}
|
|
616
|
+
}
|
|
617
|
+
/**
|
|
618
|
+
* @returns {CoreStorage}
|
|
619
|
+
*/
|
|
620
|
+
get core() {
|
|
621
|
+
try {
|
|
622
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
623
|
+
wasm.basestorage_core(retptr, this.__wbg_ptr);
|
|
624
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
625
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
626
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
627
|
+
if (r2) {
|
|
628
|
+
throw takeObject(r1);
|
|
629
|
+
}
|
|
630
|
+
return CoreStorage.__wrap(r0);
|
|
631
|
+
} finally {
|
|
632
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
633
|
+
}
|
|
634
|
+
}
|
|
635
|
+
}
|
|
636
|
+
|
|
637
|
+
const CollectionFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
638
|
+
? { register: () => {}, unregister: () => {} }
|
|
639
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_collection_free(ptr >>> 0));
|
|
640
|
+
/**
|
|
641
|
+
*/
|
|
642
|
+
export class Collection {
|
|
643
|
+
|
|
644
|
+
static __wrap(ptr) {
|
|
645
|
+
ptr = ptr >>> 0;
|
|
646
|
+
const obj = Object.create(Collection.prototype);
|
|
647
|
+
obj.__wbg_ptr = ptr;
|
|
648
|
+
CollectionFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
649
|
+
return obj;
|
|
650
|
+
}
|
|
651
|
+
|
|
652
|
+
__destroy_into_raw() {
|
|
653
|
+
const ptr = this.__wbg_ptr;
|
|
654
|
+
this.__wbg_ptr = 0;
|
|
655
|
+
CollectionFinalization.unregister(this);
|
|
656
|
+
return ptr;
|
|
657
|
+
}
|
|
658
|
+
|
|
659
|
+
free() {
|
|
660
|
+
const ptr = this.__destroy_into_raw();
|
|
661
|
+
wasm.__wbg_collection_free(ptr);
|
|
662
|
+
}
|
|
663
|
+
/**
|
|
664
|
+
* @returns {string}
|
|
665
|
+
*/
|
|
666
|
+
get name() {
|
|
667
|
+
let deferred1_0;
|
|
668
|
+
let deferred1_1;
|
|
669
|
+
try {
|
|
670
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
671
|
+
wasm.collection_name(retptr, this.__wbg_ptr);
|
|
672
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
673
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
674
|
+
deferred1_0 = r0;
|
|
675
|
+
deferred1_1 = r1;
|
|
676
|
+
return getStringFromWasm0(r0, r1);
|
|
677
|
+
} finally {
|
|
678
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
679
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
680
|
+
}
|
|
681
|
+
}
|
|
682
|
+
/**
|
|
683
|
+
* @returns {Schema}
|
|
684
|
+
*/
|
|
685
|
+
get schema() {
|
|
686
|
+
try {
|
|
687
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
688
|
+
wasm.collection_schema(retptr, this.__wbg_ptr);
|
|
689
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
690
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
691
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
692
|
+
if (r2) {
|
|
693
|
+
throw takeObject(r1);
|
|
694
|
+
}
|
|
695
|
+
return Schema.__wrap(r0);
|
|
696
|
+
} finally {
|
|
697
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
698
|
+
}
|
|
699
|
+
}
|
|
700
|
+
/**
|
|
701
|
+
* Finds and returns all documents in the collection.
|
|
702
|
+
*
|
|
703
|
+
* This function is asynchronous and returns a `Schema` representing
|
|
704
|
+
* the documents found in the collection.
|
|
705
|
+
* @param {any} query
|
|
706
|
+
* @returns {Promise<any>}
|
|
707
|
+
*/
|
|
708
|
+
find(query) {
|
|
709
|
+
const ret = wasm.collection_find(this.__wbg_ptr, addHeapObject(query));
|
|
710
|
+
return takeObject(ret);
|
|
711
|
+
}
|
|
712
|
+
/**
|
|
713
|
+
* counts and returns all documents in the collection.
|
|
714
|
+
*
|
|
715
|
+
* This function is asynchronous and returns a `Schema` representing
|
|
716
|
+
* the documents found in the collection.
|
|
717
|
+
* @param {any} query
|
|
718
|
+
* @returns {Promise<any>}
|
|
719
|
+
*/
|
|
720
|
+
count(query) {
|
|
721
|
+
const ret = wasm.collection_count(this.__wbg_ptr, addHeapObject(query));
|
|
722
|
+
return takeObject(ret);
|
|
723
|
+
}
|
|
724
|
+
/**
|
|
725
|
+
* Finds and returns a single document in the collection by its ID.
|
|
726
|
+
*
|
|
727
|
+
* This function is asynchronous.
|
|
728
|
+
* @param {any} primary_key
|
|
729
|
+
* @returns {Promise<any>}
|
|
730
|
+
*/
|
|
731
|
+
findById(primary_key) {
|
|
732
|
+
const ret = wasm.collection_findById(this.__wbg_ptr, addHeapObject(primary_key));
|
|
733
|
+
return takeObject(ret);
|
|
734
|
+
}
|
|
735
|
+
/**
|
|
736
|
+
* Updates a document in the collection with the given data.
|
|
737
|
+
*
|
|
738
|
+
* This function is asynchronous and returns a `Result` indicating success or failure.
|
|
739
|
+
*
|
|
740
|
+
* # Arguments
|
|
741
|
+
*
|
|
742
|
+
* * `document` - A `JsValue` representing the partial document to update.
|
|
743
|
+
* @param {any} document
|
|
744
|
+
* @returns {Promise<any>}
|
|
745
|
+
*/
|
|
746
|
+
update(document) {
|
|
747
|
+
const ret = wasm.collection_update(this.__wbg_ptr, addHeapObject(document));
|
|
748
|
+
return takeObject(ret);
|
|
749
|
+
}
|
|
750
|
+
/**
|
|
751
|
+
* Creates a new document in the collection.
|
|
752
|
+
*
|
|
753
|
+
* This function is asynchronous and returns a `Result` indicating success or failure.
|
|
754
|
+
*
|
|
755
|
+
* # Arguments
|
|
756
|
+
*
|
|
757
|
+
* * `document` - A `JsValue` representing the document to create.
|
|
758
|
+
* @param {any} document
|
|
759
|
+
* @returns {Promise<any>}
|
|
760
|
+
*/
|
|
761
|
+
create(document) {
|
|
762
|
+
const ret = wasm.collection_create(this.__wbg_ptr, addHeapObject(document));
|
|
763
|
+
return takeObject(ret);
|
|
764
|
+
}
|
|
765
|
+
/**
|
|
766
|
+
* Deletes a document from the collection by its ID.
|
|
767
|
+
*
|
|
768
|
+
* This function is asynchronous.
|
|
769
|
+
* @param {any} primary_key
|
|
770
|
+
* @returns {Promise<any>}
|
|
771
|
+
*/
|
|
772
|
+
delete(primary_key) {
|
|
773
|
+
const ret = wasm.collection_delete(this.__wbg_ptr, addHeapObject(primary_key));
|
|
774
|
+
return takeObject(ret);
|
|
775
|
+
}
|
|
776
|
+
}
|
|
777
|
+
|
|
778
|
+
const CoreStorageFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
779
|
+
? { register: () => {}, unregister: () => {} }
|
|
780
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_corestorage_free(ptr >>> 0));
|
|
781
|
+
/**
|
|
782
|
+
*/
|
|
783
|
+
export class CoreStorage {
|
|
784
|
+
|
|
785
|
+
static __wrap(ptr) {
|
|
786
|
+
ptr = ptr >>> 0;
|
|
787
|
+
const obj = Object.create(CoreStorage.prototype);
|
|
788
|
+
obj.__wbg_ptr = ptr;
|
|
789
|
+
CoreStorageFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
790
|
+
return obj;
|
|
791
|
+
}
|
|
792
|
+
|
|
793
|
+
__destroy_into_raw() {
|
|
794
|
+
const ptr = this.__wbg_ptr;
|
|
795
|
+
this.__wbg_ptr = 0;
|
|
796
|
+
CoreStorageFinalization.unregister(this);
|
|
797
|
+
return ptr;
|
|
798
|
+
}
|
|
799
|
+
|
|
800
|
+
free() {
|
|
801
|
+
const ptr = this.__destroy_into_raw();
|
|
802
|
+
wasm.__wbg_corestorage_free(ptr);
|
|
803
|
+
}
|
|
804
|
+
/**
|
|
805
|
+
*/
|
|
806
|
+
constructor() {
|
|
807
|
+
const ret = wasm.corestorage_new();
|
|
808
|
+
this.__wbg_ptr = ret >>> 0;
|
|
809
|
+
return this;
|
|
810
|
+
}
|
|
811
|
+
/**
|
|
812
|
+
* @param {any} value
|
|
813
|
+
* @returns {string}
|
|
814
|
+
*/
|
|
815
|
+
getPrimaryKey(value) {
|
|
816
|
+
let deferred2_0;
|
|
817
|
+
let deferred2_1;
|
|
818
|
+
try {
|
|
819
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
820
|
+
wasm.corestorage_getPrimaryKey(retptr, this.__wbg_ptr, addHeapObject(value));
|
|
821
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
822
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
823
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
824
|
+
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
825
|
+
var ptr1 = r0;
|
|
826
|
+
var len1 = r1;
|
|
827
|
+
if (r3) {
|
|
828
|
+
ptr1 = 0; len1 = 0;
|
|
829
|
+
throw takeObject(r2);
|
|
830
|
+
}
|
|
831
|
+
deferred2_0 = ptr1;
|
|
832
|
+
deferred2_1 = len1;
|
|
833
|
+
return getStringFromWasm0(ptr1, len1);
|
|
834
|
+
} finally {
|
|
835
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
836
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
837
|
+
}
|
|
838
|
+
}
|
|
839
|
+
/**
|
|
840
|
+
* @param {any} document
|
|
841
|
+
* @param {Query} query
|
|
842
|
+
* @returns {boolean}
|
|
843
|
+
*/
|
|
844
|
+
matchesQuery(document, query) {
|
|
845
|
+
try {
|
|
846
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
847
|
+
_assertClass(query, Query);
|
|
848
|
+
wasm.corestorage_matchesQuery(retptr, this.__wbg_ptr, addBorrowedObject(document), query.__wbg_ptr);
|
|
849
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
850
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
851
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
852
|
+
if (r2) {
|
|
853
|
+
throw takeObject(r1);
|
|
854
|
+
}
|
|
855
|
+
return r0 !== 0;
|
|
856
|
+
} finally {
|
|
857
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
858
|
+
heap[stack_pointer++] = undefined;
|
|
859
|
+
}
|
|
860
|
+
}
|
|
861
|
+
}
|
|
862
|
+
|
|
863
|
+
const DatabaseFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
864
|
+
? { register: () => {}, unregister: () => {} }
|
|
865
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_database_free(ptr >>> 0));
|
|
866
|
+
/**
|
|
867
|
+
* Represents a database with collections of documents.
|
|
868
|
+
*/
|
|
869
|
+
export class Database {
|
|
870
|
+
|
|
871
|
+
static __wrap(ptr) {
|
|
872
|
+
ptr = ptr >>> 0;
|
|
873
|
+
const obj = Object.create(Database.prototype);
|
|
874
|
+
obj.__wbg_ptr = ptr;
|
|
875
|
+
DatabaseFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
876
|
+
return obj;
|
|
877
|
+
}
|
|
878
|
+
|
|
879
|
+
__destroy_into_raw() {
|
|
880
|
+
const ptr = this.__wbg_ptr;
|
|
881
|
+
this.__wbg_ptr = 0;
|
|
882
|
+
DatabaseFinalization.unregister(this);
|
|
883
|
+
return ptr;
|
|
884
|
+
}
|
|
885
|
+
|
|
886
|
+
free() {
|
|
887
|
+
const ptr = this.__destroy_into_raw();
|
|
888
|
+
wasm.__wbg_database_free(ptr);
|
|
889
|
+
}
|
|
890
|
+
/**
|
|
891
|
+
* @returns {Promise<any>}
|
|
892
|
+
*/
|
|
893
|
+
start() {
|
|
894
|
+
const ret = wasm.database_start(this.__wbg_ptr);
|
|
895
|
+
return takeObject(ret);
|
|
896
|
+
}
|
|
897
|
+
/**
|
|
898
|
+
* @returns {Promise<any>}
|
|
899
|
+
*/
|
|
900
|
+
close() {
|
|
901
|
+
const ptr = this.__destroy_into_raw();
|
|
902
|
+
const ret = wasm.database_close(ptr);
|
|
903
|
+
return takeObject(ret);
|
|
904
|
+
}
|
|
905
|
+
/**
|
|
906
|
+
* @returns {boolean}
|
|
907
|
+
*/
|
|
908
|
+
get started() {
|
|
909
|
+
const ret = wasm.database_started(this.__wbg_ptr);
|
|
910
|
+
return ret !== 0;
|
|
911
|
+
}
|
|
912
|
+
/**
|
|
913
|
+
* Retrieves the collections in the database.
|
|
914
|
+
*
|
|
915
|
+
* This function returns an `Object` containing the collections.
|
|
916
|
+
*
|
|
917
|
+
* # Returns
|
|
918
|
+
*
|
|
919
|
+
* * `Result<Object, JsValue>` - A result containing an `Object` with the collections or an error.
|
|
920
|
+
* @returns {object}
|
|
921
|
+
*/
|
|
922
|
+
get collections() {
|
|
923
|
+
try {
|
|
924
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
925
|
+
wasm.database_collections(retptr, this.__wbg_ptr);
|
|
926
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
927
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
928
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
929
|
+
if (r2) {
|
|
930
|
+
throw takeObject(r1);
|
|
931
|
+
}
|
|
932
|
+
return takeObject(r0);
|
|
933
|
+
} finally {
|
|
934
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
935
|
+
}
|
|
936
|
+
}
|
|
937
|
+
/**
|
|
938
|
+
* @param {string} db_name
|
|
939
|
+
* @param {object} schemas_js
|
|
940
|
+
* @param {object} migrations_js
|
|
941
|
+
* @param {Array<any>} plugins
|
|
942
|
+
* @param {any} module
|
|
943
|
+
* @param {string | undefined} [password]
|
|
944
|
+
* @param {any | undefined} [storage]
|
|
945
|
+
* @returns {Promise<Database>}
|
|
946
|
+
*/
|
|
947
|
+
static create(db_name, schemas_js, migrations_js, plugins, module, password, storage) {
|
|
948
|
+
const ptr0 = passStringToWasm0(db_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
949
|
+
const len0 = WASM_VECTOR_LEN;
|
|
950
|
+
var ptr1 = isLikeNone(password) ? 0 : passStringToWasm0(password, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
951
|
+
var len1 = WASM_VECTOR_LEN;
|
|
952
|
+
const ret = wasm.database_create(ptr0, len0, addHeapObject(schemas_js), addHeapObject(migrations_js), addHeapObject(plugins), addHeapObject(module), ptr1, len1, isLikeNone(storage) ? 0 : addHeapObject(storage));
|
|
953
|
+
return takeObject(ret);
|
|
954
|
+
}
|
|
955
|
+
}
|
|
956
|
+
|
|
957
|
+
const InMemoryFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
958
|
+
? { register: () => {}, unregister: () => {} }
|
|
959
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_inmemory_free(ptr >>> 0));
|
|
960
|
+
/**
|
|
961
|
+
*/
|
|
962
|
+
export class InMemory {
|
|
963
|
+
|
|
964
|
+
static __wrap(ptr) {
|
|
965
|
+
ptr = ptr >>> 0;
|
|
966
|
+
const obj = Object.create(InMemory.prototype);
|
|
967
|
+
obj.__wbg_ptr = ptr;
|
|
968
|
+
InMemoryFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
969
|
+
return obj;
|
|
970
|
+
}
|
|
971
|
+
|
|
972
|
+
__destroy_into_raw() {
|
|
973
|
+
const ptr = this.__wbg_ptr;
|
|
974
|
+
this.__wbg_ptr = 0;
|
|
975
|
+
InMemoryFinalization.unregister(this);
|
|
976
|
+
return ptr;
|
|
977
|
+
}
|
|
978
|
+
|
|
979
|
+
free() {
|
|
980
|
+
const ptr = this.__destroy_into_raw();
|
|
981
|
+
wasm.__wbg_inmemory_free(ptr);
|
|
982
|
+
}
|
|
983
|
+
/**
|
|
984
|
+
* @param {string} name
|
|
985
|
+
* @param {object} schemas_js
|
|
986
|
+
* @returns {Promise<InMemory>}
|
|
987
|
+
*/
|
|
988
|
+
static create(name, schemas_js) {
|
|
989
|
+
const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
990
|
+
const len0 = WASM_VECTOR_LEN;
|
|
991
|
+
const ret = wasm.inmemory_create(ptr0, len0, addHeapObject(schemas_js));
|
|
992
|
+
return takeObject(ret);
|
|
993
|
+
}
|
|
994
|
+
/**
|
|
995
|
+
* @returns {any}
|
|
996
|
+
*/
|
|
997
|
+
get by_index() {
|
|
998
|
+
try {
|
|
999
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1000
|
+
wasm.inmemory_by_index(retptr, this.__wbg_ptr);
|
|
1001
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
1002
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
1003
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
1004
|
+
if (r2) {
|
|
1005
|
+
throw takeObject(r1);
|
|
1006
|
+
}
|
|
1007
|
+
return takeObject(r0);
|
|
1008
|
+
} finally {
|
|
1009
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1010
|
+
}
|
|
1011
|
+
}
|
|
1012
|
+
/**
|
|
1013
|
+
* @param {Operation} op
|
|
1014
|
+
* @returns {Promise<any>}
|
|
1015
|
+
*/
|
|
1016
|
+
write(op) {
|
|
1017
|
+
_assertClass(op, Operation);
|
|
1018
|
+
const ret = wasm.inmemory_write(this.__wbg_ptr, op.__wbg_ptr);
|
|
1019
|
+
return takeObject(ret);
|
|
1020
|
+
}
|
|
1021
|
+
/**
|
|
1022
|
+
* @param {string} collection_name
|
|
1023
|
+
* @param {any} query
|
|
1024
|
+
* @returns {Promise<any>}
|
|
1025
|
+
*/
|
|
1026
|
+
find(collection_name, query) {
|
|
1027
|
+
const ptr0 = passStringToWasm0(collection_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1028
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1029
|
+
const ret = wasm.inmemory_find(this.__wbg_ptr, ptr0, len0, addHeapObject(query));
|
|
1030
|
+
return takeObject(ret);
|
|
1031
|
+
}
|
|
1032
|
+
/**
|
|
1033
|
+
* @param {string} collection_name
|
|
1034
|
+
* @param {any} primary_key
|
|
1035
|
+
* @returns {Promise<any>}
|
|
1036
|
+
*/
|
|
1037
|
+
findDocumentById(collection_name, primary_key) {
|
|
1038
|
+
const ptr0 = passStringToWasm0(collection_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1039
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1040
|
+
const ret = wasm.inmemory_findDocumentById(this.__wbg_ptr, ptr0, len0, addHeapObject(primary_key));
|
|
1041
|
+
return takeObject(ret);
|
|
1042
|
+
}
|
|
1043
|
+
/**
|
|
1044
|
+
* @param {string} collection_name
|
|
1045
|
+
* @param {any} query
|
|
1046
|
+
* @returns {Promise<any>}
|
|
1047
|
+
*/
|
|
1048
|
+
count(collection_name, query) {
|
|
1049
|
+
const ptr0 = passStringToWasm0(collection_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1050
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1051
|
+
const ret = wasm.inmemory_count(this.__wbg_ptr, ptr0, len0, addHeapObject(query));
|
|
1052
|
+
return takeObject(ret);
|
|
1053
|
+
}
|
|
1054
|
+
/**
|
|
1055
|
+
* @returns {Promise<any>}
|
|
1056
|
+
*/
|
|
1057
|
+
close() {
|
|
1058
|
+
const ret = wasm.inmemory_close(this.__wbg_ptr);
|
|
1059
|
+
return takeObject(ret);
|
|
1060
|
+
}
|
|
1061
|
+
/**
|
|
1062
|
+
* @returns {Promise<any>}
|
|
1063
|
+
*/
|
|
1064
|
+
start() {
|
|
1065
|
+
const ret = wasm.inmemory_start(this.__wbg_ptr);
|
|
1066
|
+
return takeObject(ret);
|
|
1067
|
+
}
|
|
1068
|
+
}
|
|
1069
|
+
|
|
1070
|
+
const IndexDBFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1071
|
+
? { register: () => {}, unregister: () => {} }
|
|
1072
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_indexdb_free(ptr >>> 0));
|
|
1073
|
+
/**
|
|
1074
|
+
*/
|
|
1075
|
+
export class IndexDB {
|
|
1076
|
+
|
|
1077
|
+
static __wrap(ptr) {
|
|
1078
|
+
ptr = ptr >>> 0;
|
|
1079
|
+
const obj = Object.create(IndexDB.prototype);
|
|
1080
|
+
obj.__wbg_ptr = ptr;
|
|
1081
|
+
IndexDBFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
1082
|
+
return obj;
|
|
1083
|
+
}
|
|
1084
|
+
|
|
1085
|
+
__destroy_into_raw() {
|
|
1086
|
+
const ptr = this.__wbg_ptr;
|
|
1087
|
+
this.__wbg_ptr = 0;
|
|
1088
|
+
IndexDBFinalization.unregister(this);
|
|
1089
|
+
return ptr;
|
|
1090
|
+
}
|
|
1091
|
+
|
|
1092
|
+
free() {
|
|
1093
|
+
const ptr = this.__destroy_into_raw();
|
|
1094
|
+
wasm.__wbg_indexdb_free(ptr);
|
|
1095
|
+
}
|
|
1096
|
+
/**
|
|
1097
|
+
* @param {string} name
|
|
1098
|
+
* @param {object} schemas_js
|
|
1099
|
+
* @returns {Promise<IndexDB>}
|
|
1100
|
+
*/
|
|
1101
|
+
static create(name, schemas_js) {
|
|
1102
|
+
const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1103
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1104
|
+
const ret = wasm.indexdb_create(ptr0, len0, addHeapObject(schemas_js));
|
|
1105
|
+
return takeObject(ret);
|
|
1106
|
+
}
|
|
1107
|
+
/**
|
|
1108
|
+
* @param {Operation} op
|
|
1109
|
+
* @returns {Promise<any>}
|
|
1110
|
+
*/
|
|
1111
|
+
write(op) {
|
|
1112
|
+
_assertClass(op, Operation);
|
|
1113
|
+
const ret = wasm.indexdb_write(this.__wbg_ptr, op.__wbg_ptr);
|
|
1114
|
+
return takeObject(ret);
|
|
1115
|
+
}
|
|
1116
|
+
/**
|
|
1117
|
+
* @param {string} collection_name
|
|
1118
|
+
* @param {any} query
|
|
1119
|
+
* @returns {Promise<any>}
|
|
1120
|
+
*/
|
|
1121
|
+
find(collection_name, query) {
|
|
1122
|
+
const ptr0 = passStringToWasm0(collection_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1123
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1124
|
+
const ret = wasm.indexdb_find(this.__wbg_ptr, ptr0, len0, addHeapObject(query));
|
|
1125
|
+
return takeObject(ret);
|
|
1126
|
+
}
|
|
1127
|
+
/**
|
|
1128
|
+
* @param {string} collection_name
|
|
1129
|
+
* @param {any} primary_key
|
|
1130
|
+
* @returns {Promise<any>}
|
|
1131
|
+
*/
|
|
1132
|
+
findDocumentById(collection_name, primary_key) {
|
|
1133
|
+
const ptr0 = passStringToWasm0(collection_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1134
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1135
|
+
const ret = wasm.indexdb_findDocumentById(this.__wbg_ptr, ptr0, len0, addHeapObject(primary_key));
|
|
1136
|
+
return takeObject(ret);
|
|
1137
|
+
}
|
|
1138
|
+
/**
|
|
1139
|
+
* @param {string} collection_name
|
|
1140
|
+
* @param {any} query
|
|
1141
|
+
* @returns {Promise<any>}
|
|
1142
|
+
*/
|
|
1143
|
+
count(collection_name, query) {
|
|
1144
|
+
const ptr0 = passStringToWasm0(collection_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1145
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1146
|
+
const ret = wasm.indexdb_count(this.__wbg_ptr, ptr0, len0, addHeapObject(query));
|
|
1147
|
+
return takeObject(ret);
|
|
1148
|
+
}
|
|
1149
|
+
/**
|
|
1150
|
+
* @returns {Promise<any>}
|
|
1151
|
+
*/
|
|
1152
|
+
close() {
|
|
1153
|
+
const ret = wasm.indexdb_close(this.__wbg_ptr);
|
|
1154
|
+
return takeObject(ret);
|
|
1155
|
+
}
|
|
1156
|
+
/**
|
|
1157
|
+
* @returns {Promise<any>}
|
|
1158
|
+
*/
|
|
1159
|
+
start() {
|
|
1160
|
+
const ret = wasm.indexdb_start(this.__wbg_ptr);
|
|
1161
|
+
return takeObject(ret);
|
|
1162
|
+
}
|
|
1163
|
+
}
|
|
1164
|
+
|
|
1165
|
+
const OperationFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1166
|
+
? { register: () => {}, unregister: () => {} }
|
|
1167
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_operation_free(ptr >>> 0));
|
|
1168
|
+
/**
|
|
1169
|
+
* Represents an operation to be performed on a collection.
|
|
1170
|
+
*/
|
|
1171
|
+
export class Operation {
|
|
1172
|
+
|
|
1173
|
+
static __wrap(ptr) {
|
|
1174
|
+
ptr = ptr >>> 0;
|
|
1175
|
+
const obj = Object.create(Operation.prototype);
|
|
1176
|
+
obj.__wbg_ptr = ptr;
|
|
1177
|
+
OperationFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
1178
|
+
return obj;
|
|
1179
|
+
}
|
|
1180
|
+
|
|
1181
|
+
__destroy_into_raw() {
|
|
1182
|
+
const ptr = this.__wbg_ptr;
|
|
1183
|
+
this.__wbg_ptr = 0;
|
|
1184
|
+
OperationFinalization.unregister(this);
|
|
1185
|
+
return ptr;
|
|
1186
|
+
}
|
|
1187
|
+
|
|
1188
|
+
free() {
|
|
1189
|
+
const ptr = this.__destroy_into_raw();
|
|
1190
|
+
wasm.__wbg_operation_free(ptr);
|
|
1191
|
+
}
|
|
1192
|
+
/**
|
|
1193
|
+
* Retrieves the name of the collection.
|
|
1194
|
+
*
|
|
1195
|
+
* # Returns
|
|
1196
|
+
*
|
|
1197
|
+
* * `String` - The name of the collection.
|
|
1198
|
+
* @returns {string}
|
|
1199
|
+
*/
|
|
1200
|
+
get collection() {
|
|
1201
|
+
let deferred1_0;
|
|
1202
|
+
let deferred1_1;
|
|
1203
|
+
try {
|
|
1204
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1205
|
+
wasm.operation_collection(retptr, this.__wbg_ptr);
|
|
1206
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
1207
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
1208
|
+
deferred1_0 = r0;
|
|
1209
|
+
deferred1_1 = r1;
|
|
1210
|
+
return getStringFromWasm0(r0, r1);
|
|
1211
|
+
} finally {
|
|
1212
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1213
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
1214
|
+
}
|
|
1215
|
+
}
|
|
1216
|
+
/**
|
|
1217
|
+
* Retrieves the type of operation.
|
|
1218
|
+
*
|
|
1219
|
+
* # Returns
|
|
1220
|
+
*
|
|
1221
|
+
* * `OpType` - The type of operation.
|
|
1222
|
+
* @returns {OpType}
|
|
1223
|
+
*/
|
|
1224
|
+
get opType() {
|
|
1225
|
+
const ret = wasm.operation_opType(this.__wbg_ptr);
|
|
1226
|
+
return ret;
|
|
1227
|
+
}
|
|
1228
|
+
/**
|
|
1229
|
+
* Retrieves the data involved in the operation.
|
|
1230
|
+
*
|
|
1231
|
+
* # Returns
|
|
1232
|
+
*
|
|
1233
|
+
* * `JsValue` - The data involved in the operation.
|
|
1234
|
+
* @returns {any}
|
|
1235
|
+
*/
|
|
1236
|
+
get data() {
|
|
1237
|
+
const ret = wasm.operation_data(this.__wbg_ptr);
|
|
1238
|
+
return takeObject(ret);
|
|
1239
|
+
}
|
|
1240
|
+
/**
|
|
1241
|
+
* Retrieves the indexes related to the operation.
|
|
1242
|
+
*
|
|
1243
|
+
* # Returns
|
|
1244
|
+
*
|
|
1245
|
+
* * `Result<JsValue, JsValue>` - A result containing the indexes as a `JsValue` or an error.
|
|
1246
|
+
* @returns {any}
|
|
1247
|
+
*/
|
|
1248
|
+
get indexes() {
|
|
1249
|
+
try {
|
|
1250
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1251
|
+
wasm.operation_indexes(retptr, this.__wbg_ptr);
|
|
1252
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
1253
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
1254
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
1255
|
+
if (r2) {
|
|
1256
|
+
throw takeObject(r1);
|
|
1257
|
+
}
|
|
1258
|
+
return takeObject(r0);
|
|
1259
|
+
} finally {
|
|
1260
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1261
|
+
}
|
|
1262
|
+
}
|
|
1263
|
+
}
|
|
1264
|
+
|
|
1265
|
+
const PropertyFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1266
|
+
? { register: () => {}, unregister: () => {} }
|
|
1267
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_property_free(ptr >>> 0));
|
|
1268
|
+
/**
|
|
1269
|
+
* Represents a property within a schema, including type, items, length constraints, and other attributes.
|
|
1270
|
+
*/
|
|
1271
|
+
export class Property {
|
|
1272
|
+
|
|
1273
|
+
__destroy_into_raw() {
|
|
1274
|
+
const ptr = this.__wbg_ptr;
|
|
1275
|
+
this.__wbg_ptr = 0;
|
|
1276
|
+
PropertyFinalization.unregister(this);
|
|
1277
|
+
return ptr;
|
|
1278
|
+
}
|
|
1279
|
+
|
|
1280
|
+
free() {
|
|
1281
|
+
const ptr = this.__destroy_into_raw();
|
|
1282
|
+
wasm.__wbg_property_free(ptr);
|
|
1283
|
+
}
|
|
1284
|
+
/**
|
|
1285
|
+
* Checks is the schema is valid.
|
|
1286
|
+
*
|
|
1287
|
+
* # Returns
|
|
1288
|
+
*
|
|
1289
|
+
* Throws exception if not valid
|
|
1290
|
+
* @returns {boolean}
|
|
1291
|
+
*/
|
|
1292
|
+
is_valid() {
|
|
1293
|
+
try {
|
|
1294
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1295
|
+
wasm.property_is_valid(retptr, this.__wbg_ptr);
|
|
1296
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
1297
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
1298
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
1299
|
+
if (r2) {
|
|
1300
|
+
throw takeObject(r1);
|
|
1301
|
+
}
|
|
1302
|
+
return r0 !== 0;
|
|
1303
|
+
} finally {
|
|
1304
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1305
|
+
}
|
|
1306
|
+
}
|
|
1307
|
+
/**
|
|
1308
|
+
* Retrieves the type of the property.
|
|
1309
|
+
*
|
|
1310
|
+
* # Returns
|
|
1311
|
+
*
|
|
1312
|
+
* * `PropertyType` - The type of the property.
|
|
1313
|
+
* @returns {any}
|
|
1314
|
+
*/
|
|
1315
|
+
get type() {
|
|
1316
|
+
const ret = wasm.property_type(this.__wbg_ptr);
|
|
1317
|
+
return takeObject(ret);
|
|
1318
|
+
}
|
|
1319
|
+
/**
|
|
1320
|
+
* Retrieves the items of the property.
|
|
1321
|
+
*
|
|
1322
|
+
* # Returns
|
|
1323
|
+
*
|
|
1324
|
+
* * `Result<JsValue, JsValue>` - A result containing the items as a `JsValue` or an error.
|
|
1325
|
+
* @returns {any}
|
|
1326
|
+
*/
|
|
1327
|
+
get items() {
|
|
1328
|
+
try {
|
|
1329
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1330
|
+
wasm.property_items(retptr, this.__wbg_ptr);
|
|
1331
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
1332
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
1333
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
1334
|
+
if (r2) {
|
|
1335
|
+
throw takeObject(r1);
|
|
1336
|
+
}
|
|
1337
|
+
return takeObject(r0);
|
|
1338
|
+
} finally {
|
|
1339
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1340
|
+
}
|
|
1341
|
+
}
|
|
1342
|
+
/**
|
|
1343
|
+
* Retrieves the maximum number of items of the property.
|
|
1344
|
+
*
|
|
1345
|
+
* # Returns
|
|
1346
|
+
*
|
|
1347
|
+
* * `Result<JsValue, JsValue>` - A result containing the maximum number of items as a `JsValue` or an error.
|
|
1348
|
+
* @returns {any}
|
|
1349
|
+
*/
|
|
1350
|
+
get maxItems() {
|
|
1351
|
+
try {
|
|
1352
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1353
|
+
wasm.property_maxItems(retptr, this.__wbg_ptr);
|
|
1354
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
1355
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
1356
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
1357
|
+
if (r2) {
|
|
1358
|
+
throw takeObject(r1);
|
|
1359
|
+
}
|
|
1360
|
+
return takeObject(r0);
|
|
1361
|
+
} finally {
|
|
1362
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1363
|
+
}
|
|
1364
|
+
}
|
|
1365
|
+
/**
|
|
1366
|
+
* Retrieves the minimum number of items of the property.
|
|
1367
|
+
*
|
|
1368
|
+
* # Returns
|
|
1369
|
+
*
|
|
1370
|
+
* * `Result<JsValue, JsValue>` - A result containing the minimum number of items as a `JsValue` or an error.
|
|
1371
|
+
* @returns {any}
|
|
1372
|
+
*/
|
|
1373
|
+
get minItems() {
|
|
1374
|
+
try {
|
|
1375
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1376
|
+
wasm.property_minItems(retptr, this.__wbg_ptr);
|
|
1377
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
1378
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
1379
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
1380
|
+
if (r2) {
|
|
1381
|
+
throw takeObject(r1);
|
|
1382
|
+
}
|
|
1383
|
+
return takeObject(r0);
|
|
1384
|
+
} finally {
|
|
1385
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1386
|
+
}
|
|
1387
|
+
}
|
|
1388
|
+
/**
|
|
1389
|
+
* Retrieves the maximum length of the property.
|
|
1390
|
+
*
|
|
1391
|
+
* # Returns
|
|
1392
|
+
*
|
|
1393
|
+
* * `Result<JsValue, JsValue>` - A result containing the maximum length as a `JsValue` or an error.
|
|
1394
|
+
* @returns {any}
|
|
1395
|
+
*/
|
|
1396
|
+
get maxLength() {
|
|
1397
|
+
try {
|
|
1398
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1399
|
+
wasm.property_maxLength(retptr, this.__wbg_ptr);
|
|
1400
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
1401
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
1402
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
1403
|
+
if (r2) {
|
|
1404
|
+
throw takeObject(r1);
|
|
1405
|
+
}
|
|
1406
|
+
return takeObject(r0);
|
|
1407
|
+
} finally {
|
|
1408
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1409
|
+
}
|
|
1410
|
+
}
|
|
1411
|
+
/**
|
|
1412
|
+
* Retrieves the minimum length of the property.
|
|
1413
|
+
*
|
|
1414
|
+
* # Returns
|
|
1415
|
+
*
|
|
1416
|
+
* * `Result<JsValue, JsValue>` - A result containing the minimum length as a `JsValue` or an error.
|
|
1417
|
+
* @returns {any}
|
|
1418
|
+
*/
|
|
1419
|
+
get minLength() {
|
|
1420
|
+
try {
|
|
1421
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1422
|
+
wasm.property_minLength(retptr, this.__wbg_ptr);
|
|
1423
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
1424
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
1425
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
1426
|
+
if (r2) {
|
|
1427
|
+
throw takeObject(r1);
|
|
1428
|
+
}
|
|
1429
|
+
return takeObject(r0);
|
|
1430
|
+
} finally {
|
|
1431
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1432
|
+
}
|
|
1433
|
+
}
|
|
1434
|
+
/**
|
|
1435
|
+
* Retrieves the nested properties of the property.
|
|
1436
|
+
*
|
|
1437
|
+
* # Returns
|
|
1438
|
+
*
|
|
1439
|
+
* * `Result<JsValue, JsValue>` - A result containing the nested properties as a `JsValue` or an error.
|
|
1440
|
+
* @returns {any}
|
|
1441
|
+
*/
|
|
1442
|
+
get properties() {
|
|
1443
|
+
try {
|
|
1444
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1445
|
+
wasm.property_properties(retptr, this.__wbg_ptr);
|
|
1446
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
1447
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
1448
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
1449
|
+
if (r2) {
|
|
1450
|
+
throw takeObject(r1);
|
|
1451
|
+
}
|
|
1452
|
+
return takeObject(r0);
|
|
1453
|
+
} finally {
|
|
1454
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1455
|
+
}
|
|
1456
|
+
}
|
|
1457
|
+
}
|
|
1458
|
+
|
|
1459
|
+
const QueryFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1460
|
+
? { register: () => {}, unregister: () => {} }
|
|
1461
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_query_free(ptr >>> 0));
|
|
1462
|
+
/**
|
|
1463
|
+
*/
|
|
1464
|
+
export class Query {
|
|
1465
|
+
|
|
1466
|
+
__destroy_into_raw() {
|
|
1467
|
+
const ptr = this.__wbg_ptr;
|
|
1468
|
+
this.__wbg_ptr = 0;
|
|
1469
|
+
QueryFinalization.unregister(this);
|
|
1470
|
+
return ptr;
|
|
1471
|
+
}
|
|
1472
|
+
|
|
1473
|
+
free() {
|
|
1474
|
+
const ptr = this.__destroy_into_raw();
|
|
1475
|
+
wasm.__wbg_query_free(ptr);
|
|
1476
|
+
}
|
|
1477
|
+
/**
|
|
1478
|
+
* @param {any} query
|
|
1479
|
+
* @param {Schema} schema
|
|
1480
|
+
*/
|
|
1481
|
+
constructor(query, schema) {
|
|
1482
|
+
try {
|
|
1483
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1484
|
+
_assertClass(schema, Schema);
|
|
1485
|
+
var ptr0 = schema.__destroy_into_raw();
|
|
1486
|
+
wasm.query_new(retptr, addHeapObject(query), ptr0);
|
|
1487
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
1488
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
1489
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
1490
|
+
if (r2) {
|
|
1491
|
+
throw takeObject(r1);
|
|
1492
|
+
}
|
|
1493
|
+
this.__wbg_ptr = r0 >>> 0;
|
|
1494
|
+
return this;
|
|
1495
|
+
} finally {
|
|
1496
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1497
|
+
}
|
|
1498
|
+
}
|
|
1499
|
+
/**
|
|
1500
|
+
* @returns {any}
|
|
1501
|
+
*/
|
|
1502
|
+
get query() {
|
|
1503
|
+
try {
|
|
1504
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1505
|
+
wasm.query_query(retptr, this.__wbg_ptr);
|
|
1506
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
1507
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
1508
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
1509
|
+
if (r2) {
|
|
1510
|
+
throw takeObject(r1);
|
|
1511
|
+
}
|
|
1512
|
+
return takeObject(r0);
|
|
1513
|
+
} finally {
|
|
1514
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1515
|
+
}
|
|
1516
|
+
}
|
|
1517
|
+
/**
|
|
1518
|
+
* @returns {any}
|
|
1519
|
+
*/
|
|
1520
|
+
parse() {
|
|
1521
|
+
try {
|
|
1522
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1523
|
+
wasm.query_parse(retptr, this.__wbg_ptr);
|
|
1524
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
1525
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
1526
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
1527
|
+
if (r2) {
|
|
1528
|
+
throw takeObject(r1);
|
|
1529
|
+
}
|
|
1530
|
+
return takeObject(r0);
|
|
1531
|
+
} finally {
|
|
1532
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1533
|
+
}
|
|
1534
|
+
}
|
|
1535
|
+
}
|
|
1536
|
+
|
|
1537
|
+
const SchemaFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1538
|
+
? { register: () => {}, unregister: () => {} }
|
|
1539
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_schema_free(ptr >>> 0));
|
|
1540
|
+
/**
|
|
1541
|
+
* Represents the schema of a collection, including version, primary key, type, required fields, properties, and indexes.
|
|
1542
|
+
*/
|
|
1543
|
+
export class Schema {
|
|
1544
|
+
|
|
1545
|
+
static __wrap(ptr) {
|
|
1546
|
+
ptr = ptr >>> 0;
|
|
1547
|
+
const obj = Object.create(Schema.prototype);
|
|
1548
|
+
obj.__wbg_ptr = ptr;
|
|
1549
|
+
SchemaFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
1550
|
+
return obj;
|
|
1551
|
+
}
|
|
1552
|
+
|
|
1553
|
+
__destroy_into_raw() {
|
|
1554
|
+
const ptr = this.__wbg_ptr;
|
|
1555
|
+
this.__wbg_ptr = 0;
|
|
1556
|
+
SchemaFinalization.unregister(this);
|
|
1557
|
+
return ptr;
|
|
1558
|
+
}
|
|
1559
|
+
|
|
1560
|
+
free() {
|
|
1561
|
+
const ptr = this.__destroy_into_raw();
|
|
1562
|
+
wasm.__wbg_schema_free(ptr);
|
|
1563
|
+
}
|
|
1564
|
+
/**
|
|
1565
|
+
* @param {any} document
|
|
1566
|
+
*/
|
|
1567
|
+
validate(document) {
|
|
1568
|
+
try {
|
|
1569
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1570
|
+
wasm.schema_validate(retptr, this.__wbg_ptr, addHeapObject(document));
|
|
1571
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
1572
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
1573
|
+
if (r1) {
|
|
1574
|
+
throw takeObject(r0);
|
|
1575
|
+
}
|
|
1576
|
+
} finally {
|
|
1577
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1578
|
+
}
|
|
1579
|
+
}
|
|
1580
|
+
/**
|
|
1581
|
+
* @returns {boolean}
|
|
1582
|
+
*/
|
|
1583
|
+
is_valid() {
|
|
1584
|
+
try {
|
|
1585
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1586
|
+
wasm.schema_is_valid(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 r0 !== 0;
|
|
1594
|
+
} finally {
|
|
1595
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1596
|
+
}
|
|
1597
|
+
}
|
|
1598
|
+
/**
|
|
1599
|
+
* Creates a new `Schema` instance from a given `JsValue`.
|
|
1600
|
+
*
|
|
1601
|
+
* # Arguments
|
|
1602
|
+
*
|
|
1603
|
+
* * `schema` - A `JsValue` representing the schema.
|
|
1604
|
+
*
|
|
1605
|
+
* # Returns
|
|
1606
|
+
*
|
|
1607
|
+
* * `Result<Schema, JsValue>` - A result containing the new `Schema` instance or an error.
|
|
1608
|
+
* @param {any} schema
|
|
1609
|
+
* @returns {Schema}
|
|
1610
|
+
*/
|
|
1611
|
+
static create(schema) {
|
|
1612
|
+
try {
|
|
1613
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1614
|
+
wasm.schema_create(retptr, addHeapObject(schema));
|
|
1615
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
1616
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
1617
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
1618
|
+
if (r2) {
|
|
1619
|
+
throw takeObject(r1);
|
|
1620
|
+
}
|
|
1621
|
+
return Schema.__wrap(r0);
|
|
1622
|
+
} finally {
|
|
1623
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1624
|
+
}
|
|
1625
|
+
}
|
|
1626
|
+
/**
|
|
1627
|
+
* Retrieves the version of the schema.
|
|
1628
|
+
*
|
|
1629
|
+
* # Returns
|
|
1630
|
+
*
|
|
1631
|
+
* * `i32` - The version of the schema.
|
|
1632
|
+
* @returns {number}
|
|
1633
|
+
*/
|
|
1634
|
+
get version() {
|
|
1635
|
+
const ret = wasm.schema_version(this.__wbg_ptr);
|
|
1636
|
+
return ret;
|
|
1637
|
+
}
|
|
1638
|
+
/**
|
|
1639
|
+
* Retrieves the primary key of the schema.
|
|
1640
|
+
*
|
|
1641
|
+
* # Returns
|
|
1642
|
+
*
|
|
1643
|
+
* * `String` - The primary key of the schema.
|
|
1644
|
+
* @returns {string}
|
|
1645
|
+
*/
|
|
1646
|
+
get primaryKey() {
|
|
1647
|
+
let deferred1_0;
|
|
1648
|
+
let deferred1_1;
|
|
1649
|
+
try {
|
|
1650
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1651
|
+
wasm.schema_primaryKey(retptr, this.__wbg_ptr);
|
|
1652
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
1653
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
1654
|
+
deferred1_0 = r0;
|
|
1655
|
+
deferred1_1 = r1;
|
|
1656
|
+
return getStringFromWasm0(r0, r1);
|
|
1657
|
+
} finally {
|
|
1658
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1659
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
1660
|
+
}
|
|
1661
|
+
}
|
|
1662
|
+
/**
|
|
1663
|
+
* Retrieves the type of the schema.
|
|
1664
|
+
*
|
|
1665
|
+
* # Returns
|
|
1666
|
+
*
|
|
1667
|
+
* * `String` - The type of the schema.
|
|
1668
|
+
* @returns {string}
|
|
1669
|
+
*/
|
|
1670
|
+
get type() {
|
|
1671
|
+
let deferred1_0;
|
|
1672
|
+
let deferred1_1;
|
|
1673
|
+
try {
|
|
1674
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1675
|
+
wasm.schema_type(retptr, this.__wbg_ptr);
|
|
1676
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
1677
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
1678
|
+
deferred1_0 = r0;
|
|
1679
|
+
deferred1_1 = r1;
|
|
1680
|
+
return getStringFromWasm0(r0, r1);
|
|
1681
|
+
} finally {
|
|
1682
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1683
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
1684
|
+
}
|
|
1685
|
+
}
|
|
1686
|
+
/**
|
|
1687
|
+
* Retrieves the indexes of the schema, if any.
|
|
1688
|
+
*
|
|
1689
|
+
* # Returns
|
|
1690
|
+
*
|
|
1691
|
+
* * `Option<Vec<String>>` - The indexes of the schema, if any.
|
|
1692
|
+
* @returns {(string)[] | undefined}
|
|
1693
|
+
*/
|
|
1694
|
+
get indexes() {
|
|
1695
|
+
try {
|
|
1696
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1697
|
+
wasm.schema_indexes(retptr, this.__wbg_ptr);
|
|
1698
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
1699
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
1700
|
+
let v1;
|
|
1701
|
+
if (r0 !== 0) {
|
|
1702
|
+
v1 = getArrayJsValueFromWasm0(r0, r1).slice();
|
|
1703
|
+
wasm.__wbindgen_free(r0, r1 * 4, 4);
|
|
1704
|
+
}
|
|
1705
|
+
return v1;
|
|
1706
|
+
} finally {
|
|
1707
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1708
|
+
}
|
|
1709
|
+
}
|
|
1710
|
+
/**
|
|
1711
|
+
* @returns {(string)[] | undefined}
|
|
1712
|
+
*/
|
|
1713
|
+
get encrypted() {
|
|
1714
|
+
try {
|
|
1715
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1716
|
+
wasm.schema_encrypted(retptr, this.__wbg_ptr);
|
|
1717
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
1718
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
1719
|
+
let v1;
|
|
1720
|
+
if (r0 !== 0) {
|
|
1721
|
+
v1 = getArrayJsValueFromWasm0(r0, r1).slice();
|
|
1722
|
+
wasm.__wbindgen_free(r0, r1 * 4, 4);
|
|
1723
|
+
}
|
|
1724
|
+
return v1;
|
|
1725
|
+
} finally {
|
|
1726
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1727
|
+
}
|
|
1728
|
+
}
|
|
1729
|
+
/**
|
|
1730
|
+
* Retrieves the properties of the schema.
|
|
1731
|
+
*
|
|
1732
|
+
* # Returns
|
|
1733
|
+
*
|
|
1734
|
+
* * `Result<JsValue, JsValue>` - A result containing the properties as a `JsValue` or an error.
|
|
1735
|
+
* @returns {any}
|
|
1736
|
+
*/
|
|
1737
|
+
get properties() {
|
|
1738
|
+
try {
|
|
1739
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1740
|
+
wasm.schema_properties(retptr, this.__wbg_ptr);
|
|
1741
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
1742
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
1743
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
1744
|
+
if (r2) {
|
|
1745
|
+
throw takeObject(r1);
|
|
1746
|
+
}
|
|
1747
|
+
return takeObject(r0);
|
|
1748
|
+
} finally {
|
|
1749
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1750
|
+
}
|
|
1751
|
+
}
|
|
1752
|
+
}
|
|
1753
|
+
|
|
1754
|
+
const WasmBindgenTestContextFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1755
|
+
? { register: () => {}, unregister: () => {} }
|
|
1756
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_wasmbindgentestcontext_free(ptr >>> 0));
|
|
1757
|
+
/**
|
|
1758
|
+
* Runtime test harness support instantiated in JS.
|
|
1759
|
+
*
|
|
1760
|
+
* The node.js entry script instantiates a `Context` here which is used to
|
|
1761
|
+
* drive test execution.
|
|
1762
|
+
*/
|
|
1763
|
+
export class WasmBindgenTestContext {
|
|
1764
|
+
|
|
1765
|
+
__destroy_into_raw() {
|
|
1766
|
+
const ptr = this.__wbg_ptr;
|
|
1767
|
+
this.__wbg_ptr = 0;
|
|
1768
|
+
WasmBindgenTestContextFinalization.unregister(this);
|
|
1769
|
+
return ptr;
|
|
1770
|
+
}
|
|
1771
|
+
|
|
1772
|
+
free() {
|
|
1773
|
+
const ptr = this.__destroy_into_raw();
|
|
1774
|
+
wasm.__wbg_wasmbindgentestcontext_free(ptr);
|
|
1775
|
+
}
|
|
1776
|
+
/**
|
|
1777
|
+
* Creates a new context ready to run tests.
|
|
1778
|
+
*
|
|
1779
|
+
* A `Context` is the main structure through which test execution is
|
|
1780
|
+
* coordinated, and this will collect output and results for all executed
|
|
1781
|
+
* tests.
|
|
1782
|
+
*/
|
|
1783
|
+
constructor() {
|
|
1784
|
+
const ret = wasm.wasmbindgentestcontext_new();
|
|
1785
|
+
this.__wbg_ptr = ret >>> 0;
|
|
1786
|
+
return this;
|
|
1787
|
+
}
|
|
1788
|
+
/**
|
|
1789
|
+
* Inform this context about runtime arguments passed to the test
|
|
1790
|
+
* harness.
|
|
1791
|
+
* @param {any[]} args
|
|
1792
|
+
*/
|
|
1793
|
+
args(args) {
|
|
1794
|
+
const ptr0 = passArrayJsValueToWasm0(args, wasm.__wbindgen_malloc);
|
|
1795
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1796
|
+
wasm.wasmbindgentestcontext_args(this.__wbg_ptr, ptr0, len0);
|
|
1797
|
+
}
|
|
1798
|
+
/**
|
|
1799
|
+
* Executes a list of tests, returning a promise representing their
|
|
1800
|
+
* eventual completion.
|
|
1801
|
+
*
|
|
1802
|
+
* This is the main entry point for executing tests. All the tests passed
|
|
1803
|
+
* in are the JS `Function` object that was plucked off the
|
|
1804
|
+
* `WebAssembly.Instance` exports list.
|
|
1805
|
+
*
|
|
1806
|
+
* The promise returned resolves to either `true` if all tests passed or
|
|
1807
|
+
* `false` if at least one test failed.
|
|
1808
|
+
* @param {any[]} tests
|
|
1809
|
+
* @returns {Promise<any>}
|
|
1810
|
+
*/
|
|
1811
|
+
run(tests) {
|
|
1812
|
+
const ptr0 = passArrayJsValueToWasm0(tests, wasm.__wbindgen_malloc);
|
|
1813
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1814
|
+
const ret = wasm.wasmbindgentestcontext_run(this.__wbg_ptr, ptr0, len0);
|
|
1815
|
+
return takeObject(ret);
|
|
1816
|
+
}
|
|
1817
|
+
}
|
|
1818
|
+
|
|
1819
|
+
async function __wbg_load(module, imports) {
|
|
1820
|
+
if (typeof Response === 'function' && module instanceof Response) {
|
|
1821
|
+
if (typeof WebAssembly.instantiateStreaming === 'function') {
|
|
1822
|
+
try {
|
|
1823
|
+
return await WebAssembly.instantiateStreaming(module, imports);
|
|
1824
|
+
|
|
1825
|
+
} catch (e) {
|
|
1826
|
+
if (module.headers.get('Content-Type') != 'application/wasm') {
|
|
1827
|
+
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);
|
|
1828
|
+
|
|
1829
|
+
} else {
|
|
1830
|
+
throw e;
|
|
1831
|
+
}
|
|
1832
|
+
}
|
|
1833
|
+
}
|
|
1834
|
+
|
|
1835
|
+
const bytes = await module.arrayBuffer();
|
|
1836
|
+
return await WebAssembly.instantiate(bytes, imports);
|
|
1837
|
+
|
|
1838
|
+
} else {
|
|
1839
|
+
const instance = await WebAssembly.instantiate(module, imports);
|
|
1840
|
+
|
|
1841
|
+
if (instance instanceof WebAssembly.Instance) {
|
|
1842
|
+
return { instance, module };
|
|
1843
|
+
|
|
1844
|
+
} else {
|
|
1845
|
+
return instance;
|
|
1846
|
+
}
|
|
1847
|
+
}
|
|
1848
|
+
}
|
|
1849
|
+
|
|
1850
|
+
function __wbg_get_imports() {
|
|
1851
|
+
const imports = {};
|
|
1852
|
+
imports.wbg = {};
|
|
1853
|
+
imports.wbg.__wbindgen_object_drop_ref = function(arg0) {
|
|
1854
|
+
takeObject(arg0);
|
|
1855
|
+
};
|
|
1856
|
+
imports.wbg.__wbindgen_is_undefined = function(arg0) {
|
|
1857
|
+
const ret = getObject(arg0) === undefined;
|
|
1858
|
+
return ret;
|
|
1859
|
+
};
|
|
1860
|
+
imports.wbg.__wbindgen_is_null = function(arg0) {
|
|
1861
|
+
const ret = getObject(arg0) === null;
|
|
1862
|
+
return ret;
|
|
1863
|
+
};
|
|
1864
|
+
imports.wbg.__wbindgen_string_new = function(arg0, arg1) {
|
|
1865
|
+
const ret = getStringFromWasm0(arg0, arg1);
|
|
1866
|
+
return addHeapObject(ret);
|
|
1867
|
+
};
|
|
1868
|
+
imports.wbg.__wbindgen_object_clone_ref = function(arg0) {
|
|
1869
|
+
const ret = getObject(arg0);
|
|
1870
|
+
return addHeapObject(ret);
|
|
1871
|
+
};
|
|
1872
|
+
imports.wbg.__wbg_close_b18eee4bcb7def21 = function() { return handleError(function (arg0) {
|
|
1873
|
+
const ret = getObject(arg0).close();
|
|
1874
|
+
return addHeapObject(ret);
|
|
1875
|
+
}, arguments) };
|
|
1876
|
+
imports.wbg.__wbg_count_431f5e9ed174125c = function() { return handleError(function (arg0, arg1, arg2, arg3) {
|
|
1877
|
+
const ret = getObject(arg0).count(getStringFromWasm0(arg1, arg2), takeObject(arg3));
|
|
1878
|
+
return addHeapObject(ret);
|
|
1879
|
+
}, arguments) };
|
|
1880
|
+
imports.wbg.__wbg_indexdb_new = function(arg0) {
|
|
1881
|
+
const ret = IndexDB.__wrap(arg0);
|
|
1882
|
+
return addHeapObject(ret);
|
|
1883
|
+
};
|
|
1884
|
+
imports.wbg.__wbg_start_65a59f7936d1615b = function() { return handleError(function (arg0) {
|
|
1885
|
+
const ret = getObject(arg0).start();
|
|
1886
|
+
return addHeapObject(ret);
|
|
1887
|
+
}, arguments) };
|
|
1888
|
+
imports.wbg.__wbg_inmemory_new = function(arg0) {
|
|
1889
|
+
const ret = InMemory.__wrap(arg0);
|
|
1890
|
+
return addHeapObject(ret);
|
|
1891
|
+
};
|
|
1892
|
+
imports.wbg.__wbg_apply_69a38b2b812c92ba = function() { return handleError(function (arg0, arg1, arg2) {
|
|
1893
|
+
const ret = getObject(arg1).apply(takeObject(arg2));
|
|
1894
|
+
const ptr1 = passArrayJsValueToWasm0(ret, wasm.__wbindgen_malloc);
|
|
1895
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1896
|
+
getInt32Memory0()[arg0 / 4 + 1] = len1;
|
|
1897
|
+
getInt32Memory0()[arg0 / 4 + 0] = ptr1;
|
|
1898
|
+
}, arguments) };
|
|
1899
|
+
imports.wbg.__wbindgen_string_get = function(arg0, arg1) {
|
|
1900
|
+
const obj = getObject(arg1);
|
|
1901
|
+
const ret = typeof(obj) === 'string' ? obj : undefined;
|
|
1902
|
+
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1903
|
+
var len1 = WASM_VECTOR_LEN;
|
|
1904
|
+
getInt32Memory0()[arg0 / 4 + 1] = len1;
|
|
1905
|
+
getInt32Memory0()[arg0 / 4 + 0] = ptr1;
|
|
1906
|
+
};
|
|
1907
|
+
imports.wbg.__wbindgen_number_new = function(arg0) {
|
|
1908
|
+
const ret = arg0;
|
|
1909
|
+
return addHeapObject(ret);
|
|
1910
|
+
};
|
|
1911
|
+
imports.wbg.__wbg_database_new = function(arg0) {
|
|
1912
|
+
const ret = Database.__wrap(arg0);
|
|
1913
|
+
return addHeapObject(ret);
|
|
1914
|
+
};
|
|
1915
|
+
imports.wbg.__wbg_write_ca9bab98548a9017 = function() { return handleError(function (arg0, arg1) {
|
|
1916
|
+
const ret = getObject(arg0).write(Operation.__wrap(arg1));
|
|
1917
|
+
return addHeapObject(ret);
|
|
1918
|
+
}, arguments) };
|
|
1919
|
+
imports.wbg.__wbg_find_f9ccdf6abdbe1b6b = function() { return handleError(function (arg0, arg1, arg2, arg3) {
|
|
1920
|
+
const ret = getObject(arg0).find(getStringFromWasm0(arg1, arg2), takeObject(arg3));
|
|
1921
|
+
return addHeapObject(ret);
|
|
1922
|
+
}, arguments) };
|
|
1923
|
+
imports.wbg.__wbg_findDocumentById_709034599222e0b9 = function() { return handleError(function (arg0, arg1, arg2, arg3) {
|
|
1924
|
+
const ret = getObject(arg0).findDocumentById(getStringFromWasm0(arg1, arg2), takeObject(arg3));
|
|
1925
|
+
return addHeapObject(ret);
|
|
1926
|
+
}, arguments) };
|
|
1927
|
+
imports.wbg.__wbindgen_number_get = function(arg0, arg1) {
|
|
1928
|
+
const obj = getObject(arg1);
|
|
1929
|
+
const ret = typeof(obj) === 'number' ? obj : undefined;
|
|
1930
|
+
getFloat64Memory0()[arg0 / 8 + 1] = isLikeNone(ret) ? 0 : ret;
|
|
1931
|
+
getInt32Memory0()[arg0 / 4 + 0] = !isLikeNone(ret);
|
|
1932
|
+
};
|
|
1933
|
+
imports.wbg.__wbindgen_error_new = function(arg0, arg1) {
|
|
1934
|
+
const ret = new Error(getStringFromWasm0(arg0, arg1));
|
|
1935
|
+
return addHeapObject(ret);
|
|
1936
|
+
};
|
|
1937
|
+
imports.wbg.__wbindgen_is_function = function(arg0) {
|
|
1938
|
+
const ret = typeof(getObject(arg0)) === 'function';
|
|
1939
|
+
return ret;
|
|
1940
|
+
};
|
|
1941
|
+
imports.wbg.__wbindgen_is_string = function(arg0) {
|
|
1942
|
+
const ret = typeof(getObject(arg0)) === 'string';
|
|
1943
|
+
return ret;
|
|
1944
|
+
};
|
|
1945
|
+
imports.wbg.__wbindgen_is_bigint = function(arg0) {
|
|
1946
|
+
const ret = typeof(getObject(arg0)) === 'bigint';
|
|
1947
|
+
return ret;
|
|
1948
|
+
};
|
|
1949
|
+
imports.wbg.__wbindgen_is_object = function(arg0) {
|
|
1950
|
+
const val = getObject(arg0);
|
|
1951
|
+
const ret = typeof(val) === 'object' && val !== null;
|
|
1952
|
+
return ret;
|
|
1953
|
+
};
|
|
1954
|
+
imports.wbg.__wbindgen_is_falsy = function(arg0) {
|
|
1955
|
+
const ret = !getObject(arg0);
|
|
1956
|
+
return ret;
|
|
1957
|
+
};
|
|
1958
|
+
imports.wbg.__wbindgen_boolean_get = function(arg0) {
|
|
1959
|
+
const v = getObject(arg0);
|
|
1960
|
+
const ret = typeof(v) === 'boolean' ? (v ? 1 : 0) : 2;
|
|
1961
|
+
return ret;
|
|
1962
|
+
};
|
|
1963
|
+
imports.wbg.__wbg_collection_new = function(arg0) {
|
|
1964
|
+
const ret = Collection.__wrap(arg0);
|
|
1965
|
+
return addHeapObject(ret);
|
|
1966
|
+
};
|
|
1967
|
+
imports.wbg.__wbindgen_cb_drop = function(arg0) {
|
|
1968
|
+
const obj = takeObject(arg0).original;
|
|
1969
|
+
if (obj.cnt-- == 1) {
|
|
1970
|
+
obj.a = 0;
|
|
1971
|
+
return true;
|
|
1972
|
+
}
|
|
1973
|
+
const ret = false;
|
|
1974
|
+
return ret;
|
|
1975
|
+
};
|
|
1976
|
+
imports.wbg.__wbindgen_is_array = function(arg0) {
|
|
1977
|
+
const ret = Array.isArray(getObject(arg0));
|
|
1978
|
+
return ret;
|
|
1979
|
+
};
|
|
1980
|
+
imports.wbg.__wbindgen_in = function(arg0, arg1) {
|
|
1981
|
+
const ret = getObject(arg0) in getObject(arg1);
|
|
1982
|
+
return ret;
|
|
1983
|
+
};
|
|
1984
|
+
imports.wbg.__wbindgen_bigint_from_i64 = function(arg0) {
|
|
1985
|
+
const ret = arg0;
|
|
1986
|
+
return addHeapObject(ret);
|
|
1987
|
+
};
|
|
1988
|
+
imports.wbg.__wbindgen_jsval_eq = function(arg0, arg1) {
|
|
1989
|
+
const ret = getObject(arg0) === getObject(arg1);
|
|
1990
|
+
return ret;
|
|
1991
|
+
};
|
|
1992
|
+
imports.wbg.__wbindgen_bigint_from_u64 = function(arg0) {
|
|
1993
|
+
const ret = BigInt.asUintN(64, arg0);
|
|
1994
|
+
return addHeapObject(ret);
|
|
1995
|
+
};
|
|
1996
|
+
imports.wbg.__wbg_crypto_1d1f22824a6a080c = function(arg0) {
|
|
1997
|
+
const ret = getObject(arg0).crypto;
|
|
1998
|
+
return addHeapObject(ret);
|
|
1999
|
+
};
|
|
2000
|
+
imports.wbg.__wbg_process_4a72847cc503995b = function(arg0) {
|
|
2001
|
+
const ret = getObject(arg0).process;
|
|
2002
|
+
return addHeapObject(ret);
|
|
2003
|
+
};
|
|
2004
|
+
imports.wbg.__wbg_versions_f686565e586dd935 = function(arg0) {
|
|
2005
|
+
const ret = getObject(arg0).versions;
|
|
2006
|
+
return addHeapObject(ret);
|
|
2007
|
+
};
|
|
2008
|
+
imports.wbg.__wbg_node_104a2ff8d6ea03a2 = function(arg0) {
|
|
2009
|
+
const ret = getObject(arg0).node;
|
|
2010
|
+
return addHeapObject(ret);
|
|
2011
|
+
};
|
|
2012
|
+
imports.wbg.__wbg_require_cca90b1a94a0255b = function() { return handleError(function () {
|
|
2013
|
+
const ret = module.require;
|
|
2014
|
+
return addHeapObject(ret);
|
|
2015
|
+
}, arguments) };
|
|
2016
|
+
imports.wbg.__wbg_msCrypto_eb05e62b530a1508 = function(arg0) {
|
|
2017
|
+
const ret = getObject(arg0).msCrypto;
|
|
2018
|
+
return addHeapObject(ret);
|
|
2019
|
+
};
|
|
2020
|
+
imports.wbg.__wbg_randomFillSync_5c9c955aa56b6049 = function() { return handleError(function (arg0, arg1) {
|
|
2021
|
+
getObject(arg0).randomFillSync(takeObject(arg1));
|
|
2022
|
+
}, arguments) };
|
|
2023
|
+
imports.wbg.__wbg_getRandomValues_3aa56aa6edec874c = function() { return handleError(function (arg0, arg1) {
|
|
2024
|
+
getObject(arg0).getRandomValues(getObject(arg1));
|
|
2025
|
+
}, arguments) };
|
|
2026
|
+
imports.wbg.__wbg_instanceof_Window_f401953a2cf86220 = function(arg0) {
|
|
2027
|
+
let result;
|
|
2028
|
+
try {
|
|
2029
|
+
result = getObject(arg0) instanceof Window;
|
|
2030
|
+
} catch (_) {
|
|
2031
|
+
result = false;
|
|
2032
|
+
}
|
|
2033
|
+
const ret = result;
|
|
2034
|
+
return ret;
|
|
2035
|
+
};
|
|
2036
|
+
imports.wbg.__wbg_localStorage_e381d34d0c40c761 = function() { return handleError(function (arg0) {
|
|
2037
|
+
const ret = getObject(arg0).localStorage;
|
|
2038
|
+
return isLikeNone(ret) ? 0 : addHeapObject(ret);
|
|
2039
|
+
}, arguments) };
|
|
2040
|
+
imports.wbg.__wbg_indexedDB_7c51d9056667f4e0 = function() { return handleError(function (arg0) {
|
|
2041
|
+
const ret = getObject(arg0).indexedDB;
|
|
2042
|
+
return isLikeNone(ret) ? 0 : addHeapObject(ret);
|
|
2043
|
+
}, arguments) };
|
|
2044
|
+
imports.wbg.__wbg_getItem_164e8e5265095b87 = function() { return handleError(function (arg0, arg1, arg2, arg3) {
|
|
2045
|
+
const ret = getObject(arg1).getItem(getStringFromWasm0(arg2, arg3));
|
|
2046
|
+
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2047
|
+
var len1 = WASM_VECTOR_LEN;
|
|
2048
|
+
getInt32Memory0()[arg0 / 4 + 1] = len1;
|
|
2049
|
+
getInt32Memory0()[arg0 / 4 + 0] = ptr1;
|
|
2050
|
+
}, arguments) };
|
|
2051
|
+
imports.wbg.__wbg_error_8e3928cfb8a43e2b = function(arg0) {
|
|
2052
|
+
console.error(getObject(arg0));
|
|
2053
|
+
};
|
|
2054
|
+
imports.wbg.__wbg_log_5bb5f88f245d7762 = function(arg0) {
|
|
2055
|
+
console.log(getObject(arg0));
|
|
2056
|
+
};
|
|
2057
|
+
imports.wbg.__wbg_open_f0d7259fd7e689ce = function() { return handleError(function (arg0, arg1, arg2, arg3) {
|
|
2058
|
+
const ret = getObject(arg0).open(getStringFromWasm0(arg1, arg2), arg3 >>> 0);
|
|
2059
|
+
return addHeapObject(ret);
|
|
2060
|
+
}, arguments) };
|
|
2061
|
+
imports.wbg.__wbg_instanceof_IdbOpenDbRequest_3f4a166bc0340578 = function(arg0) {
|
|
2062
|
+
let result;
|
|
2063
|
+
try {
|
|
2064
|
+
result = getObject(arg0) instanceof IDBOpenDBRequest;
|
|
2065
|
+
} catch (_) {
|
|
2066
|
+
result = false;
|
|
2067
|
+
}
|
|
2068
|
+
const ret = result;
|
|
2069
|
+
return ret;
|
|
2070
|
+
};
|
|
2071
|
+
imports.wbg.__wbg_setonupgradeneeded_ad7645373c7d5e1b = function(arg0, arg1) {
|
|
2072
|
+
getObject(arg0).onupgradeneeded = getObject(arg1);
|
|
2073
|
+
};
|
|
2074
|
+
imports.wbg.__wbg_instanceof_IdbRequest_93249da04f5370b6 = function(arg0) {
|
|
2075
|
+
let result;
|
|
2076
|
+
try {
|
|
2077
|
+
result = getObject(arg0) instanceof IDBRequest;
|
|
2078
|
+
} catch (_) {
|
|
2079
|
+
result = false;
|
|
2080
|
+
}
|
|
2081
|
+
const ret = result;
|
|
2082
|
+
return ret;
|
|
2083
|
+
};
|
|
2084
|
+
imports.wbg.__wbg_result_6cedf5f78600a79c = function() { return handleError(function (arg0) {
|
|
2085
|
+
const ret = getObject(arg0).result;
|
|
2086
|
+
return addHeapObject(ret);
|
|
2087
|
+
}, arguments) };
|
|
2088
|
+
imports.wbg.__wbg_error_685b20024dc2d6ca = function() { return handleError(function (arg0) {
|
|
2089
|
+
const ret = getObject(arg0).error;
|
|
2090
|
+
return isLikeNone(ret) ? 0 : addHeapObject(ret);
|
|
2091
|
+
}, arguments) };
|
|
2092
|
+
imports.wbg.__wbg_setonsuccess_632ce0a1460455c2 = function(arg0, arg1) {
|
|
2093
|
+
getObject(arg0).onsuccess = getObject(arg1);
|
|
2094
|
+
};
|
|
2095
|
+
imports.wbg.__wbg_setonerror_8479b33e7568a904 = function(arg0, arg1) {
|
|
2096
|
+
getObject(arg0).onerror = getObject(arg1);
|
|
2097
|
+
};
|
|
2098
|
+
imports.wbg.__wbg_setoncomplete_d8e4236665cbf1e2 = function(arg0, arg1) {
|
|
2099
|
+
getObject(arg0).oncomplete = getObject(arg1);
|
|
2100
|
+
};
|
|
2101
|
+
imports.wbg.__wbg_setonerror_da071ec94e148397 = function(arg0, arg1) {
|
|
2102
|
+
getObject(arg0).onerror = getObject(arg1);
|
|
2103
|
+
};
|
|
2104
|
+
imports.wbg.__wbg_objectStore_da468793bd9df17b = function() { return handleError(function (arg0, arg1, arg2) {
|
|
2105
|
+
const ret = getObject(arg0).objectStore(getStringFromWasm0(arg1, arg2));
|
|
2106
|
+
return addHeapObject(ret);
|
|
2107
|
+
}, arguments) };
|
|
2108
|
+
imports.wbg.__wbg_length_9ae5daf9a690cba9 = function(arg0) {
|
|
2109
|
+
const ret = getObject(arg0).length;
|
|
2110
|
+
return ret;
|
|
2111
|
+
};
|
|
2112
|
+
imports.wbg.__wbg_contains_c65b44400b549286 = function(arg0, arg1, arg2) {
|
|
2113
|
+
const ret = getObject(arg0).contains(getStringFromWasm0(arg1, arg2));
|
|
2114
|
+
return ret;
|
|
2115
|
+
};
|
|
2116
|
+
imports.wbg.__wbg_get_910bbb94abdcf488 = function(arg0, arg1, arg2) {
|
|
2117
|
+
const ret = getObject(arg1)[arg2 >>> 0];
|
|
2118
|
+
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2119
|
+
var len1 = WASM_VECTOR_LEN;
|
|
2120
|
+
getInt32Memory0()[arg0 / 4 + 1] = len1;
|
|
2121
|
+
getInt32Memory0()[arg0 / 4 + 0] = ptr1;
|
|
2122
|
+
};
|
|
2123
|
+
imports.wbg.__wbg_target_2fc177e386c8b7b0 = function(arg0) {
|
|
2124
|
+
const ret = getObject(arg0).target;
|
|
2125
|
+
return isLikeNone(ret) ? 0 : addHeapObject(ret);
|
|
2126
|
+
};
|
|
2127
|
+
imports.wbg.__wbg_instanceof_IdbDatabase_db671cf2454a9542 = function(arg0) {
|
|
2128
|
+
let result;
|
|
2129
|
+
try {
|
|
2130
|
+
result = getObject(arg0) instanceof IDBDatabase;
|
|
2131
|
+
} catch (_) {
|
|
2132
|
+
result = false;
|
|
2133
|
+
}
|
|
2134
|
+
const ret = result;
|
|
2135
|
+
return ret;
|
|
2136
|
+
};
|
|
2137
|
+
imports.wbg.__wbg_objectStoreNames_588b5924274239fd = function(arg0) {
|
|
2138
|
+
const ret = getObject(arg0).objectStoreNames;
|
|
2139
|
+
return addHeapObject(ret);
|
|
2140
|
+
};
|
|
2141
|
+
imports.wbg.__wbg_close_6bfe4ca2fe67cb67 = function(arg0) {
|
|
2142
|
+
getObject(arg0).close();
|
|
2143
|
+
};
|
|
2144
|
+
imports.wbg.__wbg_createObjectStore_882f2f6b1b1ef040 = function() { return handleError(function (arg0, arg1, arg2) {
|
|
2145
|
+
const ret = getObject(arg0).createObjectStore(getStringFromWasm0(arg1, arg2));
|
|
2146
|
+
return addHeapObject(ret);
|
|
2147
|
+
}, arguments) };
|
|
2148
|
+
imports.wbg.__wbg_transaction_c32bb10c9c692f4b = function() { return handleError(function (arg0, arg1, arg2) {
|
|
2149
|
+
const ret = getObject(arg0).transaction(getStringFromWasm0(arg1, arg2));
|
|
2150
|
+
return addHeapObject(ret);
|
|
2151
|
+
}, arguments) };
|
|
2152
|
+
imports.wbg.__wbg_transaction_1e282a79e9bb7387 = function() { return handleError(function (arg0, arg1, arg2, arg3) {
|
|
2153
|
+
const ret = getObject(arg0).transaction(getStringFromWasm0(arg1, arg2), takeObject(arg3));
|
|
2154
|
+
return addHeapObject(ret);
|
|
2155
|
+
}, arguments) };
|
|
2156
|
+
imports.wbg.__wbg_delete_f60bba7d0ae59a4f = function() { return handleError(function (arg0, arg1) {
|
|
2157
|
+
const ret = getObject(arg0).delete(getObject(arg1));
|
|
2158
|
+
return addHeapObject(ret);
|
|
2159
|
+
}, arguments) };
|
|
2160
|
+
imports.wbg.__wbg_get_5361b64cac0d0826 = function() { return handleError(function (arg0, arg1) {
|
|
2161
|
+
const ret = getObject(arg0).get(getObject(arg1));
|
|
2162
|
+
return addHeapObject(ret);
|
|
2163
|
+
}, arguments) };
|
|
2164
|
+
imports.wbg.__wbg_getAll_2782e438df699384 = function() { return handleError(function (arg0) {
|
|
2165
|
+
const ret = getObject(arg0).getAll();
|
|
2166
|
+
return addHeapObject(ret);
|
|
2167
|
+
}, arguments) };
|
|
2168
|
+
imports.wbg.__wbg_put_22792e17580ca18b = function() { return handleError(function (arg0, arg1, arg2) {
|
|
2169
|
+
const ret = getObject(arg0).put(getObject(arg1), getObject(arg2));
|
|
2170
|
+
return addHeapObject(ret);
|
|
2171
|
+
}, arguments) };
|
|
2172
|
+
imports.wbg.__wbindgen_jsval_loose_eq = function(arg0, arg1) {
|
|
2173
|
+
const ret = getObject(arg0) == getObject(arg1);
|
|
2174
|
+
return ret;
|
|
2175
|
+
};
|
|
2176
|
+
imports.wbg.__wbindgen_as_number = function(arg0) {
|
|
2177
|
+
const ret = +getObject(arg0);
|
|
2178
|
+
return ret;
|
|
2179
|
+
};
|
|
2180
|
+
imports.wbg.__wbg_String_389b54bd9d25375f = function(arg0, arg1) {
|
|
2181
|
+
const ret = String(getObject(arg1));
|
|
2182
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2183
|
+
const len1 = WASM_VECTOR_LEN;
|
|
2184
|
+
getInt32Memory0()[arg0 / 4 + 1] = len1;
|
|
2185
|
+
getInt32Memory0()[arg0 / 4 + 0] = ptr1;
|
|
2186
|
+
};
|
|
2187
|
+
imports.wbg.__wbg_getwithrefkey_4a92a5eca60879b9 = function(arg0, arg1) {
|
|
2188
|
+
const ret = getObject(arg0)[getObject(arg1)];
|
|
2189
|
+
return addHeapObject(ret);
|
|
2190
|
+
};
|
|
2191
|
+
imports.wbg.__wbg_set_9182712abebf82ef = function(arg0, arg1, arg2) {
|
|
2192
|
+
getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
|
|
2193
|
+
};
|
|
2194
|
+
imports.wbg.__wbg_log_28eee4e6432efd24 = function(arg0, arg1) {
|
|
2195
|
+
console.log(getStringFromWasm0(arg0, arg1));
|
|
2196
|
+
};
|
|
2197
|
+
imports.wbg.__wbg_String_55b8bdc4bc243677 = function(arg0, arg1) {
|
|
2198
|
+
const ret = String(getObject(arg1));
|
|
2199
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2200
|
+
const len1 = WASM_VECTOR_LEN;
|
|
2201
|
+
getInt32Memory0()[arg0 / 4 + 1] = len1;
|
|
2202
|
+
getInt32Memory0()[arg0 / 4 + 0] = ptr1;
|
|
2203
|
+
};
|
|
2204
|
+
imports.wbg.__wbg_getElementById_8458f2a6c28467dc = function(arg0, arg1, arg2) {
|
|
2205
|
+
const ret = getObject(arg0).getElementById(getStringFromWasm0(arg1, arg2));
|
|
2206
|
+
return addHeapObject(ret);
|
|
2207
|
+
};
|
|
2208
|
+
imports.wbg.__wbg_settextcontent_fc3ff485b96fcb1d = function(arg0, arg1, arg2) {
|
|
2209
|
+
getObject(arg0).textContent = getStringFromWasm0(arg1, arg2);
|
|
2210
|
+
};
|
|
2211
|
+
imports.wbg.__wbg_wbgtestinvoke_8c20f4132af2bded = function() { return handleError(function (arg0, arg1) {
|
|
2212
|
+
try {
|
|
2213
|
+
var state0 = {a: arg0, b: arg1};
|
|
2214
|
+
var cb0 = () => {
|
|
2215
|
+
const a = state0.a;
|
|
2216
|
+
state0.a = 0;
|
|
2217
|
+
try {
|
|
2218
|
+
return __wbg_adapter_253(a, state0.b, );
|
|
2219
|
+
} finally {
|
|
2220
|
+
state0.a = a;
|
|
2221
|
+
}
|
|
2222
|
+
};
|
|
2223
|
+
__wbg_test_invoke(cb0);
|
|
2224
|
+
} finally {
|
|
2225
|
+
state0.a = state0.b = 0;
|
|
2226
|
+
}
|
|
2227
|
+
}, arguments) };
|
|
2228
|
+
imports.wbg.__wbg_static_accessor_document_d4b6ae7f5578480f = function() {
|
|
2229
|
+
const ret = document;
|
|
2230
|
+
return addHeapObject(ret);
|
|
2231
|
+
};
|
|
2232
|
+
imports.wbg.__wbg_self_55106357ec10ecd4 = function(arg0) {
|
|
2233
|
+
const ret = getObject(arg0).self;
|
|
2234
|
+
return isLikeNone(ret) ? 0 : addHeapObject(ret);
|
|
2235
|
+
};
|
|
2236
|
+
imports.wbg.__wbg_constructor_fd0d22d60b7dfd72 = function(arg0) {
|
|
2237
|
+
const ret = getObject(arg0).constructor;
|
|
2238
|
+
return addHeapObject(ret);
|
|
2239
|
+
};
|
|
2240
|
+
imports.wbg.__wbg_name_7f439d24ff7ba1d3 = function(arg0, arg1) {
|
|
2241
|
+
const ret = getObject(arg1).name;
|
|
2242
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2243
|
+
const len1 = WASM_VECTOR_LEN;
|
|
2244
|
+
getInt32Memory0()[arg0 / 4 + 1] = len1;
|
|
2245
|
+
getInt32Memory0()[arg0 / 4 + 0] = ptr1;
|
|
2246
|
+
};
|
|
2247
|
+
imports.wbg.__wbg_stack_17c77e9f5bfe6714 = function(arg0, arg1) {
|
|
2248
|
+
const ret = getObject(arg1).stack;
|
|
2249
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2250
|
+
const len1 = WASM_VECTOR_LEN;
|
|
2251
|
+
getInt32Memory0()[arg0 / 4 + 1] = len1;
|
|
2252
|
+
getInt32Memory0()[arg0 / 4 + 0] = ptr1;
|
|
2253
|
+
};
|
|
2254
|
+
imports.wbg.__wbg_textcontent_67e4e811cbdf00fc = function(arg0, arg1) {
|
|
2255
|
+
const ret = getObject(arg1).textContent;
|
|
2256
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2257
|
+
const len1 = WASM_VECTOR_LEN;
|
|
2258
|
+
getInt32Memory0()[arg0 / 4 + 1] = len1;
|
|
2259
|
+
getInt32Memory0()[arg0 / 4 + 0] = ptr1;
|
|
2260
|
+
};
|
|
2261
|
+
imports.wbg.__wbg_stack_44743fb7d71926a0 = function(arg0) {
|
|
2262
|
+
const ret = getObject(arg0).stack;
|
|
2263
|
+
return addHeapObject(ret);
|
|
2264
|
+
};
|
|
2265
|
+
imports.wbg.__wbg_wbgtestoutputwriteln_4db3bd64914ec955 = function(arg0) {
|
|
2266
|
+
__wbg_test_output_writeln(takeObject(arg0));
|
|
2267
|
+
};
|
|
2268
|
+
imports.wbg.__wbg_stack_436273c21658169b = function(arg0) {
|
|
2269
|
+
const ret = getObject(arg0).stack;
|
|
2270
|
+
return addHeapObject(ret);
|
|
2271
|
+
};
|
|
2272
|
+
imports.wbg.__wbg_new_abda76e883ba8a5f = function() {
|
|
2273
|
+
const ret = new Error();
|
|
2274
|
+
return addHeapObject(ret);
|
|
2275
|
+
};
|
|
2276
|
+
imports.wbg.__wbg_stack_658279fe44541cf6 = function(arg0, arg1) {
|
|
2277
|
+
const ret = getObject(arg1).stack;
|
|
2278
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2279
|
+
const len1 = WASM_VECTOR_LEN;
|
|
2280
|
+
getInt32Memory0()[arg0 / 4 + 1] = len1;
|
|
2281
|
+
getInt32Memory0()[arg0 / 4 + 0] = ptr1;
|
|
2282
|
+
};
|
|
2283
|
+
imports.wbg.__wbg_error_f851667af71bcfc6 = function(arg0, arg1) {
|
|
2284
|
+
let deferred0_0;
|
|
2285
|
+
let deferred0_1;
|
|
2286
|
+
try {
|
|
2287
|
+
deferred0_0 = arg0;
|
|
2288
|
+
deferred0_1 = arg1;
|
|
2289
|
+
console.error(getStringFromWasm0(arg0, arg1));
|
|
2290
|
+
} finally {
|
|
2291
|
+
wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
|
|
2292
|
+
}
|
|
2293
|
+
};
|
|
2294
|
+
imports.wbg.__wbg_queueMicrotask_3cbae2ec6b6cd3d6 = function(arg0) {
|
|
2295
|
+
const ret = getObject(arg0).queueMicrotask;
|
|
2296
|
+
return addHeapObject(ret);
|
|
2297
|
+
};
|
|
2298
|
+
imports.wbg.__wbg_queueMicrotask_481971b0d87f3dd4 = function(arg0) {
|
|
2299
|
+
queueMicrotask(getObject(arg0));
|
|
2300
|
+
};
|
|
2301
|
+
imports.wbg.__wbg_get_bd8e338fbd5f5cc8 = function(arg0, arg1) {
|
|
2302
|
+
const ret = getObject(arg0)[arg1 >>> 0];
|
|
2303
|
+
return addHeapObject(ret);
|
|
2304
|
+
};
|
|
2305
|
+
imports.wbg.__wbg_length_cd7af8117672b8b8 = function(arg0) {
|
|
2306
|
+
const ret = getObject(arg0).length;
|
|
2307
|
+
return ret;
|
|
2308
|
+
};
|
|
2309
|
+
imports.wbg.__wbg_new_16b304a2cfa7ff4a = function() {
|
|
2310
|
+
const ret = new Array();
|
|
2311
|
+
return addHeapObject(ret);
|
|
2312
|
+
};
|
|
2313
|
+
imports.wbg.__wbg_newnoargs_e258087cd0daa0ea = function(arg0, arg1) {
|
|
2314
|
+
const ret = new Function(getStringFromWasm0(arg0, arg1));
|
|
2315
|
+
return addHeapObject(ret);
|
|
2316
|
+
};
|
|
2317
|
+
imports.wbg.__wbg_new_d9bc3a0147634640 = function() {
|
|
2318
|
+
const ret = new Map();
|
|
2319
|
+
return addHeapObject(ret);
|
|
2320
|
+
};
|
|
2321
|
+
imports.wbg.__wbg_next_40fc327bfc8770e6 = function(arg0) {
|
|
2322
|
+
const ret = getObject(arg0).next;
|
|
2323
|
+
return addHeapObject(ret);
|
|
2324
|
+
};
|
|
2325
|
+
imports.wbg.__wbg_next_196c84450b364254 = function() { return handleError(function (arg0) {
|
|
2326
|
+
const ret = getObject(arg0).next();
|
|
2327
|
+
return addHeapObject(ret);
|
|
2328
|
+
}, arguments) };
|
|
2329
|
+
imports.wbg.__wbg_done_298b57d23c0fc80c = function(arg0) {
|
|
2330
|
+
const ret = getObject(arg0).done;
|
|
2331
|
+
return ret;
|
|
2332
|
+
};
|
|
2333
|
+
imports.wbg.__wbg_value_d93c65011f51a456 = function(arg0) {
|
|
2334
|
+
const ret = getObject(arg0).value;
|
|
2335
|
+
return addHeapObject(ret);
|
|
2336
|
+
};
|
|
2337
|
+
imports.wbg.__wbg_iterator_2cee6dadfd956dfa = function() {
|
|
2338
|
+
const ret = Symbol.iterator;
|
|
2339
|
+
return addHeapObject(ret);
|
|
2340
|
+
};
|
|
2341
|
+
imports.wbg.__wbg_get_e3c254076557e348 = function() { return handleError(function (arg0, arg1) {
|
|
2342
|
+
const ret = Reflect.get(getObject(arg0), getObject(arg1));
|
|
2343
|
+
return addHeapObject(ret);
|
|
2344
|
+
}, arguments) };
|
|
2345
|
+
imports.wbg.__wbg_call_27c0f87801dedf93 = function() { return handleError(function (arg0, arg1) {
|
|
2346
|
+
const ret = getObject(arg0).call(getObject(arg1));
|
|
2347
|
+
return addHeapObject(ret);
|
|
2348
|
+
}, arguments) };
|
|
2349
|
+
imports.wbg.__wbg_new_72fb9a18b5ae2624 = function() {
|
|
2350
|
+
const ret = new Object();
|
|
2351
|
+
return addHeapObject(ret);
|
|
2352
|
+
};
|
|
2353
|
+
imports.wbg.__wbg_self_ce0dbfc45cf2f5be = function() { return handleError(function () {
|
|
2354
|
+
const ret = self.self;
|
|
2355
|
+
return addHeapObject(ret);
|
|
2356
|
+
}, arguments) };
|
|
2357
|
+
imports.wbg.__wbg_window_c6fb939a7f436783 = function() { return handleError(function () {
|
|
2358
|
+
const ret = window.window;
|
|
2359
|
+
return addHeapObject(ret);
|
|
2360
|
+
}, arguments) };
|
|
2361
|
+
imports.wbg.__wbg_globalThis_d1e6af4856ba331b = function() { return handleError(function () {
|
|
2362
|
+
const ret = globalThis.globalThis;
|
|
2363
|
+
return addHeapObject(ret);
|
|
2364
|
+
}, arguments) };
|
|
2365
|
+
imports.wbg.__wbg_global_207b558942527489 = function() { return handleError(function () {
|
|
2366
|
+
const ret = global.global;
|
|
2367
|
+
return addHeapObject(ret);
|
|
2368
|
+
}, arguments) };
|
|
2369
|
+
imports.wbg.__wbg_set_d4638f722068f043 = function(arg0, arg1, arg2) {
|
|
2370
|
+
getObject(arg0)[arg1 >>> 0] = takeObject(arg2);
|
|
2371
|
+
};
|
|
2372
|
+
imports.wbg.__wbg_from_89e3fc3ba5e6fb48 = function(arg0) {
|
|
2373
|
+
const ret = Array.from(getObject(arg0));
|
|
2374
|
+
return addHeapObject(ret);
|
|
2375
|
+
};
|
|
2376
|
+
imports.wbg.__wbg_forEach_2be8de7347d63332 = function(arg0, arg1, arg2) {
|
|
2377
|
+
try {
|
|
2378
|
+
var state0 = {a: arg1, b: arg2};
|
|
2379
|
+
var cb0 = (arg0, arg1, arg2) => {
|
|
2380
|
+
const a = state0.a;
|
|
2381
|
+
state0.a = 0;
|
|
2382
|
+
try {
|
|
2383
|
+
return __wbg_adapter_296(a, state0.b, arg0, arg1, arg2);
|
|
2384
|
+
} finally {
|
|
2385
|
+
state0.a = a;
|
|
2386
|
+
}
|
|
2387
|
+
};
|
|
2388
|
+
getObject(arg0).forEach(cb0);
|
|
2389
|
+
} finally {
|
|
2390
|
+
state0.a = state0.b = 0;
|
|
2391
|
+
}
|
|
2392
|
+
};
|
|
2393
|
+
imports.wbg.__wbg_isArray_2ab64d95e09ea0ae = function(arg0) {
|
|
2394
|
+
const ret = Array.isArray(getObject(arg0));
|
|
2395
|
+
return ret;
|
|
2396
|
+
};
|
|
2397
|
+
imports.wbg.__wbg_of_4a2b313a453ec059 = function(arg0) {
|
|
2398
|
+
const ret = Array.of(getObject(arg0));
|
|
2399
|
+
return addHeapObject(ret);
|
|
2400
|
+
};
|
|
2401
|
+
imports.wbg.__wbg_push_a5b05aedc7234f9f = function(arg0, arg1) {
|
|
2402
|
+
const ret = getObject(arg0).push(getObject(arg1));
|
|
2403
|
+
return ret;
|
|
2404
|
+
};
|
|
2405
|
+
imports.wbg.__wbg_instanceof_ArrayBuffer_836825be07d4c9d2 = function(arg0) {
|
|
2406
|
+
let result;
|
|
2407
|
+
try {
|
|
2408
|
+
result = getObject(arg0) instanceof ArrayBuffer;
|
|
2409
|
+
} catch (_) {
|
|
2410
|
+
result = false;
|
|
2411
|
+
}
|
|
2412
|
+
const ret = result;
|
|
2413
|
+
return ret;
|
|
2414
|
+
};
|
|
2415
|
+
imports.wbg.__wbg_new_28c511d9baebfa89 = function(arg0, arg1) {
|
|
2416
|
+
const ret = new Error(getStringFromWasm0(arg0, arg1));
|
|
2417
|
+
return addHeapObject(ret);
|
|
2418
|
+
};
|
|
2419
|
+
imports.wbg.__wbg_message_5bf28016c2b49cfb = function(arg0) {
|
|
2420
|
+
const ret = getObject(arg0).message;
|
|
2421
|
+
return addHeapObject(ret);
|
|
2422
|
+
};
|
|
2423
|
+
imports.wbg.__wbg_name_e7429f0dda6079e2 = function(arg0) {
|
|
2424
|
+
const ret = getObject(arg0).name;
|
|
2425
|
+
return addHeapObject(ret);
|
|
2426
|
+
};
|
|
2427
|
+
imports.wbg.__wbg_call_b3ca7c6051f9bec1 = function() { return handleError(function (arg0, arg1, arg2) {
|
|
2428
|
+
const ret = getObject(arg0).call(getObject(arg1), getObject(arg2));
|
|
2429
|
+
return addHeapObject(ret);
|
|
2430
|
+
}, arguments) };
|
|
2431
|
+
imports.wbg.__wbg_call_938992c832f74314 = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
|
|
2432
|
+
const ret = getObject(arg0).call(getObject(arg1), getObject(arg2), getObject(arg3), getObject(arg4));
|
|
2433
|
+
return addHeapObject(ret);
|
|
2434
|
+
}, arguments) };
|
|
2435
|
+
imports.wbg.__wbg_set_8417257aaedc936b = function(arg0, arg1, arg2) {
|
|
2436
|
+
const ret = getObject(arg0).set(getObject(arg1), getObject(arg2));
|
|
2437
|
+
return addHeapObject(ret);
|
|
2438
|
+
};
|
|
2439
|
+
imports.wbg.__wbg_isSafeInteger_f7b04ef02296c4d2 = function(arg0) {
|
|
2440
|
+
const ret = Number.isSafeInteger(getObject(arg0));
|
|
2441
|
+
return ret;
|
|
2442
|
+
};
|
|
2443
|
+
imports.wbg.__wbg_assign_496d2d14fecafbcf = function(arg0, arg1) {
|
|
2444
|
+
const ret = Object.assign(getObject(arg0), getObject(arg1));
|
|
2445
|
+
return addHeapObject(ret);
|
|
2446
|
+
};
|
|
2447
|
+
imports.wbg.__wbg_entries_95cc2c823b285a09 = function(arg0) {
|
|
2448
|
+
const ret = Object.entries(getObject(arg0));
|
|
2449
|
+
return addHeapObject(ret);
|
|
2450
|
+
};
|
|
2451
|
+
imports.wbg.__wbg_is_010fdc0f4ab96916 = function(arg0, arg1) {
|
|
2452
|
+
const ret = Object.is(getObject(arg0), getObject(arg1));
|
|
2453
|
+
return ret;
|
|
2454
|
+
};
|
|
2455
|
+
imports.wbg.__wbg_keys_91e412b4b222659f = function(arg0) {
|
|
2456
|
+
const ret = Object.keys(getObject(arg0));
|
|
2457
|
+
return addHeapObject(ret);
|
|
2458
|
+
};
|
|
2459
|
+
imports.wbg.__wbg_new_81740750da40724f = function(arg0, arg1) {
|
|
2460
|
+
try {
|
|
2461
|
+
var state0 = {a: arg0, b: arg1};
|
|
2462
|
+
var cb0 = (arg0, arg1) => {
|
|
2463
|
+
const a = state0.a;
|
|
2464
|
+
state0.a = 0;
|
|
2465
|
+
try {
|
|
2466
|
+
return __wbg_adapter_349(a, state0.b, arg0, arg1);
|
|
2467
|
+
} finally {
|
|
2468
|
+
state0.a = a;
|
|
2469
|
+
}
|
|
2470
|
+
};
|
|
2471
|
+
const ret = new Promise(cb0);
|
|
2472
|
+
return addHeapObject(ret);
|
|
2473
|
+
} finally {
|
|
2474
|
+
state0.a = state0.b = 0;
|
|
2475
|
+
}
|
|
2476
|
+
};
|
|
2477
|
+
imports.wbg.__wbg_resolve_b0083a7967828ec8 = function(arg0) {
|
|
2478
|
+
const ret = Promise.resolve(getObject(arg0));
|
|
2479
|
+
return addHeapObject(ret);
|
|
2480
|
+
};
|
|
2481
|
+
imports.wbg.__wbg_then_0c86a60e8fcfe9f6 = function(arg0, arg1) {
|
|
2482
|
+
const ret = getObject(arg0).then(getObject(arg1));
|
|
2483
|
+
return addHeapObject(ret);
|
|
2484
|
+
};
|
|
2485
|
+
imports.wbg.__wbg_then_a73caa9a87991566 = function(arg0, arg1, arg2) {
|
|
2486
|
+
const ret = getObject(arg0).then(getObject(arg1), getObject(arg2));
|
|
2487
|
+
return addHeapObject(ret);
|
|
2488
|
+
};
|
|
2489
|
+
imports.wbg.__wbg_buffer_12d079cc21e14bdb = function(arg0) {
|
|
2490
|
+
const ret = getObject(arg0).buffer;
|
|
2491
|
+
return addHeapObject(ret);
|
|
2492
|
+
};
|
|
2493
|
+
imports.wbg.__wbg_newwithbyteoffsetandlength_aa4a17c33a06e5cb = function(arg0, arg1, arg2) {
|
|
2494
|
+
const ret = new Uint8Array(getObject(arg0), arg1 >>> 0, arg2 >>> 0);
|
|
2495
|
+
return addHeapObject(ret);
|
|
2496
|
+
};
|
|
2497
|
+
imports.wbg.__wbg_new_63b92bc8671ed464 = function(arg0) {
|
|
2498
|
+
const ret = new Uint8Array(getObject(arg0));
|
|
2499
|
+
return addHeapObject(ret);
|
|
2500
|
+
};
|
|
2501
|
+
imports.wbg.__wbg_set_a47bac70306a19a7 = function(arg0, arg1, arg2) {
|
|
2502
|
+
getObject(arg0).set(getObject(arg1), arg2 >>> 0);
|
|
2503
|
+
};
|
|
2504
|
+
imports.wbg.__wbg_length_c20a40f15020d68a = function(arg0) {
|
|
2505
|
+
const ret = getObject(arg0).length;
|
|
2506
|
+
return ret;
|
|
2507
|
+
};
|
|
2508
|
+
imports.wbg.__wbg_instanceof_Uint8Array_2b3bbecd033d19f6 = function(arg0) {
|
|
2509
|
+
let result;
|
|
2510
|
+
try {
|
|
2511
|
+
result = getObject(arg0) instanceof Uint8Array;
|
|
2512
|
+
} catch (_) {
|
|
2513
|
+
result = false;
|
|
2514
|
+
}
|
|
2515
|
+
const ret = result;
|
|
2516
|
+
return ret;
|
|
2517
|
+
};
|
|
2518
|
+
imports.wbg.__wbg_newwithlength_e9b4878cebadb3d3 = function(arg0) {
|
|
2519
|
+
const ret = new Uint8Array(arg0 >>> 0);
|
|
2520
|
+
return addHeapObject(ret);
|
|
2521
|
+
};
|
|
2522
|
+
imports.wbg.__wbg_subarray_a1f73cd4b5b42fe1 = function(arg0, arg1, arg2) {
|
|
2523
|
+
const ret = getObject(arg0).subarray(arg1 >>> 0, arg2 >>> 0);
|
|
2524
|
+
return addHeapObject(ret);
|
|
2525
|
+
};
|
|
2526
|
+
imports.wbg.__wbg_apply_0a5aa603881e6d79 = function() { return handleError(function (arg0, arg1, arg2) {
|
|
2527
|
+
const ret = Reflect.apply(getObject(arg0), getObject(arg1), getObject(arg2));
|
|
2528
|
+
return addHeapObject(ret);
|
|
2529
|
+
}, arguments) };
|
|
2530
|
+
imports.wbg.__wbg_deleteProperty_13e721a56f19e842 = function() { return handleError(function (arg0, arg1) {
|
|
2531
|
+
const ret = Reflect.deleteProperty(getObject(arg0), getObject(arg1));
|
|
2532
|
+
return ret;
|
|
2533
|
+
}, arguments) };
|
|
2534
|
+
imports.wbg.__wbg_set_1f9b04f170055d33 = function() { return handleError(function (arg0, arg1, arg2) {
|
|
2535
|
+
const ret = Reflect.set(getObject(arg0), getObject(arg1), getObject(arg2));
|
|
2536
|
+
return ret;
|
|
2537
|
+
}, arguments) };
|
|
2538
|
+
imports.wbg.__wbg_parse_66d1801634e099ac = function() { return handleError(function (arg0, arg1) {
|
|
2539
|
+
const ret = JSON.parse(getStringFromWasm0(arg0, arg1));
|
|
2540
|
+
return addHeapObject(ret);
|
|
2541
|
+
}, arguments) };
|
|
2542
|
+
imports.wbg.__wbg_stringify_8887fe74e1c50d81 = function() { return handleError(function (arg0) {
|
|
2543
|
+
const ret = JSON.stringify(getObject(arg0));
|
|
2544
|
+
return addHeapObject(ret);
|
|
2545
|
+
}, arguments) };
|
|
2546
|
+
imports.wbg.__wbindgen_bigint_get_as_i64 = function(arg0, arg1) {
|
|
2547
|
+
const v = getObject(arg1);
|
|
2548
|
+
const ret = typeof(v) === 'bigint' ? v : undefined;
|
|
2549
|
+
getBigInt64Memory0()[arg0 / 8 + 1] = isLikeNone(ret) ? BigInt(0) : ret;
|
|
2550
|
+
getInt32Memory0()[arg0 / 4 + 0] = !isLikeNone(ret);
|
|
2551
|
+
};
|
|
2552
|
+
imports.wbg.__wbindgen_debug_string = function(arg0, arg1) {
|
|
2553
|
+
const ret = debugString(getObject(arg1));
|
|
2554
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2555
|
+
const len1 = WASM_VECTOR_LEN;
|
|
2556
|
+
getInt32Memory0()[arg0 / 4 + 1] = len1;
|
|
2557
|
+
getInt32Memory0()[arg0 / 4 + 0] = ptr1;
|
|
2558
|
+
};
|
|
2559
|
+
imports.wbg.__wbindgen_throw = function(arg0, arg1) {
|
|
2560
|
+
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
2561
|
+
};
|
|
2562
|
+
imports.wbg.__wbindgen_memory = function() {
|
|
2563
|
+
const ret = wasm.memory;
|
|
2564
|
+
return addHeapObject(ret);
|
|
2565
|
+
};
|
|
2566
|
+
imports.wbg.__wbindgen_closure_wrapper567 = function(arg0, arg1, arg2) {
|
|
2567
|
+
const ret = makeMutClosure(arg0, arg1, 241, __wbg_adapter_56);
|
|
2568
|
+
return addHeapObject(ret);
|
|
2569
|
+
};
|
|
2570
|
+
imports.wbg.__wbindgen_closure_wrapper569 = function(arg0, arg1, arg2) {
|
|
2571
|
+
const ret = makeMutClosure(arg0, arg1, 241, __wbg_adapter_56);
|
|
2572
|
+
return addHeapObject(ret);
|
|
2573
|
+
};
|
|
2574
|
+
imports.wbg.__wbindgen_closure_wrapper571 = function(arg0, arg1, arg2) {
|
|
2575
|
+
const ret = makeMutClosure(arg0, arg1, 241, __wbg_adapter_61);
|
|
2576
|
+
return addHeapObject(ret);
|
|
2577
|
+
};
|
|
2578
|
+
imports.wbg.__wbindgen_closure_wrapper573 = function(arg0, arg1, arg2) {
|
|
2579
|
+
const ret = makeClosure(arg0, arg1, 241, __wbg_adapter_64);
|
|
2580
|
+
return addHeapObject(ret);
|
|
2581
|
+
};
|
|
2582
|
+
imports.wbg.__wbindgen_closure_wrapper1374 = function(arg0, arg1, arg2) {
|
|
2583
|
+
const ret = makeMutClosure(arg0, arg1, 375, __wbg_adapter_67);
|
|
2584
|
+
return addHeapObject(ret);
|
|
2585
|
+
};
|
|
2586
|
+
|
|
2587
|
+
return imports;
|
|
2588
|
+
}
|
|
2589
|
+
|
|
2590
|
+
function __wbg_init_memory(imports, maybe_memory) {
|
|
2591
|
+
|
|
2592
|
+
}
|
|
2593
|
+
|
|
2594
|
+
function __wbg_finalize_init(instance, module) {
|
|
2595
|
+
wasm = instance.exports;
|
|
2596
|
+
__wbg_init.__wbindgen_wasm_module = module;
|
|
2597
|
+
cachedBigInt64Memory0 = null;
|
|
2598
|
+
cachedFloat64Memory0 = null;
|
|
2599
|
+
cachedInt32Memory0 = null;
|
|
2600
|
+
cachedUint32Memory0 = null;
|
|
2601
|
+
cachedUint8Memory0 = null;
|
|
2602
|
+
|
|
2603
|
+
wasm.__wbindgen_start();
|
|
2604
|
+
return wasm;
|
|
2605
|
+
}
|
|
2606
|
+
|
|
2607
|
+
function initSync(module) {
|
|
2608
|
+
if (wasm !== undefined) return wasm;
|
|
2609
|
+
|
|
2610
|
+
const imports = __wbg_get_imports();
|
|
2611
|
+
|
|
2612
|
+
__wbg_init_memory(imports);
|
|
2613
|
+
|
|
2614
|
+
if (!(module instanceof WebAssembly.Module)) {
|
|
2615
|
+
module = new WebAssembly.Module(module);
|
|
2616
|
+
}
|
|
2617
|
+
|
|
2618
|
+
const instance = new WebAssembly.Instance(module, imports);
|
|
2619
|
+
|
|
2620
|
+
return __wbg_finalize_init(instance, module);
|
|
2621
|
+
}
|
|
2622
|
+
|
|
2623
|
+
async function __wbg_init(input) {
|
|
2624
|
+
if (wasm !== undefined) return wasm;
|
|
2625
|
+
|
|
2626
|
+
const imports = __wbg_get_imports();
|
|
2627
|
+
|
|
2628
|
+
if (typeof input === 'string' || (typeof Request === 'function' && input instanceof Request) || (typeof URL === 'function' && input instanceof URL)) {
|
|
2629
|
+
input = fetch(input);
|
|
2630
|
+
}
|
|
2631
|
+
|
|
2632
|
+
__wbg_init_memory(imports);
|
|
2633
|
+
|
|
2634
|
+
const { instance, module } = await __wbg_load(await input, imports);
|
|
2635
|
+
|
|
2636
|
+
return __wbg_finalize_init(instance, module);
|
|
2637
|
+
}
|
|
2638
|
+
|
|
2639
|
+
export { initSync }
|
|
2640
|
+
export default __wbg_init;
|