loro-crdt 1.13.2 → 1.13.4

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.
@@ -1,5 +1,7 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
+ export function encodeFrontiers(frontiers: ({ peer: PeerID, counter: number })[]): Uint8Array;
4
+ export function callPendingEvents(): void;
3
5
  /**
4
6
  * Decode the metadata of the import blob.
5
7
  *
@@ -13,13 +15,14 @@
13
15
  * - changeNum
14
16
  */
15
17
  export function decodeImportBlobMeta(blob: Uint8Array, check_checksum: boolean): ImportBlobMetadata;
18
+ /**
19
+ * Enable debug info of Loro
20
+ */
21
+ export function setDebug(): void;
16
22
  /**
17
23
  * Get the version of Loro
18
24
  */
19
25
  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;
23
26
  /**
24
27
  * Redacts sensitive content in JSON updates within the specified version range.
25
28
  *
@@ -40,11 +43,8 @@ export function callPendingEvents(): void;
40
43
  * @returns {Object} The redacted JSON updates
41
44
  */
42
45
  export function redactJsonUpdates(json_updates: string | JsonSchema, version_range: any): JsonSchema;
43
- export function encodeFrontiers(frontiers: ({ peer: PeerID, counter: number })[]): Uint8Array;
44
- /**
45
- * Enable debug info of Loro
46
- */
47
- export function setDebug(): void;
46
+ export function decodeFrontiers(bytes: Uint8Array): { peer: PeerID, counter: number }[];
47
+ export function run(): void;
48
48
 
49
49
  /**
50
50
  * Container types supported by loro.
package/browser/index.js CHANGED
@@ -410,7 +410,7 @@ export {
410
410
  __wbg_entries_3265d4158b33e5dc,
411
411
  __wbg_entries_c8a90a7ed73e84ce,
412
412
  __wbg_error_7534b8e9a36f1ab4,
413
- __wbg_error_eddb9b302feac7d3,
413
+ __wbg_error_efea264b63fa5feb,
414
414
  __wbg_from_2a5d3e218e67aa85,
415
415
  __wbg_getOwnPropertySymbols_97eebed6fe6e08be,
416
416
  __wbg_getRandomValues_b8f5dbd5f3995a9e,
@@ -428,8 +428,8 @@ export {
428
428
  __wbg_length_a446193dc22c12f8,
429
429
  __wbg_length_e2d2a49132c1b256,
430
430
  __wbg_log_0cc1b7768397bcfe,
431
+ __wbg_log_1b4065b9118c2c54,
431
432
  __wbg_log_cb9e190acc5753fb,
432
- __wbg_log_d8b98f6c2e2f68e5,
433
433
  __wbg_lorocounter_new,
434
434
  __wbg_lorolist_new,
435
435
  __wbg_loromap_new,
@@ -476,7 +476,7 @@ export {
476
476
  __wbg_value_cd1ffa7b1ab794f1,
477
477
  __wbg_versions_c01dfd4722a88165,
478
478
  __wbg_versionvector_new,
479
- __wbg_warn_a198177f86cf58b2,
479
+ __wbg_warn_e677aaf23eb7ded7,
480
480
  __wbindgen_as_number,
481
481
  __wbindgen_bigint_from_i64,
482
482
  __wbindgen_bigint_from_u64,
@@ -1,5 +1,7 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
+ export function encodeFrontiers(frontiers: ({ peer: PeerID, counter: number })[]): Uint8Array;
4
+ export function callPendingEvents(): void;
3
5
  /**
4
6
  * Decode the metadata of the import blob.
5
7
  *
@@ -13,13 +15,14 @@
13
15
  * - changeNum
14
16
  */
15
17
  export function decodeImportBlobMeta(blob: Uint8Array, check_checksum: boolean): ImportBlobMetadata;
18
+ /**
19
+ * Enable debug info of Loro
20
+ */
21
+ export function setDebug(): void;
16
22
  /**
17
23
  * Get the version of Loro
18
24
  */
19
25
  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;
