loro-crdt 1.13.7 → 1.13.8

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/web/loro_wasm.js CHANGED
@@ -261,10 +261,29 @@ export function run() {
261
261
  }
262
262
 
263
263
  /**
264
- * Enable debug info of Loro
264
+ * @param {Uint8Array} bytes
265
+ * @returns {{ peer: PeerID, counter: number }[]}
265
266
  */
266
- export function setDebug() {
267
- wasm.setDebug();
267
+ export function decodeFrontiers(bytes) {
268
+ try {
269
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
270
+ const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
271
+ const len0 = WASM_VECTOR_LEN;
272
+ wasm.decodeFrontiers(retptr, ptr0, len0);
273
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
274
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
275
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
276
+ if (r2) {
277
+ throw takeObject(r1);
278
+ }
279
+ return takeObject(r0);
280
+ } finally {
281
+ wasm.__wbindgen_add_to_stack_pointer(16);
282
+ }
283
+ }
284
+
285
+ export function callPendingEvents() {
286
+ wasm.callPendingEvents();
268
287
  }
269
288
 
270
289
  /**
@@ -288,39 +307,6 @@ export function LORO_VERSION() {
288
307
  }
289
308
  }
290
309
 
291
- /**
292
- * Decode the metadata of the import blob.
293
- *
294
- * This method is useful to get the following metadata of the import blob:
295
- *
296
- * - startVersionVector
297
- * - endVersionVector
298
- * - startTimestamp
299
- * - endTimestamp
300
- * - mode
301
- * - changeNum
302
- * @param {Uint8Array} blob
303
- * @param {boolean} check_checksum
304
- * @returns {ImportBlobMetadata}
305
- */
306
- export function decodeImportBlobMeta(blob, check_checksum) {
307
- try {
308
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
309
- const ptr0 = passArray8ToWasm0(blob, wasm.__wbindgen_malloc);
310
- const len0 = WASM_VECTOR_LEN;
311
- wasm.decodeImportBlobMeta(retptr, ptr0, len0, check_checksum);
312
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
313
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
314
- var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
315
- if (r2) {
316
- throw takeObject(r1);
317
- }
318
- return takeObject(r0);
319
- } finally {
320
- wasm.__wbindgen_add_to_stack_pointer(16);
321
- }
322
- }
323
-
324
310
  /**
325
311
  * Redacts sensitive content in JSON updates within the specified version range.
326
312
  *
@@ -359,32 +345,6 @@ export function redactJsonUpdates(json_updates, version_range) {
359
345
  }
360
346
  }
361
347
 
362
- /**
363
- * @param {Uint8Array} bytes
364
- * @returns {{ peer: PeerID, counter: number }[]}
365
- */
366
- export function decodeFrontiers(bytes) {
367
- try {
368
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
369
- const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
370
- const len0 = WASM_VECTOR_LEN;
371
- wasm.decodeFrontiers(retptr, ptr0, len0);
372
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
373
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
374
- var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
375
- if (r2) {
376
- throw takeObject(r1);
377
- }
378
- return takeObject(r0);
379
- } finally {
380
- wasm.__wbindgen_add_to_stack_pointer(16);
381
- }
382
- }
383
-
384
- export function callPendingEvents() {
385
- wasm.callPendingEvents();
386
- }
387
-
388
348
  function passArrayJsValueToWasm0(array, malloc) {
389
349
  const ptr = malloc(array.length * 4, 4) >>> 0;
390
350
  const mem = getDataViewMemory0();
@@ -419,12 +379,52 @@ export function encodeFrontiers(frontiers) {
419
379
  }
420
380
  }
421
381
 
382
+ /**
383
+ * Decode the metadata of the import blob.
384
+ *
385
+ * This method is useful to get the following metadata of the import blob:
386
+ *
387
+ * - startVersionVector
388
+ * - endVersionVector
389
+ * - startTimestamp
390
+ * - endTimestamp
391
+ * - mode
392
+ * - changeNum
393
+ * @param {Uint8Array} blob
394
+ * @param {boolean} check_checksum
395
+ * @returns {ImportBlobMetadata}
396
+ */
397
+ export function decodeImportBlobMeta(blob, check_checksum) {
398
+ try {
399
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
400
+ const ptr0 = passArray8ToWasm0(blob, wasm.__wbindgen_malloc);
401
+ const len0 = WASM_VECTOR_LEN;
402
+ wasm.decodeImportBlobMeta(retptr, ptr0, len0, check_checksum);
403
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
404
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
405
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
406
+ if (r2) {
407
+ throw takeObject(r1);
408
+ }
409
+ return takeObject(r0);
410
+ } finally {
411
+ wasm.__wbindgen_add_to_stack_pointer(16);
412
+ }
413
+ }
414
+
415
+ /**
416
+ * Enable debug info of Loro
417
+ */
418
+ export function setDebug() {
419
+ wasm.setDebug();
420
+ }
421
+
422
422
  function __wbg_adapter_60(arg0, arg1, arg2) {
423
- wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__hbc243e3100319c48(arg0, arg1, addHeapObject(arg2));
423
+ wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h03abcb20aecec54f(arg0, arg1, addHeapObject(arg2));
424
424
  }
425
425
 
426
426
  function __wbg_adapter_63(arg0, arg1) {
427
- wasm._dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h09294ef44fc27173(arg0, arg1);
427
+ wasm._dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h03e188dc81fd4288(arg0, arg1);
428
428
  }
429
429
 
430
430
  const AwarenessWasmFinalization = (typeof FinalizationRegistry === 'undefined')
@@ -7022,7 +7022,7 @@ function __wbg_get_imports() {
7022
7022
  const ret = getObject(arg0).entries();
7023
7023
  return addHeapObject(ret);
7024
7024
  };
7025
- imports.wbg.__wbg_error_30083555868aa7a9 = function(arg0, arg1) {
7025
+ imports.wbg.__wbg_error_2caaeb4a4ddff603 = function(arg0, arg1) {
7026
7026
  console.error(getStringFromWasm0(arg0, arg1));
7027
7027
  };
7028
7028
  imports.wbg.__wbg_error_7534b8e9a36f1ab4 = function(arg0, arg1) {
@@ -7134,9 +7134,6 @@ function __wbg_get_imports() {
7134
7134
  wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
7135
7135
  }
7136
7136
  };
7137
- imports.wbg.__wbg_log_c534a954ce262324 = function(arg0, arg1) {
7138
- console.log(getStringFromWasm0(arg0, arg1));
7139
- };
7140
7137
  imports.wbg.__wbg_log_cb9e190acc5753fb = function(arg0, arg1) {
7141
7138
  let deferred0_0;
7142
7139
  let deferred0_1;
@@ -7148,6 +7145,9 @@ function __wbg_get_imports() {
7148
7145
  wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
7149
7146
  }
7150
7147
  };
7148
+ imports.wbg.__wbg_log_fc81db84f828b288 = function(arg0, arg1) {
7149
+ console.log(getStringFromWasm0(arg0, arg1));
7150
+ };
7151
7151
  imports.wbg.__wbg_lorocounter_new = function(arg0) {
7152
7152
  const ret = LoroCounter.__wrap(arg0);
7153
7153
  return addHeapObject(ret);
@@ -7247,7 +7247,7 @@ function __wbg_get_imports() {
7247
7247
  const ret = getObject(arg0).node;
7248
7248
  return addHeapObject(ret);
7249
7249
  };
7250
- imports.wbg.__wbg_now_9a16e63446ca7697 = function() {
7250
+ imports.wbg.__wbg_now_829357f5fa91c9dd = function() {
7251
7251
  const ret = Date.now();
7252
7252
  return ret;
7253
7253
  };
@@ -7337,7 +7337,7 @@ function __wbg_get_imports() {
7337
7337
  const ret = VersionVector.__wrap(arg0);
7338
7338
  return addHeapObject(ret);
7339
7339
  };
7340
- imports.wbg.__wbg_warn_994f3bd0367746f9 = function(arg0, arg1) {
7340
+ imports.wbg.__wbg_warn_5e3717ed8ac922f8 = function(arg0, arg1) {
7341
7341
  console.warn(getStringFromWasm0(arg0, arg1));
7342
7342
  };
7343
7343
  imports.wbg.__wbindgen_as_number = function(arg0) {
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__hbc243e3100319c48: (a: number, b: number, c: number) => void;
334
- export const _dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h09294ef44fc27173: (a: number, b: number) => void;
333
+ export const _dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h03abcb20aecec54f: (a: number, b: number, c: number) => void;
334
+ export const _dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h03e188dc81fd4288: (a: number, b: number) => void;
335
335
  export const __wbindgen_start: () => void;