loro-crdt 1.10.2 → 1.10.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.
package/web/loro_wasm.js CHANGED
@@ -232,11 +232,6 @@ function getArrayJsValueFromWasm0(ptr, len) {
232
232
  wasm.__externref_drop_slice(ptr, len);
233
233
  return result;
234
234
  }
235
-
236
- export function callPendingEvents() {
237
- wasm.callPendingEvents();
238
- }
239
-
240
235
  /**
241
236
  * Get the version of Loro
242
237
  * @returns {string}
@@ -286,24 +281,6 @@ export function encodeFrontiers(frontiers) {
286
281
  return v2;
287
282
  }
288
283
 
289
- /**
290
- * @param {Uint8Array} bytes
291
- * @returns {{ peer: PeerID, counter: number }[]}
292
- */
293
- export function decodeFrontiers(bytes) {
294
- const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
295
- const len0 = WASM_VECTOR_LEN;
296
- const ret = wasm.decodeFrontiers(ptr0, len0);
297
- if (ret[2]) {
298
- throw takeFromExternrefTable0(ret[1]);
299
- }
300
- return takeFromExternrefTable0(ret[0]);
301
- }
302
-
303
- export function run() {
304
- wasm.run();
305
- }
306
-
307
284
  /**
308
285
  * Redacts sensitive content in JSON updates within the specified version range.
309
286
  *
@@ -334,6 +311,28 @@ export function redactJsonUpdates(json_updates, version_range) {
334
311
  return takeFromExternrefTable0(ret[0]);
335
312
  }
336
313
 
314
+ export function callPendingEvents() {
315
+ wasm.callPendingEvents();
316
+ }
317
+
318
+ export function run() {
319
+ wasm.run();
320
+ }
321
+
322
+ /**
323
+ * @param {Uint8Array} bytes
324
+ * @returns {{ peer: PeerID, counter: number }[]}
325
+ */
326
+ export function decodeFrontiers(bytes) {
327
+ const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
328
+ const len0 = WASM_VECTOR_LEN;
329
+ const ret = wasm.decodeFrontiers(ptr0, len0);
330
+ if (ret[2]) {
331
+ throw takeFromExternrefTable0(ret[1]);
332
+ }
333
+ return takeFromExternrefTable0(ret[0]);
334
+ }
335
+
337
336
  /**
338
337
  * Decode the metadata of the import blob.
339
338
  *
@@ -360,11 +359,11 @@ export function decodeImportBlobMeta(blob, check_checksum) {
360
359
  }
361
360
 
362
361
  function __wbg_adapter_62(arg0, arg1, arg2) {
363
- wasm.closure11_externref_shim(arg0, arg1, arg2);
362
+ wasm.closure9_externref_shim(arg0, arg1, arg2);
364
363
  }
365
364
 
366
365
  function __wbg_adapter_65(arg0, arg1) {
367
- wasm._dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__ha7d67e25add7f151(arg0, arg1);
366
+ wasm._dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h2222385ed10d04df(arg0, arg1);
368
367
  }
369
368
 
370
369
  const AwarenessWasmFinalization = (typeof FinalizationRegistry === 'undefined')
@@ -1648,6 +1647,25 @@ export class LoroDoc {
1648
1647
  }
1649
1648
  return takeFromExternrefTable0(ret[0]);
1650
1649
  }
1650
+ /**
1651
+ * Subscribe to changes that may affect a JSONPath query.
1652
+ *
1653
+ * The callback receives no query result; it is a lightweight notifier and may
1654
+ * fire false positives so callers can debounce/throttle before running JSONPath
1655
+ * themselves.
1656
+ * @param {string} jsonpath
1657
+ * @param {Function} f
1658
+ * @returns {any}
1659
+ */
1660
+ subscribeJsonpath(jsonpath, f) {
1661
+ const ptr0 = passStringToWasm0(jsonpath, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1662
+ const len0 = WASM_VECTOR_LEN;
1663
+ const ret = wasm.lorodoc_subscribeJsonpath(this.__wbg_ptr, ptr0, len0, f);
1664
+ if (ret[2]) {
1665
+ throw takeFromExternrefTable0(ret[1]);
1666
+ }
1667
+ return takeFromExternrefTable0(ret[0]);
1668
+ }
1651
1669
  /**
1652
1670
  * Delete all content from a root container and hide it from the document.
1653
1671
  *
@@ -5541,9 +5559,6 @@ function __wbg_get_imports() {
5541
5559
  const ret = arg0.entries();
5542
5560
  return ret;
5543
5561
  };
5544
- imports.wbg.__wbg_error_4ac2b4fe53215e85 = function(arg0, arg1) {
5545
- console.error(getStringFromWasm0(arg0, arg1));
5546
- };
5547
5562
  imports.wbg.__wbg_error_7534b8e9a36f1ab4 = function(arg0, arg1) {
5548
5563
  let deferred0_0;
5549
5564
  let deferred0_1;
@@ -5555,6 +5570,9 @@ function __wbg_get_imports() {
5555
5570
  wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
5556
5571
  }
5557
5572
  };
5573
+ imports.wbg.__wbg_error_ec1c81ec21690870 = function(arg0, arg1) {
5574
+ console.error(getStringFromWasm0(arg0, arg1));
5575
+ };
5558
5576
  imports.wbg.__wbg_from_2a5d3e218e67aa85 = function(arg0) {
5559
5577
  const ret = Array.from(arg0);
5560
5578
  return ret;
@@ -5653,7 +5671,7 @@ function __wbg_get_imports() {
5653
5671
  wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
5654
5672
  }
5655
5673
  };
5656
- imports.wbg.__wbg_log_bd9aa71b996755d3 = function(arg0, arg1) {
5674
+ imports.wbg.__wbg_log_8c0006defd0ef388 = function(arg0, arg1) {
5657
5675
  console.log(getStringFromWasm0(arg0, arg1));
5658
5676
  };
5659
5677
  imports.wbg.__wbg_log_cb9e190acc5753fb = function(arg0, arg1) {
@@ -5766,7 +5784,7 @@ function __wbg_get_imports() {
5766
5784
  const ret = arg0.node;
5767
5785
  return ret;
5768
5786
  };
5769
- imports.wbg.__wbg_now_d256cd3265ccdaa6 = function() {
5787
+ imports.wbg.__wbg_now_8a87c5466cc7d560 = function() {
5770
5788
  const ret = Date.now();
5771
5789
  return ret;
5772
5790
  };
@@ -5856,7 +5874,7 @@ function __wbg_get_imports() {
5856
5874
  const ret = VersionVector.__wrap(arg0);
5857
5875
  return ret;
5858
5876
  };
5859
- imports.wbg.__wbg_warn_ba32d63a72098111 = function(arg0, arg1) {
5877
+ imports.wbg.__wbg_warn_6a7b1c2df711ad0a = function(arg0, arg1) {
5860
5878
  console.warn(getStringFromWasm0(arg0, arg1));
5861
5879
  };
5862
5880
  imports.wbg.__wbindgen_as_number = function(arg0) {
@@ -5895,7 +5913,7 @@ function __wbg_get_imports() {
5895
5913
  const ret = makeMutClosure(arg0, arg1, 10, __wbg_adapter_62);
5896
5914
  return ret;
5897
5915
  };
5898
- imports.wbg.__wbindgen_closure_wrapper721 = function(arg0, arg1, arg2) {
5916
+ imports.wbg.__wbindgen_closure_wrapper720 = function(arg0, arg1, arg2) {
5899
5917
  const ret = makeMutClosure(arg0, arg1, 10, __wbg_adapter_65);
5900
5918
  return ret;
5901
5919
  };
Binary file
@@ -134,6 +134,7 @@ export const lorodoc_shallowSinceFrontiers: (a: number) => [number, number, numb
134
134
  export const lorodoc_shallowSinceVV: (a: number) => number;
135
135
  export const lorodoc_subscribe: (a: number, b: any) => any;
136
136
  export const lorodoc_subscribeFirstCommitFromPeer: (a: number, b: any) => any;
137
+ export const lorodoc_subscribeJsonpath: (a: number, b: number, c: number, d: any) => [number, number, number];
137
138
  export const lorodoc_subscribeLocalUpdates: (a: number, b: any) => any;
138
139
  export const lorodoc_subscribePreCommit: (a: number, b: any) => any;
139
140
  export const lorodoc_toJSON: (a: number) => [number, number, number];
@@ -324,6 +325,6 @@ export const __wbindgen_free: (a: number, b: number, c: number) => void;
324
325
  export const __wbindgen_export_6: WebAssembly.Table;
325
326
  export const __externref_table_dealloc: (a: number) => void;
326
327
  export const __externref_drop_slice: (a: number, b: number) => void;
327
- export const closure11_externref_shim: (a: number, b: number, c: any) => void;
328
- export const _dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__ha7d67e25add7f151: (a: number, b: number) => void;
328
+ export const closure9_externref_shim: (a: number, b: number, c: any) => void;
329
+ export const _dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h2222385ed10d04df: (a: number, b: number) => void;
329
330
  export const __wbindgen_start: () => void;