23
26
  /**
24
27
  * Redacts sensitive content in JSON updates within the specified version range.
25
28
  *
@@ -40,11 +43,8 @@ export function callPendingEvents(): void;
40
43
  * @returns {Object} The redacted JSON updates
41
44
  */
42
45
  export function redactJsonUpdates(json_updates: string | JsonSchema, version_range: any): JsonSchema;
43
- export function encodeFrontiers(frontiers: ({ peer: PeerID, counter: number })[]): Uint8Array;
44
- /**
45
- * Enable debug info of Loro
46
- */
47
- export function setDebug(): void;
46
+ export function decodeFrontiers(bytes: Uint8Array): { peer: PeerID, counter: number }[];
47
+ export function run(): void;
48
48
 
49
49
  /**
50
50
  * Container types supported by loro.
@@ -29,7 +29,7 @@ import {
29
29
  __wbg_entries_3265d4158b33e5dc,
30
30
  __wbg_entries_c8a90a7ed73e84ce,
31
31
  __wbg_error_7534b8e9a36f1ab4,
32
- __wbg_error_eddb9b302feac7d3,
32
+ __wbg_error_efea264b63fa5feb,
33
33
  __wbg_from_2a5d3e218e67aa85,
34
34
  __wbg_getOwnPropertySymbols_97eebed6fe6e08be,
35
35
  __wbg_getRandomValues_b8f5dbd5f3995a9e,
@@ -47,8 +47,8 @@ import {
47
47
  __wbg_length_a446193dc22c12f8,
48
48
  __wbg_length_e2d2a49132c1b256,
49
49
  __wbg_log_0cc1b7768397bcfe,
50
+ __wbg_log_1b4065b9118c2c54,
50
51
  __wbg_log_cb9e190acc5753fb,
51
- __wbg_log_d8b98f6c2e2f68e5,
52
52
  __wbg_lorocounter_new,
53
53
  __wbg_lorolist_new,
54
54
  __wbg_loromap_new,
@@ -95,7 +95,7 @@ import {
95
95
  __wbg_value_cd1ffa7b1ab794f1,
96
96
  __wbg_versions_c01dfd4722a88165,
97
97
  __wbg_versionvector_new,
98
- __wbg_warn_a198177f86cf58b2,
98
+ __wbg_warn_e677aaf23eb7ded7,
99
99
  __wbindgen_as_number,
100
100
  __wbindgen_bigint_from_i64,
101
101
  __wbindgen_bigint_from_u64,
@@ -170,7 +170,7 @@ const imports = {
170
170
  __wbg_entries_3265d4158b33e5dc,
171
171
  __wbg_entries_c8a90a7ed73e84ce,
172
172
  __wbg_error_7534b8e9a36f1ab4,
173
- __wbg_error_eddb9b302feac7d3,
173
+ __wbg_error_efea264b63fa5feb,
174
174
  __wbg_from_2a5d3e218e67aa85,
175
175
  __wbg_getOwnPropertySymbols_97eebed6fe6e08be,
176
176
  __wbg_getRandomValues_b8f5dbd5f3995a9e,
@@ -188,8 +188,8 @@ const imports = {
188
188
  __wbg_length_a446193dc22c12f8,
189
189
  __wbg_length_e2d2a49132c1b256,
190
190
  __wbg_log_0cc1b7768397bcfe,
191
+ __wbg_log_1b4065b9118c2c54,
191
192
  __wbg_log_cb9e190acc5753fb,
192
- __wbg_log_d8b98f6c2e2f68e5,
193
193
  __wbg_lorocounter_new,
194
194
  __wbg_lorolist_new,
195
195
  __wbg_loromap_new,
@@ -236,7 +236,7 @@ const imports = {
236
236
  __wbg_value_cd1ffa7b1ab794f1,
237
237
  __wbg_versions_c01dfd4722a88165,
238
238
  __wbg_versionvector_new,
239
- __wbg_warn_a198177f86cf58b2,
239
+ __wbg_warn_e677aaf23eb7ded7,
240
240
  __wbindgen_as_number,
241
241
  __wbindgen_bigint_from_i64,
242
242
  __wbindgen_bigint_from_u64,
@@ -363,7 +363,7 @@ export {
363
363
  __wbg_entries_3265d4158b33e5dc,
364
364
  __wbg_entries_c8a90a7ed73e84ce,
365
365
  __wbg_error_7534b8e9a36f1ab4,
366
- __wbg_error_eddb9b302feac7d3,
366
+ __wbg_error_efea264b63fa5feb,
367
367
  __wbg_from_2a5d3e218e67aa85,
368
368
  __wbg_getOwnPropertySymbols_97eebed6fe6e08be,
369
369
  __wbg_getRandomValues_b8f5dbd5f3995a9e,
@@ -381,8 +381,8 @@ export {
381
381
  __wbg_length_a446193dc22c12f8,
382
382
  __wbg_length_e2d2a49132c1b256,
383
383
  __wbg_log_0cc1b7768397bcfe,
384
+ __wbg_log_1b4065b9118c2c54,
384
385
  __wbg_log_cb9e190acc5753fb,
385
- __wbg_log_d8b98f6c2e2f68e5,
386
386
  __wbg_lorocounter_new,
387
387
  __wbg_lorolist_new,
388
388
  __wbg_loromap_new,
@@ -429,7 +429,7 @@ export {
429
429
  __wbg_value_cd1ffa7b1ab794f1,
430
430
  __wbg_versions_c01dfd4722a88165,
431
431
  __wbg_versionvector_new,
432
- __wbg_warn_a198177f86cf58b2,
432
+ __wbg_warn_e677aaf23eb7ded7,
433
433
  __wbindgen_as_number,
434
434
  __wbindgen_bigint_from_i64,
435
435
  __wbindgen_bigint_from_u64,
@@ -263,6 +263,45 @@ function getArrayJsValueFromWasm0(ptr, len) {
263
263
  }
264
264
  return result;
265
265
  }
266
+
267
+ function passArrayJsValueToWasm0(array, malloc) {
268
+ const ptr = malloc(array.length * 4, 4) >>> 0;
269
+ const mem = getDataViewMemory0();
270
+ for (let i = 0; i < array.length; i++) {
271
+ mem.setUint32(ptr + 4 * i, addHeapObject(array[i]), true);
272
+ }
273
+ WASM_VECTOR_LEN = array.length;
274
+ return ptr;
275
+ }
276
+ /**
277
+ * @param {({ peer: PeerID, counter: number })[]} frontiers
278
+ * @returns {Uint8Array}
279
+ */
280
+ export function encodeFrontiers(frontiers) {
281
+ try {
282
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
283
+ const ptr0 = passArrayJsValueToWasm0(frontiers, wasm.__wbindgen_malloc);
284
+ const len0 = WASM_VECTOR_LEN;
285
+ wasm.encodeFrontiers(retptr, ptr0, len0);
286
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
287
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
288
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
289
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
290
+ if (r3) {
291
+ throw takeObject(r2);
292
+ }
293
+ var v2 = getArrayU8FromWasm0(r0, r1).slice();
294
+ wasm.__wbindgen_free(r0, r1 * 1, 1);
295
+ return v2;
296
+ } finally {
297
+ wasm.__wbindgen_add_to_stack_pointer(16);
298
+ }
299
+ }
300
+
301
+ export function callPendingEvents() {
302
+ wasm.callPendingEvents();
303
+ }
304
+
266
305
  /**
267
306
  * Decode the metadata of the import blob.
268
307
  *
@@ -296,6 +335,13 @@ export function decodeImportBlobMeta(blob, check_checksum) {
296
335
  }
297
336
  }
298
337
 
338
+ /**
339
+ * Enable debug info of Loro
340
+ */
341
+ export function setDebug() {
342
+ wasm.setDebug();
343
+ }
344
+
299
345
  /**
300
346
  * Get the version of Loro
301
347
  * @returns {string}
@@ -317,36 +363,6 @@ export function LORO_VERSION() {
317
363
  }
318
364
  }
319
365
 
320
- export function run() {
321
- wasm.run();
322
- }
323
-
324
- /**
325
- * @param {Uint8Array} bytes
326
- * @returns {{ peer: PeerID, counter: number }[]}
327
- */
328
- export function decodeFrontiers(bytes) {
329
- try {
330
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
331
- const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
332
- const len0 = WASM_VECTOR_LEN;
333
- wasm.decodeFrontiers(retptr, ptr0, len0);
334
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
335
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
336
- var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
337
- if (r2) {
338
- throw takeObject(r1);
339
- }
340
- return takeObject(r0);
341
- } finally {
342
- wasm.__wbindgen_add_to_stack_pointer(16);
343
- }
344
- }
345
-
346
- export function callPendingEvents() {
347
- wasm.callPendingEvents();
348
- }
349
-
350
366
  /**
351
367
  * Redacts sensitive content in JSON updates within the specified version range.
352
368
  *
@@ -385,53 +401,38 @@ export function redactJsonUpdates(json_updates, version_range) {
385
401
  }
386
402
  }
387
403
 
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
404
  /**
398
- * @param {({ peer: PeerID, counter: number })[]} frontiers
399
- * @returns {Uint8Array}
405
+ * @param {Uint8Array} bytes
406
+ * @returns {{ peer: PeerID, counter: number }[]}
400
407
  */
