loro-crdt 1.3.0 → 1.3.2
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 +13 -0
- package/README.md +1 -3
- package/base64/index.js +44 -38
- package/base64/loro_wasm.d.ts +12 -9
- package/base64/loro_wasm_bg-0d85a13f.js +64 -0
- package/bundler/loro_wasm.d.ts +12 -9
- package/bundler/loro_wasm_bg.js +39 -33
- package/bundler/loro_wasm_bg.wasm +0 -0
- package/bundler/loro_wasm_bg.wasm.d.ts +3 -2
- package/nodejs/loro_wasm.d.ts +12 -9
- package/nodejs/loro_wasm.js +39 -33
- package/nodejs/loro_wasm_bg.wasm +0 -0
- package/nodejs/loro_wasm_bg.wasm.d.ts +3 -2
- package/package.json +1 -1
- package/web/loro_wasm.d.ts +15 -11
- package/web/loro_wasm.js +37 -31
- package/web/loro_wasm_bg.wasm +0 -0
- package/web/loro_wasm_bg.wasm.d.ts +3 -2
- package/base64/loro_wasm_bg-faa2e3e4.js +0 -64
package/bundler/loro_wasm.d.ts
CHANGED
|
@@ -48,7 +48,7 @@ export function decodeImportBlobMeta(blob: Uint8Array, check_checksum: boolean):
|
|
|
48
48
|
* const text = list.insertContainer(1, new LoroText());
|
|
49
49
|
* ```
|
|
50
50
|
*/
|
|
51
|
-
export type ContainerType = "Text" | "Map" | "List"| "Tree" | "MovableList";
|
|
51
|
+
export type ContainerType = "Text" | "Map" | "List"| "Tree" | "MovableList" | "Counter";
|
|
52
52
|
|
|
53
53
|
export type PeerID = `${number}`;
|
|
54
54
|
/**
|
|
@@ -292,7 +292,7 @@ export type UndoConfig = {
|
|
|
292
292
|
onPush?: (isUndo: boolean, counterRange: { start: number, end: number }, event?: LoroEventBatch) => { value: Value, cursors: Cursor[] },
|
|
293
293
|
onPop?: (isUndo: boolean, value: { value: Value, cursors: Cursor[] }, counterRange: { start: number, end: number }) => void
|
|
294
294
|
};
|
|
295
|
-
export type Container = LoroList | LoroMap | LoroText | LoroTree | LoroMovableList;
|
|
295
|
+
export type Container = LoroList | LoroMap | LoroText | LoroTree | LoroMovableList | LoroCounter;
|
|
296
296
|
|
|
297
297
|
export interface ImportBlobMetadata {
|
|
298
298
|
/**
|
|
@@ -1378,7 +1378,7 @@ export class Cursor {
|
|
|
1378
1378
|
kind(): any;
|
|
1379
1379
|
}
|
|
1380
1380
|
/**
|
|
1381
|
-
* The handler of a
|
|
1381
|
+
* The handler of a counter container.
|
|
1382
1382
|
*/
|
|
1383
1383
|
export class LoroCounter {
|
|
1384
1384
|
free(): void;
|
|
@@ -1387,6 +1387,11 @@ export class LoroCounter {
|
|
|
1387
1387
|
*/
|
|
1388
1388
|
constructor();
|
|
1389
1389
|
/**
|
|
1390
|
+
* "Counter"
|
|
1391
|
+
* @returns {'Counter'}
|
|
1392
|
+
*/
|
|
1393
|
+
kind(): 'Counter';
|
|
1394
|
+
/**
|
|
1390
1395
|
* Increment the counter by the given value.
|
|
1391
1396
|
* @param {number} value
|
|
1392
1397
|
*/
|
|
@@ -1431,6 +1436,10 @@ export class LoroCounter {
|
|
|
1431
1436
|
*/
|
|
1432
1437
|
getShallowValue(): number;
|
|
1433
1438
|
/**
|
|
1439
|
+
* The container id of this handler.
|
|
1440
|
+
*/
|
|
1441
|
+
readonly id: ContainerID;
|
|
1442
|
+
/**
|
|
1434
1443
|
* Get the value of the counter.
|
|
1435
1444
|
*/
|
|
1436
1445
|
readonly value: number;
|
|
@@ -3498,12 +3507,6 @@ export class UndoManager {
|
|
|
3498
3507
|
*/
|
|
3499
3508
|
addExcludeOriginPrefix(prefix: string): void;
|
|
3500
3509
|
/**
|
|
3501
|
-
* Check if the undo manager is bound to the given document.
|
|
3502
|
-
* @param {LoroDoc} doc
|
|
3503
|
-
* @returns {boolean}
|
|
3504
|
-
*/
|
|
3505
|
-
checkBinding(doc: LoroDoc): boolean;
|
|
3506
|
-
/**
|
|
3507
3510
|
*/
|
|
3508
3511
|
clear(): void;
|
|
3509
3512
|
}
|
package/bundler/loro_wasm_bg.js
CHANGED
|
@@ -736,7 +736,7 @@ const LoroCounterFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
|
736
736
|
? { register: () => {}, unregister: () => {} }
|
|
737
737
|
: new FinalizationRegistry(ptr => wasm.__wbg_lorocounter_free(ptr >>> 0));
|
|
738
738
|
/**
|
|
739
|
-
* The handler of a
|
|
739
|
+
* The handler of a counter container.
|
|
740
740
|
*/
|
|
741
741
|
export class LoroCounter {
|
|
742
742
|
|
|
@@ -768,6 +768,22 @@ export class LoroCounter {
|
|
|
768
768
|
return this;
|
|
769
769
|
}
|
|
770
770
|
/**
|
|
771
|
+
* "Counter"
|
|
772
|
+
* @returns {'Counter'}
|
|
773
|
+
*/
|
|
774
|
+
kind() {
|
|
775
|
+
const ret = wasm.lorocounter_kind(this.__wbg_ptr);
|
|
776
|
+
return takeObject(ret);
|
|
777
|
+
}
|
|
778
|
+
/**
|
|
779
|
+
* The container id of this handler.
|
|
780
|
+
* @returns {ContainerID}
|
|
781
|
+
*/
|
|
782
|
+
get id() {
|
|
783
|
+
const ret = wasm.lorocounter_id(this.__wbg_ptr);
|
|
784
|
+
return takeObject(ret);
|
|
785
|
+
}
|
|
786
|
+
/**
|
|
771
787
|
* Increment the counter by the given value.
|
|
772
788
|
* @param {number} value
|
|
773
789
|
*/
|
|
@@ -2095,7 +2111,7 @@ export class LoroDoc {
|
|
|
2095
2111
|
importUpdateBatch(data) {
|
|
2096
2112
|
try {
|
|
2097
2113
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
2098
|
-
wasm.
|
|
2114
|
+
wasm.lorodoc_importBatch(retptr, this.__wbg_ptr, addHeapObject(data));
|
|
2099
2115
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
2100
2116
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
2101
2117
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
@@ -5723,16 +5739,6 @@ export class UndoManager {
|
|
|
5723
5739
|
wasm.undomanager_addExcludeOriginPrefix(this.__wbg_ptr, ptr0, len0);
|
|
5724
5740
|
}
|
|
5725
5741
|
/**
|
|
5726
|
-
* Check if the undo manager is bound to the given document.
|
|
5727
|
-
* @param {LoroDoc} doc
|
|
5728
|
-
* @returns {boolean}
|
|
5729
|
-
*/
|
|
5730
|
-
checkBinding(doc) {
|
|
5731
|
-
_assertClass(doc, LoroDoc);
|
|
5732
|
-
const ret = wasm.undomanager_checkBinding(this.__wbg_ptr, doc.__wbg_ptr);
|
|
5733
|
-
return ret !== 0;
|
|
5734
|
-
}
|
|
5735
|
-
/**
|
|
5736
5742
|
* Set the on push event listener.
|
|
5737
5743
|
*
|
|
5738
5744
|
* Every time an undo step or redo step is pushed, the on push event listener will be called.
|
|
@@ -5978,13 +5984,23 @@ export function __wbindgen_object_drop_ref(arg0) {
|
|
|
5978
5984
|
takeObject(arg0);
|
|
5979
5985
|
};
|
|
5980
5986
|
|
|
5987
|
+
export function __wbg_lorotree_new(arg0) {
|
|
5988
|
+
const ret = LoroTree.__wrap(arg0);
|
|
5989
|
+
return addHeapObject(ret);
|
|
5990
|
+
};
|
|
5991
|
+
|
|
5981
5992
|
export function __wbg_lorolist_new(arg0) {
|
|
5982
5993
|
const ret = LoroList.__wrap(arg0);
|
|
5983
5994
|
return addHeapObject(ret);
|
|
5984
5995
|
};
|
|
5985
5996
|
|
|
5986
|
-
export function
|
|
5987
|
-
const ret =
|
|
5997
|
+
export function __wbg_lorotext_new(arg0) {
|
|
5998
|
+
const ret = LoroText.__wrap(arg0);
|
|
5999
|
+
return addHeapObject(ret);
|
|
6000
|
+
};
|
|
6001
|
+
|
|
6002
|
+
export function __wbg_cursor_new(arg0) {
|
|
6003
|
+
const ret = Cursor.__wrap(arg0);
|
|
5988
6004
|
return addHeapObject(ret);
|
|
5989
6005
|
};
|
|
5990
6006
|
|
|
@@ -5998,8 +6014,8 @@ export function __wbg_lorotreenode_new(arg0) {
|
|
|
5998
6014
|
return addHeapObject(ret);
|
|
5999
6015
|
};
|
|
6000
6016
|
|
|
6001
|
-
export function
|
|
6002
|
-
const ret =
|
|
6017
|
+
export function __wbg_lorocounter_new(arg0) {
|
|
6018
|
+
const ret = LoroCounter.__wrap(arg0);
|
|
6003
6019
|
return addHeapObject(ret);
|
|
6004
6020
|
};
|
|
6005
6021
|
|
|
@@ -6008,16 +6024,6 @@ export function __wbg_loromovablelist_new(arg0) {
|
|
|
6008
6024
|
return addHeapObject(ret);
|
|
6009
6025
|
};
|
|
6010
6026
|
|
|
6011
|
-
export function __wbg_cursor_new(arg0) {
|
|
6012
|
-
const ret = Cursor.__wrap(arg0);
|
|
6013
|
-
return addHeapObject(ret);
|
|
6014
|
-
};
|
|
6015
|
-
|
|
6016
|
-
export function __wbg_lorotext_new(arg0) {
|
|
6017
|
-
const ret = LoroText.__wrap(arg0);
|
|
6018
|
-
return addHeapObject(ret);
|
|
6019
|
-
};
|
|
6020
|
-
|
|
6021
6027
|
export function __wbg_versionvector_new(arg0) {
|
|
6022
6028
|
const ret = VersionVector.__wrap(arg0);
|
|
6023
6029
|
return addHeapObject(ret);
|
|
@@ -6141,11 +6147,11 @@ export function __wbindgen_typeof(arg0) {
|
|
|
6141
6147
|
return addHeapObject(ret);
|
|
6142
6148
|
};
|
|
6143
6149
|
|
|
6144
|
-
export function
|
|
6150
|
+
export function __wbg_error_9384d761bf46409d(arg0, arg1) {
|
|
6145
6151
|
console.error(getStringFromWasm0(arg0, arg1));
|
|
6146
6152
|
};
|
|
6147
6153
|
|
|
6148
|
-
export function
|
|
6154
|
+
export function __wbg_log_c86c3e1bf097ba35(arg0, arg1) {
|
|
6149
6155
|
console.log(getStringFromWasm0(arg0, arg1));
|
|
6150
6156
|
};
|
|
6151
6157
|
|
|
@@ -6246,7 +6252,7 @@ export function __wbg_error_f851667af71bcfc6(arg0, arg1) {
|
|
|
6246
6252
|
}
|
|
6247
6253
|
};
|
|
6248
6254
|
|
|
6249
|
-
export const
|
|
6255
|
+
export const __wbg_now_2d57022b1935b215 = typeof Date.now == 'function' ? Date.now : notDefined('Date.now');
|
|
6250
6256
|
|
|
6251
6257
|
export function __wbg_crypto_1d1f22824a6a080c(arg0) {
|
|
6252
6258
|
const ret = getObject(arg0).crypto;
|
|
@@ -6570,13 +6576,13 @@ export function __wbindgen_memory() {
|
|
|
6570
6576
|
return addHeapObject(ret);
|
|
6571
6577
|
};
|
|
6572
6578
|
|
|
6573
|
-
export function
|
|
6574
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
6579
|
+
export function __wbindgen_closure_wrapper482(arg0, arg1, arg2) {
|
|
6580
|
+
const ret = makeMutClosure(arg0, arg1, 8, __wbg_adapter_60);
|
|
6575
6581
|
return addHeapObject(ret);
|
|
6576
6582
|
};
|
|
6577
6583
|
|
|
6578
|
-
export function
|
|
6579
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
6584
|
+
export function __wbindgen_closure_wrapper485(arg0, arg1, arg2) {
|
|
6585
|
+
const ret = makeMutClosure(arg0, arg1, 10, __wbg_adapter_63);
|
|
6580
6586
|
return addHeapObject(ret);
|
|
6581
6587
|
};
|
|
6582
6588
|
|
|
Binary file
|
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
export const memory: WebAssembly.Memory;
|
|
4
4
|
export function __wbg_lorocounter_free(a: number): void;
|
|
5
5
|
export function lorocounter_new(): number;
|
|
6
|
+
export function lorocounter_kind(a: number): number;
|
|
7
|
+
export function lorocounter_id(a: number): number;
|
|
6
8
|
export function lorocounter_increment(a: number, b: number, c: number): void;
|
|
7
9
|
export function lorocounter_decrement(a: number, b: number, c: number): void;
|
|
8
10
|
export function lorocounter_value(a: number): number;
|
|
@@ -78,7 +80,6 @@ export function lorodoc_exportJsonUpdates(a: number, b: number, c: number, d: nu
|
|
|
78
80
|
export function lorodoc_exportJsonInIdSpan(a: number, b: number, c: number): void;
|
|
79
81
|
export function lorodoc_importJsonUpdates(a: number, b: number, c: number): void;
|
|
80
82
|
export function lorodoc_import(a: number, b: number, c: number, d: number): void;
|
|
81
|
-
export function lorodoc_importUpdateBatch(a: number, b: number, c: number): void;
|
|
82
83
|
export function lorodoc_importBatch(a: number, b: number, c: number): void;
|
|
83
84
|
export function lorodoc_getShallowValue(a: number, b: number): void;
|
|
84
85
|
export function lorodoc_toJSON(a: number, b: number): void;
|
|
@@ -253,7 +254,6 @@ export function undomanager_canRedo(a: number): number;
|
|
|
253
254
|
export function undomanager_setMaxUndoSteps(a: number, b: number): void;
|
|
254
255
|
export function undomanager_setMergeInterval(a: number, b: number): void;
|
|
255
256
|
export function undomanager_addExcludeOriginPrefix(a: number, b: number, c: number): void;
|
|
256
|
-
export function undomanager_checkBinding(a: number, b: number): number;
|
|
257
257
|
export function undomanager_setOnPush(a: number, b: number): void;
|
|
258
258
|
export function undomanager_setOnPop(a: number, b: number): void;
|
|
259
259
|
export function undomanager_clear(a: number): void;
|
|
@@ -271,6 +271,7 @@ export function versionvector_remove(a: number, b: number, c: number): void;
|
|
|
271
271
|
export function versionvector_length(a: number): number;
|
|
272
272
|
export function decodeImportBlobMeta(a: number, b: number, c: number, d: number): void;
|
|
273
273
|
export function __wbg_loromovablelist_free(a: number): void;
|
|
274
|
+
export function lorodoc_importUpdateBatch(a: number, b: number, c: number): void;
|
|
274
275
|
export function loromovablelist_parent(a: number): number;
|
|
275
276
|
export function lorotext_isAttached(a: number): number;
|
|
276
277
|
export function loromap_isAttached(a: number): number;
|
package/nodejs/loro_wasm.d.ts
CHANGED
|
@@ -48,7 +48,7 @@ export function decodeImportBlobMeta(blob: Uint8Array, check_checksum: boolean):
|
|
|
48
48
|
* const text = list.insertContainer(1, new LoroText());
|
|
49
49
|
* ```
|
|
50
50
|
*/
|
|
51
|
-
export type ContainerType = "Text" | "Map" | "List"| "Tree" | "MovableList";
|
|
51
|
+
export type ContainerType = "Text" | "Map" | "List"| "Tree" | "MovableList" | "Counter";
|
|
52
52
|
|
|
53
53
|
export type PeerID = `${number}`;
|
|
54
54
|
/**
|
|
@@ -292,7 +292,7 @@ export type UndoConfig = {
|
|
|
292
292
|
onPush?: (isUndo: boolean, counterRange: { start: number, end: number }, event?: LoroEventBatch) => { value: Value, cursors: Cursor[] },
|
|
293
293
|
onPop?: (isUndo: boolean, value: { value: Value, cursors: Cursor[] }, counterRange: { start: number, end: number }) => void
|
|
294
294
|
};
|
|
295
|
-
export type Container = LoroList | LoroMap | LoroText | LoroTree | LoroMovableList;
|
|
295
|
+
export type Container = LoroList | LoroMap | LoroText | LoroTree | LoroMovableList | LoroCounter;
|
|
296
296
|
|
|
297
297
|
export interface ImportBlobMetadata {
|
|
298
298
|
/**
|
|
@@ -1378,7 +1378,7 @@ export class Cursor {
|
|
|
1378
1378
|
kind(): any;
|
|
1379
1379
|
}
|
|
1380
1380
|
/**
|
|
1381
|
-
* The handler of a
|
|
1381
|
+
* The handler of a counter container.
|
|
1382
1382
|
*/
|
|
1383
1383
|
export class LoroCounter {
|
|
1384
1384
|
free(): void;
|
|
@@ -1387,6 +1387,11 @@ export class LoroCounter {
|
|
|
1387
1387
|
*/
|
|
1388
1388
|
constructor();
|
|
1389
1389
|
/**
|
|
1390
|
+
* "Counter"
|
|
1391
|
+
* @returns {'Counter'}
|
|
1392
|
+
*/
|
|
1393
|
+
kind(): 'Counter';
|
|
1394
|
+
/**
|
|
1390
1395
|
* Increment the counter by the given value.
|
|
1391
1396
|
* @param {number} value
|
|
1392
1397
|
*/
|
|
@@ -1431,6 +1436,10 @@ export class LoroCounter {
|
|
|
1431
1436
|
*/
|
|
1432
1437
|
getShallowValue(): number;
|
|
1433
1438
|
/**
|
|
1439
|
+
* The container id of this handler.
|
|
1440
|
+
*/
|
|
1441
|
+
readonly id: ContainerID;
|
|
1442
|
+
/**
|
|
1434
1443
|
* Get the value of the counter.
|
|
1435
1444
|
*/
|
|
1436
1445
|
readonly value: number;
|
|
@@ -3498,12 +3507,6 @@ export class UndoManager {
|
|
|
3498
3507
|
*/
|
|
3499
3508
|
addExcludeOriginPrefix(prefix: string): void;
|
|
3500
3509
|
/**
|
|
3501
|
-
* Check if the undo manager is bound to the given document.
|
|
3502
|
-
* @param {LoroDoc} doc
|
|
3503
|
-
* @returns {boolean}
|
|
3504
|
-
*/
|
|
3505
|
-
checkBinding(doc: LoroDoc): boolean;
|
|
3506
|
-
/**
|
|
3507
3510
|
*/
|
|
3508
3511
|
clear(): void;
|
|
3509
3512
|
}
|
package/nodejs/loro_wasm.js
CHANGED
|
@@ -733,7 +733,7 @@ const LoroCounterFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
|
733
733
|
? { register: () => {}, unregister: () => {} }
|
|
734
734
|
: new FinalizationRegistry(ptr => wasm.__wbg_lorocounter_free(ptr >>> 0));
|
|
735
735
|
/**
|
|
736
|
-
* The handler of a
|
|
736
|
+
* The handler of a counter container.
|
|
737
737
|
*/
|
|
738
738
|
class LoroCounter {
|
|
739
739
|
|
|
@@ -765,6 +765,22 @@ class LoroCounter {
|
|
|
765
765
|
return this;
|
|
766
766
|
}
|
|
767
767
|
/**
|
|
768
|
+
* "Counter"
|
|
769
|
+
* @returns {'Counter'}
|
|
770
|
+
*/
|
|
771
|
+
kind() {
|
|
772
|
+
const ret = wasm.lorocounter_kind(this.__wbg_ptr);
|
|
773
|
+
return takeObject(ret);
|
|
774
|
+
}
|
|
775
|
+
/**
|
|
776
|
+
* The container id of this handler.
|
|
777
|
+
* @returns {ContainerID}
|
|
778
|
+
*/
|
|
779
|
+
get id() {
|
|
780
|
+
const ret = wasm.lorocounter_id(this.__wbg_ptr);
|
|
781
|
+
return takeObject(ret);
|
|
782
|
+
}
|
|
783
|
+
/**
|
|
768
784
|
* Increment the counter by the given value.
|
|
769
785
|
* @param {number} value
|
|
770
786
|
*/
|
|
@@ -2093,7 +2109,7 @@ class LoroDoc {
|
|
|
2093
2109
|
importUpdateBatch(data) {
|
|
2094
2110
|
try {
|
|
2095
2111
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
2096
|
-
wasm.
|
|
2112
|
+
wasm.lorodoc_importBatch(retptr, this.__wbg_ptr, addHeapObject(data));
|
|
2097
2113
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
2098
2114
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
2099
2115
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
@@ -5728,16 +5744,6 @@ class UndoManager {
|
|
|
5728
5744
|
wasm.undomanager_addExcludeOriginPrefix(this.__wbg_ptr, ptr0, len0);
|
|
5729
5745
|
}
|
|
5730
5746
|
/**
|
|
5731
|
-
* Check if the undo manager is bound to the given document.
|
|
5732
|
-
* @param {LoroDoc} doc
|
|
5733
|
-
* @returns {boolean}
|
|
5734
|
-
*/
|
|
5735
|
-
checkBinding(doc) {
|
|
5736
|
-
_assertClass(doc, LoroDoc);
|
|
5737
|
-
const ret = wasm.undomanager_checkBinding(this.__wbg_ptr, doc.__wbg_ptr);
|
|
5738
|
-
return ret !== 0;
|
|
5739
|
-
}
|
|
5740
|
-
/**
|
|
5741
5747
|
* Set the on push event listener.
|
|
5742
5748
|
*
|
|
5743
5749
|
* Every time an undo step or redo step is pushed, the on push event listener will be called.
|
|
@@ -5985,13 +5991,23 @@ module.exports.__wbindgen_object_drop_ref = function(arg0) {
|
|
|
5985
5991
|
takeObject(arg0);
|
|
5986
5992
|
};
|
|
5987
5993
|
|
|
5994
|
+
module.exports.__wbg_lorotree_new = function(arg0) {
|
|
5995
|
+
const ret = LoroTree.__wrap(arg0);
|
|
5996
|
+
return addHeapObject(ret);
|
|
5997
|
+
};
|
|
5998
|
+
|
|
5988
5999
|
module.exports.__wbg_lorolist_new = function(arg0) {
|
|
5989
6000
|
const ret = LoroList.__wrap(arg0);
|
|
5990
6001
|
return addHeapObject(ret);
|
|
5991
6002
|
};
|
|
5992
6003
|
|
|
5993
|
-
module.exports.
|
|
5994
|
-
const ret =
|
|
6004
|
+
module.exports.__wbg_lorotext_new = function(arg0) {
|
|
6005
|
+
const ret = LoroText.__wrap(arg0);
|
|
6006
|
+
return addHeapObject(ret);
|
|
6007
|
+
};
|
|
6008
|
+
|
|
6009
|
+
module.exports.__wbg_cursor_new = function(arg0) {
|
|
6010
|
+
const ret = Cursor.__wrap(arg0);
|
|
5995
6011
|
return addHeapObject(ret);
|
|
5996
6012
|
};
|
|
5997
6013
|
|
|
@@ -6005,8 +6021,8 @@ module.exports.__wbg_lorotreenode_new = function(arg0) {
|
|
|
6005
6021
|
return addHeapObject(ret);
|
|
6006
6022
|
};
|
|
6007
6023
|
|
|
6008
|
-
module.exports.
|
|
6009
|
-
const ret =
|
|
6024
|
+
module.exports.__wbg_lorocounter_new = function(arg0) {
|
|
6025
|
+
const ret = LoroCounter.__wrap(arg0);
|
|
6010
6026
|
return addHeapObject(ret);
|
|
6011
6027
|
};
|
|
6012
6028
|
|
|
@@ -6015,16 +6031,6 @@ module.exports.__wbg_loromovablelist_new = function(arg0) {
|
|
|
6015
6031
|
return addHeapObject(ret);
|
|
6016
6032
|
};
|
|
6017
6033
|
|
|
6018
|
-
module.exports.__wbg_cursor_new = function(arg0) {
|
|
6019
|
-
const ret = Cursor.__wrap(arg0);
|
|
6020
|
-
return addHeapObject(ret);
|
|
6021
|
-
};
|
|
6022
|
-
|
|
6023
|
-
module.exports.__wbg_lorotext_new = function(arg0) {
|
|
6024
|
-
const ret = LoroText.__wrap(arg0);
|
|
6025
|
-
return addHeapObject(ret);
|
|
6026
|
-
};
|
|
6027
|
-
|
|
6028
6034
|
module.exports.__wbg_versionvector_new = function(arg0) {
|
|
6029
6035
|
const ret = VersionVector.__wrap(arg0);
|
|
6030
6036
|
return addHeapObject(ret);
|
|
@@ -6148,11 +6154,11 @@ module.exports.__wbindgen_typeof = function(arg0) {
|
|
|
6148
6154
|
return addHeapObject(ret);
|
|
6149
6155
|
};
|
|
6150
6156
|
|
|
6151
|
-
module.exports.
|
|
6157
|
+
module.exports.__wbg_error_9384d761bf46409d = function(arg0, arg1) {
|
|
6152
6158
|
console.error(getStringFromWasm0(arg0, arg1));
|
|
6153
6159
|
};
|
|
6154
6160
|
|
|
6155
|
-
module.exports.
|
|
6161
|
+
module.exports.__wbg_log_c86c3e1bf097ba35 = function(arg0, arg1) {
|
|
6156
6162
|
console.log(getStringFromWasm0(arg0, arg1));
|
|
6157
6163
|
};
|
|
6158
6164
|
|
|
@@ -6253,7 +6259,7 @@ module.exports.__wbg_error_f851667af71bcfc6 = function(arg0, arg1) {
|
|
|
6253
6259
|
}
|
|
6254
6260
|
};
|
|
6255
6261
|
|
|
6256
|
-
module.exports.
|
|
6262
|
+
module.exports.__wbg_now_2d57022b1935b215 = typeof Date.now == 'function' ? Date.now : notDefined('Date.now');
|
|
6257
6263
|
|
|
6258
6264
|
module.exports.__wbg_crypto_1d1f22824a6a080c = function(arg0) {
|
|
6259
6265
|
const ret = getObject(arg0).crypto;
|
|
@@ -6577,13 +6583,13 @@ module.exports.__wbindgen_memory = function() {
|
|
|
6577
6583
|
return addHeapObject(ret);
|
|
6578
6584
|
};
|
|
6579
6585
|
|
|
6580
|
-
module.exports.
|
|
6581
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
6586
|
+
module.exports.__wbindgen_closure_wrapper482 = function(arg0, arg1, arg2) {
|
|
6587
|
+
const ret = makeMutClosure(arg0, arg1, 8, __wbg_adapter_60);
|
|
6582
6588
|
return addHeapObject(ret);
|
|
6583
6589
|
};
|
|
6584
6590
|
|
|
6585
|
-
module.exports.
|
|
6586
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
6591
|
+
module.exports.__wbindgen_closure_wrapper485 = function(arg0, arg1, arg2) {
|
|
6592
|
+
const ret = makeMutClosure(arg0, arg1, 10, __wbg_adapter_63);
|
|
6587
6593
|
return addHeapObject(ret);
|
|
6588
6594
|
};
|
|
6589
6595
|
|
package/nodejs/loro_wasm_bg.wasm
CHANGED
|
Binary file
|
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
export const memory: WebAssembly.Memory;
|
|
4
4
|
export function __wbg_lorocounter_free(a: number): void;
|
|
5
5
|
export function lorocounter_new(): number;
|
|
6
|
+
export function lorocounter_kind(a: number): number;
|
|
7
|
+
export function lorocounter_id(a: number): number;
|
|
6
8
|
export function lorocounter_increment(a: number, b: number, c: number): void;
|
|
7
9
|
export function lorocounter_decrement(a: number, b: number, c: number): void;
|
|
8
10
|
export function lorocounter_value(a: number): number;
|
|
@@ -78,7 +80,6 @@ export function lorodoc_exportJsonUpdates(a: number, b: number, c: number, d: nu
|
|
|
78
80
|
export function lorodoc_exportJsonInIdSpan(a: number, b: number, c: number): void;
|
|
79
81
|
export function lorodoc_importJsonUpdates(a: number, b: number, c: number): void;
|
|
80
82
|
export function lorodoc_import(a: number, b: number, c: number, d: number): void;
|
|
81
|
-
export function lorodoc_importUpdateBatch(a: number, b: number, c: number): void;
|
|
82
83
|
export function lorodoc_importBatch(a: number, b: number, c: number): void;
|
|
83
84
|
export function lorodoc_getShallowValue(a: number, b: number): void;
|
|
84
85
|
export function lorodoc_toJSON(a: number, b: number): void;
|
|
@@ -253,7 +254,6 @@ export function undomanager_canRedo(a: number): number;
|
|
|
253
254
|
export function undomanager_setMaxUndoSteps(a: number, b: number): void;
|
|
254
255
|
export function undomanager_setMergeInterval(a: number, b: number): void;
|
|
255
256
|
export function undomanager_addExcludeOriginPrefix(a: number, b: number, c: number): void;
|
|
256
|
-
export function undomanager_checkBinding(a: number, b: number): number;
|
|
257
257
|
export function undomanager_setOnPush(a: number, b: number): void;
|
|
258
258
|
export function undomanager_setOnPop(a: number, b: number): void;
|
|
259
259
|
export function undomanager_clear(a: number): void;
|
|
@@ -271,6 +271,7 @@ export function versionvector_remove(a: number, b: number, c: number): void;
|
|
|
271
271
|
export function versionvector_length(a: number): number;
|
|
272
272
|
export function decodeImportBlobMeta(a: number, b: number, c: number, d: number): void;
|
|
273
273
|
export function __wbg_loromovablelist_free(a: number): void;
|
|
274
|
+
export function lorodoc_importUpdateBatch(a: number, b: number, c: number): void;
|
|
274
275
|
export function loromovablelist_parent(a: number): number;
|
|
275
276
|
export function lorotext_isAttached(a: number): number;
|
|
276
277
|
export function loromap_isAttached(a: number): number;
|
package/package.json
CHANGED
package/web/loro_wasm.d.ts
CHANGED
|
@@ -48,7 +48,7 @@ export function decodeImportBlobMeta(blob: Uint8Array, check_checksum: boolean):
|
|
|
48
48
|
* const text = list.insertContainer(1, new LoroText());
|
|
49
49
|
* ```
|
|
50
50
|
*/
|
|
51
|
-
export type ContainerType = "Text" | "Map" | "List"| "Tree" | "MovableList";
|
|
51
|
+
export type ContainerType = "Text" | "Map" | "List"| "Tree" | "MovableList" | "Counter";
|
|
52
52
|
|
|
53
53
|
export type PeerID = `${number}`;
|
|
54
54
|
/**
|
|
@@ -292,7 +292,7 @@ export type UndoConfig = {
|
|
|
292
292
|
onPush?: (isUndo: boolean, counterRange: { start: number, end: number }, event?: LoroEventBatch) => { value: Value, cursors: Cursor[] },
|
|
293
293
|
onPop?: (isUndo: boolean, value: { value: Value, cursors: Cursor[] }, counterRange: { start: number, end: number }) => void
|
|
294
294
|
};
|
|
295
|
-
export type Container = LoroList | LoroMap | LoroText | LoroTree | LoroMovableList;
|
|
295
|
+
export type Container = LoroList | LoroMap | LoroText | LoroTree | LoroMovableList | LoroCounter;
|
|
296
296
|
|
|
297
297
|
export interface ImportBlobMetadata {
|
|
298
298
|
/**
|
|
@@ -1378,7 +1378,7 @@ export class Cursor {
|
|
|
1378
1378
|
kind(): any;
|
|
1379
1379
|
}
|
|
1380
1380
|
/**
|
|
1381
|
-
* The handler of a
|
|
1381
|
+
* The handler of a counter container.
|
|
1382
1382
|
*/
|
|
1383
1383
|
export class LoroCounter {
|
|
1384
1384
|
free(): void;
|
|
@@ -1387,6 +1387,11 @@ export class LoroCounter {
|
|
|
1387
1387
|
*/
|
|
1388
1388
|
constructor();
|
|
1389
1389
|
/**
|
|
1390
|
+
* "Counter"
|
|
1391
|
+
* @returns {'Counter'}
|
|
1392
|
+
*/
|
|
1393
|
+
kind(): 'Counter';
|
|
1394
|
+
/**
|
|
1390
1395
|
* Increment the counter by the given value.
|
|
1391
1396
|
* @param {number} value
|
|
1392
1397
|
*/
|
|
@@ -1431,6 +1436,10 @@ export class LoroCounter {
|
|
|
1431
1436
|
*/
|
|
1432
1437
|
getShallowValue(): number;
|
|
1433
1438
|
/**
|
|
1439
|
+
* The container id of this handler.
|
|
1440
|
+
*/
|
|
1441
|
+
readonly id: ContainerID;
|
|
1442
|
+
/**
|
|
1434
1443
|
* Get the value of the counter.
|
|
1435
1444
|
*/
|
|
1436
1445
|
readonly value: number;
|
|
@@ -3498,12 +3507,6 @@ export class UndoManager {
|
|
|
3498
3507
|
*/
|
|
3499
3508
|
addExcludeOriginPrefix(prefix: string): void;
|
|
3500
3509
|
/**
|
|
3501
|
-
* Check if the undo manager is bound to the given document.
|
|
3502
|
-
* @param {LoroDoc} doc
|
|
3503
|
-
* @returns {boolean}
|
|
3504
|
-
*/
|
|
3505
|
-
checkBinding(doc: LoroDoc): boolean;
|
|
3506
|
-
/**
|
|
3507
3510
|
*/
|
|
3508
3511
|
clear(): void;
|
|
3509
3512
|
}
|
|
@@ -3583,6 +3586,8 @@ export interface InitOutput {
|
|
|
3583
3586
|
readonly memory: WebAssembly.Memory;
|
|
3584
3587
|
readonly __wbg_lorocounter_free: (a: number) => void;
|
|
3585
3588
|
readonly lorocounter_new: () => number;
|
|
3589
|
+
readonly lorocounter_kind: (a: number) => number;
|
|
3590
|
+
readonly lorocounter_id: (a: number) => number;
|
|
3586
3591
|
readonly lorocounter_increment: (a: number, b: number, c: number) => void;
|
|
3587
3592
|
readonly lorocounter_decrement: (a: number, b: number, c: number) => void;
|
|
3588
3593
|
readonly lorocounter_value: (a: number) => number;
|
|
@@ -3658,7 +3663,6 @@ export interface InitOutput {
|
|
|
3658
3663
|
readonly lorodoc_exportJsonInIdSpan: (a: number, b: number, c: number) => void;
|
|
3659
3664
|
readonly lorodoc_importJsonUpdates: (a: number, b: number, c: number) => void;
|
|
3660
3665
|
readonly lorodoc_import: (a: number, b: number, c: number, d: number) => void;
|
|
3661
|
-
readonly lorodoc_importUpdateBatch: (a: number, b: number, c: number) => void;
|
|
3662
3666
|
readonly lorodoc_importBatch: (a: number, b: number, c: number) => void;
|
|
3663
3667
|
readonly lorodoc_getShallowValue: (a: number, b: number) => void;
|
|
3664
3668
|
readonly lorodoc_toJSON: (a: number, b: number) => void;
|
|
@@ -3833,7 +3837,6 @@ export interface InitOutput {
|
|
|
3833
3837
|
readonly undomanager_setMaxUndoSteps: (a: number, b: number) => void;
|
|
3834
3838
|
readonly undomanager_setMergeInterval: (a: number, b: number) => void;
|
|
3835
3839
|
readonly undomanager_addExcludeOriginPrefix: (a: number, b: number, c: number) => void;
|
|
3836
|
-
readonly undomanager_checkBinding: (a: number, b: number) => number;
|
|
3837
3840
|
readonly undomanager_setOnPush: (a: number, b: number) => void;
|
|
3838
3841
|
readonly undomanager_setOnPop: (a: number, b: number) => void;
|
|
3839
3842
|
readonly undomanager_clear: (a: number) => void;
|
|
@@ -3851,6 +3854,7 @@ export interface InitOutput {
|
|
|
3851
3854
|
readonly versionvector_length: (a: number) => number;
|
|
3852
3855
|
readonly decodeImportBlobMeta: (a: number, b: number, c: number, d: number) => void;
|
|
3853
3856
|
readonly __wbg_loromovablelist_free: (a: number) => void;
|
|
3857
|
+
readonly lorodoc_importUpdateBatch: (a: number, b: number, c: number) => void;
|
|
3854
3858
|
readonly loromovablelist_parent: (a: number) => number;
|
|
3855
3859
|
readonly lorotext_isAttached: (a: number) => number;
|
|
3856
3860
|
readonly loromap_isAttached: (a: number) => number;
|