@moltendb-web/core 1.3.0 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/moltendb-worker.js +1 -1
- package/dist/wasm/{moltendb.d.ts → moltendb_core.d.ts} +15 -12
- package/dist/wasm/{moltendb.js → moltendb_core.js} +147 -178
- package/dist/wasm/moltendb_core_bg.wasm +0 -0
- package/dist/wasm/moltendb_core_bg.wasm.d.ts +19 -0
- package/package.json +3 -3
- package/dist/wasm/moltendb_bg.wasm +0 -0
- package/dist/wasm/moltendb_bg.wasm.d.ts +0 -16
package/dist/moltendb-worker.js
CHANGED
|
@@ -89,18 +89,21 @@ export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembl
|
|
|
89
89
|
export interface InitOutput {
|
|
90
90
|
readonly memory: WebAssembly.Memory;
|
|
91
91
|
readonly __wbg_workerdb_free: (a: number, b: number) => void;
|
|
92
|
-
readonly workerdb_analytics: (a: number, b: number, c: number
|
|
93
|
-
readonly workerdb_handle_message: (a: number, b: number,
|
|
94
|
-
readonly workerdb_new: (a: number, b: number) =>
|
|
95
|
-
readonly workerdb_subscribe: (a: number, b:
|
|
96
|
-
readonly
|
|
97
|
-
readonly
|
|
98
|
-
readonly
|
|
99
|
-
readonly
|
|
100
|
-
readonly
|
|
101
|
-
readonly
|
|
102
|
-
readonly
|
|
103
|
-
readonly
|
|
92
|
+
readonly workerdb_analytics: (a: number, b: number, c: number) => [number, number];
|
|
93
|
+
readonly workerdb_handle_message: (a: number, b: any) => [number, number, number];
|
|
94
|
+
readonly workerdb_new: (a: number, b: number) => any;
|
|
95
|
+
readonly workerdb_subscribe: (a: number, b: any) => void;
|
|
96
|
+
readonly wasm_bindgen__closure__destroy__hd467cd5df2070873: (a: number, b: number) => void;
|
|
97
|
+
readonly wasm_bindgen__convert__closures_____invoke__hfcbb4037b8cae583: (a: number, b: number, c: any) => [number, number];
|
|
98
|
+
readonly wasm_bindgen__convert__closures_____invoke__h23a1582ccafe3e3c: (a: number, b: number, c: any, d: any) => void;
|
|
99
|
+
readonly __wbindgen_malloc: (a: number, b: number) => number;
|
|
100
|
+
readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|
|
101
|
+
readonly __wbindgen_exn_store: (a: number) => void;
|
|
102
|
+
readonly __externref_table_alloc: () => number;
|
|
103
|
+
readonly __wbindgen_externrefs: WebAssembly.Table;
|
|
104
|
+
readonly __wbindgen_free: (a: number, b: number, c: number) => void;
|
|
105
|
+
readonly __externref_table_dealloc: (a: number) => void;
|
|
106
|
+
readonly __wbindgen_start: () => void;
|
|
104
107
|
}
|
|
105
108
|
|
|
106
109
|
export type SyncInitInput = BufferSource | WebAssembly.Module;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* @ts-self-types="./
|
|
1
|
+
/* @ts-self-types="./moltendb_core.d.ts" */
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* The WASM-exposed database handle used by the JavaScript Web Worker.
|
|
@@ -57,18 +57,14 @@ export class WorkerDb {
|
|
|
57
57
|
let deferred2_0;
|
|
58
58
|
let deferred2_1;
|
|
59
59
|
try {
|
|
60
|
-
const
|
|
61
|
-
const ptr0 = passStringToWasm0(query_json, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
60
|
+
const ptr0 = passStringToWasm0(query_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
62
61
|
const len0 = WASM_VECTOR_LEN;
|
|
63
|
-
wasm.workerdb_analytics(
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
deferred2_1 = r1;
|
|
68
|
-
return getStringFromWasm0(r0, r1);
|
|
62
|
+
const ret = wasm.workerdb_analytics(this.__wbg_ptr, ptr0, len0);
|
|
63
|
+
deferred2_0 = ret[0];
|
|
64
|
+
deferred2_1 = ret[1];
|
|
65
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
69
66
|
} finally {
|
|
70
|
-
wasm.
|
|
71
|
-
wasm.__wbindgen_export4(deferred2_0, deferred2_1, 1);
|
|
67
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
72
68
|
}
|
|
73
69
|
}
|
|
74
70
|
/**
|
|
@@ -93,19 +89,11 @@ export class WorkerDb {
|
|
|
93
89
|
* @returns {any}
|
|
94
90
|
*/
|
|
95
91
|
handle_message(data) {
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
100
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
101
|
-
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
102
|
-
if (r2) {
|
|
103
|
-
throw takeObject(r1);
|
|
104
|
-
}
|
|
105
|
-
return takeObject(r0);
|
|
106
|
-
} finally {
|
|
107
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
92
|
+
const ret = wasm.workerdb_handle_message(this.__wbg_ptr, data);
|
|
93
|
+
if (ret[2]) {
|
|
94
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
108
95
|
}
|
|
96
|
+
return takeFromExternrefTable0(ret[0]);
|
|
109
97
|
}
|
|
110
98
|
/**
|
|
111
99
|
* Initialize the database and open (or create) the OPFS storage file.
|
|
@@ -126,10 +114,10 @@ export class WorkerDb {
|
|
|
126
114
|
* @param {string} db_name
|
|
127
115
|
*/
|
|
128
116
|
constructor(db_name) {
|
|
129
|
-
const ptr0 = passStringToWasm0(db_name, wasm.
|
|
117
|
+
const ptr0 = passStringToWasm0(db_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
130
118
|
const len0 = WASM_VECTOR_LEN;
|
|
131
119
|
const ret = wasm.workerdb_new(ptr0, len0);
|
|
132
|
-
return
|
|
120
|
+
return ret;
|
|
133
121
|
}
|
|
134
122
|
/**
|
|
135
123
|
* Subscribe to real-time database changes.
|
|
@@ -138,7 +126,7 @@ export class WorkerDb {
|
|
|
138
126
|
* @param {Function} callback
|
|
139
127
|
*/
|
|
140
128
|
subscribe(callback) {
|
|
141
|
-
wasm.workerdb_subscribe(this.__wbg_ptr,
|
|
129
|
+
wasm.workerdb_subscribe(this.__wbg_ptr, callback);
|
|
142
130
|
}
|
|
143
131
|
}
|
|
144
132
|
if (Symbol.dispose) WorkerDb.prototype[Symbol.dispose] = WorkerDb.prototype.free;
|
|
@@ -148,76 +136,76 @@ function __wbg_get_imports() {
|
|
|
148
136
|
__proto__: null,
|
|
149
137
|
__wbg_Error_83742b46f01ce22d: function(arg0, arg1) {
|
|
150
138
|
const ret = Error(getStringFromWasm0(arg0, arg1));
|
|
151
|
-
return
|
|
139
|
+
return ret;
|
|
152
140
|
},
|
|
153
141
|
__wbg_String_8564e559799eccda: function(arg0, arg1) {
|
|
154
|
-
const ret = String(
|
|
155
|
-
const ptr1 = passStringToWasm0(ret, wasm.
|
|
142
|
+
const ret = String(arg1);
|
|
143
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
156
144
|
const len1 = WASM_VECTOR_LEN;
|
|
157
145
|
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
158
146
|
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
159
147
|
},
|
|
160
148
|
__wbg___wbindgen_bigint_get_as_i64_447a76b5c6ef7bda: function(arg0, arg1) {
|
|
161
|
-
const v =
|
|
149
|
+
const v = arg1;
|
|
162
150
|
const ret = typeof(v) === 'bigint' ? v : undefined;
|
|
163
151
|
getDataViewMemory0().setBigInt64(arg0 + 8 * 1, isLikeNone(ret) ? BigInt(0) : ret, true);
|
|
164
152
|
getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
|
|
165
153
|
},
|
|
166
154
|
__wbg___wbindgen_boolean_get_c0f3f60bac5a78d1: function(arg0) {
|
|
167
|
-
const v =
|
|
155
|
+
const v = arg0;
|
|
168
156
|
const ret = typeof(v) === 'boolean' ? v : undefined;
|
|
169
157
|
return isLikeNone(ret) ? 0xFFFFFF : ret ? 1 : 0;
|
|
170
158
|
},
|
|
171
159
|
__wbg___wbindgen_debug_string_5398f5bb970e0daa: function(arg0, arg1) {
|
|
172
|
-
const ret = debugString(
|
|
173
|
-
const ptr1 = passStringToWasm0(ret, wasm.
|
|
160
|
+
const ret = debugString(arg1);
|
|
161
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
174
162
|
const len1 = WASM_VECTOR_LEN;
|
|
175
163
|
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
176
164
|
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
177
165
|
},
|
|
178
166
|
__wbg___wbindgen_in_41dbb8413020e076: function(arg0, arg1) {
|
|
179
|
-
const ret =
|
|
167
|
+
const ret = arg0 in arg1;
|
|
180
168
|
return ret;
|
|
181
169
|
},
|
|
182
170
|
__wbg___wbindgen_is_bigint_e2141d4f045b7eda: function(arg0) {
|
|
183
|
-
const ret = typeof(
|
|
171
|
+
const ret = typeof(arg0) === 'bigint';
|
|
184
172
|
return ret;
|
|
185
173
|
},
|
|
186
174
|
__wbg___wbindgen_is_function_3c846841762788c1: function(arg0) {
|
|
187
|
-
const ret = typeof(
|
|
175
|
+
const ret = typeof(arg0) === 'function';
|
|
188
176
|
return ret;
|
|
189
177
|
},
|
|
190
178
|
__wbg___wbindgen_is_object_781bc9f159099513: function(arg0) {
|
|
191
|
-
const val =
|
|
179
|
+
const val = arg0;
|
|
192
180
|
const ret = typeof(val) === 'object' && val !== null;
|
|
193
181
|
return ret;
|
|
194
182
|
},
|
|
195
183
|
__wbg___wbindgen_is_string_7ef6b97b02428fae: function(arg0) {
|
|
196
|
-
const ret = typeof(
|
|
184
|
+
const ret = typeof(arg0) === 'string';
|
|
197
185
|
return ret;
|
|
198
186
|
},
|
|
199
187
|
__wbg___wbindgen_is_undefined_52709e72fb9f179c: function(arg0) {
|
|
200
|
-
const ret =
|
|
188
|
+
const ret = arg0 === undefined;
|
|
201
189
|
return ret;
|
|
202
190
|
},
|
|
203
191
|
__wbg___wbindgen_jsval_eq_ee31bfad3e536463: function(arg0, arg1) {
|
|
204
|
-
const ret =
|
|
192
|
+
const ret = arg0 === arg1;
|
|
205
193
|
return ret;
|
|
206
194
|
},
|
|
207
195
|
__wbg___wbindgen_jsval_loose_eq_5bcc3bed3c69e72b: function(arg0, arg1) {
|
|
208
|
-
const ret =
|
|
196
|
+
const ret = arg0 == arg1;
|
|
209
197
|
return ret;
|
|
210
198
|
},
|
|
211
199
|
__wbg___wbindgen_number_get_34bb9d9dcfa21373: function(arg0, arg1) {
|
|
212
|
-
const obj =
|
|
200
|
+
const obj = arg1;
|
|
213
201
|
const ret = typeof(obj) === 'number' ? obj : undefined;
|
|
214
202
|
getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
|
|
215
203
|
getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
|
|
216
204
|
},
|
|
217
205
|
__wbg___wbindgen_string_get_395e606bd0ee4427: function(arg0, arg1) {
|
|
218
|
-
const obj =
|
|
206
|
+
const obj = arg1;
|
|
219
207
|
const ret = typeof(obj) === 'string' ? obj : undefined;
|
|
220
|
-
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.
|
|
208
|
+
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
221
209
|
var len1 = WASM_VECTOR_LEN;
|
|
222
210
|
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
223
211
|
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
@@ -226,33 +214,33 @@ function __wbg_get_imports() {
|
|
|
226
214
|
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
227
215
|
},
|
|
228
216
|
__wbg__wbg_cb_unref_6b5b6b8576d35cb1: function(arg0) {
|
|
229
|
-
|
|
217
|
+
arg0._wbg_cb_unref();
|
|
230
218
|
},
|
|
231
219
|
__wbg_call_2d781c1f4d5c0ef8: function() { return handleError(function (arg0, arg1, arg2) {
|
|
232
|
-
const ret =
|
|
233
|
-
return
|
|
220
|
+
const ret = arg0.call(arg1, arg2);
|
|
221
|
+
return ret;
|
|
234
222
|
}, arguments); },
|
|
235
223
|
__wbg_call_e133b57c9155d22c: function() { return handleError(function (arg0, arg1) {
|
|
236
|
-
const ret =
|
|
237
|
-
return
|
|
224
|
+
const ret = arg0.call(arg1);
|
|
225
|
+
return ret;
|
|
238
226
|
}, arguments); },
|
|
239
227
|
__wbg_close_bea86eef0f71dd9b: function(arg0) {
|
|
240
|
-
|
|
228
|
+
arg0.close();
|
|
241
229
|
},
|
|
242
230
|
__wbg_createSyncAccessHandle_b7143219a305a2ce: function(arg0) {
|
|
243
|
-
const ret =
|
|
244
|
-
return
|
|
231
|
+
const ret = arg0.createSyncAccessHandle();
|
|
232
|
+
return ret;
|
|
245
233
|
},
|
|
246
234
|
__wbg_done_08ce71ee07e3bd17: function(arg0) {
|
|
247
|
-
const ret =
|
|
235
|
+
const ret = arg0.done;
|
|
248
236
|
return ret;
|
|
249
237
|
},
|
|
250
238
|
__wbg_entries_e8a20ff8c9757101: function(arg0) {
|
|
251
|
-
const ret = Object.entries(
|
|
252
|
-
return
|
|
239
|
+
const ret = Object.entries(arg0);
|
|
240
|
+
return ret;
|
|
253
241
|
},
|
|
254
242
|
__wbg_error_8d9a8e04cd1d3588: function(arg0) {
|
|
255
|
-
console.error(
|
|
243
|
+
console.error(arg0);
|
|
256
244
|
},
|
|
257
245
|
__wbg_error_a6fa202b58aa1cd3: function(arg0, arg1) {
|
|
258
246
|
let deferred0_0;
|
|
@@ -262,43 +250,43 @@ function __wbg_get_imports() {
|
|
|
262
250
|
deferred0_1 = arg1;
|
|
263
251
|
console.error(getStringFromWasm0(arg0, arg1));
|
|
264
252
|
} finally {
|
|
265
|
-
wasm.
|
|
253
|
+
wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
|
|
266
254
|
}
|
|
267
255
|
},
|
|
268
256
|
__wbg_flush_1eca046e0ff7c399: function() { return handleError(function (arg0) {
|
|
269
|
-
|
|
257
|
+
arg0.flush();
|
|
270
258
|
}, arguments); },
|
|
271
259
|
__wbg_getDirectory_2406d369de179ff0: function(arg0) {
|
|
272
|
-
const ret =
|
|
273
|
-
return
|
|
260
|
+
const ret = arg0.getDirectory();
|
|
261
|
+
return ret;
|
|
274
262
|
},
|
|
275
263
|
__wbg_getFileHandle_b85805519dc63efa: function(arg0, arg1, arg2, arg3) {
|
|
276
|
-
const ret =
|
|
277
|
-
return
|
|
264
|
+
const ret = arg0.getFileHandle(getStringFromWasm0(arg1, arg2), arg3);
|
|
265
|
+
return ret;
|
|
278
266
|
},
|
|
279
267
|
__wbg_getRandomValues_a1cf2e70b003a59d: function() { return handleError(function (arg0, arg1) {
|
|
280
268
|
globalThis.crypto.getRandomValues(getArrayU8FromWasm0(arg0, arg1));
|
|
281
269
|
}, arguments); },
|
|
282
270
|
__wbg_getSize_0a16c5e2524d34aa: function() { return handleError(function (arg0) {
|
|
283
|
-
const ret =
|
|
271
|
+
const ret = arg0.getSize();
|
|
284
272
|
return ret;
|
|
285
273
|
}, arguments); },
|
|
286
274
|
__wbg_get_326e41e095fb2575: function() { return handleError(function (arg0, arg1) {
|
|
287
|
-
const ret = Reflect.get(
|
|
288
|
-
return
|
|
275
|
+
const ret = Reflect.get(arg0, arg1);
|
|
276
|
+
return ret;
|
|
289
277
|
}, arguments); },
|
|
290
278
|
__wbg_get_a8ee5c45dabc1b3b: function(arg0, arg1) {
|
|
291
|
-
const ret =
|
|
292
|
-
return
|
|
279
|
+
const ret = arg0[arg1 >>> 0];
|
|
280
|
+
return ret;
|
|
293
281
|
},
|
|
294
282
|
__wbg_get_unchecked_329cfe50afab7352: function(arg0, arg1) {
|
|
295
|
-
const ret =
|
|
296
|
-
return
|
|
283
|
+
const ret = arg0[arg1 >>> 0];
|
|
284
|
+
return ret;
|
|
297
285
|
},
|
|
298
286
|
__wbg_instanceof_ArrayBuffer_101e2bf31071a9f6: function(arg0) {
|
|
299
287
|
let result;
|
|
300
288
|
try {
|
|
301
|
-
result =
|
|
289
|
+
result = arg0 instanceof ArrayBuffer;
|
|
302
290
|
} catch (_) {
|
|
303
291
|
result = false;
|
|
304
292
|
}
|
|
@@ -308,7 +296,7 @@ function __wbg_get_imports() {
|
|
|
308
296
|
__wbg_instanceof_Map_f194b366846aca0c: function(arg0) {
|
|
309
297
|
let result;
|
|
310
298
|
try {
|
|
311
|
-
result =
|
|
299
|
+
result = arg0 instanceof Map;
|
|
312
300
|
} catch (_) {
|
|
313
301
|
result = false;
|
|
314
302
|
}
|
|
@@ -318,7 +306,7 @@ function __wbg_get_imports() {
|
|
|
318
306
|
__wbg_instanceof_Uint8Array_740438561a5b956d: function(arg0) {
|
|
319
307
|
let result;
|
|
320
308
|
try {
|
|
321
|
-
result =
|
|
309
|
+
result = arg0 instanceof Uint8Array;
|
|
322
310
|
} catch (_) {
|
|
323
311
|
result = false;
|
|
324
312
|
}
|
|
@@ -328,7 +316,7 @@ function __wbg_get_imports() {
|
|
|
328
316
|
__wbg_instanceof_WorkerGlobalScope_de6976d00cb213c6: function(arg0) {
|
|
329
317
|
let result;
|
|
330
318
|
try {
|
|
331
|
-
result =
|
|
319
|
+
result = arg0 instanceof WorkerGlobalScope;
|
|
332
320
|
} catch (_) {
|
|
333
321
|
result = false;
|
|
334
322
|
}
|
|
@@ -336,51 +324,51 @@ function __wbg_get_imports() {
|
|
|
336
324
|
return ret;
|
|
337
325
|
},
|
|
338
326
|
__wbg_isArray_33b91feb269ff46e: function(arg0) {
|
|
339
|
-
const ret = Array.isArray(
|
|
327
|
+
const ret = Array.isArray(arg0);
|
|
340
328
|
return ret;
|
|
341
329
|
},
|
|
342
330
|
__wbg_isSafeInteger_ecd6a7f9c3e053cd: function(arg0) {
|
|
343
|
-
const ret = Number.isSafeInteger(
|
|
331
|
+
const ret = Number.isSafeInteger(arg0);
|
|
344
332
|
return ret;
|
|
345
333
|
},
|
|
346
334
|
__wbg_iterator_d8f549ec8fb061b1: function() {
|
|
347
335
|
const ret = Symbol.iterator;
|
|
348
|
-
return
|
|
336
|
+
return ret;
|
|
349
337
|
},
|
|
350
338
|
__wbg_length_b3416cf66a5452c8: function(arg0) {
|
|
351
|
-
const ret =
|
|
339
|
+
const ret = arg0.length;
|
|
352
340
|
return ret;
|
|
353
341
|
},
|
|
354
342
|
__wbg_length_ea16607d7b61445b: function(arg0) {
|
|
355
|
-
const ret =
|
|
343
|
+
const ret = arg0.length;
|
|
356
344
|
return ret;
|
|
357
345
|
},
|
|
358
346
|
__wbg_log_524eedafa26daa59: function(arg0) {
|
|
359
|
-
console.log(
|
|
347
|
+
console.log(arg0);
|
|
360
348
|
},
|
|
361
349
|
__wbg_navigator_583ffd4fc14c0f7a: function(arg0) {
|
|
362
|
-
const ret =
|
|
363
|
-
return
|
|
350
|
+
const ret = arg0.navigator;
|
|
351
|
+
return ret;
|
|
364
352
|
},
|
|
365
353
|
__wbg_new_227d7c05414eb861: function() {
|
|
366
354
|
const ret = new Error();
|
|
367
|
-
return
|
|
355
|
+
return ret;
|
|
368
356
|
},
|
|
369
357
|
__wbg_new_49d5571bd3f0c4d4: function() {
|
|
370
358
|
const ret = new Map();
|
|
371
|
-
return
|
|
359
|
+
return ret;
|
|
372
360
|
},
|
|
373
361
|
__wbg_new_5f486cdf45a04d78: function(arg0) {
|
|
374
|
-
const ret = new Uint8Array(
|
|
375
|
-
return
|
|
362
|
+
const ret = new Uint8Array(arg0);
|
|
363
|
+
return ret;
|
|
376
364
|
},
|
|
377
365
|
__wbg_new_a70fbab9066b301f: function() {
|
|
378
366
|
const ret = new Array();
|
|
379
|
-
return
|
|
367
|
+
return ret;
|
|
380
368
|
},
|
|
381
369
|
__wbg_new_ab79df5bd7c26067: function() {
|
|
382
370
|
const ret = new Object();
|
|
383
|
-
return
|
|
371
|
+
return ret;
|
|
384
372
|
},
|
|
385
373
|
__wbg_new_typed_aaaeaf29cf802876: function(arg0, arg1) {
|
|
386
374
|
try {
|
|
@@ -389,24 +377,24 @@ function __wbg_get_imports() {
|
|
|
389
377
|
const a = state0.a;
|
|
390
378
|
state0.a = 0;
|
|
391
379
|
try {
|
|
392
|
-
return
|
|
380
|
+
return wasm_bindgen__convert__closures_____invoke__h23a1582ccafe3e3c(a, state0.b, arg0, arg1);
|
|
393
381
|
} finally {
|
|
394
382
|
state0.a = a;
|
|
395
383
|
}
|
|
396
384
|
};
|
|
397
385
|
const ret = new Promise(cb0);
|
|
398
|
-
return
|
|
386
|
+
return ret;
|
|
399
387
|
} finally {
|
|
400
388
|
state0.a = state0.b = 0;
|
|
401
389
|
}
|
|
402
390
|
},
|
|
403
391
|
__wbg_next_11b99ee6237339e3: function() { return handleError(function (arg0) {
|
|
404
|
-
const ret =
|
|
405
|
-
return
|
|
392
|
+
const ret = arg0.next();
|
|
393
|
+
return ret;
|
|
406
394
|
}, arguments); },
|
|
407
395
|
__wbg_next_e01a967809d1aa68: function(arg0) {
|
|
408
|
-
const ret =
|
|
409
|
-
return
|
|
396
|
+
const ret = arg0.next;
|
|
397
|
+
return ret;
|
|
410
398
|
},
|
|
411
399
|
__wbg_now_16f0c993d5dd6c27: function() {
|
|
412
400
|
const ret = Date.now();
|
|
@@ -417,164 +405,156 @@ function __wbg_get_imports() {
|
|
|
417
405
|
return ret;
|
|
418
406
|
}, arguments); },
|
|
419
407
|
__wbg_now_e7c6795a7f81e10f: function(arg0) {
|
|
420
|
-
const ret =
|
|
408
|
+
const ret = arg0.now();
|
|
421
409
|
return ret;
|
|
422
410
|
},
|
|
423
411
|
__wbg_performance_3fcf6e32a7e1ed0a: function(arg0) {
|
|
424
|
-
const ret =
|
|
425
|
-
return
|
|
412
|
+
const ret = arg0.performance;
|
|
413
|
+
return ret;
|
|
426
414
|
},
|
|
427
415
|
__wbg_prototypesetcall_d62e5099504357e6: function(arg0, arg1, arg2) {
|
|
428
|
-
Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1),
|
|
416
|
+
Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), arg2);
|
|
429
417
|
},
|
|
430
418
|
__wbg_queueMicrotask_0c399741342fb10f: function(arg0) {
|
|
431
|
-
const ret =
|
|
432
|
-
return
|
|
419
|
+
const ret = arg0.queueMicrotask;
|
|
420
|
+
return ret;
|
|
433
421
|
},
|
|
434
422
|
__wbg_queueMicrotask_a082d78ce798393e: function(arg0) {
|
|
435
|
-
queueMicrotask(
|
|
423
|
+
queueMicrotask(arg0);
|
|
436
424
|
},
|
|
437
425
|
__wbg_read_0285869b4fd131af: function() { return handleError(function (arg0, arg1, arg2, arg3) {
|
|
438
|
-
const ret =
|
|
426
|
+
const ret = arg0.read(getArrayU8FromWasm0(arg1, arg2), arg3);
|
|
439
427
|
return ret;
|
|
440
428
|
}, arguments); },
|
|
441
429
|
__wbg_resolve_ae8d83246e5bcc12: function(arg0) {
|
|
442
|
-
const ret = Promise.resolve(
|
|
443
|
-
return
|
|
430
|
+
const ret = Promise.resolve(arg0);
|
|
431
|
+
return ret;
|
|
444
432
|
},
|
|
445
433
|
__wbg_set_282384002438957f: function(arg0, arg1, arg2) {
|
|
446
|
-
|
|
434
|
+
arg0[arg1 >>> 0] = arg2;
|
|
447
435
|
},
|
|
448
436
|
__wbg_set_6be42768c690e380: function(arg0, arg1, arg2) {
|
|
449
|
-
|
|
437
|
+
arg0[arg1] = arg2;
|
|
450
438
|
},
|
|
451
439
|
__wbg_set_at_e227be75df7f9abf: function(arg0, arg1) {
|
|
452
|
-
|
|
440
|
+
arg0.at = arg1;
|
|
453
441
|
},
|
|
454
442
|
__wbg_set_bf7251625df30a02: function(arg0, arg1, arg2) {
|
|
455
|
-
const ret =
|
|
456
|
-
return
|
|
443
|
+
const ret = arg0.set(arg1, arg2);
|
|
444
|
+
return ret;
|
|
457
445
|
},
|
|
458
446
|
__wbg_set_create_ef897736206a6f05: function(arg0, arg1) {
|
|
459
|
-
|
|
447
|
+
arg0.create = arg1 !== 0;
|
|
460
448
|
},
|
|
461
449
|
__wbg_stack_3b0d974bbf31e44f: function(arg0, arg1) {
|
|
462
|
-
const ret =
|
|
463
|
-
const ptr1 = passStringToWasm0(ret, wasm.
|
|
450
|
+
const ret = arg1.stack;
|
|
451
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
464
452
|
const len1 = WASM_VECTOR_LEN;
|
|
465
453
|
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
466
454
|
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
467
455
|
},
|
|
468
456
|
__wbg_static_accessor_GLOBAL_8adb955bd33fac2f: function() {
|
|
469
457
|
const ret = typeof global === 'undefined' ? null : global;
|
|
470
|
-
return isLikeNone(ret) ? 0 :
|
|
458
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
471
459
|
},
|
|
472
460
|
__wbg_static_accessor_GLOBAL_THIS_ad356e0db91c7913: function() {
|
|
473
461
|
const ret = typeof globalThis === 'undefined' ? null : globalThis;
|
|
474
|
-
return isLikeNone(ret) ? 0 :
|
|
462
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
475
463
|
},
|
|
476
464
|
__wbg_static_accessor_SELF_f207c857566db248: function() {
|
|
477
465
|
const ret = typeof self === 'undefined' ? null : self;
|
|
478
|
-
return isLikeNone(ret) ? 0 :
|
|
466
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
479
467
|
},
|
|
480
468
|
__wbg_static_accessor_WINDOW_bb9f1ba69d61b386: function() {
|
|
481
469
|
const ret = typeof window === 'undefined' ? null : window;
|
|
482
|
-
return isLikeNone(ret) ? 0 :
|
|
470
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
483
471
|
},
|
|
484
472
|
__wbg_storage_8d917976d6753ee0: function(arg0) {
|
|
485
|
-
const ret =
|
|
486
|
-
return
|
|
473
|
+
const ret = arg0.storage;
|
|
474
|
+
return ret;
|
|
487
475
|
},
|
|
488
476
|
__wbg_then_098abe61755d12f6: function(arg0, arg1) {
|
|
489
|
-
const ret =
|
|
490
|
-
return
|
|
477
|
+
const ret = arg0.then(arg1);
|
|
478
|
+
return ret;
|
|
491
479
|
},
|
|
492
480
|
__wbg_then_9e335f6dd892bc11: function(arg0, arg1, arg2) {
|
|
493
|
-
const ret =
|
|
494
|
-
return
|
|
481
|
+
const ret = arg0.then(arg1, arg2);
|
|
482
|
+
return ret;
|
|
495
483
|
},
|
|
496
484
|
__wbg_truncate_af8ac1613ab66393: function() { return handleError(function (arg0, arg1) {
|
|
497
|
-
|
|
485
|
+
arg0.truncate(arg1);
|
|
498
486
|
}, arguments); },
|
|
499
487
|
__wbg_value_21fc78aab0322612: function(arg0) {
|
|
500
|
-
const ret =
|
|
501
|
-
return
|
|
488
|
+
const ret = arg0.value;
|
|
489
|
+
return ret;
|
|
502
490
|
},
|
|
503
491
|
__wbg_workerdb_new: function(arg0) {
|
|
504
492
|
const ret = WorkerDb.__wrap(arg0);
|
|
505
|
-
return
|
|
493
|
+
return ret;
|
|
506
494
|
},
|
|
507
495
|
__wbg_write_57c477a82b886339: function() { return handleError(function (arg0, arg1, arg2, arg3) {
|
|
508
|
-
const ret =
|
|
496
|
+
const ret = arg0.write(getArrayU8FromWasm0(arg1, arg2), arg3);
|
|
509
497
|
return ret;
|
|
510
498
|
}, arguments); },
|
|
511
499
|
__wbindgen_cast_0000000000000001: function(arg0, arg1) {
|
|
512
|
-
// Cast intrinsic for `Closure(Closure { dtor_idx:
|
|
513
|
-
const ret = makeMutClosure(arg0, arg1, wasm.
|
|
514
|
-
return
|
|
500
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 779, function: Function { arguments: [Externref], shim_idx: 780, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
|
|
501
|
+
const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__hd467cd5df2070873, wasm_bindgen__convert__closures_____invoke__hfcbb4037b8cae583);
|
|
502
|
+
return ret;
|
|
515
503
|
},
|
|
516
504
|
__wbindgen_cast_0000000000000002: function(arg0) {
|
|
517
505
|
// Cast intrinsic for `F64 -> Externref`.
|
|
518
506
|
const ret = arg0;
|
|
519
|
-
return
|
|
507
|
+
return ret;
|
|
520
508
|
},
|
|
521
509
|
__wbindgen_cast_0000000000000003: function(arg0) {
|
|
522
510
|
// Cast intrinsic for `I64 -> Externref`.
|
|
523
511
|
const ret = arg0;
|
|
524
|
-
return
|
|
512
|
+
return ret;
|
|
525
513
|
},
|
|
526
514
|
__wbindgen_cast_0000000000000004: function(arg0, arg1) {
|
|
527
515
|
// Cast intrinsic for `Ref(String) -> Externref`.
|
|
528
516
|
const ret = getStringFromWasm0(arg0, arg1);
|
|
529
|
-
return
|
|
517
|
+
return ret;
|
|
530
518
|
},
|
|
531
519
|
__wbindgen_cast_0000000000000005: function(arg0) {
|
|
532
520
|
// Cast intrinsic for `U64 -> Externref`.
|
|
533
521
|
const ret = BigInt.asUintN(64, arg0);
|
|
534
|
-
return
|
|
535
|
-
},
|
|
536
|
-
__wbindgen_object_clone_ref: function(arg0) {
|
|
537
|
-
const ret = getObject(arg0);
|
|
538
|
-
return addHeapObject(ret);
|
|
522
|
+
return ret;
|
|
539
523
|
},
|
|
540
|
-
|
|
541
|
-
|
|
524
|
+
__wbindgen_init_externref_table: function() {
|
|
525
|
+
const table = wasm.__wbindgen_externrefs;
|
|
526
|
+
const offset = table.grow(4);
|
|
527
|
+
table.set(0, undefined);
|
|
528
|
+
table.set(offset + 0, undefined);
|
|
529
|
+
table.set(offset + 1, null);
|
|
530
|
+
table.set(offset + 2, true);
|
|
531
|
+
table.set(offset + 3, false);
|
|
542
532
|
},
|
|
543
533
|
};
|
|
544
534
|
return {
|
|
545
535
|
__proto__: null,
|
|
546
|
-
"./
|
|
536
|
+
"./moltendb_core_bg.js": import0,
|
|
547
537
|
};
|
|
548
538
|
}
|
|
549
539
|
|
|
550
|
-
function
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
555
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
556
|
-
if (r1) {
|
|
557
|
-
throw takeObject(r0);
|
|
558
|
-
}
|
|
559
|
-
} finally {
|
|
560
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
540
|
+
function wasm_bindgen__convert__closures_____invoke__hfcbb4037b8cae583(arg0, arg1, arg2) {
|
|
541
|
+
const ret = wasm.wasm_bindgen__convert__closures_____invoke__hfcbb4037b8cae583(arg0, arg1, arg2);
|
|
542
|
+
if (ret[1]) {
|
|
543
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
561
544
|
}
|
|
562
545
|
}
|
|
563
546
|
|
|
564
|
-
function
|
|
565
|
-
wasm.
|
|
547
|
+
function wasm_bindgen__convert__closures_____invoke__h23a1582ccafe3e3c(arg0, arg1, arg2, arg3) {
|
|
548
|
+
wasm.wasm_bindgen__convert__closures_____invoke__h23a1582ccafe3e3c(arg0, arg1, arg2, arg3);
|
|
566
549
|
}
|
|
567
550
|
|
|
568
551
|
const WorkerDbFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
569
552
|
? { register: () => {}, unregister: () => {} }
|
|
570
553
|
: new FinalizationRegistry(ptr => wasm.__wbg_workerdb_free(ptr >>> 0, 1));
|
|
571
554
|
|
|
572
|
-
function
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
heap_next = heap[idx];
|
|
576
|
-
|
|
577
|
-
heap[idx] = obj;
|
|
555
|
+
function addToExternrefTable0(obj) {
|
|
556
|
+
const idx = wasm.__externref_table_alloc();
|
|
557
|
+
wasm.__wbindgen_externrefs.set(idx, obj);
|
|
578
558
|
return idx;
|
|
579
559
|
}
|
|
580
560
|
|
|
@@ -647,12 +627,6 @@ function debugString(val) {
|
|
|
647
627
|
return className;
|
|
648
628
|
}
|
|
649
629
|
|
|
650
|
-
function dropObject(idx) {
|
|
651
|
-
if (idx < 1028) return;
|
|
652
|
-
heap[idx] = heap_next;
|
|
653
|
-
heap_next = idx;
|
|
654
|
-
}
|
|
655
|
-
|
|
656
630
|
function getArrayU8FromWasm0(ptr, len) {
|
|
657
631
|
ptr = ptr >>> 0;
|
|
658
632
|
return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
|
|
@@ -679,21 +653,15 @@ function getUint8ArrayMemory0() {
|
|
|
679
653
|
return cachedUint8ArrayMemory0;
|
|
680
654
|
}
|
|
681
655
|
|
|
682
|
-
function getObject(idx) { return heap[idx]; }
|
|
683
|
-
|
|
684
656
|
function handleError(f, args) {
|
|
685
657
|
try {
|
|
686
658
|
return f.apply(this, args);
|
|
687
659
|
} catch (e) {
|
|
688
|
-
|
|
660
|
+
const idx = addToExternrefTable0(e);
|
|
661
|
+
wasm.__wbindgen_exn_store(idx);
|
|
689
662
|
}
|
|
690
663
|
}
|
|
691
664
|
|
|
692
|
-
let heap = new Array(1024).fill(undefined);
|
|
693
|
-
heap.push(undefined, null, true, false);
|
|
694
|
-
|
|
695
|
-
let heap_next = heap.length;
|
|
696
|
-
|
|
697
665
|
function isLikeNone(x) {
|
|
698
666
|
return x === undefined || x === null;
|
|
699
667
|
}
|
|
@@ -763,10 +731,10 @@ function passStringToWasm0(arg, malloc, realloc) {
|
|
|
763
731
|
return ptr;
|
|
764
732
|
}
|
|
765
733
|
|
|
766
|
-
function
|
|
767
|
-
const
|
|
768
|
-
|
|
769
|
-
return
|
|
734
|
+
function takeFromExternrefTable0(idx) {
|
|
735
|
+
const value = wasm.__wbindgen_externrefs.get(idx);
|
|
736
|
+
wasm.__externref_table_dealloc(idx);
|
|
737
|
+
return value;
|
|
770
738
|
}
|
|
771
739
|
|
|
772
740
|
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
@@ -804,6 +772,7 @@ function __wbg_finalize_init(instance, module) {
|
|
|
804
772
|
wasmModule = module;
|
|
805
773
|
cachedDataViewMemory0 = null;
|
|
806
774
|
cachedUint8ArrayMemory0 = null;
|
|
775
|
+
wasm.__wbindgen_start();
|
|
807
776
|
return wasm;
|
|
808
777
|
}
|
|
809
778
|
|
|
@@ -875,7 +844,7 @@ async function __wbg_init(module_or_path) {
|
|
|
875
844
|
}
|
|
876
845
|
|
|
877
846
|
if (module_or_path === undefined) {
|
|
878
|
-
module_or_path = new URL('
|
|
847
|
+
module_or_path = new URL('moltendb_core_bg.wasm', import.meta.url);
|
|
879
848
|
}
|
|
880
849
|
const imports = __wbg_get_imports();
|
|
881
850
|
|
|
Binary file
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
export const memory: WebAssembly.Memory;
|
|
4
|
+
export const __wbg_workerdb_free: (a: number, b: number) => void;
|
|
5
|
+
export const workerdb_analytics: (a: number, b: number, c: number) => [number, number];
|
|
6
|
+
export const workerdb_handle_message: (a: number, b: any) => [number, number, number];
|
|
7
|
+
export const workerdb_new: (a: number, b: number) => any;
|
|
8
|
+
export const workerdb_subscribe: (a: number, b: any) => void;
|
|
9
|
+
export const wasm_bindgen__closure__destroy__hd467cd5df2070873: (a: number, b: number) => void;
|
|
10
|
+
export const wasm_bindgen__convert__closures_____invoke__hfcbb4037b8cae583: (a: number, b: number, c: any) => [number, number];
|
|
11
|
+
export const wasm_bindgen__convert__closures_____invoke__h23a1582ccafe3e3c: (a: number, b: number, c: any, d: any) => void;
|
|
12
|
+
export const __wbindgen_malloc: (a: number, b: number) => number;
|
|
13
|
+
export const __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|
|
14
|
+
export const __wbindgen_exn_store: (a: number) => void;
|
|
15
|
+
export const __externref_table_alloc: () => number;
|
|
16
|
+
export const __wbindgen_externrefs: WebAssembly.Table;
|
|
17
|
+
export const __wbindgen_free: (a: number, b: number, c: number) => void;
|
|
18
|
+
export const __externref_table_dealloc: (a: number) => void;
|
|
19
|
+
export const __wbindgen_start: () => void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@moltendb-web/core",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.0",
|
|
4
4
|
"description": "MoltenDb WASM runtime — the database engine, Web Worker, and main-thread client in one package.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"author": "Maximilian Both <maximilian.both27@outlook.com>",
|
|
@@ -23,8 +23,8 @@
|
|
|
23
23
|
"import": "./dist/moltendb-worker.js",
|
|
24
24
|
"types": "./dist/moltendb-worker.d.ts"
|
|
25
25
|
},
|
|
26
|
-
"./wasm": "./dist/wasm/
|
|
27
|
-
"./wasm-bg": "./dist/wasm/
|
|
26
|
+
"./wasm": "./dist/wasm/moltendb_core.js",
|
|
27
|
+
"./wasm-bg": "./dist/wasm/moltendb_core_bg.wasm"
|
|
28
28
|
},
|
|
29
29
|
"main": "./dist/index.js",
|
|
30
30
|
"types": "./dist/index.d.ts",
|
|
Binary file
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/* tslint:disable */
|
|
2
|
-
/* eslint-disable */
|
|
3
|
-
export const memory: WebAssembly.Memory;
|
|
4
|
-
export const __wbg_workerdb_free: (a: number, b: number) => void;
|
|
5
|
-
export const workerdb_analytics: (a: number, b: number, c: number, d: number) => void;
|
|
6
|
-
export const workerdb_handle_message: (a: number, b: number, c: number) => void;
|
|
7
|
-
export const workerdb_new: (a: number, b: number) => number;
|
|
8
|
-
export const workerdb_subscribe: (a: number, b: number) => void;
|
|
9
|
-
export const __wasm_bindgen_func_elem_3615: (a: number, b: number) => void;
|
|
10
|
-
export const __wasm_bindgen_func_elem_3699: (a: number, b: number, c: number, d: number) => void;
|
|
11
|
-
export const __wasm_bindgen_func_elem_3704: (a: number, b: number, c: number, d: number) => void;
|
|
12
|
-
export const __wbindgen_export: (a: number, b: number) => number;
|
|
13
|
-
export const __wbindgen_export2: (a: number, b: number, c: number, d: number) => number;
|
|
14
|
-
export const __wbindgen_export3: (a: number) => void;
|
|
15
|
-
export const __wbindgen_export4: (a: number, b: number, c: number) => void;
|
|
16
|
-
export const __wbindgen_add_to_stack_pointer: (a: number) => number;
|