loro-crdt 1.13.2 → 1.13.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -0
- package/base64/index.js +103 -103
- package/base64/loro_wasm.d.ts +21 -21
- package/browser/index.js +4 -4
- package/browser/loro_wasm.d.ts +21 -21
- package/browser/loro_wasm.js +12 -12
- package/browser/loro_wasm_bg.js +99 -99
- package/browser/loro_wasm_bg.wasm +0 -0
- package/browser/loro_wasm_bg.wasm.d.ts +2 -2
- package/bundler/index.js +4 -4
- package/bundler/loro_wasm.d.ts +21 -21
- package/bundler/loro_wasm_bg.js +99 -99
- package/bundler/loro_wasm_bg.wasm +0 -0
- package/bundler/loro_wasm_bg.wasm.d.ts +2 -2
- package/nodejs/loro_wasm.d.ts +21 -21
- package/nodejs/loro_wasm.js +100 -100
- package/nodejs/loro_wasm_bg.wasm +0 -0
- package/nodejs/loro_wasm_bg.wasm.d.ts +2 -2
- package/package.json +1 -1
- package/web/loro_wasm.d.ts +23 -23
- package/web/loro_wasm.js +97 -97
- package/web/loro_wasm_bg.wasm +0 -0
- package/web/loro_wasm_bg.wasm.d.ts +2 -2
package/base64/loro_wasm.d.ts
CHANGED
|
@@ -1,25 +1,10 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
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
|
|
14
|
-
*/
|
|
15
|
-
export function decodeImportBlobMeta(blob: Uint8Array, check_checksum: boolean): ImportBlobMetadata;
|
|
16
|
-
/**
|
|
17
|
-
* Get the version of Loro
|
|
4
|
+
* Enable debug info of Loro
|
|
18
5
|
*/
|
|
19
|
-
export function
|
|
20
|
-
export function
|
|
21
|
-
export function decodeFrontiers(bytes: Uint8Array): { peer: PeerID, counter: number }[];
|
|
22
|
-
export function callPendingEvents(): void;
|
|
6
|
+
export function setDebug(): void;
|
|
7
|
+
export function encodeFrontiers(frontiers: ({ peer: PeerID, counter: number })[]): Uint8Array;
|
|
23
8
|
/**
|
|
24
9
|
* Redacts sensitive content in JSON updates within the specified version range.
|
|
25
10
|
*
|
|
@@ -40,11 +25,26 @@ export function callPendingEvents(): void;
|
|
|
40
25
|
* @returns {Object} The redacted JSON updates
|
|
41
26
|
*/
|
|
42
27
|
export function redactJsonUpdates(json_updates: string | JsonSchema, version_range: any): JsonSchema;
|
|
43
|
-
export function
|
|
28
|
+
export function decodeFrontiers(bytes: Uint8Array): { peer: PeerID, counter: number }[];
|
|
44
29
|
/**
|
|
45
|
-
*
|
|
30
|
+
* Get the version of Loro
|
|
46
31
|
*/
|
|
47
|
-
export function
|
|
32
|
+
export function LORO_VERSION(): string;
|
|
33
|
+
export function run(): void;
|
|
34
|
+
/**
|
|
35
|
+
* Decode the metadata of the import blob.
|
|
36
|
+
*
|
|
37
|
+
* This method is useful to get the following metadata of the import blob:
|
|
38
|
+
*
|
|
39
|
+
* - startVersionVector
|
|
40
|
+
* - endVersionVector
|
|
41
|
+
* - startTimestamp
|
|
42
|
+
* - endTimestamp
|
|
43
|
+
* - mode
|
|
44
|
+
* - changeNum
|
|
45
|
+
*/
|
|
46
|
+
export function decodeImportBlobMeta(blob: Uint8Array, check_checksum: boolean): ImportBlobMetadata;
|
|
47
|
+
export function callPendingEvents(): void;
|
|
48
48
|
|
|
49
49
|
/**
|
|
50
50
|
* Container types supported by loro.
|
package/browser/index.js
CHANGED
|
@@ -409,8 +409,8 @@ export {
|
|
|
409
409
|
__wbg_done_769e5ede4b31c67b,
|
|
410
410
|
__wbg_entries_3265d4158b33e5dc,
|
|
411
411
|
__wbg_entries_c8a90a7ed73e84ce,
|
|
412
|
+
__wbg_error_56998721a304cd56,
|
|
412
413
|
__wbg_error_7534b8e9a36f1ab4,
|
|
413
|
-
__wbg_error_eddb9b302feac7d3,
|
|
414
414
|
__wbg_from_2a5d3e218e67aa85,
|
|
415
415
|
__wbg_getOwnPropertySymbols_97eebed6fe6e08be,
|
|
416
416
|
__wbg_getRandomValues_b8f5dbd5f3995a9e,
|
|
@@ -428,8 +428,8 @@ export {
|
|
|
428
428
|
__wbg_length_a446193dc22c12f8,
|
|
429
429
|
__wbg_length_e2d2a49132c1b256,
|
|
430
430
|
__wbg_log_0cc1b7768397bcfe,
|
|
431
|
+
__wbg_log_1fa0a78510bbe830,
|
|
431
432
|
__wbg_log_cb9e190acc5753fb,
|
|
432
|
-
__wbg_log_d8b98f6c2e2f68e5,
|
|
433
433
|
__wbg_lorocounter_new,
|
|
434
434
|
__wbg_lorolist_new,
|
|
435
435
|
__wbg_loromap_new,
|
|
@@ -476,7 +476,7 @@ export {
|
|
|
476
476
|
__wbg_value_cd1ffa7b1ab794f1,
|
|
477
477
|
__wbg_versions_c01dfd4722a88165,
|
|
478
478
|
__wbg_versionvector_new,
|
|
479
|
-
|
|
479
|
+
__wbg_warn_db4faa19bfbe9598,
|
|
480
480
|
__wbindgen_as_number,
|
|
481
481
|
__wbindgen_bigint_from_i64,
|
|
482
482
|
__wbindgen_bigint_from_u64,
|
|
@@ -484,7 +484,7 @@ export {
|
|
|
484
484
|
__wbindgen_boolean_get,
|
|
485
485
|
__wbindgen_cb_drop,
|
|
486
486
|
__wbindgen_closure_wrapper331,
|
|
487
|
-
|
|
487
|
+
__wbindgen_closure_wrapper334,
|
|
488
488
|
__wbindgen_debug_string,
|
|
489
489
|
__wbindgen_error_new,
|
|
490
490
|
__wbindgen_in,
|
package/browser/loro_wasm.d.ts
CHANGED
|
@@ -1,25 +1,10 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
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
|
|
14
|
-
*/
|
|
15
|
-
export function decodeImportBlobMeta(blob: Uint8Array, check_checksum: boolean): ImportBlobMetadata;
|
|
16
|
-
/**
|
|
17
|
-
* Get the version of Loro
|
|
4
|
+
* Enable debug info of Loro
|
|
18
5
|
*/
|
|
19
|
-
export function
|
|
20
|
-
export function
|
|
21
|
-
export function decodeFrontiers(bytes: Uint8Array): { peer: PeerID, counter: number }[];
|
|
22
|
-
export function callPendingEvents(): void;
|
|
6
|
+
export function setDebug(): void;
|
|
7
|
+
export function encodeFrontiers(frontiers: ({ peer: PeerID, counter: number })[]): Uint8Array;
|
|
23
8
|
/**
|
|
24
9
|
* Redacts sensitive content in JSON updates within the specified version range.
|
|
25
10
|
*
|
|
@@ -40,11 +25,26 @@ export function callPendingEvents(): void;
|
|
|
40
25
|
* @returns {Object} The redacted JSON updates
|
|
41
26
|
*/
|
|
42
27
|
export function redactJsonUpdates(json_updates: string | JsonSchema, version_range: any): JsonSchema;
|
|
43
|
-
export function
|
|
28
|
+
export function decodeFrontiers(bytes: Uint8Array): { peer: PeerID, counter: number }[];
|
|
44
29
|
/**
|
|
45
|
-
*
|
|
30
|
+
* Get the version of Loro
|
|
46
31
|
*/
|
|
47
|
-
export function
|
|
32
|
+
export function LORO_VERSION(): string;
|
|
33
|
+
export function run(): void;
|
|
34
|
+
/**
|
|
35
|
+
* Decode the metadata of the import blob.
|
|
36
|
+
*
|
|
37
|
+
* This method is useful to get the following metadata of the import blob:
|
|
38
|
+
*
|
|
39
|
+
* - startVersionVector
|
|
40
|
+
* - endVersionVector
|
|
41
|
+
* - startTimestamp
|
|
42
|
+
* - endTimestamp
|
|
43
|
+
* - mode
|
|
44
|
+
* - changeNum
|
|
45
|
+
*/
|
|
46
|
+
export function decodeImportBlobMeta(blob: Uint8Array, check_checksum: boolean): ImportBlobMetadata;
|
|
47
|
+
export function callPendingEvents(): void;
|
|
48
48
|
|
|
49
49
|
/**
|
|
50
50
|
* Container types supported by loro.
|
package/browser/loro_wasm.js
CHANGED
|
@@ -28,8 +28,8 @@ import {
|
|
|
28
28
|
__wbg_done_769e5ede4b31c67b,
|
|
29
29
|
__wbg_entries_3265d4158b33e5dc,
|
|
30
30
|
__wbg_entries_c8a90a7ed73e84ce,
|
|
31
|
+
__wbg_error_56998721a304cd56,
|
|
31
32
|
__wbg_error_7534b8e9a36f1ab4,
|
|
32
|
-
__wbg_error_eddb9b302feac7d3,
|
|
33
33
|
__wbg_from_2a5d3e218e67aa85,
|
|
34
34
|
__wbg_getOwnPropertySymbols_97eebed6fe6e08be,
|
|
35
35
|
__wbg_getRandomValues_b8f5dbd5f3995a9e,
|
|
@@ -47,8 +47,8 @@ import {
|
|
|
47
47
|
__wbg_length_a446193dc22c12f8,
|
|
48
48
|
__wbg_length_e2d2a49132c1b256,
|
|
49
49
|
__wbg_log_0cc1b7768397bcfe,
|
|
50
|
+
__wbg_log_1fa0a78510bbe830,
|
|
50
51
|
__wbg_log_cb9e190acc5753fb,
|
|
51
|
-
__wbg_log_d8b98f6c2e2f68e5,
|
|
52
52
|
__wbg_lorocounter_new,
|
|
53
53
|
__wbg_lorolist_new,
|
|
54
54
|
__wbg_loromap_new,
|
|
@@ -95,7 +95,7 @@ import {
|
|
|
95
95
|
__wbg_value_cd1ffa7b1ab794f1,
|
|
96
96
|
__wbg_versions_c01dfd4722a88165,
|
|
97
97
|
__wbg_versionvector_new,
|
|
98
|
-
|
|
98
|
+
__wbg_warn_db4faa19bfbe9598,
|
|
99
99
|
__wbindgen_as_number,
|
|
100
100
|
__wbindgen_bigint_from_i64,
|
|
101
101
|
__wbindgen_bigint_from_u64,
|
|
@@ -103,7 +103,7 @@ import {
|
|
|
103
103
|
__wbindgen_boolean_get,
|
|
104
104
|
__wbindgen_cb_drop,
|
|
105
105
|
__wbindgen_closure_wrapper331,
|
|
106
|
-
|
|
106
|
+
__wbindgen_closure_wrapper334,
|
|
107
107
|
__wbindgen_debug_string,
|
|
108
108
|
__wbindgen_error_new,
|
|
109
109
|
__wbindgen_in,
|
|
@@ -169,8 +169,8 @@ const imports = {
|
|
|
169
169
|
__wbg_done_769e5ede4b31c67b,
|
|
170
170
|
__wbg_entries_3265d4158b33e5dc,
|
|
171
171
|
__wbg_entries_c8a90a7ed73e84ce,
|
|
172
|
+
__wbg_error_56998721a304cd56,
|
|
172
173
|
__wbg_error_7534b8e9a36f1ab4,
|
|
173
|
-
__wbg_error_eddb9b302feac7d3,
|
|
174
174
|
__wbg_from_2a5d3e218e67aa85,
|
|
175
175
|
__wbg_getOwnPropertySymbols_97eebed6fe6e08be,
|
|
176
176
|
__wbg_getRandomValues_b8f5dbd5f3995a9e,
|
|
@@ -188,8 +188,8 @@ const imports = {
|
|
|
188
188
|
__wbg_length_a446193dc22c12f8,
|
|
189
189
|
__wbg_length_e2d2a49132c1b256,
|
|
190
190
|
__wbg_log_0cc1b7768397bcfe,
|
|
191
|
+
__wbg_log_1fa0a78510bbe830,
|
|
191
192
|
__wbg_log_cb9e190acc5753fb,
|
|
192
|
-
__wbg_log_d8b98f6c2e2f68e5,
|
|
193
193
|
__wbg_lorocounter_new,
|
|
194
194
|
__wbg_lorolist_new,
|
|
195
195
|
__wbg_loromap_new,
|
|
@@ -236,7 +236,7 @@ const imports = {
|
|
|
236
236
|
__wbg_value_cd1ffa7b1ab794f1,
|
|
237
237
|
__wbg_versions_c01dfd4722a88165,
|
|
238
238
|
__wbg_versionvector_new,
|
|
239
|
-
|
|
239
|
+
__wbg_warn_db4faa19bfbe9598,
|
|
240
240
|
__wbindgen_as_number,
|
|
241
241
|
__wbindgen_bigint_from_i64,
|
|
242
242
|
__wbindgen_bigint_from_u64,
|
|
@@ -244,7 +244,7 @@ const imports = {
|
|
|
244
244
|
__wbindgen_boolean_get,
|
|
245
245
|
__wbindgen_cb_drop,
|
|
246
246
|
__wbindgen_closure_wrapper331,
|
|
247
|
-
|
|
247
|
+
__wbindgen_closure_wrapper334,
|
|
248
248
|
__wbindgen_debug_string,
|
|
249
249
|
__wbindgen_error_new,
|
|
250
250
|
__wbindgen_in,
|
|
@@ -362,8 +362,8 @@ export {
|
|
|
362
362
|
__wbg_done_769e5ede4b31c67b,
|
|
363
363
|
__wbg_entries_3265d4158b33e5dc,
|
|
364
364
|
__wbg_entries_c8a90a7ed73e84ce,
|
|
365
|
+
__wbg_error_56998721a304cd56,
|
|
365
366
|
__wbg_error_7534b8e9a36f1ab4,
|
|
366
|
-
__wbg_error_eddb9b302feac7d3,
|
|
367
367
|
__wbg_from_2a5d3e218e67aa85,
|
|
368
368
|
__wbg_getOwnPropertySymbols_97eebed6fe6e08be,
|
|
369
369
|
__wbg_getRandomValues_b8f5dbd5f3995a9e,
|
|
@@ -381,8 +381,8 @@ export {
|
|
|
381
381
|
__wbg_length_a446193dc22c12f8,
|
|
382
382
|
__wbg_length_e2d2a49132c1b256,
|
|
383
383
|
__wbg_log_0cc1b7768397bcfe,
|
|
384
|
+
__wbg_log_1fa0a78510bbe830,
|
|
384
385
|
__wbg_log_cb9e190acc5753fb,
|
|
385
|
-
__wbg_log_d8b98f6c2e2f68e5,
|
|
386
386
|
__wbg_lorocounter_new,
|
|
387
387
|
__wbg_lorolist_new,
|
|
388
388
|
__wbg_loromap_new,
|
|
@@ -429,7 +429,7 @@ export {
|
|
|
429
429
|
__wbg_value_cd1ffa7b1ab794f1,
|
|
430
430
|
__wbg_versions_c01dfd4722a88165,
|
|
431
431
|
__wbg_versionvector_new,
|
|
432
|
-
|
|
432
|
+
__wbg_warn_db4faa19bfbe9598,
|
|
433
433
|
__wbindgen_as_number,
|
|
434
434
|
__wbindgen_bigint_from_i64,
|
|
435
435
|
__wbindgen_bigint_from_u64,
|
|
@@ -437,7 +437,7 @@ export {
|
|
|
437
437
|
__wbindgen_boolean_get,
|
|
438
438
|
__wbindgen_cb_drop,
|
|
439
439
|
__wbindgen_closure_wrapper331,
|
|
440
|
-
|
|
440
|
+
__wbindgen_closure_wrapper334,
|
|
441
441
|
__wbindgen_debug_string,
|
|
442
442
|
__wbindgen_error_new,
|
|
443
443
|
__wbindgen_in,
|
package/browser/loro_wasm_bg.js
CHANGED
|
@@ -264,89 +264,46 @@ function getArrayJsValueFromWasm0(ptr, len) {
|
|
|
264
264
|
return result;
|
|
265
265
|
}
|
|
266
266
|
/**
|
|
267
|
-
*
|
|
268
|
-
*
|
|
269
|
-
* This method is useful to get the following metadata of the import blob:
|
|
270
|
-
*
|
|
271
|
-
* - startVersionVector
|
|
272
|
-
* - endVersionVector
|
|
273
|
-
* - startTimestamp
|
|
274
|
-
* - endTimestamp
|
|
275
|
-
* - mode
|
|
276
|
-
* - changeNum
|
|
277
|
-
* @param {Uint8Array} blob
|
|
278
|
-
* @param {boolean} check_checksum
|
|
279
|
-
* @returns {ImportBlobMetadata}
|
|
267
|
+
* Enable debug info of Loro
|
|
280
268
|
*/
|
|
281
|
-
export function
|
|
282
|
-
|
|
283
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
284
|
-
const ptr0 = passArray8ToWasm0(blob, wasm.__wbindgen_malloc);
|
|
285
|
-
const len0 = WASM_VECTOR_LEN;
|
|
286
|
-
wasm.decodeImportBlobMeta(retptr, ptr0, len0, check_checksum);
|
|
287
|
-
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
288
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
289
|
-
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
290
|
-
if (r2) {
|
|
291
|
-
throw takeObject(r1);
|
|
292
|
-
}
|
|
293
|
-
return takeObject(r0);
|
|
294
|
-
} finally {
|
|
295
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
296
|
-
}
|
|
269
|
+
export function setDebug() {
|
|
270
|
+
wasm.setDebug();
|
|
297
271
|
}
|
|
298
272
|
|
|
299
|
-
|
|
300
|
-
*
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
let deferred1_0;
|
|
305
|
-
let deferred1_1;
|
|
306
|
-
try {
|
|
307
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
308
|
-
wasm.LORO_VERSION(retptr);
|
|
309
|
-
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
310
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
311
|
-
deferred1_0 = r0;
|
|
312
|
-
deferred1_1 = r1;
|
|
313
|
-
return getStringFromWasm0(r0, r1);
|
|
314
|
-
} finally {
|
|
315
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
316
|
-
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
273
|
+
function passArrayJsValueToWasm0(array, malloc) {
|
|
274
|
+
const ptr = malloc(array.length * 4, 4) >>> 0;
|
|
275
|
+
const mem = getDataViewMemory0();
|
|
276
|
+
for (let i = 0; i < array.length; i++) {
|
|
277
|
+
mem.setUint32(ptr + 4 * i, addHeapObject(array[i]), true);
|
|
317
278
|
}
|
|
279
|
+
WASM_VECTOR_LEN = array.length;
|
|
280
|
+
return ptr;
|
|
318
281
|
}
|
|
319
|
-
|
|
320
|
-
export function run() {
|
|
321
|
-
wasm.run();
|
|
322
|
-
}
|
|
323
|
-
|
|
324
282
|
/**
|
|
325
|
-
* @param {
|
|
326
|
-
* @returns {
|
|
283
|
+
* @param {({ peer: PeerID, counter: number })[]} frontiers
|
|
284
|
+
* @returns {Uint8Array}
|
|
327
285
|
*/
|
|
328
|
-
export function
|
|
286
|
+
export function encodeFrontiers(frontiers) {
|
|
329
287
|
try {
|
|
330
288
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
331
|
-
const ptr0 =
|
|
289
|
+
const ptr0 = passArrayJsValueToWasm0(frontiers, wasm.__wbindgen_malloc);
|
|
332
290
|
const len0 = WASM_VECTOR_LEN;
|
|
333
|
-
wasm.
|
|
291
|
+
wasm.encodeFrontiers(retptr, ptr0, len0);
|
|
334
292
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
335
293
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
336
294
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
337
|
-
|
|
338
|
-
|
|
295
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
296
|
+
if (r3) {
|
|
297
|
+
throw takeObject(r2);
|
|
339
298
|
}
|
|
340
|
-
|
|
299
|
+
var v2 = getArrayU8FromWasm0(r0, r1).slice();
|
|
300
|
+
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
301
|
+
return v2;
|
|
341
302
|
} finally {
|
|
342
303
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
343
304
|
}
|
|
344
305
|
}
|
|
345
306
|
|
|
346
|
-
export function callPendingEvents() {
|
|
347
|
-
wasm.callPendingEvents();
|
|
348
|
-
}
|
|
349
|
-
|
|
350
307
|
/**
|
|
351
308
|
* Redacts sensitive content in JSON updates within the specified version range.
|
|
352
309
|
*
|
|
@@ -385,53 +342,96 @@ export function redactJsonUpdates(json_updates, version_range) {
|
|
|
385
342
|
}
|
|
386
343
|
}
|
|
387
344
|
|
|
388
|
-
function passArrayJsValueToWasm0(array, malloc) {
|
|
389
|
-
const ptr = malloc(array.length * 4, 4) >>> 0;
|
|
390
|
-
const mem = getDataViewMemory0();
|
|
391
|
-
for (let i = 0; i < array.length; i++) {
|
|
392
|
-
mem.setUint32(ptr + 4 * i, addHeapObject(array[i]), true);
|
|
393
|
-
}
|
|
394
|
-
WASM_VECTOR_LEN = array.length;
|
|
395
|
-
return ptr;
|
|
396
|
-
}
|
|
397
345
|
/**
|
|
398
|
-
* @param {
|
|
399
|
-
* @returns {
|
|
346
|
+
* @param {Uint8Array} bytes
|
|
347
|
+
* @returns {{ peer: PeerID, counter: number }[]}
|
|
400
348
|
*/
|
|
401
|
-
export function
|
|
349
|
+
export function decodeFrontiers(bytes) {
|
|
402
350
|
try {
|
|
403
351
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
404
|
-
const ptr0 =
|
|
352
|
+
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
405
353
|
const len0 = WASM_VECTOR_LEN;
|
|
406
|
-
wasm.
|
|
354
|
+
wasm.decodeFrontiers(retptr, ptr0, len0);
|
|
407
355
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
408
356
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
409
357
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
throw takeObject(r2);
|
|
358
|
+
if (r2) {
|
|
359
|
+
throw takeObject(r1);
|
|
413
360
|
}
|
|
414
|
-
|
|
415
|
-
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
416
|
-
return v2;
|
|
361
|
+
return takeObject(r0);
|
|
417
362
|
} finally {
|
|
418
363
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
419
364
|
}
|
|
420
365
|
}
|
|
421
366
|
|
|
422
367
|
/**
|
|
423
|
-
*
|
|
368
|
+
* Get the version of Loro
|
|
369
|
+
* @returns {string}
|
|
424
370
|
*/
|
|
425
|
-
export function
|
|
426
|
-
|
|
371
|
+
export function LORO_VERSION() {
|
|
372
|
+
let deferred1_0;
|
|
373
|
+
let deferred1_1;
|
|
374
|
+
try {
|
|
375
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
376
|
+
wasm.LORO_VERSION(retptr);
|
|
377
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
378
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
379
|
+
deferred1_0 = r0;
|
|
380
|
+
deferred1_1 = r1;
|
|
381
|
+
return getStringFromWasm0(r0, r1);
|
|
382
|
+
} finally {
|
|
383
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
384
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
export function run() {
|
|
389
|
+
wasm.run();
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
/**
|
|
393
|
+
* Decode the metadata of the import blob.
|
|
394
|
+
*
|
|
395
|
+
* This method is useful to get the following metadata of the import blob:
|
|
396
|
+
*
|
|
397
|
+
* - startVersionVector
|
|
398
|
+
* - endVersionVector
|
|
399
|
+
* - startTimestamp
|
|
400
|
+
* - endTimestamp
|
|
401
|
+
* - mode
|
|
402
|
+
* - changeNum
|
|
403
|
+
* @param {Uint8Array} blob
|
|
404
|
+
* @param {boolean} check_checksum
|
|
405
|
+
* @returns {ImportBlobMetadata}
|
|
406
|
+
*/
|
|
407
|
+
export function decodeImportBlobMeta(blob, check_checksum) {
|
|
408
|
+
try {
|
|
409
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
410
|
+
const ptr0 = passArray8ToWasm0(blob, wasm.__wbindgen_malloc);
|
|
411
|
+
const len0 = WASM_VECTOR_LEN;
|
|
412
|
+
wasm.decodeImportBlobMeta(retptr, ptr0, len0, check_checksum);
|
|
413
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
414
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
415
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
416
|
+
if (r2) {
|
|
417
|
+
throw takeObject(r1);
|
|
418
|
+
}
|
|
419
|
+
return takeObject(r0);
|
|
420
|
+
} finally {
|
|
421
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
422
|
+
}
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
export function callPendingEvents() {
|
|
426
|
+
wasm.callPendingEvents();
|
|
427
427
|
}
|
|
428
428
|
|
|
429
429
|
function __wbg_adapter_60(arg0, arg1, arg2) {
|
|
430
|
-
wasm.
|
|
430
|
+
wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__ha2b51c6fc8df0ff6(arg0, arg1, addHeapObject(arg2));
|
|
431
431
|
}
|
|
432
432
|
|
|
433
433
|
function __wbg_adapter_63(arg0, arg1) {
|
|
434
|
-
wasm.
|
|
434
|
+
wasm._dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h794210845e4bfab8(arg0, arg1);
|
|
435
435
|
}
|
|
436
436
|
|
|
437
437
|
const AwarenessWasmFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
@@ -6993,6 +6993,10 @@ export function __wbg_entries_c8a90a7ed73e84ce(arg0) {
|
|
|
6993
6993
|
return addHeapObject(ret);
|
|
6994
6994
|
};
|
|
6995
6995
|
|
|
6996
|
+
export function __wbg_error_56998721a304cd56(arg0, arg1) {
|
|
6997
|
+
console.error(getStringFromWasm0(arg0, arg1));
|
|
6998
|
+
};
|
|
6999
|
+
|
|
6996
7000
|
export function __wbg_error_7534b8e9a36f1ab4(arg0, arg1) {
|
|
6997
7001
|
let deferred0_0;
|
|
6998
7002
|
let deferred0_1;
|
|
@@ -7005,10 +7009,6 @@ export function __wbg_error_7534b8e9a36f1ab4(arg0, arg1) {
|
|
|
7005
7009
|
}
|
|
7006
7010
|
};
|
|
7007
7011
|
|
|
7008
|
-
export function __wbg_error_eddb9b302feac7d3(arg0, arg1) {
|
|
7009
|
-
console.error(getStringFromWasm0(arg0, arg1));
|
|
7010
|
-
};
|
|
7011
|
-
|
|
7012
7012
|
export function __wbg_from_2a5d3e218e67aa85(arg0) {
|
|
7013
7013
|
const ret = Array.from(getObject(arg0));
|
|
7014
7014
|
return addHeapObject(ret);
|
|
@@ -7124,6 +7124,10 @@ export function __wbg_log_0cc1b7768397bcfe(arg0, arg1, arg2, arg3, arg4, arg5, a
|
|
|
7124
7124
|
}
|
|
7125
7125
|
};
|
|
7126
7126
|
|
|
7127
|
+
export function __wbg_log_1fa0a78510bbe830(arg0, arg1) {
|
|
7128
|
+
console.log(getStringFromWasm0(arg0, arg1));
|
|
7129
|
+
};
|
|
7130
|
+
|
|
7127
7131
|
export function __wbg_log_cb9e190acc5753fb(arg0, arg1) {
|
|
7128
7132
|
let deferred0_0;
|
|
7129
7133
|
let deferred0_1;
|
|
@@ -7136,10 +7140,6 @@ export function __wbg_log_cb9e190acc5753fb(arg0, arg1) {
|
|
|
7136
7140
|
}
|
|
7137
7141
|
};
|
|
7138
7142
|
|
|
7139
|
-
export function __wbg_log_d8b98f6c2e2f68e5(arg0, arg1) {
|
|
7140
|
-
console.log(getStringFromWasm0(arg0, arg1));
|
|
7141
|
-
};
|
|
7142
|
-
|
|
7143
7143
|
export function __wbg_lorocounter_new(arg0) {
|
|
7144
7144
|
const ret = LoroCounter.__wrap(arg0);
|
|
7145
7145
|
return addHeapObject(ret);
|
|
@@ -7374,7 +7374,7 @@ export function __wbg_versionvector_new(arg0) {
|
|
|
7374
7374
|
return addHeapObject(ret);
|
|
7375
7375
|
};
|
|
7376
7376
|
|
|
7377
|
-
export function
|
|
7377
|
+
export function __wbg_warn_db4faa19bfbe9598(arg0, arg1) {
|
|
7378
7378
|
console.warn(getStringFromWasm0(arg0, arg1));
|
|
7379
7379
|
};
|
|
7380
7380
|
|
|
@@ -7421,7 +7421,7 @@ export function __wbindgen_closure_wrapper331(arg0, arg1, arg2) {
|
|
|
7421
7421
|
return addHeapObject(ret);
|
|
7422
7422
|
};
|
|
7423
7423
|
|
|
7424
|
-
export function
|
|
7424
|
+
export function __wbindgen_closure_wrapper334(arg0, arg1, arg2) {
|
|
7425
7425
|
const ret = makeMutClosure(arg0, arg1, 9, __wbg_adapter_63);
|
|
7426
7426
|
return addHeapObject(ret);
|
|
7427
7427
|
};
|
|
Binary file
|
|
@@ -330,6 +330,6 @@ export const __wbindgen_exn_store: (a: number) => void;
|
|
|
330
330
|
export const __wbindgen_free: (a: number, b: number, c: number) => void;
|
|
331
331
|
export const __wbindgen_export_4: WebAssembly.Table;
|
|
332
332
|
export const __wbindgen_add_to_stack_pointer: (a: number) => number;
|
|
333
|
-
export const
|
|
334
|
-
export const
|
|
333
|
+
export const _dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__ha2b51c6fc8df0ff6: (a: number, b: number, c: number) => void;
|
|
334
|
+
export const _dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h794210845e4bfab8: (a: number, b: number) => void;
|
|
335
335
|
export const __wbindgen_start: () => void;
|
package/bundler/index.js
CHANGED
|
@@ -409,8 +409,8 @@ export {
|
|
|
409
409
|
__wbg_done_769e5ede4b31c67b,
|
|
410
410
|
__wbg_entries_3265d4158b33e5dc,
|
|
411
411
|
__wbg_entries_c8a90a7ed73e84ce,
|
|
412
|
+
__wbg_error_56998721a304cd56,
|
|
412
413
|
__wbg_error_7534b8e9a36f1ab4,
|
|
413
|
-
__wbg_error_eddb9b302feac7d3,
|
|
414
414
|
__wbg_from_2a5d3e218e67aa85,
|
|
415
415
|
__wbg_getOwnPropertySymbols_97eebed6fe6e08be,
|
|
416
416
|
__wbg_getRandomValues_b8f5dbd5f3995a9e,
|
|
@@ -428,8 +428,8 @@ export {
|
|
|
428
428
|
__wbg_length_a446193dc22c12f8,
|
|
429
429
|
__wbg_length_e2d2a49132c1b256,
|
|
430
430
|
__wbg_log_0cc1b7768397bcfe,
|
|
431
|
+
__wbg_log_1fa0a78510bbe830,
|
|
431
432
|
__wbg_log_cb9e190acc5753fb,
|
|
432
|
-
__wbg_log_d8b98f6c2e2f68e5,
|
|
433
433
|
__wbg_lorocounter_new,
|
|
434
434
|
__wbg_lorolist_new,
|
|
435
435
|
__wbg_loromap_new,
|
|
@@ -476,7 +476,7 @@ export {
|
|
|
476
476
|
__wbg_value_cd1ffa7b1ab794f1,
|
|
477
477
|
__wbg_versions_c01dfd4722a88165,
|
|
478
478
|
__wbg_versionvector_new,
|
|
479
|
-
|
|
479
|
+
__wbg_warn_db4faa19bfbe9598,
|
|
480
480
|
__wbindgen_as_number,
|
|
481
481
|
__wbindgen_bigint_from_i64,
|
|
482
482
|
__wbindgen_bigint_from_u64,
|
|
@@ -484,7 +484,7 @@ export {
|
|
|
484
484
|
__wbindgen_boolean_get,
|
|
485
485
|
__wbindgen_cb_drop,
|
|
486
486
|
__wbindgen_closure_wrapper331,
|
|
487
|
-
|
|
487
|
+
__wbindgen_closure_wrapper334,
|
|
488
488
|
__wbindgen_debug_string,
|
|
489
489
|
__wbindgen_error_new,
|
|
490
490
|
__wbindgen_in,
|
package/bundler/loro_wasm.d.ts
CHANGED
|
@@ -1,25 +1,10 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
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
|
|
14
|
-
*/
|
|
15
|
-
export function decodeImportBlobMeta(blob: Uint8Array, check_checksum: boolean): ImportBlobMetadata;
|
|
16
|
-
/**
|
|
17
|
-
* Get the version of Loro
|
|
4
|
+
* Enable debug info of Loro
|
|
18
5
|
*/
|
|
19
|
-
export function
|
|
20
|
-
export function
|
|
21
|
-
export function decodeFrontiers(bytes: Uint8Array): { peer: PeerID, counter: number }[];
|
|
22
|
-
export function callPendingEvents(): void;
|
|
6
|
+
export function setDebug(): void;
|
|
7
|
+
export function encodeFrontiers(frontiers: ({ peer: PeerID, counter: number })[]): Uint8Array;
|
|
23
8
|
/**
|
|
24
9
|
* Redacts sensitive content in JSON updates within the specified version range.
|
|
25
10
|
*
|
|
@@ -40,11 +25,26 @@ export function callPendingEvents(): void;
|
|
|
40
25
|
* @returns {Object} The redacted JSON updates
|
|
41
26
|
*/
|
|
42
27
|
export function redactJsonUpdates(json_updates: string | JsonSchema, version_range: any): JsonSchema;
|
|
43
|
-
export function
|
|
28
|
+
export function decodeFrontiers(bytes: Uint8Array): { peer: PeerID, counter: number }[];
|
|
44
29
|
/**
|
|
45
|
-
*
|
|
30
|
+
* Get the version of Loro
|
|
46
31
|
*/
|
|
47
|
-
export function
|
|
32
|
+
export function LORO_VERSION(): string;
|
|
33
|
+
export function run(): void;
|
|
34
|
+
/**
|
|
35
|
+
* Decode the metadata of the import blob.
|
|
36
|
+
*
|
|
37
|
+
* This method is useful to get the following metadata of the import blob:
|
|
38
|
+
*
|
|
39
|
+
* - startVersionVector
|
|
40
|
+
* - endVersionVector
|
|
41
|
+
* - startTimestamp
|
|
42
|
+
* - endTimestamp
|
|
43
|
+
* - mode
|
|
44
|
+
* - changeNum
|
|
45
|
+
*/
|
|
46
|
+
export function decodeImportBlobMeta(blob: Uint8Array, check_checksum: boolean): ImportBlobMetadata;
|
|
47
|
+
export function callPendingEvents(): void;
|
|
48
48
|
|
|
49
49
|
/**
|
|
50
50
|
* Container types supported by loro.
|