401
- export function encodeFrontiers(frontiers) {
408
+ export function decodeFrontiers(bytes) {
402
409
  try {
403
410
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
404
- const ptr0 = passArrayJsValueToWasm0(frontiers, wasm.__wbindgen_malloc);
411
+ const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
405
412
  const len0 = WASM_VECTOR_LEN;
406
- wasm.encodeFrontiers(retptr, ptr0, len0);
413
+ wasm.decodeFrontiers(retptr, ptr0, len0);
407
414
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
408
415
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
409
416
  var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
410
- var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
411
- if (r3) {
412
- throw takeObject(r2);
417
+ if (r2) {
418
+ throw takeObject(r1);
413
419
  }
414
- var v2 = getArrayU8FromWasm0(r0, r1).slice();
415
- wasm.__wbindgen_free(r0, r1 * 1, 1);
416
- return v2;
420
+ return takeObject(r0);
417
421
  } finally {
418
422
  wasm.__wbindgen_add_to_stack_pointer(16);
419
423
  }
420
424
  }
421
425
 
422
- /**
423
- * Enable debug info of Loro
424
- */
425
- export function setDebug() {
426
- wasm.setDebug();
426
+ export function run() {
427
+ wasm.run();
427
428
  }
428
429
 
429
430
  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));
431
+ wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__hed608779f4ff852a(arg0, arg1, addHeapObject(arg2));
431
432
  }
