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.
@@ -1,6 +1,5 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
- export function callPendingEvents(): void;
4
3
  /**
5
4
  * Get the version of Loro
6
5
  */
@@ -10,8 +9,6 @@ export function LORO_VERSION(): string;
10
9
  */
11
10
  export function setDebug(): void;
12
11
  export function encodeFrontiers(frontiers: ({ peer: PeerID, counter: number })[]): Uint8Array;
13
- export function decodeFrontiers(bytes: Uint8Array): { peer: PeerID, counter: number }[];
14
- export function run(): void;
15
12
  /**
16
13
  * Redacts sensitive content in JSON updates within the specified version range.
17
14
  *
@@ -32,6 +29,9 @@ export function run(): void;
32
29
  * @returns {Object} The redacted JSON updates
33
30
  */
34
31
  export function redactJsonUpdates(json_updates: string | JsonSchema, version_range: any): JsonSchema;
32
+ export function callPendingEvents(): void;
33
+ export function run(): void;
34
+ export function decodeFrontiers(bytes: Uint8Array): { peer: PeerID, counter: number }[];
35
35
  /**
36
36
  * Decode the metadata of the import blob.
37
37
  *
@@ -874,6 +874,12 @@ interface Listener {
874
874
 
875
875
  interface LoroDoc {
876
876
  subscribe(listener: Listener): Subscription;
877
+ /**
878
+ * Subscribe to changes that may affect a JSONPath query.
879
+ * Callback may fire false positives and carries no query result.
880
+ * You can debounce/throttle the callback before running `JSONPath(...)` to optimize heavy reads.
881
+ */
882
+ subscribeJsonpath(path: string, callback: () => void): Subscription;
877
883
  }
878
884
 
