loro-crdt 1.1.4 → 1.2.1
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/CHANGELOG.md +16 -0
- package/base64/index.js +35 -26
- package/base64/loro_wasm.d.ts +8 -7
- package/base64/loro_wasm_bg-101e42d1.js +64 -0
- package/bundler/loro_wasm.d.ts +8 -7
- package/bundler/loro_wasm_bg.js +33 -24
- package/bundler/loro_wasm_bg.wasm +0 -0
- package/bundler/loro_wasm_bg.wasm.d.ts +1 -1
- package/nodejs/loro_wasm.d.ts +8 -7
- package/nodejs/loro_wasm.js +33 -24
- package/nodejs/loro_wasm_bg.wasm +0 -0
- package/nodejs/loro_wasm_bg.wasm.d.ts +1 -1
- package/package.json +1 -1
- package/web/loro_wasm.d.ts +9 -8
- package/web/loro_wasm.js +32 -23
- package/web/loro_wasm_bg.wasm +0 -0
- package/web/loro_wasm_bg.wasm.d.ts +1 -1
- package/base64/loro_wasm_bg-3397dbb8.js +0 -64
package/bundler/loro_wasm.d.ts
CHANGED
|
@@ -359,7 +359,7 @@ export type TreeNodeJSON<T> = Omit<TreeNodeValue, 'meta' | 'children'> & {
|
|
|
359
359
|
|
|
360
360
|
interface LoroTree{
|
|
361
361
|
toArray(): TreeNodeValue[];
|
|
362
|
-
getNodes(options?: { withDeleted
|
|
362
|
+
getNodes(options?: { withDeleted?: boolean } ): LoroTreeNode[];
|
|
363
363
|
}
|
|
364
364
|
|
|
365
365
|
interface LoroMovableList {
|
|
@@ -454,7 +454,7 @@ export type ExportMode = {
|
|
|
454
454
|
} | {
|
|
455
455
|
mode: "updates-in-range",
|
|
456
456
|
spans: {
|
|
457
|
-
id:
|
|
457
|
+
id: OpId,
|
|
458
458
|
len: number,
|
|
459
459
|
}[],
|
|
460
460
|
};
|
|
@@ -1570,9 +1570,9 @@ export class LoroDoc {
|
|
|
1570
1570
|
* @param ids - the changes to visit
|
|
1571
1571
|
* @param f - the callback function, return `true` to continue visiting, return `false` to stop
|
|
1572
1572
|
* @param {({ peer: PeerID, counter: number })[]} ids
|
|
1573
|
-
* @param {(change:
|
|
1573
|
+
* @param {(change: Change) => boolean} f
|
|
1574
1574
|
*/
|
|
1575
|
-
travelChangeAncestors(ids: ({ peer: PeerID, counter: number })[], f: (change:
|
|
1575
|
+
travelChangeAncestors(ids: ({ peer: PeerID, counter: number })[], f: (change: Change) => boolean): void;
|
|
1576
1576
|
/**
|
|
1577
1577
|
* Checkout the `DocState` to a specific version.
|
|
1578
1578
|
*
|
|
@@ -1880,8 +1880,9 @@ export class LoroDoc {
|
|
|
1880
1880
|
* doc2.importUpdateBatch([snapshot, updates]);
|
|
1881
1881
|
* ```
|
|
1882
1882
|
* @param {Array<any>} data
|
|
1883
|
+
* @returns {ImportStatus}
|
|
1883
1884
|
*/
|
|
1884
|
-
importUpdateBatch(data: Array<any>):
|
|
1885
|
+
importUpdateBatch(data: Array<any>): ImportStatus;
|
|
1885
1886
|
/**
|
|
1886
1887
|
* Get the shallow json format of the document state.
|
|
1887
1888
|
*
|
|
@@ -2541,9 +2542,9 @@ export class LoroText {
|
|
|
2541
2542
|
* text.insert(0, "Hello");
|
|
2542
2543
|
* text.iter((str) => (console.log(str), true));
|
|
2543
2544
|
* ```
|
|
2544
|
-
* @param {
|
|
2545
|
+
* @param {(string) => boolean} callback
|
|
2545
2546
|
*/
|
|
2546
|
-
iter(callback:
|
|
2547
|
+
iter(callback: (string) => boolean): void;
|
|
2547
2548
|
/**
|
|
2548
2549
|
* Insert the string at the given index (utf-16 index).
|
|
2549
2550
|
*
|
package/bundler/loro_wasm_bg.js
CHANGED
|
@@ -1211,7 +1211,7 @@ export class LoroDoc {
|
|
|
1211
1211
|
* @param ids - the changes to visit
|
|
1212
1212
|
* @param f - the callback function, return `true` to continue visiting, return `false` to stop
|
|
1213
1213
|
* @param {({ peer: PeerID, counter: number })[]} ids
|
|
1214
|
-
* @param {(change:
|
|
1214
|
+
* @param {(change: Change) => boolean} f
|
|
1215
1215
|
*/
|
|
1216
1216
|
travelChangeAncestors(ids, f) {
|
|
1217
1217
|
try {
|
|
@@ -2004,6 +2004,7 @@ export class LoroDoc {
|
|
|
2004
2004
|
* doc2.importUpdateBatch([snapshot, updates]);
|
|
2005
2005
|
* ```
|
|
2006
2006
|
* @param {Array<any>} data
|
|
2007
|
+
* @returns {ImportStatus}
|
|
2007
2008
|
*/
|
|
2008
2009
|
importUpdateBatch(data) {
|
|
2009
2010
|
try {
|
|
@@ -2011,9 +2012,11 @@ export class LoroDoc {
|
|
|
2011
2012
|
wasm.lorodoc_importUpdateBatch(retptr, this.__wbg_ptr, addHeapObject(data));
|
|
2012
2013
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
2013
2014
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
2014
|
-
|
|
2015
|
-
|
|
2015
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
2016
|
+
if (r2) {
|
|
2017
|
+
throw takeObject(r1);
|
|
2016
2018
|
}
|
|
2019
|
+
return takeObject(r0);
|
|
2017
2020
|
} finally {
|
|
2018
2021
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
2019
2022
|
}
|
|
@@ -3849,13 +3852,19 @@ export class LoroText {
|
|
|
3849
3852
|
* text.insert(0, "Hello");
|
|
3850
3853
|
* text.iter((str) => (console.log(str), true));
|
|
3851
3854
|
* ```
|
|
3852
|
-
* @param {
|
|
3855
|
+
* @param {(string) => boolean} callback
|
|
3853
3856
|
*/
|
|
3854
3857
|
iter(callback) {
|
|
3855
3858
|
try {
|
|
3856
|
-
wasm.
|
|
3859
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
3860
|
+
wasm.lorotext_iter(retptr, this.__wbg_ptr, addHeapObject(callback));
|
|
3861
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
3862
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
3863
|
+
if (r1) {
|
|
3864
|
+
throw takeObject(r0);
|
|
3865
|
+
}
|
|
3857
3866
|
} finally {
|
|
3858
|
-
|
|
3867
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
3859
3868
|
}
|
|
3860
3869
|
}
|
|
3861
3870
|
/**
|
|
@@ -5628,13 +5637,8 @@ export function __wbindgen_object_drop_ref(arg0) {
|
|
|
5628
5637
|
takeObject(arg0);
|
|
5629
5638
|
};
|
|
5630
5639
|
|
|
5631
|
-
export function
|
|
5632
|
-
const ret =
|
|
5633
|
-
return addHeapObject(ret);
|
|
5634
|
-
};
|
|
5635
|
-
|
|
5636
|
-
export function __wbg_lorotree_new(arg0) {
|
|
5637
|
-
const ret = LoroTree.__wrap(arg0);
|
|
5640
|
+
export function __wbg_loromap_new(arg0) {
|
|
5641
|
+
const ret = LoroMap.__wrap(arg0);
|
|
5638
5642
|
return addHeapObject(ret);
|
|
5639
5643
|
};
|
|
5640
5644
|
|
|
@@ -5643,18 +5647,18 @@ export function __wbg_lorotext_new(arg0) {
|
|
|
5643
5647
|
return addHeapObject(ret);
|
|
5644
5648
|
};
|
|
5645
5649
|
|
|
5646
|
-
export function
|
|
5647
|
-
const ret =
|
|
5650
|
+
export function __wbg_lorolist_new(arg0) {
|
|
5651
|
+
const ret = LoroList.__wrap(arg0);
|
|
5648
5652
|
return addHeapObject(ret);
|
|
5649
5653
|
};
|
|
5650
5654
|
|
|
5651
|
-
export function
|
|
5652
|
-
const ret =
|
|
5655
|
+
export function __wbg_lorotree_new(arg0) {
|
|
5656
|
+
const ret = LoroTree.__wrap(arg0);
|
|
5653
5657
|
return addHeapObject(ret);
|
|
5654
5658
|
};
|
|
5655
5659
|
|
|
5656
|
-
export function
|
|
5657
|
-
const ret =
|
|
5660
|
+
export function __wbg_cursor_new(arg0) {
|
|
5661
|
+
const ret = Cursor.__wrap(arg0);
|
|
5658
5662
|
return addHeapObject(ret);
|
|
5659
5663
|
};
|
|
5660
5664
|
|
|
@@ -5663,8 +5667,13 @@ export function __wbg_loromovablelist_new(arg0) {
|
|
|
5663
5667
|
return addHeapObject(ret);
|
|
5664
5668
|
};
|
|
5665
5669
|
|
|
5666
|
-
export function
|
|
5667
|
-
const ret =
|
|
5670
|
+
export function __wbg_lorocounter_new(arg0) {
|
|
5671
|
+
const ret = LoroCounter.__wrap(arg0);
|
|
5672
|
+
return addHeapObject(ret);
|
|
5673
|
+
};
|
|
5674
|
+
|
|
5675
|
+
export function __wbg_lorotreenode_new(arg0) {
|
|
5676
|
+
const ret = LoroTreeNode.__wrap(arg0);
|
|
5668
5677
|
return addHeapObject(ret);
|
|
5669
5678
|
};
|
|
5670
5679
|
|
|
@@ -6211,12 +6220,12 @@ export function __wbindgen_memory() {
|
|
|
6211
6220
|
};
|
|
6212
6221
|
|
|
6213
6222
|
export function __wbindgen_closure_wrapper487(arg0, arg1, arg2) {
|
|
6214
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
6223
|
+
const ret = makeMutClosure(arg0, arg1, 9, __wbg_adapter_58);
|
|
6215
6224
|
return addHeapObject(ret);
|
|
6216
6225
|
};
|
|
6217
6226
|
|
|
6218
|
-
export function
|
|
6219
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
6227
|
+
export function __wbindgen_closure_wrapper489(arg0, arg1, arg2) {
|
|
6228
|
+
const ret = makeMutClosure(arg0, arg1, 11, __wbg_adapter_61);
|
|
6220
6229
|
return addHeapObject(ret);
|
|
6221
6230
|
};
|
|
6222
6231
|
|
|
Binary file
|
|
@@ -95,7 +95,7 @@ export function lorodoc_getChangedContainersIn(a: number, b: number, c: number,
|
|
|
95
95
|
export function __wbg_lorotext_free(a: number): void;
|
|
96
96
|
export function lorotext_new(): number;
|
|
97
97
|
export function lorotext_kind(a: number): number;
|
|
98
|
-
export function lorotext_iter(a: number, b: number): void;
|
|
98
|
+
export function lorotext_iter(a: number, b: number, c: number): void;
|
|
99
99
|
export function lorotext_update(a: number, b: number, c: number, d: number, e: number): void;
|
|
100
100
|
export function lorotext_updateByLine(a: number, b: number, c: number, d: number, e: number): void;
|
|
101
101
|
export function lorotext_insert(a: number, b: number, c: number, d: number, e: number): void;
|
package/nodejs/loro_wasm.d.ts
CHANGED
|
@@ -359,7 +359,7 @@ export type TreeNodeJSON<T> = Omit<TreeNodeValue, 'meta' | 'children'> & {
|
|
|
359
359
|
|
|
360
360
|
interface LoroTree{
|
|
361
361
|
toArray(): TreeNodeValue[];
|
|
362
|
-
getNodes(options?: { withDeleted
|
|
362
|
+
getNodes(options?: { withDeleted?: boolean } ): LoroTreeNode[];
|
|
363
363
|
}
|
|
364
364
|
|
|
365
365
|
interface LoroMovableList {
|
|
@@ -454,7 +454,7 @@ export type ExportMode = {
|
|
|
454
454
|
} | {
|
|
455
455
|
mode: "updates-in-range",
|
|
456
456
|
spans: {
|
|
457
|
-
id:
|
|
457
|
+
id: OpId,
|
|
458
458
|
len: number,
|
|
459
459
|
}[],
|
|
460
460
|
};
|
|
@@ -1570,9 +1570,9 @@ export class LoroDoc {
|
|
|
1570
1570
|
* @param ids - the changes to visit
|
|
1571
1571
|
* @param f - the callback function, return `true` to continue visiting, return `false` to stop
|
|
1572
1572
|
* @param {({ peer: PeerID, counter: number })[]} ids
|
|
1573
|
-
* @param {(change:
|
|
1573
|
+
* @param {(change: Change) => boolean} f
|
|
1574
1574
|
*/
|
|
1575
|
-
travelChangeAncestors(ids: ({ peer: PeerID, counter: number })[], f: (change:
|
|
1575
|
+
travelChangeAncestors(ids: ({ peer: PeerID, counter: number })[], f: (change: Change) => boolean): void;
|
|
1576
1576
|
/**
|
|
1577
1577
|
* Checkout the `DocState` to a specific version.
|
|
1578
1578
|
*
|
|
@@ -1880,8 +1880,9 @@ export class LoroDoc {
|
|
|
1880
1880
|
* doc2.importUpdateBatch([snapshot, updates]);
|
|
1881
1881
|
* ```
|
|
1882
1882
|
* @param {Array<any>} data
|
|
1883
|
+
* @returns {ImportStatus}
|
|
1883
1884
|
*/
|
|
1884
|
-
importUpdateBatch(data: Array<any>):
|
|
1885
|
+
importUpdateBatch(data: Array<any>): ImportStatus;
|
|
1885
1886
|
/**
|
|
1886
1887
|
* Get the shallow json format of the document state.
|
|
1887
1888
|
*
|
|
@@ -2541,9 +2542,9 @@ export class LoroText {
|
|
|
2541
2542
|
* text.insert(0, "Hello");
|
|
2542
2543
|
* text.iter((str) => (console.log(str), true));
|
|
2543
2544
|
* ```
|
|
2544
|
-
* @param {
|
|
2545
|
+
* @param {(string) => boolean} callback
|
|
2545
2546
|
*/
|
|
2546
|
-
iter(callback:
|
|
2547
|
+
iter(callback: (string) => boolean): void;
|
|
2547
2548
|
/**
|
|
2548
2549
|
* Insert the string at the given index (utf-16 index).
|
|
2549
2550
|
*
|
package/nodejs/loro_wasm.js
CHANGED
|
@@ -1209,7 +1209,7 @@ class LoroDoc {
|
|
|
1209
1209
|
* @param ids - the changes to visit
|
|
1210
1210
|
* @param f - the callback function, return `true` to continue visiting, return `false` to stop
|
|
1211
1211
|
* @param {({ peer: PeerID, counter: number })[]} ids
|
|
1212
|
-
* @param {(change:
|
|
1212
|
+
* @param {(change: Change) => boolean} f
|
|
1213
1213
|
*/
|
|
1214
1214
|
travelChangeAncestors(ids, f) {
|
|
1215
1215
|
try {
|
|
@@ -2002,6 +2002,7 @@ class LoroDoc {
|
|
|
2002
2002
|
* doc2.importUpdateBatch([snapshot, updates]);
|
|
2003
2003
|
* ```
|
|
2004
2004
|
* @param {Array<any>} data
|
|
2005
|
+
* @returns {ImportStatus}
|
|
2005
2006
|
*/
|
|
2006
2007
|
importUpdateBatch(data) {
|
|
2007
2008
|
try {
|
|
@@ -2009,9 +2010,11 @@ class LoroDoc {
|
|
|
2009
2010
|
wasm.lorodoc_importUpdateBatch(retptr, this.__wbg_ptr, addHeapObject(data));
|
|
2010
2011
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
2011
2012
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
2012
|
-
|
|
2013
|
-
|
|
2013
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
2014
|
+
if (r2) {
|
|
2015
|
+
throw takeObject(r1);
|
|
2014
2016
|
}
|
|
2017
|
+
return takeObject(r0);
|
|
2015
2018
|
} finally {
|
|
2016
2019
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
2017
2020
|
}
|
|
@@ -3851,13 +3854,19 @@ class LoroText {
|
|
|
3851
3854
|
* text.insert(0, "Hello");
|
|
3852
3855
|
* text.iter((str) => (console.log(str), true));
|
|
3853
3856
|
* ```
|
|
3854
|
-
* @param {
|
|
3857
|
+
* @param {(string) => boolean} callback
|
|
3855
3858
|
*/
|
|
3856
3859
|
iter(callback) {
|
|
3857
3860
|
try {
|
|
3858
|
-
wasm.
|
|
3861
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
3862
|
+
wasm.lorotext_iter(retptr, this.__wbg_ptr, addHeapObject(callback));
|
|
3863
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
3864
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
3865
|
+
if (r1) {
|
|
3866
|
+
throw takeObject(r0);
|
|
3867
|
+
}
|
|
3859
3868
|
} finally {
|
|
3860
|
-
|
|
3869
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
3861
3870
|
}
|
|
3862
3871
|
}
|
|
3863
3872
|
/**
|
|
@@ -5635,13 +5644,8 @@ module.exports.__wbindgen_object_drop_ref = function(arg0) {
|
|
|
5635
5644
|
takeObject(arg0);
|
|
5636
5645
|
};
|
|
5637
5646
|
|
|
5638
|
-
module.exports.
|
|
5639
|
-
const ret =
|
|
5640
|
-
return addHeapObject(ret);
|
|
5641
|
-
};
|
|
5642
|
-
|
|
5643
|
-
module.exports.__wbg_lorotree_new = function(arg0) {
|
|
5644
|
-
const ret = LoroTree.__wrap(arg0);
|
|
5647
|
+
module.exports.__wbg_loromap_new = function(arg0) {
|
|
5648
|
+
const ret = LoroMap.__wrap(arg0);
|
|
5645
5649
|
return addHeapObject(ret);
|
|
5646
5650
|
};
|
|
5647
5651
|
|
|
@@ -5650,18 +5654,18 @@ module.exports.__wbg_lorotext_new = function(arg0) {
|
|
|
5650
5654
|
return addHeapObject(ret);
|
|
5651
5655
|
};
|
|
5652
5656
|
|
|
5653
|
-
module.exports.
|
|
5654
|
-
const ret =
|
|
5657
|
+
module.exports.__wbg_lorolist_new = function(arg0) {
|
|
5658
|
+
const ret = LoroList.__wrap(arg0);
|
|
5655
5659
|
return addHeapObject(ret);
|
|
5656
5660
|
};
|
|
5657
5661
|
|
|
5658
|
-
module.exports.
|
|
5659
|
-
const ret =
|
|
5662
|
+
module.exports.__wbg_lorotree_new = function(arg0) {
|
|
5663
|
+
const ret = LoroTree.__wrap(arg0);
|
|
5660
5664
|
return addHeapObject(ret);
|
|
5661
5665
|
};
|
|
5662
5666
|
|
|
5663
|
-
module.exports.
|
|
5664
|
-
const ret =
|
|
5667
|
+
module.exports.__wbg_cursor_new = function(arg0) {
|
|
5668
|
+
const ret = Cursor.__wrap(arg0);
|
|
5665
5669
|
return addHeapObject(ret);
|
|
5666
5670
|
};
|
|
5667
5671
|
|
|
@@ -5670,8 +5674,13 @@ module.exports.__wbg_loromovablelist_new = function(arg0) {
|
|
|
5670
5674
|
return addHeapObject(ret);
|
|
5671
5675
|
};
|
|
5672
5676
|
|
|
5673
|
-
module.exports.
|
|
5674
|
-
const ret =
|
|
5677
|
+
module.exports.__wbg_lorocounter_new = function(arg0) {
|
|
5678
|
+
const ret = LoroCounter.__wrap(arg0);
|
|
5679
|
+
return addHeapObject(ret);
|
|
5680
|
+
};
|
|
5681
|
+
|
|
5682
|
+
module.exports.__wbg_lorotreenode_new = function(arg0) {
|
|
5683
|
+
const ret = LoroTreeNode.__wrap(arg0);
|
|
5675
5684
|
return addHeapObject(ret);
|
|
5676
5685
|
};
|
|
5677
5686
|
|
|
@@ -6218,12 +6227,12 @@ module.exports.__wbindgen_memory = function() {
|
|
|
6218
6227
|
};
|
|
6219
6228
|
|
|
6220
6229
|
module.exports.__wbindgen_closure_wrapper487 = function(arg0, arg1, arg2) {
|
|
6221
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
6230
|
+
const ret = makeMutClosure(arg0, arg1, 9, __wbg_adapter_58);
|
|
6222
6231
|
return addHeapObject(ret);
|
|
6223
6232
|
};
|
|
6224
6233
|
|
|
6225
|
-
module.exports.
|
|
6226
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
6234
|
+
module.exports.__wbindgen_closure_wrapper489 = function(arg0, arg1, arg2) {
|
|
6235
|
+
const ret = makeMutClosure(arg0, arg1, 11, __wbg_adapter_61);
|
|
6227
6236
|
return addHeapObject(ret);
|
|
6228
6237
|
};
|
|
6229
6238
|
|
package/nodejs/loro_wasm_bg.wasm
CHANGED
|
Binary file
|
|
@@ -95,7 +95,7 @@ export function lorodoc_getChangedContainersIn(a: number, b: number, c: number,
|
|
|
95
95
|
export function __wbg_lorotext_free(a: number): void;
|
|
96
96
|
export function lorotext_new(): number;
|
|
97
97
|
export function lorotext_kind(a: number): number;
|
|
98
|
-
export function lorotext_iter(a: number, b: number): void;
|
|
98
|
+
export function lorotext_iter(a: number, b: number, c: number): void;
|
|
99
99
|
export function lorotext_update(a: number, b: number, c: number, d: number, e: number): void;
|
|
100
100
|
export function lorotext_updateByLine(a: number, b: number, c: number, d: number, e: number): void;
|
|
101
101
|
export function lorotext_insert(a: number, b: number, c: number, d: number, e: number): void;
|
package/package.json
CHANGED
package/web/loro_wasm.d.ts
CHANGED
|
@@ -359,7 +359,7 @@ export type TreeNodeJSON<T> = Omit<TreeNodeValue, 'meta' | 'children'> & {
|
|
|
359
359
|
|
|
360
360
|
interface LoroTree{
|
|
361
361
|
toArray(): TreeNodeValue[];
|
|
362
|
-
getNodes(options?: { withDeleted
|
|
362
|
+
getNodes(options?: { withDeleted?: boolean } ): LoroTreeNode[];
|
|
363
363
|
}
|
|
364
364
|
|
|
365
365
|
interface LoroMovableList {
|
|
@@ -454,7 +454,7 @@ export type ExportMode = {
|
|
|
454
454
|
} | {
|
|
455
455
|
mode: "updates-in-range",
|
|
456
456
|
spans: {
|
|
457
|
-
id:
|
|
457
|
+
id: OpId,
|
|
458
458
|
len: number,
|
|
459
459
|
}[],
|
|
460
460
|
};
|
|
@@ -1570,9 +1570,9 @@ export class LoroDoc {
|
|
|
1570
1570
|
* @param ids - the changes to visit
|
|
1571
1571
|
* @param f - the callback function, return `true` to continue visiting, return `false` to stop
|
|
1572
1572
|
* @param {({ peer: PeerID, counter: number })[]} ids
|
|
1573
|
-
* @param {(change:
|
|
1573
|
+
* @param {(change: Change) => boolean} f
|
|
1574
1574
|
*/
|
|
1575
|
-
travelChangeAncestors(ids: ({ peer: PeerID, counter: number })[], f: (change:
|
|
1575
|
+
travelChangeAncestors(ids: ({ peer: PeerID, counter: number })[], f: (change: Change) => boolean): void;
|
|
1576
1576
|
/**
|
|
1577
1577
|
* Checkout the `DocState` to a specific version.
|
|
1578
1578
|
*
|
|
@@ -1880,8 +1880,9 @@ export class LoroDoc {
|
|
|
1880
1880
|
* doc2.importUpdateBatch([snapshot, updates]);
|
|
1881
1881
|
* ```
|
|
1882
1882
|
* @param {Array<any>} data
|
|
1883
|
+
* @returns {ImportStatus}
|
|
1883
1884
|
*/
|
|
1884
|
-
importUpdateBatch(data: Array<any>):
|
|
1885
|
+
importUpdateBatch(data: Array<any>): ImportStatus;
|
|
1885
1886
|
/**
|
|
1886
1887
|
* Get the shallow json format of the document state.
|
|
1887
1888
|
*
|
|
@@ -2541,9 +2542,9 @@ export class LoroText {
|
|
|
2541
2542
|
* text.insert(0, "Hello");
|
|
2542
2543
|
* text.iter((str) => (console.log(str), true));
|
|
2543
2544
|
* ```
|
|
2544
|
-
* @param {
|
|
2545
|
+
* @param {(string) => boolean} callback
|
|
2545
2546
|
*/
|
|
2546
|
-
iter(callback:
|
|
2547
|
+
iter(callback: (string) => boolean): void;
|
|
2547
2548
|
/**
|
|
2548
2549
|
* Insert the string at the given index (utf-16 index).
|
|
2549
2550
|
*
|
|
@@ -3353,7 +3354,7 @@ export interface InitOutput {
|
|
|
3353
3354
|
readonly __wbg_lorotext_free: (a: number) => void;
|
|
3354
3355
|
readonly lorotext_new: () => number;
|
|
3355
3356
|
readonly lorotext_kind: (a: number) => number;
|
|
3356
|
-
readonly lorotext_iter: (a: number, b: number) => void;
|
|
3357
|
+
readonly lorotext_iter: (a: number, b: number, c: number) => void;
|
|
3357
3358
|
readonly lorotext_update: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
3358
3359
|
readonly lorotext_updateByLine: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
3359
3360
|
readonly lorotext_insert: (a: number, b: number, c: number, d: number, e: number) => void;
|
package/web/loro_wasm.js
CHANGED
|
@@ -1203,7 +1203,7 @@ export class LoroDoc {
|
|
|
1203
1203
|
* @param ids - the changes to visit
|
|
1204
1204
|
* @param f - the callback function, return `true` to continue visiting, return `false` to stop
|
|
1205
1205
|
* @param {({ peer: PeerID, counter: number })[]} ids
|
|
1206
|
-
* @param {(change:
|
|
1206
|
+
* @param {(change: Change) => boolean} f
|
|
1207
1207
|
*/
|
|
1208
1208
|
travelChangeAncestors(ids, f) {
|
|
1209
1209
|
try {
|
|
@@ -1996,6 +1996,7 @@ export class LoroDoc {
|
|
|
1996
1996
|
* doc2.importUpdateBatch([snapshot, updates]);
|
|
1997
1997
|
* ```
|
|
1998
1998
|
* @param {Array<any>} data
|
|
1999
|
+
* @returns {ImportStatus}
|
|
1999
2000
|
*/
|
|
2000
2001
|
importUpdateBatch(data) {
|
|
2001
2002
|
try {
|
|
@@ -2003,9 +2004,11 @@ export class LoroDoc {
|
|
|
2003
2004
|
wasm.lorodoc_importUpdateBatch(retptr, this.__wbg_ptr, addHeapObject(data));
|
|
2004
2005
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
2005
2006
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
2006
|
-
|
|
2007
|
-
|
|
2007
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
2008
|
+
if (r2) {
|
|
2009
|
+
throw takeObject(r1);
|
|
2008
2010
|
}
|
|
2011
|
+
return takeObject(r0);
|
|
2009
2012
|
} finally {
|
|
2010
2013
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
2011
2014
|
}
|
|
@@ -3841,13 +3844,19 @@ export class LoroText {
|
|
|
3841
3844
|
* text.insert(0, "Hello");
|
|
3842
3845
|
* text.iter((str) => (console.log(str), true));
|
|
3843
3846
|
* ```
|
|
3844
|
-
* @param {
|
|
3847
|
+
* @param {(string) => boolean} callback
|
|
3845
3848
|
*/
|
|
3846
3849
|
iter(callback) {
|
|
3847
3850
|
try {
|
|
3848
|
-
wasm.
|
|
3851
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
3852
|
+
wasm.lorotext_iter(retptr, this.__wbg_ptr, addHeapObject(callback));
|
|
3853
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
3854
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
3855
|
+
if (r1) {
|
|
3856
|
+
throw takeObject(r0);
|
|
3857
|
+
}
|
|
3849
3858
|
} finally {
|
|
3850
|
-
|
|
3859
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
3851
3860
|
}
|
|
3852
3861
|
}
|
|
3853
3862
|
/**
|
|
@@ -5653,36 +5662,36 @@ function __wbg_get_imports() {
|
|
|
5653
5662
|
imports.wbg.__wbindgen_object_drop_ref = function(arg0) {
|
|
5654
5663
|
takeObject(arg0);
|
|
5655
5664
|
};
|
|
5656
|
-
imports.wbg.
|
|
5657
|
-
const ret =
|
|
5658
|
-
return addHeapObject(ret);
|
|
5659
|
-
};
|
|
5660
|
-
imports.wbg.__wbg_lorotree_new = function(arg0) {
|
|
5661
|
-
const ret = LoroTree.__wrap(arg0);
|
|
5665
|
+
imports.wbg.__wbg_loromap_new = function(arg0) {
|
|
5666
|
+
const ret = LoroMap.__wrap(arg0);
|
|
5662
5667
|
return addHeapObject(ret);
|
|
5663
5668
|
};
|
|
5664
5669
|
imports.wbg.__wbg_lorotext_new = function(arg0) {
|
|
5665
5670
|
const ret = LoroText.__wrap(arg0);
|
|
5666
5671
|
return addHeapObject(ret);
|
|
5667
5672
|
};
|
|
5668
|
-
imports.wbg.
|
|
5669
|
-
const ret =
|
|
5673
|
+
imports.wbg.__wbg_lorolist_new = function(arg0) {
|
|
5674
|
+
const ret = LoroList.__wrap(arg0);
|
|
5670
5675
|
return addHeapObject(ret);
|
|
5671
5676
|
};
|
|
5672
|
-
imports.wbg.
|
|
5673
|
-
const ret =
|
|
5677
|
+
imports.wbg.__wbg_lorotree_new = function(arg0) {
|
|
5678
|
+
const ret = LoroTree.__wrap(arg0);
|
|
5674
5679
|
return addHeapObject(ret);
|
|
5675
5680
|
};
|
|
5676
|
-
imports.wbg.
|
|
5677
|
-
const ret =
|
|
5681
|
+
imports.wbg.__wbg_cursor_new = function(arg0) {
|
|
5682
|
+
const ret = Cursor.__wrap(arg0);
|
|
5678
5683
|
return addHeapObject(ret);
|
|
5679
5684
|
};
|
|
5680
5685
|
imports.wbg.__wbg_loromovablelist_new = function(arg0) {
|
|
5681
5686
|
const ret = LoroMovableList.__wrap(arg0);
|
|
5682
5687
|
return addHeapObject(ret);
|
|
5683
5688
|
};
|
|
5684
|
-
imports.wbg.
|
|
5685
|
-
const ret =
|
|
5689
|
+
imports.wbg.__wbg_lorocounter_new = function(arg0) {
|
|
5690
|
+
const ret = LoroCounter.__wrap(arg0);
|
|
5691
|
+
return addHeapObject(ret);
|
|
5692
|
+
};
|
|
5693
|
+
imports.wbg.__wbg_lorotreenode_new = function(arg0) {
|
|
5694
|
+
const ret = LoroTreeNode.__wrap(arg0);
|
|
5686
5695
|
return addHeapObject(ret);
|
|
5687
5696
|
};
|
|
5688
5697
|
imports.wbg.__wbg_versionvector_new = function(arg0) {
|
|
@@ -6133,11 +6142,11 @@ function __wbg_get_imports() {
|
|
|
6133
6142
|
return addHeapObject(ret);
|
|
6134
6143
|
};
|
|
6135
6144
|
imports.wbg.__wbindgen_closure_wrapper487 = function(arg0, arg1, arg2) {
|
|
6136
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
6145
|
+
const ret = makeMutClosure(arg0, arg1, 9, __wbg_adapter_58);
|
|
6137
6146
|
return addHeapObject(ret);
|
|
6138
6147
|
};
|
|
6139
|
-
imports.wbg.
|
|
6140
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
6148
|
+
imports.wbg.__wbindgen_closure_wrapper489 = function(arg0, arg1, arg2) {
|
|
6149
|
+
const ret = makeMutClosure(arg0, arg1, 11, __wbg_adapter_61);
|
|
6141
6150
|
return addHeapObject(ret);
|
|
6142
6151
|
};
|
|
6143
6152
|
|
package/web/loro_wasm_bg.wasm
CHANGED
|
Binary file
|
|
@@ -95,7 +95,7 @@ export function lorodoc_getChangedContainersIn(a: number, b: number, c: number,
|
|
|
95
95
|
export function __wbg_lorotext_free(a: number): void;
|
|
96
96
|
export function lorotext_new(): number;
|
|
97
97
|
export function lorotext_kind(a: number): number;
|
|
98
|
-
export function lorotext_iter(a: number, b: number): void;
|
|
98
|
+
export function lorotext_iter(a: number, b: number, c: number): void;
|
|
99
99
|
export function lorotext_update(a: number, b: number, c: number, d: number, e: number): void;
|
|
100
100
|
export function lorotext_updateByLine(a: number, b: number, c: number, d: number, e: number): void;
|
|
101
101
|
export function lorotext_insert(a: number, b: number, c: number, d: number, e: number): void;
|