loro-crdt 1.10.2 → 1.10.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,17 +1,25 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
- export function callPendingEvents(): void;
4
3
  /**
5
- * Get the version of Loro
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
6
14
  */
7
- export function LORO_VERSION(): string;
15
+ export function decodeImportBlobMeta(blob: Uint8Array, check_checksum: boolean): ImportBlobMetadata;
8
16
  /**
9
17
  * Enable debug info of Loro
10
18
  */
11
19
  export function setDebug(): void;
12
- export function encodeFrontiers(frontiers: ({ peer: PeerID, counter: number })[]): Uint8Array;
20
+ export function callPendingEvents(): void;
13
21
  export function decodeFrontiers(bytes: Uint8Array): { peer: PeerID, counter: number }[];
14
- export function run(): void;
22
+ export function encodeFrontiers(frontiers: ({ peer: PeerID, counter: number })[]): Uint8Array;
15
23
  /**
16
24
  * Redacts sensitive content in JSON updates within the specified version range.
17
25
  *
@@ -33,18 +41,10 @@ export function run(): void;
33
41
  */
34
42
  export function redactJsonUpdates(json_updates: string | JsonSchema, version_range: any): JsonSchema;
35
43
  /**
36
- * Decode the metadata of the import blob.
37
- *
38
- * This method is useful to get the following metadata of the import blob:
39
- *
40
- * - startVersionVector
41
- * - endVersionVector
42
- * - startTimestamp
43
- * - endTimestamp
44
- * - mode
45
- * - changeNum
44
+ * Get the version of Loro
46
45
  */
47
- export function decodeImportBlobMeta(blob: Uint8Array, check_checksum: boolean): ImportBlobMetadata;
46
+ export function LORO_VERSION(): string;
47
+ export function run(): void;
48
48
 
49
49
  /**
50
50
  * Container types supported by loro.
@@ -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
  *
@@ -989,7 +1001,9 @@ interface LoroDoc<T extends Record<string, Container> = Record<string, Container
989
1001
  *
990
1002
  * This method can also export pending changes from the uncommitted transaction that have not yet been applied to the OpLog.
991
1003
  *
992
- * This method will NOT trigger a new commit implicitly.
1004
+ * This method will implicitly commit pending local operations (like `export(...)`) so callers can
1005
+ * observe the latest local edits. When called inside `subscribePreCommit(...)`, it will NOT trigger
1006
+ * an additional implicit commit.
993
1007
  *
994
1008
  * @param idSpan - The id span to export.
995
1009
  * @returns The changes in the given id span.
@@ -236,26 +236,29 @@ 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
- * Get the version of Loro
246
- * @returns {string}
240
+ * Decode the metadata of the import blob.
241
+ *
242
+ * This method is useful to get the following metadata of the import blob:
243
+ *
244
+ * - startVersionVector
245
+ * - endVersionVector
246
+ * - startTimestamp
247
+ * - endTimestamp
248
+ * - mode
249
+ * - changeNum
250
+ * @param {Uint8Array} blob
251
+ * @param {boolean} check_checksum
252
+ * @returns {ImportBlobMetadata}
247
253
  */
