loro-crdt 1.13.2 → 1.13.3

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.
@@ -264,89 +264,46 @@ function getArrayJsValueFromWasm0(ptr, len) {
264
264
  return result;
265
265
  }
266
266
  /**
267
- * Decode the metadata of the import blob.
268
- *
269
- * This method is useful to get the following metadata of the import blob:
270
- *
271
- * - startVersionVector
272
- * - endVersionVector
273
- * - startTimestamp
274
- * - endTimestamp
275
- * - mode
276
- * - changeNum
277
- * @param {Uint8Array} blob
278
- * @param {boolean} check_checksum
279
- * @returns {ImportBlobMetadata}
267
+ * Enable debug info of Loro
280
268
  */
281
- export function decodeImportBlobMeta(blob, check_checksum) {
282
- try {
283
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
284
- const ptr0 = passArray8ToWasm0(blob, wasm.__wbindgen_malloc);
285
- const len0 = WASM_VECTOR_LEN;
286
- wasm.decodeImportBlobMeta(retptr, ptr0, len0, check_checksum);
287
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
288
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
289
- var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
290
- if (r2) {
291
- throw takeObject(r1);
292
- }
293
- return takeObject(r0);
294
- } finally {
295
- wasm.__wbindgen_add_to_stack_pointer(16);
296
- }
269
+ export function setDebug() {
270
+ wasm.setDebug();
297
271
  }
298
272
 
299
- /**
300
- * Get the version of Loro
301
- * @returns {string}
302
- */
303
- export function LORO_VERSION() {
304
- let deferred1_0;
305
- let deferred1_1;
306
- try {
307
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
308
- wasm.LORO_VERSION(retptr);
309
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
310
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
311
- deferred1_0 = r0;
312
- deferred1_1 = r1;
313
- return getStringFromWasm0(r0, r1);
314
- } finally {
315
- wasm.__wbindgen_add_to_stack_pointer(16);
316
- wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
273
+ function passArrayJsValueToWasm0(array, malloc) {
274
+ const ptr = malloc(array.length * 4, 4) >>> 0;
275
+ const mem = getDataViewMemory0();
276
+ for (let i = 0; i < array.length; i++) {
277
+ mem.setUint32(ptr + 4 * i, addHeapObject(array[i]), true);
317
278
  }
279
+ WASM_VECTOR_LEN = array.length;
280
+ return ptr;
318
281
  }
319
-
320
- export function run() {
321
- wasm.run();
322
- }
323
-
324
282
  /**
325
- * @param {Uint8Array} bytes
326
- * @returns {{ peer: PeerID, counter: number }[]}
283
+ * @param {({ peer: PeerID, counter: number })[]} frontiers
284
+ * @returns {Uint8Array}
327
285
  */
328
- export function decodeFrontiers(bytes) {
286
+ export function encodeFrontiers(frontiers) {
329
287
  try {
330
288
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
331
- const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
289
+ const ptr0 = passArrayJsValueToWasm0(frontiers, wasm.__wbindgen_malloc);
332
290
  const len0 = WASM_VECTOR_LEN;
333
- wasm.decodeFrontiers(retptr, ptr0, len0);
291
+ wasm.encodeFrontiers(retptr, ptr0, len0);
334
292
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
335
293
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
336
294
  var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
337
- if (r2) {
338
- throw takeObject(r1);
295
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
296
+ if (r3) {
297
+ throw takeObject(r2);
339
298
  }
340
- return takeObject(r0);
299
+ var v2 = getArrayU8FromWasm0(r0, r1).slice();
300
+ wasm.__wbindgen_free(r0, r1 * 1, 1);
301
+ return v2;
341
302
  } finally {
342
303
  wasm.__wbindgen_add_to_stack_pointer(16);
343
304
  }
344
305
  }
345
306
 
346
- export function callPendingEvents() {
347
- wasm.callPendingEvents();
348
- }
349
-
350
307
  /**
351
308
  * Redacts sensitive content in JSON updates within the specified version range.
352
309
  *
@@ -385,53 +342,96 @@ export function redactJsonUpdates(json_updates, version_range) {
385
342
  }
386
343
  }
387
344
 
388
- function passArrayJsValueToWasm0(array, malloc) {
389
- const ptr = malloc(array.length * 4, 4) >>> 0;
390
- const mem = getDataViewMemory0();
391
- for (let i = 0; i < array.length; i++) {
392
- mem.setUint32(ptr + 4 * i, addHeapObject(array[i]), true);
393
- }
394
- WASM_VECTOR_LEN = array.length;
395
- return ptr;
396
- }
397
345
  /**
398
- * @param {({ peer: PeerID, counter: number })[]} frontiers
399
- * @returns {Uint8Array}
346
+ * @param {Uint8Array} bytes
347
+ * @returns {{ peer: PeerID, counter: number }[]}
400
348
  */
401
- export function encodeFrontiers(frontiers) {
349
+ export function decodeFrontiers(bytes) {
402
350
  try {
403
351
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
404
- const ptr0 = passArrayJsValueToWasm0(frontiers, wasm.__wbindgen_malloc);
352
+ const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
405
353
  const len0 = WASM_VECTOR_LEN;
406
- wasm.encodeFrontiers(retptr, ptr0, len0);
354
+ wasm.decodeFrontiers(retptr, ptr0, len0);
407
355
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
408
356
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
409
357
  var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
410
- var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
411
- if (r3) {
412
- throw takeObject(r2);
358
+ if (r2) {
359
+ throw takeObject(r1);
413
360
  }
414
- var v2 = getArrayU8FromWasm0(r0, r1).slice();
415
- wasm.__wbindgen_free(r0, r1 * 1, 1);
416
- return v2;
361
+ return takeObject(r0);
417
362
  } finally {
418
363
  wasm.__wbindgen_add_to_stack_pointer(16);
419
364
  }
420
365
  }
421
366
 
422
367
  /**
423
- * Enable debug info of Loro
368
+ * Get the version of Loro
369
+ * @returns {string}
424
370
  */
425
- export function setDebug() {
426
- wasm.setDebug();
371
+ export function LORO_VERSION() {
372
+ let deferred1_0;
373
+ let deferred1_1;
374
+ try {
375
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
376
+ wasm.LORO_VERSION(retptr);
377
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
378
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
379
+ deferred1_0 = r0;
380
+ deferred1_1 = r1;
381
+ return getStringFromWasm0(r0, r1);
382
+ } finally {
383
+ wasm.__wbindgen_add_to_stack_pointer(16);
384
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
385
+ }
386
+ }
387
+
388
+ export function run() {
389
+ wasm.run();
390
+ }
391
+
392
+ /**
393
+ * Decode the metadata of the import blob.
394
+ *
395
+ * This method is useful to get the following metadata of the import blob:
396
+ *
397
+ * - startVersionVector
398
+ * - endVersionVector
399
+ * - startTimestamp
400
+ * - endTimestamp
401
+ * - mode
402
+ * - changeNum
403
+ * @param {Uint8Array} blob
404
+ * @param {boolean} check_checksum
405
+ * @returns {ImportBlobMetadata}
406
+ */
407
+ export function decodeImportBlobMeta(blob, check_checksum) {
408
+ try {
409
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
410
+ const ptr0 = passArray8ToWasm0(blob, wasm.__wbindgen_malloc);
411
+ const len0 = WASM_VECTOR_LEN;
412
+ wasm.decodeImportBlobMeta(retptr, ptr0, len0, check_checksum);
413
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
414
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
415
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
416
+ if (r2) {
417
+ throw takeObject(r1);
418
+ }
419
+ return takeObject(r0);
420
+ } finally {
421
+ wasm.__wbindgen_add_to_stack_pointer(16);
422
+ }
423
+ }
424
+
425
+ export function callPendingEvents() {
426
+ wasm.callPendingEvents();
427
427
  }
428
428
 
429
429
  function __wbg_adapter_60(arg0, arg1, arg2) {
430
- wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h7ca1585fb4938203(arg0, arg1, addHeapObject(arg2));
430
+ wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__ha2b51c6fc8df0ff6(arg0, arg1, addHeapObject(arg2));
431
431
  }
432
432
 
433
433
  function __wbg_adapter_63(arg0, arg1) {
434
- wasm._dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__hbcad774514455511(arg0, arg1);
434
+ wasm._dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h794210845e4bfab8(arg0, arg1);
435
435
  }
436
436
 
437
437
  const AwarenessWasmFinalization = (typeof FinalizationRegistry === 'undefined')
@@ -6993,6 +6993,10 @@ export function __wbg_entries_c8a90a7ed73e84ce(arg0) {
6993
6993
  return addHeapObject(ret);
6994
6994
  };
6995
6995
 
6996
+ export function __wbg_error_56998721a304cd56(arg0, arg1) {
6997
+ console.error(getStringFromWasm0(arg0, arg1));
6998
+ };
6999
+
6996
7000
  export function __wbg_error_7534b8e9a36f1ab4(arg0, arg1) {
6997
7001
  let deferred0_0;
6998
7002
  let deferred0_1;
@@ -7005,10 +7009,6 @@ export function __wbg_error_7534b8e9a36f1ab4(arg0, arg1) {
7005
7009
  }
7006
7010
  };
7007
7011
 
7008
- export function __wbg_error_eddb9b302feac7d3(arg0, arg1) {
7009
- console.error(getStringFromWasm0(arg0, arg1));
7010
- };
7011
-
7012
7012
  export function __wbg_from_2a5d3e218e67aa85(arg0) {
7013
7013
  const ret = Array.from(getObject(arg0));
7014
7014
  return addHeapObject(ret);
@@ -7124,6 +7124,10 @@ export function __wbg_log_0cc1b7768397bcfe(arg0, arg1, arg2, arg3, arg4, arg5, a
7124
7124
  }
7125
7125
  };
7126
7126
 
7127
+ export function __wbg_log_1fa0a78510bbe830(arg0, arg1) {
7128
+ console.log(getStringFromWasm0(arg0, arg1));
7129
+ };
7130
+
7127
7131
  export function __wbg_log_cb9e190acc5753fb(arg0, arg1) {
7128
7132
  let deferred0_0;
7129
7133
  let deferred0_1;
@@ -7136,10 +7140,6 @@ export function __wbg_log_cb9e190acc5753fb(arg0, arg1) {
7136
7140
  }
7137
7141
  };
7138
7142
 
7139
- export function __wbg_log_d8b98f6c2e2f68e5(arg0, arg1) {
7140
- console.log(getStringFromWasm0(arg0, arg1));
7141
- };
7142
-
7143
7143
  export function __wbg_lorocounter_new(arg0) {
7144
7144
  const ret = LoroCounter.__wrap(arg0);
7145
7145
  return addHeapObject(ret);
@@ -7374,7 +7374,7 @@ export function __wbg_versionvector_new(arg0) {
7374
7374
  return addHeapObject(ret);
7375
7375
  };
7376
7376
 
7377
- export function __wbg_warn_a198177f86cf58b2(arg0, arg1) {
7377
+ export function __wbg_warn_db4faa19bfbe9598(arg0, arg1) {
7378
7378
  console.warn(getStringFromWasm0(arg0, arg1));
7379
7379
  };
7380
7380
 
@@ -7421,7 +7421,7 @@ export function __wbindgen_closure_wrapper331(arg0, arg1, arg2) {
7421
7421
  return addHeapObject(ret);
7422
7422
  };
7423
7423
 
7424
- export function __wbindgen_closure_wrapper333(arg0, arg1, arg2) {
7424
+ export function __wbindgen_closure_wrapper334(arg0, arg1, arg2) {
7425
7425
  const ret = makeMutClosure(arg0, arg1, 9, __wbg_adapter_63);
7426
7426
  return addHeapObject(ret);
7427
7427
  };
Binary file
@@ -330,6 +330,6 @@ export const __wbindgen_exn_store: (a: number) => void;
330
330
  export const __wbindgen_free: (a: number, b: number, c: number) => void;
331
331
  export const __wbindgen_export_4: WebAssembly.Table;
332
332
  export const __wbindgen_add_to_stack_pointer: (a: number) => number;
333
- export const _dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h7ca1585fb4938203: (a: number, b: number, c: number) => void;
334
- export const _dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__hbcad774514455511: (a: number, b: number) => void;
333
+ export const _dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__ha2b51c6fc8df0ff6: (a: number, b: number, c: number) => void;
334
+ export const _dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h794210845e4bfab8: (a: number, b: number) => void;
335
335
  export const __wbindgen_start: () => void;
@@ -1,25 +1,10 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
3
  /**
4
- * Decode the metadata of the import blob.
5
- *
6
- * This method is useful to get the following metadata of the import blob:
7
- *
8
- * - startVersionVector
9
- * - endVersionVector
10
- * - startTimestamp
11
- * - endTimestamp
12
- * - mode
13
- * - changeNum
14
- */
15
- export function decodeImportBlobMeta(blob: Uint8Array, check_checksum: boolean): ImportBlobMetadata;
16
- /**
17
- * Get the version of Loro
4
+ * Enable debug info of Loro
18
5
  */
19
- export function LORO_VERSION(): string;
20
- export function run(): void;
21
- export function decodeFrontiers(bytes: Uint8Array): { peer: PeerID, counter: number }[];
22
- export function callPendingEvents(): void;
6
+ export function setDebug(): void;
7
+ export function encodeFrontiers(frontiers: ({ peer: PeerID, counter: number })[]): Uint8Array;
23
8
  /**
24
9
  * Redacts sensitive content in JSON updates within the specified version range.
25
10
  *
@@ -40,11 +25,26 @@ export function callPendingEvents(): void;
40
25
  * @returns {Object} The redacted JSON updates
41
26
  */
42
27
  export function redactJsonUpdates(json_updates: string | JsonSchema, version_range: any): JsonSchema;
43
- export function encodeFrontiers(frontiers: ({ peer: PeerID, counter: number })[]): Uint8Array;
28
+ export function decodeFrontiers(bytes: Uint8Array): { peer: PeerID, counter: number }[];
44
29
  /**
45
- * Enable debug info of Loro
30
+ * Get the version of Loro
46
31
  */
47
- export function setDebug(): void;
32
+ export function LORO_VERSION(): string;
33
+ export function run(): void;
34
+ /**
35
+ * Decode the metadata of the import blob.
36
+ *
37
+ * This method is useful to get the following metadata of the import blob:
38
+ *
39
+ * - startVersionVector
40
+ * - endVersionVector
41
+ * - startTimestamp
42
+ * - endTimestamp
43
+ * - mode
44
+ * - changeNum
45
+ */
46
+ export function decodeImportBlobMeta(blob: Uint8Array, check_checksum: boolean): ImportBlobMetadata;
47
+ export function callPendingEvents(): void;
48
48
 
49
49
  /**
50
50
  * Container types supported by loro.
@@ -260,89 +260,46 @@ function getArrayJsValueFromWasm0(ptr, len) {
260
260
  return result;
261
261
  }
262
262
  /**
263
- * Decode the metadata of the import blob.
264
- *
265
- * This method is useful to get the following metadata of the import blob:
266
- *
267
- * - startVersionVector
268
- * - endVersionVector
269
- * - startTimestamp
270
- * - endTimestamp
271
- * - mode
272
- * - changeNum
273
- * @param {Uint8Array} blob
274
- * @param {boolean} check_checksum
275
- * @returns {ImportBlobMetadata}
263
+ * Enable debug info of Loro
276
264
  */
277
- module.exports.decodeImportBlobMeta = function(blob, check_checksum) {
278
- try {
279
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
280
- const ptr0 = passArray8ToWasm0(blob, wasm.__wbindgen_malloc);
281
- const len0 = WASM_VECTOR_LEN;
282
- wasm.decodeImportBlobMeta(retptr, ptr0, len0, check_checksum);
283
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
284
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
285
- var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
286
- if (r2) {
287
- throw takeObject(r1);
288
- }
289
- return takeObject(r0);
290
- } finally {
291
- wasm.__wbindgen_add_to_stack_pointer(16);
292
- }
265
+ module.exports.setDebug = function() {
266
+ wasm.setDebug();
293
267
  };
294
268
 
295
- /**
296
- * Get the version of Loro
297
- * @returns {string}
298
- */
299
- module.exports.LORO_VERSION = function() {
300
- let deferred1_0;
301
- let deferred1_1;
302
- try {
303
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
304
- wasm.LORO_VERSION(retptr);
305
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
306
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
307
- deferred1_0 = r0;
308
- deferred1_1 = r1;
309
- return getStringFromWasm0(r0, r1);
310
- } finally {
311
- wasm.__wbindgen_add_to_stack_pointer(16);
312
- wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
269
+ function passArrayJsValueToWasm0(array, malloc) {
270
+ const ptr = malloc(array.length * 4, 4) >>> 0;
271
+ const mem = getDataViewMemory0();
272
+ for (let i = 0; i < array.length; i++) {
273
+ mem.setUint32(ptr + 4 * i, addHeapObject(array[i]), true);
313
274
  }
314
- };
315
-
316
- module.exports.run = function() {
317
- wasm.run();
318
- };
319
-
275
+ WASM_VECTOR_LEN = array.length;
276
+ return ptr;
277
+ }
320
278
  /**
321
- * @param {Uint8Array} bytes
322
- * @returns {{ peer: PeerID, counter: number }[]}
279
+ * @param {({ peer: PeerID, counter: number })[]} frontiers
280
+ * @returns {Uint8Array}
323
281
  */
324
- module.exports.decodeFrontiers = function(bytes) {
282
+ module.exports.encodeFrontiers = function(frontiers) {
325
283
  try {
326
284
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
327
- const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
285
+ const ptr0 = passArrayJsValueToWasm0(frontiers, wasm.__wbindgen_malloc);
328
286
  const len0 = WASM_VECTOR_LEN;
329
- wasm.decodeFrontiers(retptr, ptr0, len0);
287
+ wasm.encodeFrontiers(retptr, ptr0, len0);
330
288
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
331
289
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
332
290
  var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
333
- if (r2) {
334
- throw takeObject(r1);
291
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
292
+ if (r3) {
293
+ throw takeObject(r2);
335
294
  }
336
- return takeObject(r0);
295
+ var v2 = getArrayU8FromWasm0(r0, r1).slice();
296
+ wasm.__wbindgen_free(r0, r1 * 1, 1);
297
+ return v2;
337
298
  } finally {
338
299
  wasm.__wbindgen_add_to_stack_pointer(16);
339
300
  }
340
301
  };
341
302
 
342
- module.exports.callPendingEvents = function() {
343
- wasm.callPendingEvents();
344
- };
345
-
346
303
  /**
347
304
  * Redacts sensitive content in JSON updates within the specified version range.
348
305
  *
@@ -381,53 +338,96 @@ module.exports.redactJsonUpdates = function(json_updates, version_range) {
381
338
  }
382
339
  };
383
340
 
384
- function passArrayJsValueToWasm0(array, malloc) {
385
- const ptr = malloc(array.length * 4, 4) >>> 0;
386
- const mem = getDataViewMemory0();
387
- for (let i = 0; i < array.length; i++) {
388
- mem.setUint32(ptr + 4 * i, addHeapObject(array[i]), true);
389
- }
390
- WASM_VECTOR_LEN = array.length;
391
- return ptr;
392
- }
393
341
  /**
394
- * @param {({ peer: PeerID, counter: number })[]} frontiers
395
- * @returns {Uint8Array}
342
+ * @param {Uint8Array} bytes
343
+ * @returns {{ peer: PeerID, counter: number }[]}
396
344
  */
397
- module.exports.encodeFrontiers = function(frontiers) {
345
+ module.exports.decodeFrontiers = function(bytes) {
398
346
  try {
399
347
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
400
- const ptr0 = passArrayJsValueToWasm0(frontiers, wasm.__wbindgen_malloc);
348
+ const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
401
349
  const len0 = WASM_VECTOR_LEN;
402
- wasm.encodeFrontiers(retptr, ptr0, len0);
350
+ wasm.decodeFrontiers(retptr, ptr0, len0);
403
351
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
404
352
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
405
353
  var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
406
- var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
407
- if (r3) {
408
- throw takeObject(r2);
354
+ if (r2) {
355
+ throw takeObject(r1);
409
356
  }
410
- var v2 = getArrayU8FromWasm0(r0, r1).slice();
411
- wasm.__wbindgen_free(r0, r1 * 1, 1);
412
- return v2;
357
+ return takeObject(r0);
413
358
  } finally {
414
359
  wasm.__wbindgen_add_to_stack_pointer(16);
415
360
  }
416
361
  };
417
362
 
418
363
  /**
419
- * Enable debug info of Loro
364
+ * Get the version of Loro
365
+ * @returns {string}
420
366
  */
421
- module.exports.setDebug = function() {
422
- wasm.setDebug();
367
+ module.exports.LORO_VERSION = function() {
368
+ let deferred1_0;
369
+ let deferred1_1;
370
+ try {
371
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
372
+ wasm.LORO_VERSION(retptr);
373
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
374
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
375
+ deferred1_0 = r0;
376
+ deferred1_1 = r1;
377
+ return getStringFromWasm0(r0, r1);
378
+ } finally {
379
+ wasm.__wbindgen_add_to_stack_pointer(16);
380
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
381
+ }
382
+ };
383
+
384
+ module.exports.run = function() {
385
+ wasm.run();
386
+ };
387
+
388
+ /**
389
+ * Decode the metadata of the import blob.
390
+ *
391
+ * This method is useful to get the following metadata of the import blob:
392
+ *
393
+ * - startVersionVector
394
+ * - endVersionVector
395
+ * - startTimestamp
396
+ * - endTimestamp
397
+ * - mode
398
+ * - changeNum
399
+ * @param {Uint8Array} blob
400
+ * @param {boolean} check_checksum
401
+ * @returns {ImportBlobMetadata}
402
+ */
403
+ module.exports.decodeImportBlobMeta = function(blob, check_checksum) {
404
+ try {
405
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
406
+ const ptr0 = passArray8ToWasm0(blob, wasm.__wbindgen_malloc);
407
+ const len0 = WASM_VECTOR_LEN;
408
+ wasm.decodeImportBlobMeta(retptr, ptr0, len0, check_checksum);
409
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
410
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
411
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
412
+ if (r2) {
413
+ throw takeObject(r1);
414
+ }
415
+ return takeObject(r0);
416
+ } finally {
417
+ wasm.__wbindgen_add_to_stack_pointer(16);
418
+ }
419
+ };
420
+
421
+ module.exports.callPendingEvents = function() {
422
+ wasm.callPendingEvents();
423
423
  };
424
424
 
425
425
  function __wbg_adapter_60(arg0, arg1, arg2) {
426
- wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h7ca1585fb4938203(arg0, arg1, addHeapObject(arg2));
426
+ wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__ha2b51c6fc8df0ff6(arg0, arg1, addHeapObject(arg2));
427
427
  }
428
428
 
429
429
  function __wbg_adapter_63(arg0, arg1) {
430
- wasm._dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__hbcad774514455511(arg0, arg1);
430
+ wasm._dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h794210845e4bfab8(arg0, arg1);
431
431
  }
432
432
 
433
433
  const AwarenessWasmFinalization = (typeof FinalizationRegistry === 'undefined')
@@ -7003,6 +7003,10 @@ module.exports.__wbg_entries_c8a90a7ed73e84ce = function(arg0) {
7003
7003
  return addHeapObject(ret);
7004
7004
  };
7005
7005
 
7006
+ module.exports.__wbg_error_56998721a304cd56 = function(arg0, arg1) {
7007
+ console.error(getStringFromWasm0(arg0, arg1));
7008
+ };
7009
+
7006
7010
  module.exports.__wbg_error_7534b8e9a36f1ab4 = function(arg0, arg1) {
7007
7011
  let deferred0_0;
7008
7012
  let deferred0_1;
@@ -7015,10 +7019,6 @@ module.exports.__wbg_error_7534b8e9a36f1ab4 = function(arg0, arg1) {
7015
7019
  }
7016
7020
  };
7017
7021
 
7018
- module.exports.__wbg_error_eddb9b302feac7d3 = function(arg0, arg1) {
7019
- console.error(getStringFromWasm0(arg0, arg1));
7020
- };
7021
-
7022
7022
  module.exports.__wbg_from_2a5d3e218e67aa85 = function(arg0) {
7023
7023
  const ret = Array.from(getObject(arg0));
7024
7024
  return addHeapObject(ret);
@@ -7134,6 +7134,10 @@ module.exports.__wbg_log_0cc1b7768397bcfe = function(arg0, arg1, arg2, arg3, arg
7134
7134
  }
7135
7135
  };
7136
7136
 
7137
+ module.exports.__wbg_log_1fa0a78510bbe830 = function(arg0, arg1) {
7138
+ console.log(getStringFromWasm0(arg0, arg1));
7139
+ };
7140
+
7137
7141
  module.exports.__wbg_log_cb9e190acc5753fb = function(arg0, arg1) {
7138
7142
  let deferred0_0;
7139
7143
  let deferred0_1;
@@ -7146,10 +7150,6 @@ module.exports.__wbg_log_cb9e190acc5753fb = function(arg0, arg1) {
7146
7150
  }
7147
7151
  };
7148
7152
 
7149
- module.exports.__wbg_log_d8b98f6c2e2f68e5 = function(arg0, arg1) {
7150
- console.log(getStringFromWasm0(arg0, arg1));
7151
- };
7152
-
7153
7153
  module.exports.__wbg_lorocounter_new = function(arg0) {
7154
7154
  const ret = LoroCounter.__wrap(arg0);
7155
7155
  return addHeapObject(ret);
@@ -7384,7 +7384,7 @@ module.exports.__wbg_versionvector_new = function(arg0) {
7384
7384
  return addHeapObject(ret);
7385
7385
  };
7386
7386
 
7387
- module.exports.__wbg_warn_a198177f86cf58b2 = function(arg0, arg1) {
7387
+ module.exports.__wbg_warn_db4faa19bfbe9598 = function(arg0, arg1) {
7388
7388
  console.warn(getStringFromWasm0(arg0, arg1));
7389
7389
  };
7390
7390
 
@@ -7431,7 +7431,7 @@ module.exports.__wbindgen_closure_wrapper331 = function(arg0, arg1, arg2) {
7431
7431
  return addHeapObject(ret);
7432
7432
  };
7433
7433
 
7434
- module.exports.__wbindgen_closure_wrapper333 = function(arg0, arg1, arg2) {
7434
+ module.exports.__wbindgen_closure_wrapper334 = function(arg0, arg1, arg2) {
7435
7435
  const ret = makeMutClosure(arg0, arg1, 9, __wbg_adapter_63);
7436
7436
  return addHeapObject(ret);
7437
7437
  };
Binary file
@@ -330,6 +330,6 @@ export const __wbindgen_exn_store: (a: number) => void;
330
330
  export const __wbindgen_free: (a: number, b: number, c: number) => void;
331
331
  export const __wbindgen_export_4: WebAssembly.Table;
332
332
  export const __wbindgen_add_to_stack_pointer: (a: number) => number;
333
- export const _dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h7ca1585fb4938203: (a: number, b: number, c: number) => void;
334
- export const _dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__hbcad774514455511: (a: number, b: number) => void;
333
+ export const _dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__ha2b51c6fc8df0ff6: (a: number, b: number, c: number) => void;
334
+ export const _dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h794210845e4bfab8: (a: number, b: number) => void;
335
335
  export const __wbindgen_start: () => void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "loro-crdt",
3
- "version": "1.13.2",
3
+ "version": "1.13.3",
4
4
  "description": "Loro CRDTs is a high-performance CRDT framework that makes your app state synchronized, collaborative and maintainable effortlessly.",
5
5
  "keywords": [
6
6
  "crdt",