loro-crdt 1.0.8 → 1.1.0
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 +25 -0
- package/bundler/loro_wasm.d.ts +132 -35
- package/bundler/loro_wasm_bg.js +240 -20
- package/bundler/loro_wasm_bg.wasm +0 -0
- package/bundler/loro_wasm_bg.wasm.d.ts +17 -3
- package/nodejs/loro_wasm.d.ts +132 -35
- package/nodejs/loro_wasm.js +240 -20
- package/nodejs/loro_wasm_bg.wasm +0 -0
- package/nodejs/loro_wasm_bg.wasm.d.ts +17 -3
- package/package.json +1 -1
- package/web/loro_wasm.d.ts +149 -38
- package/web/loro_wasm.js +239 -19
- package/web/loro_wasm_bg.wasm +0 -0
- package/web/loro_wasm_bg.wasm.d.ts +17 -3
|
@@ -89,12 +89,13 @@ export function lorodoc_frontiersToVV(a: number, b: number, c: number, d: number
|
|
|
89
89
|
export function lorodoc_vvToFrontiers(a: number, b: number, c: number): void;
|
|
90
90
|
export function lorodoc_getByPath(a: number, b: number, c: number): number;
|
|
91
91
|
export function lorodoc_getCursorPos(a: number, b: number, c: number): void;
|
|
92
|
+
export function lorodoc_getChangedContainersIn(a: number, b: number, c: number, d: number): void;
|
|
92
93
|
export function __wbg_lorotext_free(a: number): void;
|
|
93
94
|
export function lorotext_new(): number;
|
|
94
95
|
export function lorotext_kind(a: number): number;
|
|
95
96
|
export function lorotext_iter(a: number, b: number): void;
|
|
96
|
-
export function lorotext_update(a: number, b: number, c: number): void;
|
|
97
|
-
export function lorotext_updateByLine(a: number, b: number, c: number): void;
|
|
97
|
+
export function lorotext_update(a: number, b: number, c: number, d: number, e: number): void;
|
|
98
|
+
export function lorotext_updateByLine(a: number, b: number, c: number, d: number, e: number): void;
|
|
98
99
|
export function lorotext_insert(a: number, b: number, c: number, d: number, e: number): void;
|
|
99
100
|
export function lorotext_slice(a: number, b: number, c: number, d: number): void;
|
|
100
101
|
export function lorotext_charAt(a: number, b: number, c: number): void;
|
|
@@ -113,6 +114,8 @@ export function lorotext_applyDelta(a: number, b: number, c: number): void;
|
|
|
113
114
|
export function lorotext_parent(a: number): number;
|
|
114
115
|
export function lorotext_getAttached(a: number): number;
|
|
115
116
|
export function lorotext_getCursor(a: number, b: number, c: number): number;
|
|
117
|
+
export function lorotext_push(a: number, b: number, c: number, d: number): void;
|
|
118
|
+
export function lorotext_getEditorOf(a: number, b: number): number;
|
|
116
119
|
export function __wbg_loromap_free(a: number): void;
|
|
117
120
|
export function loromap_new(): number;
|
|
118
121
|
export function loromap_kind(a: number): number;
|
|
@@ -131,6 +134,7 @@ export function loromap_size(a: number): number;
|
|
|
131
134
|
export function loromap_parent(a: number): number;
|
|
132
135
|
export function loromap_getAttached(a: number): number;
|
|
133
136
|
export function loromap_clear(a: number, b: number): void;
|
|
137
|
+
export function loromap_getLastEditor(a: number, b: number, c: number): number;
|
|
134
138
|
export function __wbg_lorolist_free(a: number): void;
|
|
135
139
|
export function lorolist_new(): number;
|
|
136
140
|
export function lorolist_kind(a: number): number;
|
|
@@ -141,6 +145,7 @@ export function lorolist_id(a: number): number;
|
|
|
141
145
|
export function lorolist_toArray(a: number, b: number): void;
|
|
142
146
|
export function lorolist_toJSON(a: number): number;
|
|
143
147
|
export function lorolist_insertContainer(a: number, b: number, c: number, d: number): void;
|
|
148
|
+
export function lorolist_pushContainer(a: number, b: number, c: number): void;
|
|
144
149
|
export function lorolist_subscribe(a: number, b: number, c: number): void;
|
|
145
150
|
export function lorolist_length(a: number): number;
|
|
146
151
|
export function lorolist_parent(a: number): number;
|
|
@@ -150,6 +155,7 @@ export function lorolist_getCursor(a: number, b: number, c: number): number;
|
|
|
150
155
|
export function lorolist_push(a: number, b: number, c: number): void;
|
|
151
156
|
export function lorolist_pop(a: number, b: number): void;
|
|
152
157
|
export function lorolist_clear(a: number, b: number): void;
|
|
158
|
+
export function lorolist_getIdAt(a: number, b: number): number;
|
|
153
159
|
export function loromovablelist_new(): number;
|
|
154
160
|
export function loromovablelist_kind(a: number): number;
|
|
155
161
|
export function loromovablelist_insert(a: number, b: number, c: number, d: number): void;
|
|
@@ -159,6 +165,7 @@ export function loromovablelist_id(a: number): number;
|
|
|
159
165
|
export function loromovablelist_toArray(a: number, b: number): void;
|
|
160
166
|
export function loromovablelist_toJSON(a: number): number;
|
|
161
167
|
export function loromovablelist_insertContainer(a: number, b: number, c: number, d: number): void;
|
|
168
|
+
export function loromovablelist_pushContainer(a: number, b: number, c: number): void;
|
|
162
169
|
export function loromovablelist_subscribe(a: number, b: number, c: number): void;
|
|
163
170
|
export function loromovablelist_length(a: number): number;
|
|
164
171
|
export function loromovablelist_getAttached(a: number): number;
|
|
@@ -169,6 +176,9 @@ export function loromovablelist_setContainer(a: number, b: number, c: number, d:
|
|
|
169
176
|
export function loromovablelist_push(a: number, b: number, c: number): void;
|
|
170
177
|
export function loromovablelist_pop(a: number, b: number): void;
|
|
171
178
|
export function loromovablelist_clear(a: number, b: number): void;
|
|
179
|
+
export function loromovablelist_getCreatorAt(a: number, b: number): number;
|
|
180
|
+
export function loromovablelist_getLastMoverAt(a: number, b: number): number;
|
|
181
|
+
export function loromovablelist_getLastEditorAt(a: number, b: number): number;
|
|
172
182
|
export function __wbg_lorotree_free(a: number): void;
|
|
173
183
|
export function lorotreenode___getClassname(a: number, b: number): void;
|
|
174
184
|
export function __wbg_lorotreenode_free(a: number): void;
|
|
@@ -180,9 +190,13 @@ export function lorotreenode_moveBefore(a: number, b: number, c: number): void;
|
|
|
180
190
|
export function lorotreenode_index(a: number, b: number): void;
|
|
181
191
|
export function lorotreenode_fractionalIndex(a: number, b: number): void;
|
|
182
192
|
export function lorotreenode_data(a: number, b: number): void;
|
|
193
|
+
export function lorotreenode_toJSON(a: number, b: number): void;
|
|
183
194
|
export function lorotreenode_parent(a: number, b: number): void;
|
|
184
195
|
export function lorotreenode_children(a: number): number;
|
|
185
196
|
export function lorotreenode_isDeleted(a: number, b: number): void;
|
|
197
|
+
export function lorotreenode_getLastMoveId(a: number): number;
|
|
198
|
+
export function lorotreenode_creationId(a: number): number;
|
|
199
|
+
export function lorotreenode_creator(a: number): number;
|
|
186
200
|
export function lorotree_new(): number;
|
|
187
201
|
export function lorotree_kind(a: number): number;
|
|
188
202
|
export function lorotree_createNode(a: number, b: number, c: number, d: number, e: number): void;
|
|
@@ -232,7 +246,7 @@ export function versionvector_encode(a: number, b: number): void;
|
|
|
232
246
|
export function versionvector_decode(a: number, b: number, c: number): void;
|
|
233
247
|
export function versionvector_get(a: number, b: number, c: number): void;
|
|
234
248
|
export function versionvector_compare(a: number, b: number, c: number): void;
|
|
235
|
-
export function decodeImportBlobMeta(a: number, b: number, c: number): void;
|
|
249
|
+
export function decodeImportBlobMeta(a: number, b: number, c: number, d: number): void;
|
|
236
250
|
export function __wbg_loromovablelist_free(a: number): void;
|
|
237
251
|
export function loromovablelist_parent(a: number): number;
|
|
238
252
|
export function lorotext_isAttached(a: number): number;
|
package/package.json
CHANGED
package/web/loro_wasm.d.ts
CHANGED
|
@@ -26,12 +26,13 @@ export function setDebug(): void;
|
|
|
26
26
|
* - endVersionVector
|
|
27
27
|
* - startTimestamp
|
|
28
28
|
* - endTimestamp
|
|
29
|
-
* -
|
|
29
|
+
* - mode
|
|
30
30
|
* - changeNum
|
|
31
31
|
* @param {Uint8Array} blob
|
|
32
|
+
* @param {boolean} check_checksum
|
|
32
33
|
* @returns {ImportBlobMetadata}
|
|
33
34
|
*/
|
|
34
|
-
export function decodeImportBlobMeta(blob: Uint8Array): ImportBlobMetadata;
|
|
35
|
+
export function decodeImportBlobMeta(blob: Uint8Array, check_checksum: boolean): ImportBlobMetadata;
|
|
35
36
|
|
|
36
37
|
/**
|
|
37
38
|
* Container types supported by loro.
|
|
@@ -262,7 +263,7 @@ export interface ImportBlobMetadata {
|
|
|
262
263
|
startFrontiers: OpId[],
|
|
263
264
|
startTimestamp: number;
|
|
264
265
|
endTimestamp: number;
|
|
265
|
-
|
|
266
|
+
mode: "outdated-snapshot" | "outdated-update" | "snapshot" | "shallow-snapshot" | "update";
|
|
266
267
|
changeNum: number;
|
|
267
268
|
}
|
|
268
269
|
|
|
@@ -351,6 +352,11 @@ export type TreeNodeValue = {
|
|
|
351
352
|
children: TreeNodeValue[],
|
|
352
353
|
}
|
|
353
354
|
|
|
355
|
+
export type TreeNodeJSON<T> = Omit<TreeNodeValue, 'meta' | 'children'> & {
|
|
356
|
+
meta: T,
|
|
357
|
+
children: TreeNodeJSON<T>[],
|
|
358
|
+
}
|
|
359
|
+
|
|
354
360
|
interface LoroTree{
|
|
355
361
|
toArray(): TreeNodeValue[];
|
|
356
362
|
getNodes(options?: { withDeleted: boolean = false }): LoroTreeNode[];
|
|
@@ -432,6 +438,11 @@ export type JsonChange = {
|
|
|
432
438
|
ops: JsonOp[]
|
|
433
439
|
}
|
|
434
440
|
|
|
441
|
+
export interface TextUpdateOptions {
|
|
442
|
+
timeoutMs?: number,
|
|
443
|
+
useRefinedDiff?: boolean,
|
|
444
|
+
}
|
|
445
|
+
|
|
435
446
|
export type ExportMode = {
|
|
436
447
|
mode: "update",
|
|
437
448
|
from?: VersionVector,
|
|
@@ -779,6 +790,10 @@ interface LoroList<T = unknown> {
|
|
|
779
790
|
* ```
|
|
780
791
|
*/
|
|
781
792
|
insertContainer<C extends Container>(pos: number, child: C): T extends C ? T : C;
|
|
793
|
+
/**
|
|
794
|
+
* Push a container to the end of the list.
|
|
795
|
+
*/
|
|
796
|
+
pushContainer<C extends Container>(child: C): T extends C ? T : C;
|
|
782
797
|
/**
|
|
783
798
|
* Get the value at the index. If the value is a container, the corresponding handler will be returned.
|
|
784
799
|
*
|
|
@@ -851,6 +866,10 @@ interface LoroMovableList<T = unknown> {
|
|
|
851
866
|
* ```
|
|
852
867
|
*/
|
|
853
868
|
insertContainer<C extends Container>(pos: number, child: C): T extends C ? T : C;
|
|
869
|
+
/**
|
|
870
|
+
* Push a container to the end of the list.
|
|
871
|
+
*/
|
|
872
|
+
pushContainer<C extends Container>(child: C): T extends C ? T : C;
|
|
854
873
|
/**
|
|
855
874
|
* Get the value at the index. If the value is a container, the corresponding handler will be returned.
|
|
856
875
|
*
|
|
@@ -1004,6 +1023,32 @@ interface LoroText {
|
|
|
1004
1023
|
insert(pos: number, text: string): void;
|
|
1005
1024
|
delete(pos: number, len: number): void;
|
|
1006
1025
|
subscribe(listener: Listener): Subscription;
|
|
1026
|
+
/**
|
|
1027
|
+
* Update the current text to the target text.
|
|
1028
|
+
*
|
|
1029
|
+
* It will calculate the minimal difference and apply it to the current text.
|
|
1030
|
+
* It uses Myers' diff algorithm to compute the optimal difference.
|
|
1031
|
+
*
|
|
1032
|
+
* This could take a long time for large texts (e.g. > 50_000 characters).
|
|
1033
|
+
* In that case, you should use `updateByLine` instead.
|
|
1034
|
+
*
|
|
1035
|
+
* @example
|
|
1036
|
+
* ```ts
|
|
1037
|
+
* import { LoroDoc } from "loro-crdt";
|
|
1038
|
+
*
|
|
1039
|
+
* const doc = new LoroDoc();
|
|
1040
|
+
* const text = doc.getText("text");
|
|
1041
|
+
* text.insert(0, "Hello");
|
|
1042
|
+
* text.update("Hello World");
|
|
1043
|
+
* console.log(text.toString()); // "Hello World"
|
|
1044
|
+
* ```
|
|
1045
|
+
*/
|
|
1046
|
+
update(text: string, options?: TextUpdateOptions): void;
|
|
1047
|
+
/**
|
|
1048
|
+
* Update the current text based on the provided text.
|
|
1049
|
+
* This update calculation is line-based, which will be more efficient but less precise.
|
|
1050
|
+
*/
|
|
1051
|
+
updateByLine(text: string, options?: TextUpdateOptions): void;
|
|
1007
1052
|
}
|
|
1008
1053
|
interface LoroTree<T extends Record<string, unknown> = Record<string, unknown>> {
|
|
1009
1054
|
new(): LoroTree<T>;
|
|
@@ -1072,6 +1117,7 @@ interface LoroTreeNode<T extends Record<string, unknown> = Record<string, unknow
|
|
|
1072
1117
|
* the WASM boundary.
|
|
1073
1118
|
*/
|
|
1074
1119
|
children(): Array<LoroTreeNode<T>> | undefined;
|
|
1120
|
+
toJSON(): TreeNodeJSON<T>;
|
|
1075
1121
|
}
|
|
1076
1122
|
interface AwarenessWasm<T extends Value = Value> {
|
|
1077
1123
|
getState(peer: PeerID): T | undefined;
|
|
@@ -1479,11 +1525,16 @@ export class LoroDoc {
|
|
|
1479
1525
|
* Duplicate the document with a different PeerID
|
|
1480
1526
|
*
|
|
1481
1527
|
* The time complexity and space complexity of this operation are both O(n),
|
|
1528
|
+
*
|
|
1529
|
+
* When called in detached mode, it will fork at the current state frontiers.
|
|
1530
|
+
* It will have the same effect as `forkAt(&self.frontiers())`.
|
|
1482
1531
|
* @returns {LoroDoc}
|
|
1483
1532
|
*/
|
|
1484
1533
|
fork(): LoroDoc;
|
|
1485
1534
|
/**
|
|
1486
1535
|
* Creates a new LoroDoc at a specified version (Frontiers)
|
|
1536
|
+
*
|
|
1537
|
+
* The created doc will only contain the history before the specified frontiers.
|
|
1487
1538
|
* @param {({ peer: PeerID, counter: number })[]} frontiers
|
|
1488
1539
|
* @returns {LoroDoc}
|
|
1489
1540
|
*/
|
|
@@ -1519,9 +1570,9 @@ export class LoroDoc {
|
|
|
1519
1570
|
* @param ids - the changes to visit
|
|
1520
1571
|
* @param f - the callback function, return `true` to continue visiting, return `false` to stop
|
|
1521
1572
|
* @param {({ peer: PeerID, counter: number })[]} ids
|
|
1522
|
-
* @param {
|
|
1573
|
+
* @param {(change: ChangeMeta) => boolean} f
|
|
1523
1574
|
*/
|
|
1524
|
-
travelChangeAncestors(ids: ({ peer: PeerID, counter: number })[], f:
|
|
1575
|
+
travelChangeAncestors(ids: ({ peer: PeerID, counter: number })[], f: (change: ChangeMeta) => boolean): void;
|
|
1525
1576
|
/**
|
|
1526
1577
|
* Checkout the `DocState` to a specific version.
|
|
1527
1578
|
*
|
|
@@ -1997,6 +2048,23 @@ export class LoroDoc {
|
|
|
1997
2048
|
*/
|
|
1998
2049
|
getCursorPos(cursor: Cursor): { update?: Cursor, offset: number, side: Side };
|
|
1999
2050
|
/**
|
|
2051
|
+
* Gets container IDs modified in the given ID range.
|
|
2052
|
+
*
|
|
2053
|
+
* **NOTE:** This method will implicitly commit.
|
|
2054
|
+
*
|
|
2055
|
+
* This method identifies which containers were affected by changes in a given range of operations.
|
|
2056
|
+
* It can be used together with `doc.travelChangeAncestors()` to analyze the history of changes
|
|
2057
|
+
* and determine which containers were modified by each change.
|
|
2058
|
+
*
|
|
2059
|
+
* @param id - The starting ID of the change range
|
|
2060
|
+
* @param len - The length of the change range to check
|
|
2061
|
+
* @returns An array of container IDs that were modified in the given range
|
|
2062
|
+
* @param {{ peer: PeerID, counter: number }} id
|
|
2063
|
+
* @param {number} len
|
|
2064
|
+
* @returns {(ContainerID)[]}
|
|
2065
|
+
*/
|
|
2066
|
+
getChangedContainersIn(id: { peer: PeerID, counter: number }, len: number): (ContainerID)[];
|
|
2067
|
+
/**
|
|
2000
2068
|
* Peer ID of the current writer.
|
|
2001
2069
|
*/
|
|
2002
2070
|
readonly peerId: bigint;
|
|
@@ -2092,6 +2160,11 @@ export class LoroList {
|
|
|
2092
2160
|
*/
|
|
2093
2161
|
clear(): void;
|
|
2094
2162
|
/**
|
|
2163
|
+
* @param {number} pos
|
|
2164
|
+
* @returns {{ peer: PeerID, counter: number } | undefined}
|
|
2165
|
+
*/
|
|
2166
|
+
getIdAt(pos: number): { peer: PeerID, counter: number } | undefined;
|
|
2167
|
+
/**
|
|
2095
2168
|
* Get the id of this container.
|
|
2096
2169
|
*/
|
|
2097
2170
|
readonly id: ContainerID;
|
|
@@ -2242,6 +2315,12 @@ export class LoroMap {
|
|
|
2242
2315
|
*/
|
|
2243
2316
|
clear(): void;
|
|
2244
2317
|
/**
|
|
2318
|
+
* Get the peer id of the last editor on the given entry
|
|
2319
|
+
* @param {string} key
|
|
2320
|
+
* @returns {PeerID | undefined}
|
|
2321
|
+
*/
|
|
2322
|
+
getLastEditor(key: string): PeerID | undefined;
|
|
2323
|
+
/**
|
|
2245
2324
|
* The container id of this handler.
|
|
2246
2325
|
*/
|
|
2247
2326
|
readonly id: ContainerID;
|
|
@@ -2362,6 +2441,24 @@ export class LoroMovableList {
|
|
|
2362
2441
|
*/
|
|
2363
2442
|
clear(): void;
|
|
2364
2443
|
/**
|
|
2444
|
+
* Get the creator of the list item at the given position.
|
|
2445
|
+
* @param {number} pos
|
|
2446
|
+
* @returns {PeerID | undefined}
|
|
2447
|
+
*/
|
|
2448
|
+
getCreatorAt(pos: number): PeerID | undefined;
|
|
2449
|
+
/**
|
|
2450
|
+
* Get the last mover of the list item at the given position.
|
|
2451
|
+
* @param {number} pos
|
|
2452
|
+
* @returns {PeerID | undefined}
|
|
2453
|
+
*/
|
|
2454
|
+
getLastMoverAt(pos: number): PeerID | undefined;
|
|
2455
|
+
/**
|
|
2456
|
+
* Get the last editor of the list item at the given position.
|
|
2457
|
+
* @param {number} pos
|
|
2458
|
+
* @returns {PeerID | undefined}
|
|
2459
|
+
*/
|
|
2460
|
+
getLastEditorAt(pos: number): PeerID | undefined;
|
|
2461
|
+
/**
|
|
2365
2462
|
* Get the id of this container.
|
|
2366
2463
|
*/
|
|
2367
2464
|
readonly id: ContainerID;
|
|
@@ -2402,11 +2499,14 @@ export class LoroText {
|
|
|
2402
2499
|
*/
|
|
2403
2500
|
kind(): 'Text';
|
|
2404
2501
|
/**
|
|
2405
|
-
* Iterate each span(internal storage unit)
|
|
2502
|
+
* Iterate each text span(internal storage unit)
|
|
2406
2503
|
*
|
|
2407
2504
|
* The callback function will be called for each span in the text.
|
|
2408
2505
|
* If the callback returns `false`, the iteration will stop.
|
|
2409
2506
|
*
|
|
2507
|
+
* Limitation: you cannot access or alter the doc state when iterating (this is for performance consideration).
|
|
2508
|
+
* If you need to access or alter the doc state, please use `toString` instead.
|
|
2509
|
+
*
|
|
2410
2510
|
* @example
|
|
2411
2511
|
* ```ts
|
|
2412
2512
|
* import { LoroDoc } from "loro-crdt";
|
|
@@ -2420,35 +2520,6 @@ export class LoroText {
|
|
|
2420
2520
|
*/
|
|
2421
2521
|
iter(callback: Function): void;
|
|
2422
2522
|
/**
|
|
2423
|
-
* Update the current text to the target text.
|
|
2424
|
-
*
|
|
2425
|
-
* It will calculate the minimal difference and apply it to the current text.
|
|
2426
|
-
* It uses Myers' diff algorithm to compute the optimal difference.
|
|
2427
|
-
*
|
|
2428
|
-
* This could take a long time for large texts (e.g. > 50_000 characters).
|
|
2429
|
-
* In that case, you should use `updateByLine` instead.
|
|
2430
|
-
*
|
|
2431
|
-
* @example
|
|
2432
|
-
* ```ts
|
|
2433
|
-
* import { LoroDoc } from "loro-crdt";
|
|
2434
|
-
*
|
|
2435
|
-
* const doc = new LoroDoc();
|
|
2436
|
-
* const text = doc.getText("text");
|
|
2437
|
-
* text.insert(0, "Hello");
|
|
2438
|
-
* text.update("Hello World");
|
|
2439
|
-
* console.log(text.toString()); // "Hello World"
|
|
2440
|
-
* ```
|
|
2441
|
-
* @param {string} text
|
|
2442
|
-
*/
|
|
2443
|
-
update(text: string): void;
|
|
2444
|
-
/**
|
|
2445
|
-
* Update the current text to the target text, the difference is calculated line by line.
|
|
2446
|
-
*
|
|
2447
|
-
* It uses Myers' diff algorithm to compute the optimal difference.
|
|
2448
|
-
* @param {string} text
|
|
2449
|
-
*/
|
|
2450
|
-
updateByLine(text: string): void;
|
|
2451
|
-
/**
|
|
2452
2523
|
* Insert the string at the given index (utf-16 index).
|
|
2453
2524
|
*
|
|
2454
2525
|
* @example
|
|
@@ -2687,6 +2758,17 @@ export class LoroText {
|
|
|
2687
2758
|
*/
|
|
2688
2759
|
getAttached(): LoroText | undefined;
|
|
2689
2760
|
/**
|
|
2761
|
+
* Push a string to the end of the text.
|
|
2762
|
+
* @param {string} s
|
|
2763
|
+
*/
|
|
2764
|
+
push(s: string): void;
|
|
2765
|
+
/**
|
|
2766
|
+
* Get the editor of the text at the given position.
|
|
2767
|
+
* @param {number} pos
|
|
2768
|
+
* @returns {PeerID | undefined}
|
|
2769
|
+
*/
|
|
2770
|
+
getEditorOf(pos: number): PeerID | undefined;
|
|
2771
|
+
/**
|
|
2690
2772
|
* Get the container id of the text.
|
|
2691
2773
|
*/
|
|
2692
2774
|
readonly id: ContainerID;
|
|
@@ -2956,6 +3038,21 @@ export class LoroTreeNode {
|
|
|
2956
3038
|
*/
|
|
2957
3039
|
isDeleted(): boolean;
|
|
2958
3040
|
/**
|
|
3041
|
+
* Get the last mover of this node.
|
|
3042
|
+
* @returns {{ peer: PeerID, counter: number } | undefined}
|
|
3043
|
+
*/
|
|
3044
|
+
getLastMoveId(): { peer: PeerID, counter: number } | undefined;
|
|
3045
|
+
/**
|
|
3046
|
+
* Get the creation id of this node.
|
|
3047
|
+
* @returns {{ peer: PeerID, counter: number }}
|
|
3048
|
+
*/
|
|
3049
|
+
creationId(): { peer: PeerID, counter: number };
|
|
3050
|
+
/**
|
|
3051
|
+
* Get the creator of this node.
|
|
3052
|
+
* @returns {PeerID}
|
|
3053
|
+
*/
|
|
3054
|
+
creator(): PeerID;
|
|
3055
|
+
/**
|
|
2959
3056
|
* The TreeID of the node.
|
|
2960
3057
|
*/
|
|
2961
3058
|
readonly id: TreeID;
|
|
@@ -3194,12 +3291,13 @@ export interface InitOutput {
|
|
|
3194
3291
|
readonly lorodoc_vvToFrontiers: (a: number, b: number, c: number) => void;
|
|
3195
3292
|
readonly lorodoc_getByPath: (a: number, b: number, c: number) => number;
|
|
3196
3293
|
readonly lorodoc_getCursorPos: (a: number, b: number, c: number) => void;
|
|
3294
|
+
readonly lorodoc_getChangedContainersIn: (a: number, b: number, c: number, d: number) => void;
|
|
3197
3295
|
readonly __wbg_lorotext_free: (a: number) => void;
|
|
3198
3296
|
readonly lorotext_new: () => number;
|
|
3199
3297
|
readonly lorotext_kind: (a: number) => number;
|
|
3200
3298
|
readonly lorotext_iter: (a: number, b: number) => void;
|
|
3201
|
-
readonly lorotext_update: (a: number, b: number, c: number) => void;
|
|
3202
|
-
readonly lorotext_updateByLine: (a: number, b: number, c: number) => void;
|
|
3299
|
+
readonly lorotext_update: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
3300
|
+
readonly lorotext_updateByLine: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
3203
3301
|
readonly lorotext_insert: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
3204
3302
|
readonly lorotext_slice: (a: number, b: number, c: number, d: number) => void;
|
|
3205
3303
|
readonly lorotext_charAt: (a: number, b: number, c: number) => void;
|
|
@@ -3218,6 +3316,8 @@ export interface InitOutput {
|
|
|
3218
3316
|
readonly lorotext_parent: (a: number) => number;
|
|
3219
3317
|
readonly lorotext_getAttached: (a: number) => number;
|
|
3220
3318
|
readonly lorotext_getCursor: (a: number, b: number, c: number) => number;
|
|
3319
|
+
readonly lorotext_push: (a: number, b: number, c: number, d: number) => void;
|
|
3320
|
+
readonly lorotext_getEditorOf: (a: number, b: number) => number;
|
|
3221
3321
|
readonly __wbg_loromap_free: (a: number) => void;
|
|
3222
3322
|
readonly loromap_new: () => number;
|
|
3223
3323
|
readonly loromap_kind: (a: number) => number;
|
|
@@ -3236,6 +3336,7 @@ export interface InitOutput {
|
|
|
3236
3336
|
readonly loromap_parent: (a: number) => number;
|
|
3237
3337
|
readonly loromap_getAttached: (a: number) => number;
|
|
3238
3338
|
readonly loromap_clear: (a: number, b: number) => void;
|
|
3339
|
+
readonly loromap_getLastEditor: (a: number, b: number, c: number) => number;
|
|
3239
3340
|
readonly __wbg_lorolist_free: (a: number) => void;
|
|
3240
3341
|
readonly lorolist_new: () => number;
|
|
3241
3342
|
readonly lorolist_kind: (a: number) => number;
|
|
@@ -3246,6 +3347,7 @@ export interface InitOutput {
|
|
|
3246
3347
|
readonly lorolist_toArray: (a: number, b: number) => void;
|
|
3247
3348
|
readonly lorolist_toJSON: (a: number) => number;
|
|
3248
3349
|
readonly lorolist_insertContainer: (a: number, b: number, c: number, d: number) => void;
|
|
3350
|
+
readonly lorolist_pushContainer: (a: number, b: number, c: number) => void;
|
|
3249
3351
|
readonly lorolist_subscribe: (a: number, b: number, c: number) => void;
|
|
3250
3352
|
readonly lorolist_length: (a: number) => number;
|
|
3251
3353
|
readonly lorolist_parent: (a: number) => number;
|
|
@@ -3255,6 +3357,7 @@ export interface InitOutput {
|
|
|
3255
3357
|
readonly lorolist_push: (a: number, b: number, c: number) => void;
|
|
3256
3358
|
readonly lorolist_pop: (a: number, b: number) => void;
|
|
3257
3359
|
readonly lorolist_clear: (a: number, b: number) => void;
|
|
3360
|
+
readonly lorolist_getIdAt: (a: number, b: number) => number;
|
|
3258
3361
|
readonly loromovablelist_new: () => number;
|
|
3259
3362
|
readonly loromovablelist_kind: (a: number) => number;
|
|
3260
3363
|
readonly loromovablelist_insert: (a: number, b: number, c: number, d: number) => void;
|
|
@@ -3264,6 +3367,7 @@ export interface InitOutput {
|
|
|
3264
3367
|
readonly loromovablelist_toArray: (a: number, b: number) => void;
|
|
3265
3368
|
readonly loromovablelist_toJSON: (a: number) => number;
|
|
3266
3369
|
readonly loromovablelist_insertContainer: (a: number, b: number, c: number, d: number) => void;
|
|
3370
|
+
readonly loromovablelist_pushContainer: (a: number, b: number, c: number) => void;
|
|
3267
3371
|
readonly loromovablelist_subscribe: (a: number, b: number, c: number) => void;
|
|
3268
3372
|
readonly loromovablelist_length: (a: number) => number;
|
|
3269
3373
|
readonly loromovablelist_getAttached: (a: number) => number;
|
|
@@ -3274,6 +3378,9 @@ export interface InitOutput {
|
|
|
3274
3378
|
readonly loromovablelist_push: (a: number, b: number, c: number) => void;
|
|
3275
3379
|
readonly loromovablelist_pop: (a: number, b: number) => void;
|
|
3276
3380
|
readonly loromovablelist_clear: (a: number, b: number) => void;
|
|
3381
|
+
readonly loromovablelist_getCreatorAt: (a: number, b: number) => number;
|
|
3382
|
+
readonly loromovablelist_getLastMoverAt: (a: number, b: number) => number;
|
|
3383
|
+
readonly loromovablelist_getLastEditorAt: (a: number, b: number) => number;
|
|
3277
3384
|
readonly __wbg_lorotree_free: (a: number) => void;
|
|
3278
3385
|
readonly lorotreenode___getClassname: (a: number, b: number) => void;
|
|
3279
3386
|
readonly __wbg_lorotreenode_free: (a: number) => void;
|
|
@@ -3285,9 +3392,13 @@ export interface InitOutput {
|
|
|
3285
3392
|
readonly lorotreenode_index: (a: number, b: number) => void;
|
|
3286
3393
|
readonly lorotreenode_fractionalIndex: (a: number, b: number) => void;
|
|
3287
3394
|
readonly lorotreenode_data: (a: number, b: number) => void;
|
|
3395
|
+
readonly lorotreenode_toJSON: (a: number, b: number) => void;
|
|
3288
3396
|
readonly lorotreenode_parent: (a: number, b: number) => void;
|
|
3289
3397
|
readonly lorotreenode_children: (a: number) => number;
|
|
3290
3398
|
readonly lorotreenode_isDeleted: (a: number, b: number) => void;
|
|
3399
|
+
readonly lorotreenode_getLastMoveId: (a: number) => number;
|
|
3400
|
+
readonly lorotreenode_creationId: (a: number) => number;
|
|
3401
|
+
readonly lorotreenode_creator: (a: number) => number;
|
|
3291
3402
|
readonly lorotree_new: () => number;
|
|
3292
3403
|
readonly lorotree_kind: (a: number) => number;
|
|
3293
3404
|
readonly lorotree_createNode: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
@@ -3337,7 +3448,7 @@ export interface InitOutput {
|
|
|
3337
3448
|
readonly versionvector_decode: (a: number, b: number, c: number) => void;
|
|
3338
3449
|
readonly versionvector_get: (a: number, b: number, c: number) => void;
|
|
3339
3450
|
readonly versionvector_compare: (a: number, b: number, c: number) => void;
|
|
3340
|
-
readonly decodeImportBlobMeta: (a: number, b: number, c: number) => void;
|
|
3451
|
+
readonly decodeImportBlobMeta: (a: number, b: number, c: number, d: number) => void;
|
|
3341
3452
|
readonly __wbg_loromovablelist_free: (a: number) => void;
|
|
3342
3453
|
readonly loromovablelist_parent: (a: number) => number;
|
|
3343
3454
|
readonly lorotext_isAttached: (a: number) => number;
|