248
- module.exports.LORO_VERSION = function() {
249
- let deferred1_0;
250
- let deferred1_1;
251
- try {
252
- const ret = wasm.LORO_VERSION();
253
- deferred1_0 = ret[0];
254
- deferred1_1 = ret[1];
255
- return getStringFromWasm0(ret[0], ret[1]);
256
- } finally {
257
- wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
254
+ module.exports.decodeImportBlobMeta = function(blob, check_checksum) {
255
+ const ptr0 = passArray8ToWasm0(blob, wasm.__wbindgen_malloc);
256
+ const len0 = WASM_VECTOR_LEN;
257
+ const ret = wasm.decodeImportBlobMeta(ptr0, len0, check_checksum);
258
+ if (ret[2]) {
259
+ throw takeFromExternrefTable0(ret[1]);
258
260
  }
261
+ return takeFromExternrefTable0(ret[0]);
259
262
  };
260
263
 
261
264
  /**
@@ -265,6 +268,24 @@ module.exports.setDebug = function() {
265
268
  wasm.setDebug();
266
269
  };
267
270
 
271
+ module.exports.callPendingEvents = function() {
272
+ wasm.callPendingEvents();
273
+ };
274
+
275
+ /**
276
+ * @param {Uint8Array} bytes
277
+ * @returns {{ peer: PeerID, counter: number }[]}
278
+ */
279
+ module.exports.decodeFrontiers = function(bytes) {
280
+ const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
281
+ const len0 = WASM_VECTOR_LEN;
282
+ const ret = wasm.decodeFrontiers(ptr0, len0);
283
+ if (ret[2]) {
284
+ throw takeFromExternrefTable0(ret[1]);
285
+ }
286
+ return takeFromExternrefTable0(ret[0]);
287
+ };
288
+
268
289
  function passArrayJsValueToWasm0(array, malloc) {
269
290
  const ptr = malloc(array.length * 4, 4) >>> 0;
270
291
  for (let i = 0; i < array.length; i++) {
@@ -290,24 +311,6 @@ module.exports.encodeFrontiers = function(frontiers) {
290
311
  return v2;
291
312
  };
292
313
 
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
314
  /**
312
315
  * Redacts sensitive content in JSON updates within the specified version range.
313
316
  *
@@ -339,28 +342,24 @@ module.exports.redactJsonUpdates = function(json_updates, version_range) {
339
342
  };
340
343
 
341
344
  /**
342
- * Decode the metadata of the import blob.
343
- *
344
- * This method is useful to get the following metadata of the import blob:
345
- *
346
- * - startVersionVector
347
- * - endVersionVector
348
- * - startTimestamp
349
- * - endTimestamp
350
- * - mode
351
- * - changeNum
352
- * @param {Uint8Array} blob
353
- * @param {boolean} check_checksum
354
- * @returns {ImportBlobMetadata}
345
+ * Get the version of Loro
346
+ * @returns {string}
355
347
  */
356
- module.exports.decodeImportBlobMeta = function(blob, check_checksum) {
357
- const ptr0 = passArray8ToWasm0(blob, wasm.__wbindgen_malloc);
358
- const len0 = WASM_VECTOR_LEN;
359
- const ret = wasm.decodeImportBlobMeta(ptr0, len0, check_checksum);
360
- if (ret[2]) {
361
- throw takeFromExternrefTable0(ret[1]);
348
+ module.exports.LORO_VERSION = function() {
349
+ let deferred1_0;
350
+ let deferred1_1;
351
+ try {
352
+ const ret = wasm.LORO_VERSION();
353
+ deferred1_0 = ret[0];
354
+ deferred1_1 = ret[1];
355
+ return getStringFromWasm0(ret[0], ret[1]);
356
+ } finally {
357
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
362
358
  }
363
- return takeFromExternrefTable0(ret[0]);
359
+ };
360
+
361
+ module.exports.run = function() {
362
+ wasm.run();
364
363
  };
365
364
 
366
365
  function __wbg_adapter_62(arg0, arg1, arg2) {
@@ -368,7 +367,7 @@ function __wbg_adapter_62(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__hb48c49436c48b69d(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_fb60fcc2bf54ad8d = 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_c442f7198a667311 = 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_c8bdc8efc8c495eb = 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_175371353b28a2a4 = 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];
@@ -325,5 +326,5 @@ 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
328
  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;
329
+ export const _dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__hb48c49436c48b69d: (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.4",
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",
package/web/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  export { default } from "./loro_wasm.js";
2
- import { LoroDoc, EphemeralStoreWasm, AwarenessWasm, UndoManager, callPendingEvents } from "./loro_wasm.js";
2
+ import { LoroDoc, EphemeralStoreWasm, UndoManager, AwarenessWasm, callPendingEvents } from "./loro_wasm.js";
3
3
  export * from "./loro_wasm.js";
4
4
 
5
5
  /**
@@ -346,32 +346,36 @@ function decorateMethods(prototype, methods) {
346
346
  decorateMethod(prototype, method);
347
347
  }
348
348
  }
349
- function decorateAllPrototypeMethods(prototype) {
350
- const visited = new Set();
351
- let current = prototype;
352
- while (current &&
353
- current !== Object.prototype &&
354
- current !== Function.prototype) {
355
- for (const property of Object.getOwnPropertyNames(current)) {
356
- if (property === "constructor" || visited.has(property)) {
357
- continue;
358
- }
359
- visited.add(property);
360
- decorateMethod(current, property);
361
- }
362
- for (const symbol of Object.getOwnPropertySymbols(current)) {
363
- if (visited.has(symbol)) {
364
- continue;
365
- }
366
- visited.add(symbol);
367
- decorateMethod(current, symbol);
368
- }
369
- current = Object.getPrototypeOf(current);
370
- }
371
- }
372
- decorateAllPrototypeMethods(LoroDoc.prototype);
373
- decorateAllPrototypeMethods(EphemeralStoreWasm.prototype);
374
- decorateAllPrototypeMethods(AwarenessWasm.prototype);
349
+ decorateMethods(LoroDoc.prototype, [
350
+ "setDetachedEditing",
351
+ "attach",
352
+ "detach",
353
+ "fork",
354
+ "forkAt",
355
+ "checkoutToLatest",
356
+ "checkout",
357
+ "commit",
358
+ "getCursorPos",
359
+ "revertTo",
360
+ "export",
361
+ "exportJsonUpdates",
362
+ "exportJsonInIdSpan",
363
+ "importJsonUpdates",
364
+ "import",
365
+ "importUpdateBatch",
366
+ "importBatch",
367
+ "travelChangeAncestors",
368
+ "getChangedContainersIn",
369
+ "diff",
370
+ "applyDiff",
371
+ "setPeerId",
372
+ ]);
373
+ decorateMethods(EphemeralStoreWasm.prototype, [
374
+ "set",
375
+ "delete",
376
+ "apply",
377
+ "removeOutdated",
378
+ ]);
375
379
  decorateMethods(UndoManager.prototype, ["undo", "redo"]);
376
380
 
377
381
  export { Awareness, EphemeralStore, Loro, getType, idStrToId, isContainer, isContainerId, newContainerID, newRootContainerID };
package/web/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../index.ts"],"sourcesContent":[null],"names":[],"mappings":";;;AA0BA;;AAEG;AACG,M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(): void;
4
3
  /**
5
- * Get the version of Loro
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
6
14
  */
7
- export function LORO_VERSION(): string;
15
+ export function decodeImportBlobMeta(blob: Uint8Array, check_checksum: boolean): ImportBlobMetadata;
8
16
  /**
9
17
  * Enable debug info of Loro
10
18
  */
11
19
  export function setDebug(): void;
12
- export function encodeFrontiers(frontiers: ({ peer: PeerID, counter: number })[]): Uint8Array;
20
+ export function callPendingEvents(): void;
13
21
  export function decodeFrontiers(bytes: Uint8Array): { peer: PeerID, counter: number }[];
14
- export function run(): void;
22
+ export function encodeFrontiers(frontiers: ({ peer: PeerID, counter: number })[]): Uint8Array;
15
23
  /**
16
24
  * Redacts sensitive content in JSON updates within the specified version range.
17
25
  *
@@ -33,18 +41,10 @@ export function run(): void;
33
41
  */
34
42
  export function redactJsonUpdates(json_updates: string | JsonSchema, version_range: any): JsonSchema;
35
43
  /**
36
- * Decode the metadata of the import blob.
37
- *
38
- * This method is useful to get the following metadata of the import blob:
39
- *
40
- * - startVersionVector
41
- * - endVersionVector
42
- * - startTimestamp
43
- * - endTimestamp
44
- * - mode
45
- * - changeNum
44
+ * Get the version of Loro
46
45
  */
47
- export function decodeImportBlobMeta(blob: Uint8Array, check_checksum: boolean): ImportBlobMetadata;
46
+ export function LORO_VERSION(): string;
47
+ export function run(): void;
48
48
 
49
49
  /**
50
50
  * Container types supported by loro.
@@ -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
  *
@@ -989,7 +1001,9 @@ interface LoroDoc<T extends Record<string, Container> = Record<string, Container
989
1001
  *
990
1002
  * This method can also export pending changes from the uncommitted transaction that have not yet been applied to the OpLog.
991
1003
  *
992
- * This method will NOT trigger a new commit implicitly.
1004
+ * This method will implicitly commit pending local operations (like `export(...)`) so callers can
1005
+ * observe the latest local edits. When called inside `subscribePreCommit(...)`, it will NOT trigger
1006
+ * an additional implicit commit.
993
1007
  *
994
1008
  * @param idSpan - The id span to export.
995
1009
  * @returns The changes in the given id span.
@@ -3845,6 +3859,7 @@ export interface InitOutput {
3845
3859
  readonly lorodoc_shallowSinceVV: (a: number) => number;
3846
3860
  readonly lorodoc_subscribe: (a: number, b: any) => any;
3847
3861
  readonly lorodoc_subscribeFirstCommitFromPeer: (a: number, b: any) => any;
3862
+ readonly lorodoc_subscribeJsonpath: (a: number, b: number, c: number, d: any) => [number, number, number];
3848
3863
  readonly lorodoc_subscribeLocalUpdates: (a: number, b: any) => any;
3849
3864
  readonly lorodoc_subscribePreCommit: (a: number, b: any) => any;
3850
3865
  readonly lorodoc_toJSON: (a: number) => [number, number, number];
@@ -4036,7 +4051,7 @@ export interface InitOutput {
4036
4051
  readonly __externref_table_dealloc: (a: number) => void;
4037
4052
  readonly __externref_drop_slice: (a: number, b: number) => void;
4038
4053
  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;
4054
+ readonly _dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__hb48c49436c48b69d: (a: number, b: number) => void;
4040
4055
  readonly __wbindgen_start: () => void;
4041
4056
  }
4042
4057