ducjs 3.5.1 → 4.0.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/ducjs_wasm.d.ts +162 -42
- package/dist/ducjs_wasm.js +794 -87
- package/dist/ducjs_wasm_bg.wasm +0 -0
- package/dist/ducjs_wasm_bg.wasm.d.ts +39 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.js +3 -3
- package/dist/lazy-files.d.ts +1 -0
- package/dist/lazy-files.js +4 -2
- package/dist/opfs-import.d.ts +12 -0
- package/dist/opfs-import.js +113 -0
- package/dist/opfs.d.ts +36 -0
- package/dist/opfs.js +218 -0
- package/dist/parse.d.ts +1 -1
- package/dist/parse.js +3 -42
- package/dist/restore-parsed.d.ts +7 -0
- package/dist/restore-parsed.js +23 -0
- package/dist/serialize.d.ts +1 -0
- package/dist/serialize.js +17 -20
- package/dist/types/elements/typeChecks.js +7 -4
- package/dist/types/index.d.ts +1 -1
- package/dist/utils/bounds.d.ts +1 -2
- package/dist/utils/math/algebra/ga.d.ts +1 -2
- package/dist/utils/math/index.d.ts +3 -3
- package/dist/utils/math/index.js +1 -1
- package/dist/utils/version.d.ts +1 -1
- package/dist/utils/version.js +3 -1
- package/dist/version-control.d.ts +15 -36
- package/dist/version-control.js +15 -55
- package/dist/wasi.d.ts +29 -0
- package/dist/wasi.js +266 -0
- package/dist/wasm.d.ts +19 -4
- package/dist/wasm.js +20 -4
- package/package.json +8 -2
package/dist/ducjs_wasm.js
CHANGED
|
@@ -182,6 +182,40 @@ function debugString(val) {
|
|
|
182
182
|
return className;
|
|
183
183
|
}
|
|
184
184
|
|
|
185
|
+
const CLOSURE_DTORS = (typeof FinalizationRegistry === 'undefined')
|
|
186
|
+
? { register: () => {}, unregister: () => {} }
|
|
187
|
+
: new FinalizationRegistry(
|
|
188
|
+
state => {
|
|
189
|
+
wasm.__wbindgen_export_5.get(state.dtor)(state.a, state.b);
|
|
190
|
+
}
|
|
191
|
+
);
|
|
192
|
+
|
|
193
|
+
function makeMutClosure(arg0, arg1, dtor, f) {
|
|
194
|
+
const state = { a: arg0, b: arg1, cnt: 1, dtor };
|
|
195
|
+
const real = (...args) => {
|
|
196
|
+
|
|
197
|
+
// First up with a closure we increment the internal reference
|
|
198
|
+
// count. This ensures that the Rust closure environment won't
|
|
199
|
+
// be deallocated while we're invoking it.
|
|
200
|
+
state.cnt++;
|
|
201
|
+
const a = state.a;
|
|
202
|
+
state.a = 0;
|
|
203
|
+
try {
|
|
204
|
+
return f(a, state.b, ...args);
|
|
205
|
+
} finally {
|
|
206
|
+
if (--state.cnt === 0) {
|
|
207
|
+
wasm.__wbindgen_export_5.get(state.dtor)(a, state.b);
|
|
208
|
+
CLOSURE_DTORS.unregister(state);
|
|
209
|
+
} else {
|
|
210
|
+
state.a = a;
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
};
|
|
214
|
+
real.original = state;
|
|
215
|
+
CLOSURE_DTORS.register(real, state, state);
|
|
216
|
+
return real;
|
|
217
|
+
}
|
|
218
|
+
|
|
185
219
|
function passArray8ToWasm0(arg, malloc) {
|
|
186
220
|
const ptr = malloc(arg.length * 1, 1) >>> 0;
|
|
187
221
|
getUint8ArrayMemory0().set(arg, ptr / 1);
|
|
@@ -210,25 +244,33 @@ export function parseDuc(buf) {
|
|
|
210
244
|
}
|
|
211
245
|
|
|
212
246
|
/**
|
|
213
|
-
*
|
|
214
|
-
*
|
|
215
|
-
* Returns a JS object `{ versionNumber, schemaVersion, data, fromCheckpoint }`.
|
|
216
|
-
* @param {Uint8Array} duc_buf
|
|
217
|
-
* @param {string} checkpoint_id
|
|
247
|
+
* Parse a `.duc` file lazily — returns everything EXCEPT external file data blobs.
|
|
248
|
+
* @param {Uint8Array} buf
|
|
218
249
|
* @returns {any}
|
|
219
250
|
*/
|
|
220
|
-
export function
|
|
221
|
-
const ptr0 = passArray8ToWasm0(
|
|
251
|
+
export function parseDucLazy(buf) {
|
|
252
|
+
const ptr0 = passArray8ToWasm0(buf, wasm.__wbindgen_malloc);
|
|
222
253
|
const len0 = WASM_VECTOR_LEN;
|
|
223
|
-
const
|
|
224
|
-
const len1 = WASM_VECTOR_LEN;
|
|
225
|
-
const ret = wasm.restoreCheckpoint(ptr0, len0, ptr1, len1);
|
|
254
|
+
const ret = wasm.parseDucLazy(ptr0, len0);
|
|
226
255
|
if (ret[2]) {
|
|
227
256
|
throw takeFromExternrefTable0(ret[1]);
|
|
228
257
|
}
|
|
229
258
|
return takeFromExternrefTable0(ret[0]);
|
|
230
259
|
}
|
|
231
260
|
|
|
261
|
+
/**
|
|
262
|
+
* Returns the current version-control schema version defined in Rust.
|
|
263
|
+
*
|
|
264
|
+
* TypeScript should use this as the source of truth instead of hardcoding
|
|
265
|
+
* its own constant. When this value is bumped in Rust, the version control
|
|
266
|
+
* system will automatically handle migration bookkeeping (closing old chains,
|
|
267
|
+
* recording migrations) the next time a checkpoint or delta is created.
|
|
268
|
+
* @returns {number}
|
|
269
|
+
*/
|
|
270
|
+
export function getCurrentSchemaVersion() {
|
|
271
|
+
return 4000000;
|
|
272
|
+
}
|
|
273
|
+
|
|
232
274
|
/**
|
|
233
275
|
* Compute a checkpoint-relative binary diff changeset using bsdiff.
|
|
234
276
|
*
|
|
@@ -256,26 +298,6 @@ export function createDeltaChangeset(base_state, current_state) {
|
|
|
256
298
|
return v3;
|
|
257
299
|
}
|
|
258
300
|
|
|
259
|
-
/**
|
|
260
|
-
* Fetch a single external file from a `.duc` buffer by file ID.
|
|
261
|
-
*
|
|
262
|
-
* Returns the file entry as a JS object, or `undefined` if not found.
|
|
263
|
-
* @param {Uint8Array} buf
|
|
264
|
-
* @param {string} file_id
|
|
265
|
-
* @returns {any}
|
|
266
|
-
*/
|
|
267
|
-
export function getExternalFile(buf, file_id) {
|
|
268
|
-
const ptr0 = passArray8ToWasm0(buf, wasm.__wbindgen_malloc);
|
|
269
|
-
const len0 = WASM_VECTOR_LEN;
|
|
270
|
-
const ptr1 = passStringToWasm0(file_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
271
|
-
const len1 = WASM_VECTOR_LEN;
|
|
272
|
-
const ret = wasm.getExternalFile(ptr0, len0, ptr1, len1);
|
|
273
|
-
if (ret[2]) {
|
|
274
|
-
throw takeFromExternrefTable0(ret[1]);
|
|
275
|
-
}
|
|
276
|
-
return takeFromExternrefTable0(ret[0]);
|
|
277
|
-
}
|
|
278
|
-
|
|
279
301
|
/**
|
|
280
302
|
* Apply a changeset to reconstruct document state.
|
|
281
303
|
*
|
|
@@ -303,14 +325,34 @@ export function applyDeltaChangeset(base_state, changeset) {
|
|
|
303
325
|
}
|
|
304
326
|
|
|
305
327
|
/**
|
|
306
|
-
*
|
|
328
|
+
* Serialize a JS object (ExportedDataState) into `.duc` bytes (Uint8Array).
|
|
329
|
+
* @param {any} data
|
|
330
|
+
* @returns {Uint8Array}
|
|
331
|
+
*/
|
|
332
|
+
export function serializeDuc(data) {
|
|
333
|
+
const ret = wasm.serializeDuc(data);
|
|
334
|
+
if (ret[3]) {
|
|
335
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
336
|
+
}
|
|
337
|
+
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
338
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
339
|
+
return v1;
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
/**
|
|
343
|
+
* Fetch a single external file from a `.duc` buffer by file ID.
|
|
344
|
+
*
|
|
345
|
+
* Returns the file's binary data as a Uint8Array, or `undefined` if not found.
|
|
307
346
|
* @param {Uint8Array} buf
|
|
347
|
+
* @param {string} file_id
|
|
308
348
|
* @returns {any}
|
|
309
349
|
*/
|
|
310
|
-
export function
|
|
350
|
+
export function getExternalFile(buf, file_id) {
|
|
311
351
|
const ptr0 = passArray8ToWasm0(buf, wasm.__wbindgen_malloc);
|
|
312
352
|
const len0 = WASM_VECTOR_LEN;
|
|
313
|
-
const
|
|
353
|
+
const ptr1 = passStringToWasm0(file_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
354
|
+
const len1 = WASM_VECTOR_LEN;
|
|
355
|
+
const ret = wasm.getExternalFile(ptr0, len0, ptr1, len1);
|
|
314
356
|
if (ret[2]) {
|
|
315
357
|
throw takeFromExternrefTable0(ret[1]);
|
|
316
358
|
}
|
|
@@ -318,17 +360,14 @@ export function listExternalFiles(buf) {
|
|
|
318
360
|
}
|
|
319
361
|
|
|
320
362
|
/**
|
|
321
|
-
*
|
|
322
|
-
*
|
|
323
|
-
* Returns a JS object matching the `VersionGraph` TypeScript interface,
|
|
324
|
-
* or `undefined` if no version graph exists.
|
|
325
|
-
* @param {Uint8Array} duc_buf
|
|
363
|
+
* List metadata for all external files (without loading the heavy data blobs).
|
|
364
|
+
* @param {Uint8Array} buf
|
|
326
365
|
* @returns {any}
|
|
327
366
|
*/
|
|
328
|
-
export function
|
|
329
|
-
const ptr0 = passArray8ToWasm0(
|
|
367
|
+
export function listExternalFiles(buf) {
|
|
368
|
+
const ptr0 = passArray8ToWasm0(buf, wasm.__wbindgen_malloc);
|
|
330
369
|
const len0 = WASM_VECTOR_LEN;
|
|
331
|
-
const ret = wasm.
|
|
370
|
+
const ret = wasm.listExternalFiles(ptr0, len0);
|
|
332
371
|
if (ret[2]) {
|
|
333
372
|
throw takeFromExternrefTable0(ret[1]);
|
|
334
373
|
}
|
|
@@ -336,16 +375,15 @@ export function readVersionGraph(duc_buf) {
|
|
|
336
375
|
}
|
|
337
376
|
|
|
338
377
|
/**
|
|
339
|
-
*
|
|
340
|
-
*
|
|
341
|
-
* Returns a JS array of `VersionEntry` objects (no heavy data blobs).
|
|
378
|
+
* Restore the document state at `version_number` from a `.duc` file buffer.
|
|
342
379
|
* @param {Uint8Array} duc_buf
|
|
380
|
+
* @param {number} version_number
|
|
343
381
|
* @returns {any}
|
|
344
382
|
*/
|
|
345
|
-
export function
|
|
383
|
+
export function restoreVersion(duc_buf, version_number) {
|
|
346
384
|
const ptr0 = passArray8ToWasm0(duc_buf, wasm.__wbindgen_malloc);
|
|
347
385
|
const len0 = WASM_VECTOR_LEN;
|
|
348
|
-
const ret = wasm.
|
|
386
|
+
const ret = wasm.restoreVersion(ptr0, len0, version_number);
|
|
349
387
|
if (ret[2]) {
|
|
350
388
|
throw takeFromExternrefTable0(ret[1]);
|
|
351
389
|
}
|
|
@@ -353,16 +391,17 @@ export function listVersions(duc_buf) {
|
|
|
353
391
|
}
|
|
354
392
|
|
|
355
393
|
/**
|
|
356
|
-
*
|
|
357
|
-
*
|
|
358
|
-
*
|
|
359
|
-
* @param {Uint8Array} buf
|
|
394
|
+
* Restore a specific checkpoint by its ID from a `.duc` file buffer.
|
|
395
|
+
* @param {Uint8Array} duc_buf
|
|
396
|
+
* @param {string} checkpoint_id
|
|
360
397
|
* @returns {any}
|
|
361
398
|
*/
|
|
362
|
-
export function
|
|
363
|
-
const ptr0 = passArray8ToWasm0(
|
|
399
|
+
export function restoreCheckpoint(duc_buf, checkpoint_id) {
|
|
400
|
+
const ptr0 = passArray8ToWasm0(duc_buf, wasm.__wbindgen_malloc);
|
|
364
401
|
const len0 = WASM_VECTOR_LEN;
|
|
365
|
-
const
|
|
402
|
+
const ptr1 = passStringToWasm0(checkpoint_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
403
|
+
const len1 = WASM_VECTOR_LEN;
|
|
404
|
+
const ret = wasm.restoreCheckpoint(ptr0, len0, ptr1, len1);
|
|
366
405
|
if (ret[2]) {
|
|
367
406
|
throw takeFromExternrefTable0(ret[1]);
|
|
368
407
|
}
|
|
@@ -370,20 +409,14 @@ export function parseDucLazy(buf) {
|
|
|
370
409
|
}
|
|
371
410
|
|
|
372
411
|
/**
|
|
373
|
-
*
|
|
374
|
-
*
|
|
375
|
-
* The `.duc` file is a SQLite database — this function opens it and queries
|
|
376
|
-
* the `checkpoints` / `deltas` tables directly for version restoration.
|
|
377
|
-
*
|
|
378
|
-
* Returns a JS object `{ versionNumber, schemaVersion, data, fromCheckpoint }`.
|
|
412
|
+
* List all versions (checkpoints + deltas) from a `.duc` file buffer.
|
|
379
413
|
* @param {Uint8Array} duc_buf
|
|
380
|
-
* @param {number} version_number
|
|
381
414
|
* @returns {any}
|
|
382
415
|
*/
|
|
383
|
-
export function
|
|
416
|
+
export function listVersions(duc_buf) {
|
|
384
417
|
const ptr0 = passArray8ToWasm0(duc_buf, wasm.__wbindgen_malloc);
|
|
385
418
|
const len0 = WASM_VECTOR_LEN;
|
|
386
|
-
const ret = wasm.
|
|
419
|
+
const ret = wasm.listVersions(ptr0, len0);
|
|
387
420
|
if (ret[2]) {
|
|
388
421
|
throw takeFromExternrefTable0(ret[1]);
|
|
389
422
|
}
|
|
@@ -391,37 +424,22 @@ export function restoreVersion(duc_buf, version_number) {
|
|
|
391
424
|
}
|
|
392
425
|
|
|
393
426
|
/**
|
|
394
|
-
*
|
|
395
|
-
* @param {
|
|
396
|
-
* @returns {
|
|
427
|
+
* Read the full VersionGraph from a `.duc` file buffer.
|
|
428
|
+
* @param {Uint8Array} duc_buf
|
|
429
|
+
* @returns {any}
|
|
397
430
|
*/
|
|
398
|
-
export function
|
|
399
|
-
const
|
|
400
|
-
|
|
401
|
-
|
|
431
|
+
export function readVersionGraph(duc_buf) {
|
|
432
|
+
const ptr0 = passArray8ToWasm0(duc_buf, wasm.__wbindgen_malloc);
|
|
433
|
+
const len0 = WASM_VECTOR_LEN;
|
|
434
|
+
const ret = wasm.readVersionGraph(ptr0, len0);
|
|
435
|
+
if (ret[2]) {
|
|
436
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
402
437
|
}
|
|
403
|
-
|
|
404
|
-
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
405
|
-
return v1;
|
|
406
|
-
}
|
|
407
|
-
|
|
408
|
-
/**
|
|
409
|
-
* Returns the current version-control schema version defined in Rust.
|
|
410
|
-
*
|
|
411
|
-
* TypeScript should use this as the source of truth instead of hardcoding
|
|
412
|
-
* its own constant. When this value is bumped in Rust, the version control
|
|
413
|
-
* system will automatically handle migration bookkeeping (closing old chains,
|
|
414
|
-
* recording migrations) the next time a checkpoint or delta is created.
|
|
415
|
-
* @returns {number}
|
|
416
|
-
*/
|
|
417
|
-
export function getCurrentSchemaVersion() {
|
|
418
|
-
return 3000007;
|
|
438
|
+
return takeFromExternrefTable0(ret[0]);
|
|
419
439
|
}
|
|
420
440
|
|
|
421
441
|
/**
|
|
422
442
|
* Revert the document to a specific version, removing all newer versions.
|
|
423
|
-
*
|
|
424
|
-
* Returns a JS object `{ versionNumber, schemaVersion, data, fromCheckpoint }`.
|
|
425
443
|
* @param {Uint8Array} duc_buf
|
|
426
444
|
* @param {number} target_version
|
|
427
445
|
* @returns {any}
|
|
@@ -436,6 +454,479 @@ export function revertToVersion(duc_buf, target_version) {
|
|
|
436
454
|
return takeFromExternrefTable0(ret[0]);
|
|
437
455
|
}
|
|
438
456
|
|
|
457
|
+
function __wbg_adapter_16(arg0, arg1, arg2) {
|
|
458
|
+
wasm.closure99_externref_shim(arg0, arg1, arg2);
|
|
459
|
+
}
|
|
460
|
+
|
|
461
|
+
function __wbg_adapter_129(arg0, arg1, arg2, arg3) {
|
|
462
|
+
wasm.closure80_externref_shim(arg0, arg1, arg2, arg3);
|
|
463
|
+
}
|
|
464
|
+
|
|
465
|
+
const DucOpfsDocumentFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
466
|
+
? { register: () => {}, unregister: () => {} }
|
|
467
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_ducopfsdocument_free(ptr >>> 0, 1));
|
|
468
|
+
|
|
469
|
+
export class DucOpfsDocument {
|
|
470
|
+
|
|
471
|
+
static __wrap(ptr) {
|
|
472
|
+
ptr = ptr >>> 0;
|
|
473
|
+
const obj = Object.create(DucOpfsDocument.prototype);
|
|
474
|
+
obj.__wbg_ptr = ptr;
|
|
475
|
+
DucOpfsDocumentFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
476
|
+
return obj;
|
|
477
|
+
}
|
|
478
|
+
|
|
479
|
+
__destroy_into_raw() {
|
|
480
|
+
const ptr = this.__wbg_ptr;
|
|
481
|
+
this.__wbg_ptr = 0;
|
|
482
|
+
DucOpfsDocumentFinalization.unregister(this);
|
|
483
|
+
return ptr;
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
free() {
|
|
487
|
+
const ptr = this.__destroy_into_raw();
|
|
488
|
+
wasm.__wbg_ducopfsdocument_free(ptr, 0);
|
|
489
|
+
}
|
|
490
|
+
/**
|
|
491
|
+
* @param {string} name
|
|
492
|
+
* @param {string} namespace
|
|
493
|
+
* @returns {Promise<DucOpfsDocument>}
|
|
494
|
+
*/
|
|
495
|
+
static openInPool(name, namespace) {
|
|
496
|
+
const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
497
|
+
const len0 = WASM_VECTOR_LEN;
|
|
498
|
+
const ptr1 = passStringToWasm0(namespace, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
499
|
+
const len1 = WASM_VECTOR_LEN;
|
|
500
|
+
const ret = wasm.ducopfsdocument_openInPool(ptr0, len0, ptr1, len1);
|
|
501
|
+
return ret;
|
|
502
|
+
}
|
|
503
|
+
/**
|
|
504
|
+
* Read a chunk from the SQLite database backing this OPFS document.
|
|
505
|
+
*
|
|
506
|
+
* Call [`checkpointWal`] first so the main database file contains all
|
|
507
|
+
* committed data. JavaScript can gzip successive chunks without loading
|
|
508
|
+
* the whole database into WASM memory.
|
|
509
|
+
* @param {number} offset_bytes
|
|
510
|
+
* @param {number} length
|
|
511
|
+
* @returns {Promise<Uint8Array>}
|
|
512
|
+
*/
|
|
513
|
+
exportDbChunk(offset_bytes, length) {
|
|
514
|
+
const ret = wasm.ducopfsdocument_exportDbChunk(this.__wbg_ptr, offset_bytes, length);
|
|
515
|
+
return ret;
|
|
516
|
+
}
|
|
517
|
+
/**
|
|
518
|
+
* @returns {Promise<any>}
|
|
519
|
+
*/
|
|
520
|
+
static listOpfsDatabases() {
|
|
521
|
+
const ret = wasm.ducopfsdocument_listOpfsDatabases();
|
|
522
|
+
return ret;
|
|
523
|
+
}
|
|
524
|
+
/**
|
|
525
|
+
* @param {string} name
|
|
526
|
+
* @returns {Promise<boolean>}
|
|
527
|
+
*/
|
|
528
|
+
static deleteOpfsDatabase(name) {
|
|
529
|
+
const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
530
|
+
const len0 = WASM_VECTOR_LEN;
|
|
531
|
+
const ret = wasm.ducopfsdocument_deleteOpfsDatabase(ptr0, len0);
|
|
532
|
+
return ret;
|
|
533
|
+
}
|
|
534
|
+
/**
|
|
535
|
+
* @param {string} namespace
|
|
536
|
+
* @returns {Promise<any>}
|
|
537
|
+
*/
|
|
538
|
+
static listOpfsDatabasesInPool(namespace) {
|
|
539
|
+
const ptr0 = passStringToWasm0(namespace, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
540
|
+
const len0 = WASM_VECTOR_LEN;
|
|
541
|
+
const ret = wasm.ducopfsdocument_listOpfsDatabasesInPool(ptr0, len0);
|
|
542
|
+
return ret;
|
|
543
|
+
}
|
|
544
|
+
/**
|
|
545
|
+
* @param {string} name
|
|
546
|
+
* @param {string} namespace
|
|
547
|
+
* @returns {Promise<boolean>}
|
|
548
|
+
*/
|
|
549
|
+
static deleteOpfsDatabaseInPool(name, namespace) {
|
|
550
|
+
const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
551
|
+
const len0 = WASM_VECTOR_LEN;
|
|
552
|
+
const ptr1 = passStringToWasm0(namespace, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
553
|
+
const len1 = WASM_VECTOR_LEN;
|
|
554
|
+
const ret = wasm.ducopfsdocument_deleteOpfsDatabaseInPool(ptr0, len0, ptr1, len1);
|
|
555
|
+
return ret;
|
|
556
|
+
}
|
|
557
|
+
/**
|
|
558
|
+
* Open or create a persistent OPFS-backed DUC SQLite document.
|
|
559
|
+
*
|
|
560
|
+
* This must run from a Dedicated Worker because the OPFS SAH-pool VFS uses
|
|
561
|
+
* FileSystemSyncAccessHandle.
|
|
562
|
+
* @param {string} name
|
|
563
|
+
* @returns {Promise<DucOpfsDocument>}
|
|
564
|
+
*/
|
|
565
|
+
static open(name) {
|
|
566
|
+
const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
567
|
+
const len0 = WASM_VECTOR_LEN;
|
|
568
|
+
const ret = wasm.ducopfsdocument_open(ptr0, len0);
|
|
569
|
+
return ret;
|
|
570
|
+
}
|
|
571
|
+
/**
|
|
572
|
+
* Return the filename used to open this document.
|
|
573
|
+
* @returns {string}
|
|
574
|
+
*/
|
|
575
|
+
getFilename() {
|
|
576
|
+
let deferred1_0;
|
|
577
|
+
let deferred1_1;
|
|
578
|
+
try {
|
|
579
|
+
const ret = wasm.ducopfsdocument_getFilename(this.__wbg_ptr);
|
|
580
|
+
deferred1_0 = ret[0];
|
|
581
|
+
deferred1_1 = ret[1];
|
|
582
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
583
|
+
} finally {
|
|
584
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
585
|
+
}
|
|
586
|
+
}
|
|
587
|
+
/**
|
|
588
|
+
* Execute an arbitrary SQL batch (e.g. `VACUUM INTO 'export.sqlite'`).
|
|
589
|
+
* @param {string} sql
|
|
590
|
+
*/
|
|
591
|
+
executeBatch(sql) {
|
|
592
|
+
const ptr0 = passStringToWasm0(sql, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
593
|
+
const len0 = WASM_VECTOR_LEN;
|
|
594
|
+
const ret = wasm.ducopfsdocument_executeBatch(this.__wbg_ptr, ptr0, len0);
|
|
595
|
+
if (ret[1]) {
|
|
596
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
597
|
+
}
|
|
598
|
+
}
|
|
599
|
+
/**
|
|
600
|
+
* @returns {any}
|
|
601
|
+
*/
|
|
602
|
+
listVersions() {
|
|
603
|
+
const ret = wasm.ducopfsdocument_listVersions(this.__wbg_ptr);
|
|
604
|
+
if (ret[2]) {
|
|
605
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
606
|
+
}
|
|
607
|
+
return takeFromExternrefTable0(ret[0]);
|
|
608
|
+
}
|
|
609
|
+
/**
|
|
610
|
+
* Flush the WAL journal into the main database file.
|
|
611
|
+
*
|
|
612
|
+
* After calling this, the OPFS file backing this document contains
|
|
613
|
+
* all committed data. JavaScript can then read the file directly
|
|
614
|
+
* from OPFS in chunks and gzip-compress it.
|
|
615
|
+
*/
|
|
616
|
+
checkpointWal() {
|
|
617
|
+
const ret = wasm.ducopfsdocument_checkpointWal(this.__wbg_ptr);
|
|
618
|
+
if (ret[1]) {
|
|
619
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
620
|
+
}
|
|
621
|
+
}
|
|
622
|
+
/**
|
|
623
|
+
* Return the estimated database file size in bytes
|
|
624
|
+
* (`page_count × page_size`). Call [`checkpoint_wal`] first for
|
|
625
|
+
* an accurate value.
|
|
626
|
+
* @returns {number}
|
|
627
|
+
*/
|
|
628
|
+
getDbSizeBytes() {
|
|
629
|
+
const ret = wasm.ducopfsdocument_getDbSizeBytes(this.__wbg_ptr);
|
|
630
|
+
if (ret[2]) {
|
|
631
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
632
|
+
}
|
|
633
|
+
return ret[0];
|
|
634
|
+
}
|
|
635
|
+
/**
|
|
636
|
+
* @returns {any}
|
|
637
|
+
*/
|
|
638
|
+
readVersionGraph() {
|
|
639
|
+
const ret = wasm.ducopfsdocument_readVersionGraph(this.__wbg_ptr);
|
|
640
|
+
if (ret[2]) {
|
|
641
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
642
|
+
}
|
|
643
|
+
return takeFromExternrefTable0(ret[0]);
|
|
644
|
+
}
|
|
645
|
+
/**
|
|
646
|
+
* @returns {any}
|
|
647
|
+
*/
|
|
648
|
+
listExternalFiles() {
|
|
649
|
+
const ret = wasm.ducopfsdocument_listExternalFiles(this.__wbg_ptr);
|
|
650
|
+
if (ret[2]) {
|
|
651
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
652
|
+
}
|
|
653
|
+
return takeFromExternrefTable0(ret[0]);
|
|
654
|
+
}
|
|
655
|
+
/**
|
|
656
|
+
* @returns {any}
|
|
657
|
+
*/
|
|
658
|
+
readDocumentState() {
|
|
659
|
+
const ret = wasm.ducopfsdocument_readDocumentState(this.__wbg_ptr);
|
|
660
|
+
if (ret[2]) {
|
|
661
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
662
|
+
}
|
|
663
|
+
return takeFromExternrefTable0(ret[0]);
|
|
664
|
+
}
|
|
665
|
+
/**
|
|
666
|
+
* @param {any} data
|
|
667
|
+
*/
|
|
668
|
+
writeDocumentState(data) {
|
|
669
|
+
const ret = wasm.ducopfsdocument_writeDocumentState(this.__wbg_ptr, data);
|
|
670
|
+
if (ret[1]) {
|
|
671
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
672
|
+
}
|
|
673
|
+
}
|
|
674
|
+
/**
|
|
675
|
+
* @param {string} checkpoint_id
|
|
676
|
+
* @param {number} chunk_index
|
|
677
|
+
* @returns {any}
|
|
678
|
+
*/
|
|
679
|
+
readCheckpointDataChunk(checkpoint_id, chunk_index) {
|
|
680
|
+
const ptr0 = passStringToWasm0(checkpoint_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
681
|
+
const len0 = WASM_VECTOR_LEN;
|
|
682
|
+
const ret = wasm.ducopfsdocument_readCheckpointDataChunk(this.__wbg_ptr, ptr0, len0, chunk_index);
|
|
683
|
+
if (ret[2]) {
|
|
684
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
685
|
+
}
|
|
686
|
+
return takeFromExternrefTable0(ret[0]);
|
|
687
|
+
}
|
|
688
|
+
/**
|
|
689
|
+
* @param {string} delta_id
|
|
690
|
+
* @param {number} chunk_index
|
|
691
|
+
* @returns {any}
|
|
692
|
+
*/
|
|
693
|
+
readDeltaChangesetChunk(delta_id, chunk_index) {
|
|
694
|
+
const ptr0 = passStringToWasm0(delta_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
695
|
+
const len0 = WASM_VECTOR_LEN;
|
|
696
|
+
const ret = wasm.ducopfsdocument_readDeltaChangesetChunk(this.__wbg_ptr, ptr0, len0, chunk_index);
|
|
697
|
+
if (ret[2]) {
|
|
698
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
699
|
+
}
|
|
700
|
+
return takeFromExternrefTable0(ret[0]);
|
|
701
|
+
}
|
|
702
|
+
/**
|
|
703
|
+
* @param {string} checkpoint_id
|
|
704
|
+
* @param {number} chunk_index
|
|
705
|
+
* @param {number} offset_bytes
|
|
706
|
+
* @param {Uint8Array} data
|
|
707
|
+
*/
|
|
708
|
+
writeCheckpointDataChunk(checkpoint_id, chunk_index, offset_bytes, data) {
|
|
709
|
+
const ptr0 = passStringToWasm0(checkpoint_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
710
|
+
const len0 = WASM_VECTOR_LEN;
|
|
711
|
+
const ptr1 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
|
|
712
|
+
const len1 = WASM_VECTOR_LEN;
|
|
713
|
+
const ret = wasm.ducopfsdocument_writeCheckpointDataChunk(this.__wbg_ptr, ptr0, len0, chunk_index, offset_bytes, ptr1, len1);
|
|
714
|
+
if (ret[1]) {
|
|
715
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
716
|
+
}
|
|
717
|
+
}
|
|
718
|
+
/**
|
|
719
|
+
* @param {string} delta_id
|
|
720
|
+
* @param {number} chunk_index
|
|
721
|
+
* @param {number} offset_bytes
|
|
722
|
+
* @param {Uint8Array} data
|
|
723
|
+
*/
|
|
724
|
+
writeDeltaChangesetChunk(delta_id, chunk_index, offset_bytes, data) {
|
|
725
|
+
const ptr0 = passStringToWasm0(delta_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
726
|
+
const len0 = WASM_VECTOR_LEN;
|
|
727
|
+
const ptr1 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
|
|
728
|
+
const len1 = WASM_VECTOR_LEN;
|
|
729
|
+
const ret = wasm.ducopfsdocument_writeDeltaChangesetChunk(this.__wbg_ptr, ptr0, len0, chunk_index, offset_bytes, ptr1, len1);
|
|
730
|
+
if (ret[1]) {
|
|
731
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
732
|
+
}
|
|
733
|
+
}
|
|
734
|
+
/**
|
|
735
|
+
* @param {string} checkpoint_id
|
|
736
|
+
*/
|
|
737
|
+
clearCheckpointDataChunks(checkpoint_id) {
|
|
738
|
+
const ptr0 = passStringToWasm0(checkpoint_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
739
|
+
const len0 = WASM_VECTOR_LEN;
|
|
740
|
+
const ret = wasm.ducopfsdocument_clearCheckpointDataChunks(this.__wbg_ptr, ptr0, len0);
|
|
741
|
+
if (ret[1]) {
|
|
742
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
743
|
+
}
|
|
744
|
+
}
|
|
745
|
+
/**
|
|
746
|
+
* @param {string} delta_id
|
|
747
|
+
*/
|
|
748
|
+
clearDeltaChangesetChunks(delta_id) {
|
|
749
|
+
const ptr0 = passStringToWasm0(delta_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
750
|
+
const len0 = WASM_VECTOR_LEN;
|
|
751
|
+
const ret = wasm.ducopfsdocument_clearDeltaChangesetChunks(this.__wbg_ptr, ptr0, len0);
|
|
752
|
+
if (ret[1]) {
|
|
753
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
754
|
+
}
|
|
755
|
+
}
|
|
756
|
+
/**
|
|
757
|
+
* @param {string} revision_id
|
|
758
|
+
* @param {number} chunk_index
|
|
759
|
+
* @returns {any}
|
|
760
|
+
*/
|
|
761
|
+
readExternalFileRevisionChunk(revision_id, chunk_index) {
|
|
762
|
+
const ptr0 = passStringToWasm0(revision_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
763
|
+
const len0 = WASM_VECTOR_LEN;
|
|
764
|
+
const ret = wasm.ducopfsdocument_readExternalFileRevisionChunk(this.__wbg_ptr, ptr0, len0, chunk_index);
|
|
765
|
+
if (ret[2]) {
|
|
766
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
767
|
+
}
|
|
768
|
+
return takeFromExternrefTable0(ret[0]);
|
|
769
|
+
}
|
|
770
|
+
/**
|
|
771
|
+
* Read a bounded byte range, including from legacy one-row BLOB revisions.
|
|
772
|
+
* @param {string} revision_id
|
|
773
|
+
* @param {number} offset_bytes
|
|
774
|
+
* @param {number} length_bytes
|
|
775
|
+
* @returns {any}
|
|
776
|
+
*/
|
|
777
|
+
readExternalFileRevisionRange(revision_id, offset_bytes, length_bytes) {
|
|
778
|
+
const ptr0 = passStringToWasm0(revision_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
779
|
+
const len0 = WASM_VECTOR_LEN;
|
|
780
|
+
const ret = wasm.ducopfsdocument_readExternalFileRevisionRange(this.__wbg_ptr, ptr0, len0, offset_bytes, length_bytes);
|
|
781
|
+
if (ret[2]) {
|
|
782
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
783
|
+
}
|
|
784
|
+
return takeFromExternrefTable0(ret[0]);
|
|
785
|
+
}
|
|
786
|
+
/**
|
|
787
|
+
* Read a bounded batch of external-file chunks with one SQL query and one
|
|
788
|
+
* JS/WASM call. Batches are capped at 4 chunks to bound peak memory.
|
|
789
|
+
* @param {string} revision_id
|
|
790
|
+
* @param {number} start_chunk_index
|
|
791
|
+
* @param {number} max_chunks
|
|
792
|
+
* @returns {Array<any>}
|
|
793
|
+
*/
|
|
794
|
+
readExternalFileRevisionChunks(revision_id, start_chunk_index, max_chunks) {
|
|
795
|
+
const ptr0 = passStringToWasm0(revision_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
796
|
+
const len0 = WASM_VECTOR_LEN;
|
|
797
|
+
const ret = wasm.ducopfsdocument_readExternalFileRevisionChunks(this.__wbg_ptr, ptr0, len0, start_chunk_index, max_chunks);
|
|
798
|
+
if (ret[2]) {
|
|
799
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
800
|
+
}
|
|
801
|
+
return takeFromExternrefTable0(ret[0]);
|
|
802
|
+
}
|
|
803
|
+
/**
|
|
804
|
+
* @param {string} revision_id
|
|
805
|
+
* @param {number} chunk_index
|
|
806
|
+
* @param {number} offset_bytes
|
|
807
|
+
* @param {Uint8Array} data
|
|
808
|
+
*/
|
|
809
|
+
writeExternalFileRevisionChunk(revision_id, chunk_index, offset_bytes, data) {
|
|
810
|
+
const ptr0 = passStringToWasm0(revision_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
811
|
+
const len0 = WASM_VECTOR_LEN;
|
|
812
|
+
const ptr1 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
|
|
813
|
+
const len1 = WASM_VECTOR_LEN;
|
|
814
|
+
const ret = wasm.ducopfsdocument_writeExternalFileRevisionChunk(this.__wbg_ptr, ptr0, len0, chunk_index, offset_bytes, ptr1, len1);
|
|
815
|
+
if (ret[1]) {
|
|
816
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
817
|
+
}
|
|
818
|
+
}
|
|
819
|
+
/**
|
|
820
|
+
* @param {string} revision_id
|
|
821
|
+
*/
|
|
822
|
+
clearExternalFileRevisionChunks(revision_id) {
|
|
823
|
+
const ptr0 = passStringToWasm0(revision_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
824
|
+
const len0 = WASM_VECTOR_LEN;
|
|
825
|
+
const ret = wasm.ducopfsdocument_clearExternalFileRevisionChunks(this.__wbg_ptr, ptr0, len0);
|
|
826
|
+
if (ret[1]) {
|
|
827
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
828
|
+
}
|
|
829
|
+
}
|
|
830
|
+
}
|
|
831
|
+
if (Symbol.dispose) DucOpfsDocument.prototype[Symbol.dispose] = DucOpfsDocument.prototype.free;
|
|
832
|
+
|
|
833
|
+
const DucOpfsImporterFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
834
|
+
? { register: () => {}, unregister: () => {} }
|
|
835
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_ducopfsimporter_free(ptr >>> 0, 1));
|
|
836
|
+
/**
|
|
837
|
+
* Incrementally replaces one OPFS database without retaining the imported
|
|
838
|
+
* SQLite payload in WASM memory.
|
|
839
|
+
*/
|
|
840
|
+
export class DucOpfsImporter {
|
|
841
|
+
|
|
842
|
+
static __wrap(ptr) {
|
|
843
|
+
ptr = ptr >>> 0;
|
|
844
|
+
const obj = Object.create(DucOpfsImporter.prototype);
|
|
845
|
+
obj.__wbg_ptr = ptr;
|
|
846
|
+
DucOpfsImporterFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
847
|
+
return obj;
|
|
848
|
+
}
|
|
849
|
+
|
|
850
|
+
__destroy_into_raw() {
|
|
851
|
+
const ptr = this.__wbg_ptr;
|
|
852
|
+
this.__wbg_ptr = 0;
|
|
853
|
+
DucOpfsImporterFinalization.unregister(this);
|
|
854
|
+
return ptr;
|
|
855
|
+
}
|
|
856
|
+
|
|
857
|
+
free() {
|
|
858
|
+
const ptr = this.__destroy_into_raw();
|
|
859
|
+
wasm.__wbg_ducopfsimporter_free(ptr, 0);
|
|
860
|
+
}
|
|
861
|
+
/**
|
|
862
|
+
* @param {string} name
|
|
863
|
+
* @param {string} namespace
|
|
864
|
+
* @returns {Promise<DucOpfsImporter>}
|
|
865
|
+
*/
|
|
866
|
+
static beginInPool(name, namespace) {
|
|
867
|
+
const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
868
|
+
const len0 = WASM_VECTOR_LEN;
|
|
869
|
+
const ptr1 = passStringToWasm0(namespace, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
870
|
+
const len1 = WASM_VECTOR_LEN;
|
|
871
|
+
const ret = wasm.ducopfsimporter_beginInPool(ptr0, len0, ptr1, len1);
|
|
872
|
+
return ret;
|
|
873
|
+
}
|
|
874
|
+
/**
|
|
875
|
+
* Begin replacing `name`. Any prior database with the same closed name is
|
|
876
|
+
* released back to the SAH pool before the new import claims a slot.
|
|
877
|
+
* @param {string} name
|
|
878
|
+
* @returns {Promise<DucOpfsImporter>}
|
|
879
|
+
*/
|
|
880
|
+
static begin(name) {
|
|
881
|
+
const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
882
|
+
const len0 = WASM_VECTOR_LEN;
|
|
883
|
+
const ret = wasm.ducopfsimporter_begin(ptr0, len0);
|
|
884
|
+
return ret;
|
|
885
|
+
}
|
|
886
|
+
/**
|
|
887
|
+
* Write the next decompressed SQLite chunk.
|
|
888
|
+
* @param {Uint8Array} data
|
|
889
|
+
*/
|
|
890
|
+
writeChunk(data) {
|
|
891
|
+
const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
|
|
892
|
+
const len0 = WASM_VECTOR_LEN;
|
|
893
|
+
const ret = wasm.ducopfsimporter_writeChunk(this.__wbg_ptr, ptr0, len0);
|
|
894
|
+
if (ret[1]) {
|
|
895
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
896
|
+
}
|
|
897
|
+
}
|
|
898
|
+
/**
|
|
899
|
+
* @returns {number}
|
|
900
|
+
*/
|
|
901
|
+
getBytesWritten() {
|
|
902
|
+
const ret = wasm.ducopfsimporter_getBytesWritten(this.__wbg_ptr);
|
|
903
|
+
return ret;
|
|
904
|
+
}
|
|
905
|
+
/**
|
|
906
|
+
* Delete a partial import. Safe to call after a failed stream read.
|
|
907
|
+
* @returns {boolean}
|
|
908
|
+
*/
|
|
909
|
+
abort() {
|
|
910
|
+
const ret = wasm.ducopfsimporter_abort(this.__wbg_ptr);
|
|
911
|
+
if (ret[2]) {
|
|
912
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
913
|
+
}
|
|
914
|
+
return ret[0] !== 0;
|
|
915
|
+
}
|
|
916
|
+
/**
|
|
917
|
+
* Flush the imported database and make it ready for SQLite to open.
|
|
918
|
+
* @returns {number}
|
|
919
|
+
*/
|
|
920
|
+
finish() {
|
|
921
|
+
const ret = wasm.ducopfsimporter_finish(this.__wbg_ptr);
|
|
922
|
+
if (ret[2]) {
|
|
923
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
924
|
+
}
|
|
925
|
+
return ret[0];
|
|
926
|
+
}
|
|
927
|
+
}
|
|
928
|
+
if (Symbol.dispose) DucOpfsImporter.prototype[Symbol.dispose] = DucOpfsImporter.prototype.free;
|
|
929
|
+
|
|
439
930
|
const EXPECTED_RESPONSE_TYPES = new Set(['basic', 'cors', 'default']);
|
|
440
931
|
|
|
441
932
|
async function __wbg_load(module, imports) {
|
|
@@ -489,18 +980,57 @@ function __wbg_get_imports() {
|
|
|
489
980
|
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
490
981
|
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
491
982
|
};
|
|
983
|
+
imports.wbg.__wbg_buffer_8d40b1d762fb3c66 = function(arg0) {
|
|
984
|
+
const ret = arg0.buffer;
|
|
985
|
+
return ret;
|
|
986
|
+
};
|
|
987
|
+
imports.wbg.__wbg_byteLength_331a6b5545834024 = function(arg0) {
|
|
988
|
+
const ret = arg0.byteLength;
|
|
989
|
+
return ret;
|
|
990
|
+
};
|
|
991
|
+
imports.wbg.__wbg_byteOffset_49a5b5608000358b = function(arg0) {
|
|
992
|
+
const ret = arg0.byteOffset;
|
|
993
|
+
return ret;
|
|
994
|
+
};
|
|
492
995
|
imports.wbg.__wbg_call_13410aac570ffff7 = function() { return handleError(function (arg0, arg1) {
|
|
493
996
|
const ret = arg0.call(arg1);
|
|
494
997
|
return ret;
|
|
495
998
|
}, arguments) };
|
|
999
|
+
imports.wbg.__wbg_call_a5400b25a865cfd8 = function() { return handleError(function (arg0, arg1, arg2) {
|
|
1000
|
+
const ret = arg0.call(arg1, arg2);
|
|
1001
|
+
return ret;
|
|
1002
|
+
}, arguments) };
|
|
1003
|
+
imports.wbg.__wbg_createSyncAccessHandle_d06aab2e41a339b2 = function(arg0) {
|
|
1004
|
+
const ret = arg0.createSyncAccessHandle();
|
|
1005
|
+
return ret;
|
|
1006
|
+
};
|
|
496
1007
|
imports.wbg.__wbg_done_75ed0ee6dd243d9d = function(arg0) {
|
|
497
1008
|
const ret = arg0.done;
|
|
498
1009
|
return ret;
|
|
499
1010
|
};
|
|
1011
|
+
imports.wbg.__wbg_ducopfsdocument_new = function(arg0) {
|
|
1012
|
+
const ret = DucOpfsDocument.__wrap(arg0);
|
|
1013
|
+
return ret;
|
|
1014
|
+
};
|
|
1015
|
+
imports.wbg.__wbg_ducopfsimporter_new = function(arg0) {
|
|
1016
|
+
const ret = DucOpfsImporter.__wrap(arg0);
|
|
1017
|
+
return ret;
|
|
1018
|
+
};
|
|
1019
|
+
imports.wbg.__wbg_entries_1a3c3b9544532397 = function(arg0) {
|
|
1020
|
+
const ret = arg0.entries();
|
|
1021
|
+
return ret;
|
|
1022
|
+
};
|
|
500
1023
|
imports.wbg.__wbg_entries_2be2f15bd5554996 = function(arg0) {
|
|
501
1024
|
const ret = Object.entries(arg0);
|
|
502
1025
|
return ret;
|
|
503
1026
|
};
|
|
1027
|
+
imports.wbg.__wbg_fill_c8751cf67b766c70 = function(arg0, arg1, arg2, arg3) {
|
|
1028
|
+
const ret = arg0.fill(arg1, arg2 >>> 0, arg3 >>> 0);
|
|
1029
|
+
return ret;
|
|
1030
|
+
};
|
|
1031
|
+
imports.wbg.__wbg_flush_d2487a24f3bc3cf4 = function() { return handleError(function (arg0) {
|
|
1032
|
+
arg0.flush();
|
|
1033
|
+
}, arguments) };
|
|
504
1034
|
imports.wbg.__wbg_from_88bc52ce20ba6318 = function(arg0) {
|
|
505
1035
|
const ret = Array.from(arg0);
|
|
506
1036
|
return ret;
|
|
@@ -513,6 +1043,18 @@ function __wbg_get_imports() {
|
|
|
513
1043
|
const ret = arg0.getDay();
|
|
514
1044
|
return ret;
|
|
515
1045
|
};
|
|
1046
|
+
imports.wbg.__wbg_getDirectoryHandle_0fb26677897f1e21 = function(arg0, arg1, arg2, arg3) {
|
|
1047
|
+
const ret = arg0.getDirectoryHandle(getStringFromWasm0(arg1, arg2), arg3);
|
|
1048
|
+
return ret;
|
|
1049
|
+
};
|
|
1050
|
+
imports.wbg.__wbg_getDirectory_8564f4b4ae7ee35c = function(arg0) {
|
|
1051
|
+
const ret = arg0.getDirectory();
|
|
1052
|
+
return ret;
|
|
1053
|
+
};
|
|
1054
|
+
imports.wbg.__wbg_getFileHandle_9f23d09c2497fa5f = function(arg0, arg1, arg2, arg3) {
|
|
1055
|
+
const ret = arg0.getFileHandle(getStringFromWasm0(arg1, arg2), arg3);
|
|
1056
|
+
return ret;
|
|
1057
|
+
};
|
|
516
1058
|
imports.wbg.__wbg_getFullYear_e351a9fa7d2fab83 = function(arg0) {
|
|
517
1059
|
const ret = arg0.getFullYear();
|
|
518
1060
|
return ret;
|
|
@@ -536,6 +1078,10 @@ function __wbg_get_imports() {
|
|
|
536
1078
|
const ret = arg0.getSeconds();
|
|
537
1079
|
return ret;
|
|
538
1080
|
};
|
|
1081
|
+
imports.wbg.__wbg_getSize_56a06761973a6cd7 = function() { return handleError(function (arg0) {
|
|
1082
|
+
const ret = arg0.getSize();
|
|
1083
|
+
return ret;
|
|
1084
|
+
}, arguments) };
|
|
539
1085
|
imports.wbg.__wbg_getTime_6bb3f64e0f18f817 = function(arg0) {
|
|
540
1086
|
const ret = arg0.getTime();
|
|
541
1087
|
return ret;
|
|
@@ -544,6 +1090,10 @@ function __wbg_get_imports() {
|
|
|
544
1090
|
const ret = arg0.getTimezoneOffset();
|
|
545
1091
|
return ret;
|
|
546
1092
|
};
|
|
1093
|
+
imports.wbg.__wbg_getUint32_2dc0ed17b0324774 = function(arg0, arg1) {
|
|
1094
|
+
const ret = arg0.getUint32(arg1 >>> 0);
|
|
1095
|
+
return ret;
|
|
1096
|
+
};
|
|
547
1097
|
imports.wbg.__wbg_get_0da715ceaecea5c8 = function(arg0, arg1) {
|
|
548
1098
|
const ret = arg0[arg1 >>> 0];
|
|
549
1099
|
return ret;
|
|
@@ -552,6 +1102,10 @@ function __wbg_get_imports() {
|
|
|
552
1102
|
const ret = Reflect.get(arg0, arg1);
|
|
553
1103
|
return ret;
|
|
554
1104
|
}, arguments) };
|
|
1105
|
+
imports.wbg.__wbg_getindex_61bb13d19869849b = function(arg0, arg1) {
|
|
1106
|
+
const ret = arg0[arg1 >>> 0];
|
|
1107
|
+
return ret;
|
|
1108
|
+
};
|
|
555
1109
|
imports.wbg.__wbg_getwithrefkey_1dc361bd10053bfe = function(arg0, arg1) {
|
|
556
1110
|
const ret = arg0[arg1];
|
|
557
1111
|
return ret;
|
|
@@ -586,6 +1140,16 @@ function __wbg_get_imports() {
|
|
|
586
1140
|
const ret = result;
|
|
587
1141
|
return ret;
|
|
588
1142
|
};
|
|
1143
|
+
imports.wbg.__wbg_instanceof_WorkerGlobalScope_85d487cc157fd065 = function(arg0) {
|
|
1144
|
+
let result;
|
|
1145
|
+
try {
|
|
1146
|
+
result = arg0 instanceof WorkerGlobalScope;
|
|
1147
|
+
} catch (_) {
|
|
1148
|
+
result = false;
|
|
1149
|
+
}
|
|
1150
|
+
const ret = result;
|
|
1151
|
+
return ret;
|
|
1152
|
+
};
|
|
589
1153
|
imports.wbg.__wbg_isArray_030cce220591fb41 = function(arg0) {
|
|
590
1154
|
const ret = Array.isArray(arg0);
|
|
591
1155
|
return ret;
|
|
@@ -606,6 +1170,10 @@ function __wbg_get_imports() {
|
|
|
606
1170
|
const ret = arg0.length;
|
|
607
1171
|
return ret;
|
|
608
1172
|
};
|
|
1173
|
+
imports.wbg.__wbg_navigator_bfaf1b0b0eb48da2 = function(arg0) {
|
|
1174
|
+
const ret = arg0.navigator;
|
|
1175
|
+
return ret;
|
|
1176
|
+
};
|
|
609
1177
|
imports.wbg.__wbg_new0_b0a0a38c201e6df5 = function() {
|
|
610
1178
|
const ret = new Date();
|
|
611
1179
|
return ret;
|
|
@@ -618,6 +1186,24 @@ function __wbg_get_imports() {
|
|
|
618
1186
|
const ret = new Array();
|
|
619
1187
|
return ret;
|
|
620
1188
|
};
|
|
1189
|
+
imports.wbg.__wbg_new_2e3c58a15f39f5f9 = function(arg0, arg1) {
|
|
1190
|
+
try {
|
|
1191
|
+
var state0 = {a: arg0, b: arg1};
|
|
1192
|
+
var cb0 = (arg0, arg1) => {
|
|
1193
|
+
const a = state0.a;
|
|
1194
|
+
state0.a = 0;
|
|
1195
|
+
try {
|
|
1196
|
+
return __wbg_adapter_129(a, state0.b, arg0, arg1);
|
|
1197
|
+
} finally {
|
|
1198
|
+
state0.a = a;
|
|
1199
|
+
}
|
|
1200
|
+
};
|
|
1201
|
+
const ret = new Promise(cb0);
|
|
1202
|
+
return ret;
|
|
1203
|
+
} finally {
|
|
1204
|
+
state0.a = state0.b = 0;
|
|
1205
|
+
}
|
|
1206
|
+
};
|
|
621
1207
|
imports.wbg.__wbg_new_2ff1f68f3676ea53 = function() {
|
|
622
1208
|
const ret = new Map();
|
|
623
1209
|
return ret;
|
|
@@ -630,14 +1216,34 @@ function __wbg_get_imports() {
|
|
|
630
1216
|
const ret = new Uint8Array(arg0);
|
|
631
1217
|
return ret;
|
|
632
1218
|
};
|
|
1219
|
+
imports.wbg.__wbg_new_f60d6f09990bdb99 = function(arg0, arg1, arg2) {
|
|
1220
|
+
const ret = new DataView(arg0, arg1 >>> 0, arg2 >>> 0);
|
|
1221
|
+
return ret;
|
|
1222
|
+
};
|
|
633
1223
|
imports.wbg.__wbg_newfromslice_074c56947bd43469 = function(arg0, arg1) {
|
|
634
1224
|
const ret = new Uint8Array(getArrayU8FromWasm0(arg0, arg1));
|
|
635
1225
|
return ret;
|
|
636
1226
|
};
|
|
1227
|
+
imports.wbg.__wbg_newnoargs_254190557c45b4ec = function(arg0, arg1) {
|
|
1228
|
+
const ret = new Function(getStringFromWasm0(arg0, arg1));
|
|
1229
|
+
return ret;
|
|
1230
|
+
};
|
|
1231
|
+
imports.wbg.__wbg_newwithlength_a167dcc7aaa3ba77 = function(arg0) {
|
|
1232
|
+
const ret = new Uint8Array(arg0 >>> 0);
|
|
1233
|
+
return ret;
|
|
1234
|
+
};
|
|
1235
|
+
imports.wbg.__wbg_newwithlength_c2868113efe93526 = function(arg0) {
|
|
1236
|
+
const ret = new Array(arg0 >>> 0);
|
|
1237
|
+
return ret;
|
|
1238
|
+
};
|
|
637
1239
|
imports.wbg.__wbg_newwithyearmonthday_9d5466a369f2521d = function(arg0, arg1, arg2) {
|
|
638
1240
|
const ret = new Date(arg0 >>> 0, arg1, arg2);
|
|
639
1241
|
return ret;
|
|
640
1242
|
};
|
|
1243
|
+
imports.wbg.__wbg_next_1142e1658f75ec63 = function() { return handleError(function (arg0) {
|
|
1244
|
+
const ret = arg0.next();
|
|
1245
|
+
return ret;
|
|
1246
|
+
}, arguments) };
|
|
641
1247
|
imports.wbg.__wbg_next_5b3530e612fde77d = function(arg0) {
|
|
642
1248
|
const ret = arg0.next;
|
|
643
1249
|
return ret;
|
|
@@ -649,10 +1255,35 @@ function __wbg_get_imports() {
|
|
|
649
1255
|
imports.wbg.__wbg_prototypesetcall_3d4a26c1ed734349 = function(arg0, arg1, arg2) {
|
|
650
1256
|
Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), arg2);
|
|
651
1257
|
};
|
|
1258
|
+
imports.wbg.__wbg_queueMicrotask_25d0739ac89e8c88 = function(arg0) {
|
|
1259
|
+
queueMicrotask(arg0);
|
|
1260
|
+
};
|
|
1261
|
+
imports.wbg.__wbg_queueMicrotask_4488407636f5bf24 = function(arg0) {
|
|
1262
|
+
const ret = arg0.queueMicrotask;
|
|
1263
|
+
return ret;
|
|
1264
|
+
};
|
|
652
1265
|
imports.wbg.__wbg_random_7ed63a0b38ee3b75 = function() {
|
|
653
1266
|
const ret = Math.random();
|
|
654
1267
|
return ret;
|
|
655
1268
|
};
|
|
1269
|
+
imports.wbg.__wbg_read_a43bb46027f02ee9 = function() { return handleError(function (arg0, arg1, arg2, arg3) {
|
|
1270
|
+
const ret = arg0.read(getArrayU8FromWasm0(arg1, arg2), arg3);
|
|
1271
|
+
return ret;
|
|
1272
|
+
}, arguments) };
|
|
1273
|
+
imports.wbg.__wbg_read_e271e94623077591 = function() { return handleError(function (arg0, arg1, arg2) {
|
|
1274
|
+
const ret = arg0.read(arg1, arg2);
|
|
1275
|
+
return ret;
|
|
1276
|
+
}, arguments) };
|
|
1277
|
+
imports.wbg.__wbg_resolve_4055c623acdd6a1b = function(arg0) {
|
|
1278
|
+
const ret = Promise.resolve(arg0);
|
|
1279
|
+
return ret;
|
|
1280
|
+
};
|
|
1281
|
+
imports.wbg.__wbg_setUint32_8a9564ae127df4c5 = function(arg0, arg1, arg2) {
|
|
1282
|
+
arg0.setUint32(arg1 >>> 0, arg2 >>> 0);
|
|
1283
|
+
};
|
|
1284
|
+
imports.wbg.__wbg_set_1353b2a5e96bc48c = function(arg0, arg1, arg2) {
|
|
1285
|
+
arg0.set(getArrayU8FromWasm0(arg1, arg2));
|
|
1286
|
+
};
|
|
656
1287
|
imports.wbg.__wbg_set_3f1d0b984ed272ed = function(arg0, arg1, arg2) {
|
|
657
1288
|
arg0[arg1] = arg2;
|
|
658
1289
|
};
|
|
@@ -667,6 +1298,53 @@ function __wbg_get_imports() {
|
|
|
667
1298
|
const ret = arg0.set(arg1, arg2);
|
|
668
1299
|
return ret;
|
|
669
1300
|
};
|
|
1301
|
+
imports.wbg.__wbg_setat_f8fc70f546036b10 = function(arg0, arg1) {
|
|
1302
|
+
arg0.at = arg1;
|
|
1303
|
+
};
|
|
1304
|
+
imports.wbg.__wbg_setcreate_1eb73f4ea713c1ad = function(arg0, arg1) {
|
|
1305
|
+
arg0.create = arg1 !== 0;
|
|
1306
|
+
};
|
|
1307
|
+
imports.wbg.__wbg_setcreate_2d32aa4bbcd1d7af = function(arg0, arg1) {
|
|
1308
|
+
arg0.create = arg1 !== 0;
|
|
1309
|
+
};
|
|
1310
|
+
imports.wbg.__wbg_static_accessor_GLOBAL_8921f820c2ce3f12 = function() {
|
|
1311
|
+
const ret = typeof global === 'undefined' ? null : global;
|
|
1312
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
1313
|
+
};
|
|
1314
|
+
imports.wbg.__wbg_static_accessor_GLOBAL_THIS_f0a4409105898184 = function() {
|
|
1315
|
+
const ret = typeof globalThis === 'undefined' ? null : globalThis;
|
|
1316
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
1317
|
+
};
|
|
1318
|
+
imports.wbg.__wbg_static_accessor_SELF_995b214ae681ff99 = function() {
|
|
1319
|
+
const ret = typeof self === 'undefined' ? null : self;
|
|
1320
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
1321
|
+
};
|
|
1322
|
+
imports.wbg.__wbg_static_accessor_WINDOW_cde3890479c675ea = function() {
|
|
1323
|
+
const ret = typeof window === 'undefined' ? null : window;
|
|
1324
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
1325
|
+
};
|
|
1326
|
+
imports.wbg.__wbg_storage_32b4ac688c114c3d = function(arg0) {
|
|
1327
|
+
const ret = arg0.storage;
|
|
1328
|
+
return ret;
|
|
1329
|
+
};
|
|
1330
|
+
imports.wbg.__wbg_subarray_70fd07feefe14294 = function(arg0, arg1, arg2) {
|
|
1331
|
+
const ret = arg0.subarray(arg1 >>> 0, arg2 >>> 0);
|
|
1332
|
+
return ret;
|
|
1333
|
+
};
|
|
1334
|
+
imports.wbg.__wbg_then_b33a773d723afa3e = function(arg0, arg1, arg2) {
|
|
1335
|
+
const ret = arg0.then(arg1, arg2);
|
|
1336
|
+
return ret;
|
|
1337
|
+
};
|
|
1338
|
+
imports.wbg.__wbg_then_e22500defe16819f = function(arg0, arg1) {
|
|
1339
|
+
const ret = arg0.then(arg1);
|
|
1340
|
+
return ret;
|
|
1341
|
+
};
|
|
1342
|
+
imports.wbg.__wbg_truncate_0fe935591188a14c = function() { return handleError(function (arg0, arg1) {
|
|
1343
|
+
arg0.truncate(arg1 >>> 0);
|
|
1344
|
+
}, arguments) };
|
|
1345
|
+
imports.wbg.__wbg_truncate_7cddd971e3cf0a8c = function() { return handleError(function (arg0, arg1) {
|
|
1346
|
+
arg0.truncate(arg1);
|
|
1347
|
+
}, arguments) };
|
|
670
1348
|
imports.wbg.__wbg_value_dd9372230531eade = function(arg0) {
|
|
671
1349
|
const ret = arg0.value;
|
|
672
1350
|
return ret;
|
|
@@ -682,6 +1360,15 @@ function __wbg_get_imports() {
|
|
|
682
1360
|
const ret = typeof(v) === 'boolean' ? v : undefined;
|
|
683
1361
|
return isLikeNone(ret) ? 0xFFFFFF : ret ? 1 : 0;
|
|
684
1362
|
};
|
|
1363
|
+
imports.wbg.__wbg_wbindgencbdrop_eb10308566512b88 = function(arg0) {
|
|
1364
|
+
const obj = arg0.original;
|
|
1365
|
+
if (obj.cnt-- == 1) {
|
|
1366
|
+
obj.a = 0;
|
|
1367
|
+
return true;
|
|
1368
|
+
}
|
|
1369
|
+
const ret = false;
|
|
1370
|
+
return ret;
|
|
1371
|
+
};
|
|
685
1372
|
imports.wbg.__wbg_wbindgendebugstring_99ef257a3ddda34d = function(arg0, arg1) {
|
|
686
1373
|
const ret = debugString(arg1);
|
|
687
1374
|
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
@@ -739,16 +1426,36 @@ function __wbg_get_imports() {
|
|
|
739
1426
|
imports.wbg.__wbg_wbindgenthrow_451ec1a8469d7eb6 = function(arg0, arg1) {
|
|
740
1427
|
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
741
1428
|
};
|
|
1429
|
+
imports.wbg.__wbg_write_9ac6a5f58a8c835c = function() { return handleError(function (arg0, arg1, arg2, arg3) {
|
|
1430
|
+
const ret = arg0.write(getArrayU8FromWasm0(arg1, arg2), arg3);
|
|
1431
|
+
return ret;
|
|
1432
|
+
}, arguments) };
|
|
1433
|
+
imports.wbg.__wbg_write_c0e234eeb0039d0d = function() { return handleError(function (arg0, arg1, arg2) {
|
|
1434
|
+
const ret = arg0.write(arg1, arg2);
|
|
1435
|
+
return ret;
|
|
1436
|
+
}, arguments) };
|
|
742
1437
|
imports.wbg.__wbindgen_cast_2241b6af4c4b2941 = function(arg0, arg1) {
|
|
743
1438
|
// Cast intrinsic for `Ref(String) -> Externref`.
|
|
744
1439
|
const ret = getStringFromWasm0(arg0, arg1);
|
|
745
1440
|
return ret;
|
|
746
1441
|
};
|
|
1442
|
+
imports.wbg.__wbindgen_cast_31f66333318e4864 = function(arg0, arg1) {
|
|
1443
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 98, function: Function { arguments: [Externref], shim_idx: 99, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
1444
|
+
const ret = makeMutClosure(arg0, arg1, 98, __wbg_adapter_16);
|
|
1445
|
+
return ret;
|
|
1446
|
+
};
|
|
747
1447
|
imports.wbg.__wbindgen_cast_4625c577ab2ec9ee = function(arg0) {
|
|
748
1448
|
// Cast intrinsic for `U64 -> Externref`.
|
|
749
1449
|
const ret = BigInt.asUintN(64, arg0);
|
|
750
1450
|
return ret;
|
|
751
1451
|
};
|
|
1452
|
+
imports.wbg.__wbindgen_cast_77bc3e92745e9a35 = function(arg0, arg1) {
|
|
1453
|
+
var v0 = getArrayU8FromWasm0(arg0, arg1).slice();
|
|
1454
|
+
wasm.__wbindgen_free(arg0, arg1 * 1, 1);
|
|
1455
|
+
// Cast intrinsic for `Vector(U8) -> Externref`.
|
|
1456
|
+
const ret = v0;
|
|
1457
|
+
return ret;
|
|
1458
|
+
};
|
|
752
1459
|
imports.wbg.__wbindgen_cast_9ae0607507abb057 = function(arg0) {
|
|
753
1460
|
// Cast intrinsic for `I64 -> Externref`.
|
|
754
1461
|
const ret = arg0;
|