432
433
 
433
434
  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);
435
+ wasm._dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h0b205d05825e6af2(arg0, arg1);
435
436
  }
436
437
 
437
438
  const AwarenessWasmFinalization = (typeof FinalizationRegistry === 'undefined')
@@ -7005,7 +7006,7 @@ export function __wbg_error_7534b8e9a36f1ab4(arg0, arg1) {
7005
7006
  }
7006
7007
  };
7007
7008
 
7008
- export function __wbg_error_eddb9b302feac7d3(arg0, arg1) {
7009
+ export function __wbg_error_efea264b63fa5feb(arg0, arg1) {
7009
7010
  console.error(getStringFromWasm0(arg0, arg1));
7010
7011
  };
7011
7012
 
@@ -7124,6 +7125,10 @@ export function __wbg_log_0cc1b7768397bcfe(arg0, arg1, arg2, arg3, arg4, arg5, a
7124
7125
  }
7125
7126
  };
7126
7127
 
7128
+ export function __wbg_log_1b4065b9118c2c54(arg0, arg1) {
7129
+ console.log(getStringFromWasm0(arg0, arg1));
7130
+ };
7131
+
7127
7132
  export function __wbg_log_cb9e190acc5753fb(arg0, arg1) {
7128
7133
  let deferred0_0;
7129
7134
  let deferred0_1;
@@ -7136,10 +7141,6 @@ export function __wbg_log_cb9e190acc5753fb(arg0, arg1) {
7136
7141
  }
7137
7142
  };