879
885
  interface UndoManager {
@@ -911,6 +917,12 @@ interface UndoManager {
911
917
  groupEnd(): void;
912
918
  }
913
919
  interface LoroDoc<T extends Record<string, Container> = Record<string, Container>> {
920
+ /**
921
+ * Subscribe to changes that may affect a JSONPath query.
922
+ * Callback may fire false positives and carries no query result.
923
+ * You can debounce/throttle the callback before running `JSONPath(...)` to optimize heavy reads.
924
+ */
925
+ subscribeJsonpath(path: string, callback: () => void): Subscription;
914
926
  /**
915
927
  * Get a LoroMap by container id
916
928
  *
@@ -1,6 +1,5 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
- export function callPendingEvents(): void;
4
3
  /**
5
4
  * Get the version of Loro
6
5
  */
@@ -10,8 +9,6 @@ export function LORO_VERSION(): string;
10
9
  */
11
10
  export function setDebug(): void;
12
11
  export function encodeFrontiers(frontiers: ({ peer: PeerID, counter: number })[]): Uint8Array;
13
- export function decodeFrontiers(bytes: Uint8Array): { peer: PeerID, counter: number }[];
14
- export function run(): void;
15
12
  /**
16
13
  * Redacts sensitive content in JSON updates within the specified version range.
17
14
  *
@@ -32,6 +29,9 @@ export function run(): void;
32
29
  * @returns {Object} The redacted JSON updates
33
30
  */
34
31
  export function redactJsonUpdates(json_updates: string | JsonSchema, version_range: any): JsonSchema;
32
+ export function callPendingEvents(): void;
33
+ export function run(): void;
34
+ export function decodeFrontiers(bytes: Uint8Array): { peer: PeerID, counter: number }[];
35
35
  /**
36
36
  * Decode the metadata of the import blob.
37
37
  *
@@ -874,6 +874,12 @@ interface Listener {
874
874
 
875
875
  interface LoroDoc {
876
876
  subscribe(listener: Listener): Subscription;
877
+ /**
878
+ * Subscribe to changes that may affect a JSONPath query.
879
+ * Callback may fire false positives and carries no query result.
880
+ * You can debounce/throttle the callback before running `JSONPath(...)` to optimize heavy reads.
881
+ */
882
+ subscribeJsonpath(path: string, callback: () => void): Subscription;
877
883
  }
878
884
 
879
885
  interface UndoManager {
@@ -911,6 +917,12 @@ interface UndoManager {
911
917
  groupEnd(): void;
912
918
  }
913
919
  interface LoroDoc<T extends Record<string, Container> = Record<string, Container>> {
920
+ /**
921
+ * Subscribe to changes that may affect a JSONPath query.
922
+ * Callback may fire false positives and carries no query result.
923
+ * You can debounce/throttle the callback before running `JSONPath(...)` to optimize heavy reads.
924
+ */
925
+ subscribeJsonpath(path: string, callback: () => void): Subscription;
914
926
  /**
915
927
  * Get a LoroMap by container id
916
928
  *
@@ -240,11 +240,6 @@ function getArrayJsValueFromWasm0(ptr, len) {
240
240
  wasm.__externref_drop_slice(ptr, len);
241
241
  return result;
242
242
  }
243
-
244
- export function callPendingEvents() {
245
- wasm.callPendingEvents();
246
- }
247
-
248
243
  /**
249
244
  * Get the version of Loro
250
245
  * @returns {string}
@@ -294,24 +289,6 @@ export function encodeFrontiers(frontiers) {
294
289
  return v2;
295
290
  }
296
291
 
297
- /**
298
- * @param {Uint8Array} bytes
299
- * @returns {{ peer: PeerID, counter: number }[]}
300
- */
301
- export function decodeFrontiers(bytes) {
302
- const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
303
- const len0 = WASM_VECTOR_LEN;
304
- const ret = wasm.decodeFrontiers(ptr0, len0);
305
- if (ret[2]) {
306
- throw takeFromExternrefTable0(ret[1]);
307
- }
308
- return takeFromExternrefTable0(ret[0]);
309
- }
310
-
311
- export function run() {
312
- wasm.run();
313
- }
314
-
315
292
  /**
316
293
  * Redacts sensitive content in JSON updates within the specified version range.
317
294
  *
@@ -342,6 +319,28 @@ export function redactJsonUpdates(json_updates, version_range) {
342
319
  return takeFromExternrefTable0(ret[0]);
343
320
  }
344
321
 
322
+ export function callPendingEvents() {
323
+ wasm.callPendingEvents();
324
+ }
325
+
326
+ export function run() {
327
+ wasm.run();
328
+ }
329
+
330
+ /**
331
+ * @param {Uint8Array} bytes
332
+ * @returns {{ peer: PeerID, counter: number }[]}
333
+ */
334
+ export function decodeFrontiers(bytes) {
335
+ const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
336
+ const len0 = WASM_VECTOR_LEN;
337
+ const ret = wasm.decodeFrontiers(ptr0, len0);
338
+ if (ret[2]) {
339
+ throw takeFromExternrefTable0(ret[1]);
340
+ }
341
+ return takeFromExternrefTable0(ret[0]);
342
+ }
343
+
345
344
  /**
346
345
  * Decode the metadata of the import blob.
347
346
  *
@@ -368,11 +367,11 @@ export function decodeImportBlobMeta(blob, check_checksum) {
368
367
  }
369
368
 
370
369
  function __wbg_adapter_62(arg0, arg1, arg2) {
371
- wasm.closure11_externref_shim(arg0, arg1, arg2);
370
+ wasm.closure9_externref_shim(arg0, arg1, arg2);
372
371
  }
373
372
 
374
373
  function __wbg_adapter_65(arg0, arg1) {
375
- wasm._dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__ha7d67e25add7f151(arg0, arg1);
374
+ wasm._dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h2222385ed10d04df(arg0, arg1);
376
375
  }
377
376
 
378
377
  const AwarenessWasmFinalization = (typeof FinalizationRegistry === 'undefined')
@@ -1656,6 +1655,25 @@ export class LoroDoc {
1656
1655
  }
1657
1656
  return takeFromExternrefTable0(ret[0]);
1658
1657
  }
1658
+ /**
1659
+ * Subscribe to changes that may affect a JSONPath query.
1660
+ *
1661
+ * The callback receives no query result; it is a lightweight notifier and may
1662
+ * fire false positives so callers can debounce/throttle before running JSONPath
1663
+ * themselves.
1664
+ * @param {string} jsonpath
1665
+ * @param {Function} f
1666
+ * @returns {any}
1667
+ */
1668
+ subscribeJsonpath(jsonpath, f) {
1669
+ const ptr0 = passStringToWasm0(jsonpath, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1670
+ const len0 = WASM_VECTOR_LEN;
1671
+ const ret = wasm.lorodoc_subscribeJsonpath(this.__wbg_ptr, ptr0, len0, f);
1672
+ if (ret[2]) {
1673
+ throw takeFromExternrefTable0(ret[1]);
1674
+ }
1675
+ return takeFromExternrefTable0(ret[0]);
1676
+ }
1659
1677
  /**
1660
1678
  * Delete all content from a root container and hide it from the document.
1661
1679
  *
@@ -5529,10 +5547,6 @@ export function __wbg_entries_c8a90a7ed73e84ce(arg0) {
5529
5547
  return ret;
5530
5548
  };
5531
5549
 
5532
- export function __wbg_error_4ac2b4fe53215e85(arg0, arg1) {
5533
- console.error(getStringFromWasm0(arg0, arg1));
5534
- };
5535
-
5536
5550
  export function __wbg_error_7534b8e9a36f1ab4(arg0, arg1) {
5537
5551
  let deferred0_0;
5538
5552
  let deferred0_1;
@@ -5545,6 +5559,10 @@ export function __wbg_error_7534b8e9a36f1ab4(arg0, arg1) {
5545
5559
  }
5546
5560
  };
5547
5561
 
5562
+ export function __wbg_error_ec1c81ec21690870(arg0, arg1) {
5563
+ console.error(getStringFromWasm0(arg0, arg1));
5564
+ };
5565
+
5548
5566
  export function __wbg_from_2a5d3e218e67aa85(arg0) {
5549
5567
  const ret = Array.from(arg0);
5550
5568
  return ret;
@@ -5660,7 +5678,7 @@ export function __wbg_log_0cc1b7768397bcfe(arg0, arg1, arg2, arg3, arg4, arg5, a
5660
5678
  }
5661
5679
  };
5662
5680
 
5663
- export function __wbg_log_bd9aa71b996755d3(arg0, arg1) {
5681
+ export function __wbg_log_8c0006defd0ef388(arg0, arg1) {
5664
5682
  console.log(getStringFromWasm0(arg0, arg1));
5665
5683
  };
5666
5684
 
@@ -5797,7 +5815,7 @@ export function __wbg_node_905d3e251edff8a2(arg0) {
5797
5815
  return ret;
5798
5816
  };
5799
5817
 
5800
- export function __wbg_now_d256cd3265ccdaa6() {
5818
+ export function __wbg_now_8a87c5466cc7d560() {
5801
5819
  const ret = Date.now();
5802
5820
  return ret;
5803
5821
  };
@@ -5910,7 +5928,7 @@ export function __wbg_versionvector_new(arg0) {
5910
5928
  return ret;
5911
5929
  };
5912
5930
 
5913
- export function __wbg_warn_ba32d63a72098111(arg0, arg1) {
5931
+ export function __wbg_warn_6a7b1c2df711ad0a(arg0, arg1) {
5914
5932
  console.warn(getStringFromWasm0(arg0, arg1));
5915
5933
  };
5916
5934
 
@@ -5957,7 +5975,7 @@ export function __wbindgen_closure_wrapper718(arg0, arg1, arg2) {
5957
5975
  return ret;
5958
5976
  };
5959
5977
 
5960
- export function __wbindgen_closure_wrapper721(arg0, arg1, arg2) {
5978
+ export function __wbindgen_closure_wrapper720(arg0, arg1, arg2) {
5961
5979
  const ret = makeMutClosure(arg0, arg1, 10, __wbg_adapter_65);
5962
5980
  return ret;
5963
5981
  };
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;
@@ -1,6 +1,5 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
- export function callPendingEvents(): void;
4
3
  /**
5
4
  * Get the version of Loro
6
5
  */
@@ -10,8 +9,6 @@ export function LORO_VERSION(): string;
10
9
  */
11
10
  export function setDebug(): void;
12
11
  export function encodeFrontiers(frontiers: ({ peer: PeerID, counter: number })[]): Uint8Array;
13
- export function decodeFrontiers(bytes: Uint8Array): { peer: PeerID, counter: number }[];
14
- export function run(): void;
15
12
  /**
16
13
  * Redacts sensitive content in JSON updates within the specified version range.
17
14
  *
@@ -32,6 +29,9 @@ export function run(): void;
32
29
  * @returns {Object} The redacted JSON updates
33
30
  */
34
31
  export function redactJsonUpdates(json_updates: string | JsonSchema, version_range: any): JsonSchema;
32
+ export function callPendingEvents(): void;
33
+ export function run(): void;
34
+ export function decodeFrontiers(bytes: Uint8Array): { peer: PeerID, counter: number }[];
35
35
  /**
36
36
  * Decode the metadata of the import blob.
37
37
  *
@@ -874,6 +874,12 @@ interface Listener {
874
874
 
875
875
  interface LoroDoc {
876
876
  subscribe(listener: Listener): Subscription;
877
+ /**
878
+ * Subscribe to changes that may affect a JSONPath query.
879
+ * Callback may fire false positives and carries no query result.
880
+ * You can debounce/throttle the callback before running `JSONPath(...)` to optimize heavy reads.
881
+ */
882
+ subscribeJsonpath(path: string, callback: () => void): Subscription;
877
883
  }
878
884
 
879
885
  interface UndoManager {
@@ -911,6 +917,12 @@ interface UndoManager {
911
917
  groupEnd(): void;
912
918
  }
913
919
  interface LoroDoc<T extends Record<string, Container> = Record<string, Container>> {
920
+ /**
921
+ * Subscribe to changes that may affect a JSONPath query.
922
+ * Callback may fire false positives and carries no query result.
923
+ * You can debounce/throttle the callback before running `JSONPath(...)` to optimize heavy reads.
924
+ */
925
+ subscribeJsonpath(path: string, callback: () => void): Subscription;
914
926
  /**
915
927
  * Get a LoroMap by container id
916
928
  *
@@ -236,11 +236,6 @@ function getArrayJsValueFromWasm0(ptr, len) {
236
236
  wasm.__externref_drop_slice(ptr, len);
237
237
  return result;
238
238
  }
239
-
240
- module.exports.callPendingEvents = function() {
241
- wasm.callPendingEvents();
242
- };
243
-
244
239
  /**
245
240
  * Get the version of Loro
246
241
  * @returns {string}
@@ -290,24 +285,6 @@ module.exports.encodeFrontiers = function(frontiers) {
290
285
  return v2;
291
286
  };
292
287
 
293
- /**
294
- * @param {Uint8Array} bytes
295
- * @returns {{ peer: PeerID, counter: number }[]}
296
- */
297
- module.exports.decodeFrontiers = function(bytes) {
298
- const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
299
- const len0 = WASM_VECTOR_LEN;
300
- const ret = wasm.decodeFrontiers(ptr0, len0);
301
- if (ret[2]) {
302
- throw takeFromExternrefTable0(ret[1]);
303
- }
304
- return takeFromExternrefTable0(ret[0]);
305
- };
306
-
307
- module.exports.run = function() {
308
- wasm.run();
309
- };
310
-
311
288
  /**
312
289
  * Redacts sensitive content in JSON updates within the specified version range.
313
290
  *
@@ -338,6 +315,28 @@ module.exports.redactJsonUpdates = function(json_updates, version_range) {
338
315
  return takeFromExternrefTable0(ret[0]);
339
316
  };
340
317
 
318
+ module.exports.callPendingEvents = function() {
319
+ wasm.callPendingEvents();
320
+ };
321
+
322
+ module.exports.run = function() {
323
+ wasm.run();
324
+ };
325
+
326
+ /**
327
+ * @param {Uint8Array} bytes
328
+ * @returns {{ peer: PeerID, counter: number }[]}
329
+ */
330
+ module.exports.decodeFrontiers = function(bytes) {
331
+ const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
332
+ const len0 = WASM_VECTOR_LEN;
333
+ const ret = wasm.decodeFrontiers(ptr0, len0);
334
+ if (ret[2]) {
335
+ throw takeFromExternrefTable0(ret[1]);
336
+ }
337
+ return takeFromExternrefTable0(ret[0]);
338
+ };
339
+
341
340
  /**
342
341
  * Decode the metadata of the import blob.
343
342
  *
@@ -364,11 +363,11 @@ module.exports.decodeImportBlobMeta = function(blob, check_checksum) {
364
363
  };
365
364
 
366
365
  function __wbg_adapter_62(arg0, arg1, arg2) {
367
- wasm.closure11_externref_shim(arg0, arg1, arg2);
366
+ wasm.closure9_externref_shim(arg0, arg1, arg2);
368
367
  }
369
368
 
370
369
  function __wbg_adapter_65(arg0, arg1) {
371
- wasm._dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__ha7d67e25add7f151(arg0, arg1);
370
+ wasm._dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h2222385ed10d04df(arg0, arg1);
372
371
  }
373
372
 
374
373
  const AwarenessWasmFinalization = (typeof FinalizationRegistry === 'undefined')
@@ -1657,6 +1656,25 @@ class LoroDoc {
1657
1656
  }
1658
1657
  return takeFromExternrefTable0(ret[0]);
1659
1658
  }
1659
+ /**
1660
+ * Subscribe to changes that may affect a JSONPath query.
1661
+ *
1662
+ * The callback receives no query result; it is a lightweight notifier and may
1663
+ * fire false positives so callers can debounce/throttle before running JSONPath
1664
+ * themselves.
1665
+ * @param {string} jsonpath
1666
+ * @param {Function} f
1667
+ * @returns {any}
1668
+ */
1669
+ subscribeJsonpath(jsonpath, f) {
1670
+ const ptr0 = passStringToWasm0(jsonpath, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1671
+ const len0 = WASM_VECTOR_LEN;
1672
+ const ret = wasm.lorodoc_subscribeJsonpath(this.__wbg_ptr, ptr0, len0, f);
1673
+ if (ret[2]) {
1674
+ throw takeFromExternrefTable0(ret[1]);
1675
+ }
1676
+ return takeFromExternrefTable0(ret[0]);
1677
+ }
1660
1678
  /**
1661
1679
  * Delete all content from a root container and hide it from the document.
1662
1680
  *
@@ -5539,10 +5557,6 @@ module.exports.__wbg_entries_c8a90a7ed73e84ce = function(arg0) {
5539
5557
  return ret;
5540
5558
  };
5541
5559
 
5542
- module.exports.__wbg_error_4ac2b4fe53215e85 = function(arg0, arg1) {
5543
- console.error(getStringFromWasm0(arg0, arg1));
5544
- };
5545
-
5546
5560
  module.exports.__wbg_error_7534b8e9a36f1ab4 = function(arg0, arg1) {
5547
5561
  let deferred0_0;
5548
5562
  let deferred0_1;
@@ -5555,6 +5569,10 @@ module.exports.__wbg_error_7534b8e9a36f1ab4 = function(arg0, arg1) {
5555
5569
  }
5556
5570
  };
5557
5571
 
5572
+ module.exports.__wbg_error_ec1c81ec21690870 = function(arg0, arg1) {
5573
+ console.error(getStringFromWasm0(arg0, arg1));
5574
+ };
5575
+
5558
5576
  module.exports.__wbg_from_2a5d3e218e67aa85 = function(arg0) {
5559
5577
  const ret = Array.from(arg0);
5560
5578
  return ret;
@@ -5670,7 +5688,7 @@ module.exports.__wbg_log_0cc1b7768397bcfe = function(arg0, arg1, arg2, arg3, arg
5670
5688
  }
5671
5689
  };
5672
5690
 
5673
- module.exports.__wbg_log_bd9aa71b996755d3 = function(arg0, arg1) {
5691
+ module.exports.__wbg_log_8c0006defd0ef388 = function(arg0, arg1) {
5674
5692
  console.log(getStringFromWasm0(arg0, arg1));
5675
5693
  };
5676
5694
 
@@ -5807,7 +5825,7 @@ module.exports.__wbg_node_905d3e251edff8a2 = function(arg0) {
5807
5825
  return ret;
5808
5826
  };
5809
5827
 
5810
- module.exports.__wbg_now_d256cd3265ccdaa6 = function() {
5828
+ module.exports.__wbg_now_8a87c5466cc7d560 = function() {
5811
5829
  const ret = Date.now();
5812
5830
  return ret;
5813
5831
  };
@@ -5920,7 +5938,7 @@ module.exports.__wbg_versionvector_new = function(arg0) {
5920
5938
  return ret;
5921
5939
  };
5922
5940
 
5923
- module.exports.__wbg_warn_ba32d63a72098111 = function(arg0, arg1) {
5941
+ module.exports.__wbg_warn_6a7b1c2df711ad0a = function(arg0, arg1) {
5924
5942
  console.warn(getStringFromWasm0(arg0, arg1));
5925
5943
  };
5926
5944
 
@@ -5967,7 +5985,7 @@ module.exports.__wbindgen_closure_wrapper718 = function(arg0, arg1, arg2) {
5967
5985
  return ret;
5968
5986
  };
5969
5987
 
5970
- module.exports.__wbindgen_closure_wrapper721 = function(arg0, arg1, arg2) {
5988
+ module.exports.__wbindgen_closure_wrapper720 = function(arg0, arg1, arg2) {
5971
5989
  const ret = makeMutClosure(arg0, arg1, 10, __wbg_adapter_65);
5972
5990
  return ret;
5973
5991
  };
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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "loro-crdt",
3
- "version": "1.10.2",
3
+ "version": "1.10.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",
@@ -1,6 +1,5 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
- export function callPendingEvents(): void;
4
3
  /**
5
4
  * Get the version of Loro
6
5
  */
@@ -10,8 +9,6 @@ export function LORO_VERSION(): string;
10
9
  */
11
10
  export function setDebug(): void;
12
11
  export function encodeFrontiers(frontiers: ({ peer: PeerID, counter: number })[]): Uint8Array;
13
- export function decodeFrontiers(bytes: Uint8Array): { peer: PeerID, counter: number }[];
14
- export function run(): void;
15
12
  /**
16
13
  * Redacts sensitive content in JSON updates within the specified version range.
17
14
  *
@@ -32,6 +29,9 @@ export function run(): void;
32
29
  * @returns {Object} The redacted JSON updates
33
30
  */
34
31
  export function redactJsonUpdates(json_updates: string | JsonSchema, version_range: any): JsonSchema;
32
+ export function callPendingEvents(): void;
33
+ export function run(): void;
34
+ export function decodeFrontiers(bytes: Uint8Array): { peer: PeerID, counter: number }[];
35
35
  /**
36
36
  * Decode the metadata of the import blob.
37
37
  *
@@ -874,6 +874,12 @@ interface Listener {
874
874
 
875
875
  interface LoroDoc {
876
876
  subscribe(listener: Listener): Subscription;
877
+ /**
878
+ * Subscribe to changes that may affect a JSONPath query.
879
+ * Callback may fire false positives and carries no query result.
880
+ * You can debounce/throttle the callback before running `JSONPath(...)` to optimize heavy reads.
881
+ */
882
+ subscribeJsonpath(path: string, callback: () => void): Subscription;
877
883
  }
878
884
 
879
885
  interface UndoManager {
@@ -911,6 +917,12 @@ interface UndoManager {
911
917
  groupEnd(): void;
912
918
  }
913
919
  interface LoroDoc<T extends Record<string, Container> = Record<string, Container>> {
920
+ /**
921
+ * Subscribe to changes that may affect a JSONPath query.
922
+ * Callback may fire false positives and carries no query result.
923
+ * You can debounce/throttle the callback before running `JSONPath(...)` to optimize heavy reads.
924
+ */
925
+ subscribeJsonpath(path: string, callback: () => void): Subscription;
914
926
  /**
915
927
  * Get a LoroMap by container id
916
928
  *
@@ -3845,6 +3857,7 @@ export interface InitOutput {
3845
3857
  readonly lorodoc_shallowSinceVV: (a: number) => number;
3846
3858
  readonly lorodoc_subscribe: (a: number, b: any) => any;
3847
3859
  readonly lorodoc_subscribeFirstCommitFromPeer: (a: number, b: any) => any;
3860
+ readonly lorodoc_subscribeJsonpath: (a: number, b: number, c: number, d: any) => [number, number, number];
3848
3861
  readonly lorodoc_subscribeLocalUpdates: (a: number, b: any) => any;
3849
3862
  readonly lorodoc_subscribePreCommit: (a: number, b: any) => any;
3850
3863
  readonly lorodoc_toJSON: (a: number) => [number, number, number];
@@ -4035,8 +4048,8 @@ export interface InitOutput {
4035
4048
  readonly __wbindgen_export_6: WebAssembly.Table;
4036
4049
  readonly __externref_table_dealloc: (a: number) => void;
4037
4050
  readonly __externref_drop_slice: (a: number, b: number) => void;
4038
- readonly closure11_externref_shim: (a: number, b: number, c: any) => void;
4039
- readonly _dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__ha7d67e25add7f151: (a: number, b: number) => void;
4051
+ readonly closure9_externref_shim: (a: number, b: number, c: any) => void;
4052
+ readonly _dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h2222385ed10d04df: (a: number, b: number) => void;
4040
4053
  readonly __wbindgen_start: () => void;
4041
4054
  }
4042
4055