7138
7143
 
7139
- export function __wbg_log_d8b98f6c2e2f68e5(arg0, arg1) {
7140
- console.log(getStringFromWasm0(arg0, arg1));
7141
- };
7142
-
7143
7144
  export function __wbg_lorocounter_new(arg0) {
7144
7145
  const ret = LoroCounter.__wrap(arg0);
7145
7146
  return addHeapObject(ret);
@@ -7374,7 +7375,7 @@ export function __wbg_versionvector_new(arg0) {
7374
7375
  return addHeapObject(ret);
7375
7376
  };
7376
7377
 
7377
- export function __wbg_warn_a198177f86cf58b2(arg0, arg1) {
7378
+ export function __wbg_warn_e677aaf23eb7ded7(arg0, arg1) {
7378
7379
  console.warn(getStringFromWasm0(arg0, arg1));
7379
7380
  };
7380
7381
 
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__hed608779f4ff852a: (a: number, b: number, c: number) => void;
334
+ export const _dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h0b205d05825e6af2: (a: number, b: number) => void;
335
335
  export const __wbindgen_start: () => void;
package/bundler/index.js CHANGED
@@ -410,7 +410,7 @@ export {
410
410
  __wbg_entries_3265d4158b33e5dc,
411
411
  __wbg_entries_c8a90a7ed73e84ce,
412
412
  __wbg_error_7534b8e9a36f1ab4,
413
- __wbg_error_eddb9b302feac7d3,
413
+ __wbg_error_efea264b63fa5feb,
414
414
  __wbg_from_2a5d3e218e67aa85,
415
415
  __wbg_getOwnPropertySymbols_97eebed6fe6e08be,
416
416
  __wbg_getRandomValues_b8f5dbd5f3995a9e,
@@ -428,8 +428,8 @@ export {
428
428
  __wbg_length_a446193dc22c12f8,
429
429
  __wbg_length_e2d2a49132c1b256,
430
430
  __wbg_log_0cc1b7768397bcfe,
431
+ __wbg_log_1b4065b9118c2c54,
431
432
  __wbg_log_cb9e190acc5753fb,
432
- __wbg_log_d8b98f6c2e2f68e5,
433
433
  __wbg_lorocounter_new,
434
434
  __wbg_lorolist_new,
435
435
  __wbg_loromap_new,
@@ -476,7 +476,7 @@ export {
476
476
  __wbg_value_cd1ffa7b1ab794f1,
477
477
  __wbg_versions_c01dfd4722a88165,
478
478
  __wbg_versionvector_new,
479
- __wbg_warn_a198177f86cf58b2,
479
+ __wbg_warn_e677aaf23eb7ded7,
480
480
  __wbindgen_as_number,
481
481
  __wbindgen_bigint_from_i64,
482
482
  __wbindgen_bigint_from_u64,
@@ -1,5 +1,7 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
+ export function encodeFrontiers(frontiers: ({ peer: PeerID, counter: number })[]): Uint8Array;
4
+ export function callPendingEvents(): void;
3
5
  /**
4
6
  * Decode the metadata of the import blob.
5
7
  *
@@ -13,13 +15,14 @@
13
15
  * - changeNum
14
16
  */
15
17
  export function decodeImportBlobMeta(blob: Uint8Array, check_checksum: boolean): ImportBlobMetadata;
18
+ /**
19
+ * Enable debug info of Loro
20
+ */
21
+ export function setDebug(): void;
16
22
  /**
17
23
  * Get the version of Loro
18
24
  */
19
25
  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;
23
26
  /**
24
27
  * Redacts sensitive content in JSON updates within the specified version range.
25
28
  *
@@ -40,11 +43,8 @@ export function callPendingEvents(): void;
40
43
  * @returns {Object} The redacted JSON updates
41
44
  */
42
45
  export function redactJsonUpdates(json_updates: string | JsonSchema, version_range: any): JsonSchema;
43
- export function encodeFrontiers(frontiers: ({ peer: PeerID, counter: number })[]): Uint8Array;
44
- /**
45
- * Enable debug info of Loro
46
- */
47
- export function setDebug(): void;
46
+ export function decodeFrontiers(bytes: Uint8Array): { peer: PeerID, counter: number }[];
47
+ export function run(): void;
48
48
 
49
49
  /**
50
50
  * Container types supported by loro.
@@ -263,6 +263,45 @@ function getArrayJsValueFromWasm0(ptr, len) {
263
263
  }
264
264
  return result;
265
265
  }
266
+
267
+ function passArrayJsValueToWasm0(array, malloc) {
268
+ const ptr = malloc(array.length * 4, 4) >>> 0;
269
+ const mem = getDataViewMemory0();
270
+ for (let i = 0; i < array.length; i++) {
271
+ mem.setUint32(ptr + 4 * i, addHeapObject(array[i]), true);
272
+ }
273
+ WASM_VECTOR_LEN = array.length;
274
+ return ptr;
275
+ }
276
+ /**
277
+ * @param {({ peer: PeerID, counter: number })[]} frontiers
278
+ * @returns {Uint8Array}
279
+ */
280
+ export function encodeFrontiers(frontiers) {
281
+ try {
282
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
283
+ const ptr0 = passArrayJsValueToWasm0(frontiers, wasm.__wbindgen_malloc);
284
+ const len0 = WASM_VECTOR_LEN;
285
+ wasm.encodeFrontiers(retptr, ptr0, len0);
286
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
287
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
288
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
289
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
290
+ if (r3) {
291
+ throw takeObject(r2);
292
+ }
293
+ var v2 = getArrayU8FromWasm0(r0, r1).slice();
294
+ wasm.__wbindgen_free(r0, r1 * 1, 1);
295
+ return v2;
296
+ } finally {
297
+ wasm.__wbindgen_add_to_stack_pointer(16);
298
+ }
299
+ }
300
+
301
+ export function callPendingEvents() {
302
+ wasm.callPendingEvents();
303
+ }
304
+
266
305
  /**
267
306
  * Decode the metadata of the import blob.
268
307
  *
@@ -296,6 +335,13 @@ export function decodeImportBlobMeta(blob, check_checksum) {
296
335
  }
297
336
  }
298
337
 
338
+ /**
339
+ * Enable debug info of Loro
340
+ */
341
+ export function setDebug() {
342
+ wasm.setDebug();
343
+ }
344
+
299
345
  /**
300
346
  * Get the version of Loro
301
347
  * @returns {string}
@@ -317,36 +363,6 @@ export function LORO_VERSION() {
317
363
  }
318
364
  }
319
365
 
320
- export function run() {
321
- wasm.run();
322
- }
323
-
324
- /**
325
- * @param {Uint8Array} bytes
326
- * @returns {{ peer: PeerID, counter: number }[]}
327
- */
328
- export function decodeFrontiers(bytes) {
329
- try {
330
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
331
- const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
332
- const len0 = WASM_VECTOR_LEN;
333
- wasm.decodeFrontiers(retptr, ptr0, len0);
334
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
335
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
336
- var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
337
- if (r2) {
338
- throw takeObject(r1);
339
- }
340
- return takeObject(r0);
341
- } finally {
342
- wasm.__wbindgen_add_to_stack_pointer(16);
343
- }
344
- }
345
-
346
- export function callPendingEvents() {
347
- wasm.callPendingEvents();
348
- }
349
-
350
366
  /**
351
367
  * Redacts sensitive content in JSON updates within the specified version range.
352
368
  *
@@ -385,53 +401,38 @@ export function redactJsonUpdates(json_updates, version_range) {
385
401
  }
386
402
  }
387
403
 
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
404
  /**
398
- * @param {({ peer: PeerID, counter: number })[]} frontiers
399
- * @returns {Uint8Array}
405
+ * @param {Uint8Array} bytes
406
+ * @returns {{ peer: PeerID, counter: number }[]}
400
407
  */
401
- export function encodeFrontiers(frontiers) {
408
+ export function decodeFrontiers(bytes) {
402
409
  try {
403
410
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
404
- const ptr0 = passArrayJsValueToWasm0(frontiers, wasm.__wbindgen_malloc);
411
+ const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
405
412
  const len0 = WASM_VECTOR_LEN;
406
- wasm.encodeFrontiers(retptr, ptr0, len0);
413
+ wasm.decodeFrontiers(retptr, ptr0, len0);
407
414
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
408
415
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
409
416
  var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
410
- var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
411
- if (r3) {
412
- throw takeObject(r2);
417
+ if (r2) {
418
+ throw takeObject(r1);
413
419
  }
414
- var v2 = getArrayU8FromWasm0(r0, r1).slice();
415
- wasm.__wbindgen_free(r0, r1 * 1, 1);
416
- return v2;
420
+ return takeObject(r0);
417
421
  } finally {
418
422
  wasm.__wbindgen_add_to_stack_pointer(16);
419
423
  }
420
424
  }
421
425
 
422
- /**
423
- * Enable debug info of Loro
424
- */
425
- export function setDebug() {
426
- wasm.setDebug();
426
+ export function run() {
427
+ wasm.run();
427
428
  }
428
429
 
429
430
  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));
431
+ wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__hed608779f4ff852a(arg0, arg1, addHeapObject(arg2));
431
432
  }
432
433
 
433
434
  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);
435
+ wasm._dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h0b205d05825e6af2(arg0, arg1);
435
436
  }
436
437
 
437
438
  const AwarenessWasmFinalization = (typeof FinalizationRegistry === 'undefined')
@@ -7005,7 +7006,7 @@ export function __wbg_error_7534b8e9a36f1ab4(arg0, arg1) {
7005
7006
  }
7006
7007
  };
7007
7008
 
7008
- export function __wbg_error_eddb9b302feac7d3(arg0, arg1) {
7009
+ export function __wbg_error_efea264b63fa5feb(arg0, arg1) {
7009
7010
  console.error(getStringFromWasm0(arg0, arg1));
7010
7011
  };
7011
7012
 
@@ -7124,6 +7125,10 @@ export function __wbg_log_0cc1b7768397bcfe(arg0, arg1, arg2, arg3, arg4, arg5, a
7124
7125
  }
7125
7126
  };
7126
7127
 
7128
+ export function __wbg_log_1b4065b9118c2c54(arg0, arg1) {
7129
+ console.log(getStringFromWasm0(arg0, arg1));
7130
+ };
7131
+
7127
7132
  export function __wbg_log_cb9e190acc5753fb(arg0, arg1) {
7128
7133
  let deferred0_0;
7129
7134
  let deferred0_1;
@@ -7136,10 +7141,6 @@ export function __wbg_log_cb9e190acc5753fb(arg0, arg1) {
7136
7141
  }
7137
7142
  };
7138
7143
 
7139
- export function __wbg_log_d8b98f6c2e2f68e5(arg0, arg1) {
7140
- console.log(getStringFromWasm0(arg0, arg1));
7141
- };
7142
-
7143
7144
  export function __wbg_lorocounter_new(arg0) {
7144
7145
  const ret = LoroCounter.__wrap(arg0);
7145
7146
  return addHeapObject(ret);
@@ -7374,7 +7375,7 @@ export function __wbg_versionvector_new(arg0) {
7374
7375
  return addHeapObject(ret);
7375
7376
  };
7376
7377
 
7377
- export function __wbg_warn_a198177f86cf58b2(arg0, arg1) {
7378
+ export function __wbg_warn_e677aaf23eb7ded7(arg0, arg1) {
7378
7379
  console.warn(getStringFromWasm0(arg0, arg1));
7379
7380
  };
7380
7381
 
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__hed608779f4ff852a: (a: number, b: number, c: number) => void;
334
+ export const _dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h0b205d05825e6af2: (a: number, b: number) => void;
335
335
  export const __wbindgen_start: () => void;