loro-crdt 1.10.4 → 1.10.5
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 +6 -0
- package/base64/index.js +69 -68
- package/base64/loro_wasm.d.ts +16 -16
- package/bundler/loro_wasm.d.ts +16 -16
- package/bundler/loro_wasm_bg.js +65 -64
- package/bundler/loro_wasm_bg.wasm +0 -0
- package/bundler/loro_wasm_bg.wasm.d.ts +2 -2
- package/nodejs/loro_wasm.d.ts +16 -16
- package/nodejs/loro_wasm.js +65 -64
- 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 +18 -18
- package/web/loro_wasm.js +63 -62
- 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,11 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
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;
|
|
3
|
+
export function callPendingEvents(): void;
|
|
4
|
+
export function decodeFrontiers(bytes: Uint8Array): { peer: PeerID, counter: number }[];
|
|
16
5
|
/**
|
|
17
6
|
* Enable debug info of Loro
|
|
18
7
|
*/
|
|
19
8
|
export function setDebug(): void;
|
|
20
|
-
export function callPendingEvents(): void;
|
|
21
|
-
export function decodeFrontiers(bytes: Uint8Array): { peer: PeerID, counter: number }[];
|
|
22
|
-
export function encodeFrontiers(frontiers: ({ peer: PeerID, counter: number })[]): Uint8Array;
|
|
23
9
|
/**
|
|
24
10
|
* Redacts sensitive content in JSON updates within the specified version range.
|
|
25
11
|
*
|
|
@@ -44,6 +30,20 @@ export function redactJsonUpdates(json_updates: string | JsonSchema, version_ran
|
|
|
44
30
|
* Get the version of Loro
|
|
45
31
|
*/
|
|
46
32
|
export function LORO_VERSION(): string;
|
|
33
|
+
/**
|
|
34
|
+
* Decode the metadata of the import blob.
|
|
35
|
+
*
|
|
36
|
+
* This method is useful to get the following metadata of the import blob:
|
|
37
|
+
*
|
|
38
|
+
* - startVersionVector
|
|
39
|
+
* - endVersionVector
|
|
40
|
+
* - startTimestamp
|
|
41
|
+
* - endTimestamp
|
|
42
|
+
* - mode
|
|
43
|
+
* - changeNum
|
|
44
|
+
*/
|
|
45
|
+
export function decodeImportBlobMeta(blob: Uint8Array, check_checksum: boolean): ImportBlobMetadata;
|
|
46
|
+
export function encodeFrontiers(frontiers: ({ peer: PeerID, counter: number })[]): Uint8Array;
|
|
47
47
|
export function run(): void;
|
|
48
48
|
|
|
49
49
|
/**
|
package/bundler/loro_wasm.d.ts
CHANGED
|
@@ -1,25 +1,11 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
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;
|
|
3
|
+
export function callPendingEvents(): void;
|
|
4
|
+
export function decodeFrontiers(bytes: Uint8Array): { peer: PeerID, counter: number }[];
|
|
16
5
|
/**
|
|
17
6
|
* Enable debug info of Loro
|
|
18
7
|
*/
|
|
19
8
|
export function setDebug(): void;
|
|
20
|
-
export function callPendingEvents(): void;
|
|
21
|
-
export function decodeFrontiers(bytes: Uint8Array): { peer: PeerID, counter: number }[];
|
|
22
|
-
export function encodeFrontiers(frontiers: ({ peer: PeerID, counter: number })[]): Uint8Array;
|
|
23
9
|
/**
|
|
24
10
|
* Redacts sensitive content in JSON updates within the specified version range.
|
|
25
11
|
*
|
|
@@ -44,6 +30,20 @@ export function redactJsonUpdates(json_updates: string | JsonSchema, version_ran
|
|
|
44
30
|
* Get the version of Loro
|
|
45
31
|
*/
|
|
46
32
|
export function LORO_VERSION(): string;
|
|
33
|
+
/**
|
|
34
|
+
* Decode the metadata of the import blob.
|
|
35
|
+
*
|
|
36
|
+
* This method is useful to get the following metadata of the import blob:
|
|
37
|
+
*
|
|
38
|
+
* - startVersionVector
|
|
39
|
+
* - endVersionVector
|
|
40
|
+
* - startTimestamp
|
|
41
|
+
* - endTimestamp
|
|
42
|
+
* - mode
|
|
43
|
+
* - changeNum
|
|
44
|
+
*/
|
|
45
|
+
export function decodeImportBlobMeta(blob: Uint8Array, check_checksum: boolean): ImportBlobMetadata;
|
|
46
|
+
export function encodeFrontiers(frontiers: ({ peer: PeerID, counter: number })[]): Uint8Array;
|
|
47
47
|
export function run(): void;
|
|
48
48
|
|
|
49
49
|
/**
|
package/bundler/loro_wasm_bg.js
CHANGED
|
@@ -240,37 +240,6 @@ function getArrayJsValueFromWasm0(ptr, len) {
|
|
|
240
240
|
wasm.__externref_drop_slice(ptr, len);
|
|
241
241
|
return result;
|
|
242
242
|
}
|
|
243
|
-
/**
|
|
244
|
-
* Decode the metadata of the import blob.
|
|
245
|
-
*
|
|
246
|
-
* This method is useful to get the following metadata of the import blob:
|
|
247
|
-
*
|
|
248
|
-
* - startVersionVector
|
|
249
|
-
* - endVersionVector
|
|
250
|
-
* - startTimestamp
|
|
251
|
-
* - endTimestamp
|
|
252
|
-
* - mode
|
|
253
|
-
* - changeNum
|
|
254
|
-
* @param {Uint8Array} blob
|
|
255
|
-
* @param {boolean} check_checksum
|
|
256
|
-
* @returns {ImportBlobMetadata}
|
|
257
|
-
*/
|
|
258
|
-
export function decodeImportBlobMeta(blob, check_checksum) {
|
|
259
|
-
const ptr0 = passArray8ToWasm0(blob, wasm.__wbindgen_malloc);
|
|
260
|
-
const len0 = WASM_VECTOR_LEN;
|
|
261
|
-
const ret = wasm.decodeImportBlobMeta(ptr0, len0, check_checksum);
|
|
262
|
-
if (ret[2]) {
|
|
263
|
-
throw takeFromExternrefTable0(ret[1]);
|
|
264
|
-
}
|
|
265
|
-
return takeFromExternrefTable0(ret[0]);
|
|
266
|
-
}
|
|
267
|
-
|
|
268
|
-
/**
|
|
269
|
-
* Enable debug info of Loro
|
|
270
|
-
*/
|
|
271
|
-
export function setDebug() {
|
|
272
|
-
wasm.setDebug();
|
|
273
|
-
}
|
|
274
243
|
|
|
275
244
|
export function callPendingEvents() {
|
|
276
245
|
wasm.callPendingEvents();
|
|
@@ -290,29 +259,11 @@ export function decodeFrontiers(bytes) {
|
|
|
290
259
|
return takeFromExternrefTable0(ret[0]);
|
|
291
260
|
}
|
|
292
261
|
|
|
293
|
-
function passArrayJsValueToWasm0(array, malloc) {
|
|
294
|
-
const ptr = malloc(array.length * 4, 4) >>> 0;
|
|
295
|
-
for (let i = 0; i < array.length; i++) {
|
|
296
|
-
const add = addToExternrefTable0(array[i]);
|
|
297
|
-
getDataViewMemory0().setUint32(ptr + 4 * i, add, true);
|
|
298
|
-
}
|
|
299
|
-
WASM_VECTOR_LEN = array.length;
|
|
300
|
-
return ptr;
|
|
301
|
-
}
|
|
302
262
|
/**
|
|
303
|
-
*
|
|
304
|
-
* @returns {Uint8Array}
|
|
263
|
+
* Enable debug info of Loro
|
|
305
264
|
*/
|
|
306
|
-
export function
|
|
307
|
-
|
|
308
|
-
const len0 = WASM_VECTOR_LEN;
|
|
309
|
-
const ret = wasm.encodeFrontiers(ptr0, len0);
|
|
310
|
-
if (ret[3]) {
|
|
311
|
-
throw takeFromExternrefTable0(ret[2]);
|
|
312
|
-
}
|
|
313
|
-
var v2 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
314
|
-
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
315
|
-
return v2;
|
|
265
|
+
export function setDebug() {
|
|
266
|
+
wasm.setDebug();
|
|
316
267
|
}
|
|
317
268
|
|
|
318
269
|
/**
|
|
@@ -362,16 +313,66 @@ export function LORO_VERSION() {
|
|
|
362
313
|
}
|
|
363
314
|
}
|
|
364
315
|
|
|
316
|
+
/**
|
|
317
|
+
* Decode the metadata of the import blob.
|
|
318
|
+
*
|
|
319
|
+
* This method is useful to get the following metadata of the import blob:
|
|
320
|
+
*
|
|
321
|
+
* - startVersionVector
|
|
322
|
+
* - endVersionVector
|
|
323
|
+
* - startTimestamp
|
|
324
|
+
* - endTimestamp
|
|
325
|
+
* - mode
|
|
326
|
+
* - changeNum
|
|
327
|
+
* @param {Uint8Array} blob
|
|
328
|
+
* @param {boolean} check_checksum
|
|
329
|
+
* @returns {ImportBlobMetadata}
|
|
330
|
+
*/
|
|
331
|
+
export function decodeImportBlobMeta(blob, check_checksum) {
|
|
332
|
+
const ptr0 = passArray8ToWasm0(blob, wasm.__wbindgen_malloc);
|
|
333
|
+
const len0 = WASM_VECTOR_LEN;
|
|
334
|
+
const ret = wasm.decodeImportBlobMeta(ptr0, len0, check_checksum);
|
|
335
|
+
if (ret[2]) {
|
|
336
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
337
|
+
}
|
|
338
|
+
return takeFromExternrefTable0(ret[0]);
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
function passArrayJsValueToWasm0(array, malloc) {
|
|
342
|
+
const ptr = malloc(array.length * 4, 4) >>> 0;
|
|
343
|
+
for (let i = 0; i < array.length; i++) {
|
|
344
|
+
const add = addToExternrefTable0(array[i]);
|
|
345
|
+
getDataViewMemory0().setUint32(ptr + 4 * i, add, true);
|
|
346
|
+
}
|
|
347
|
+
WASM_VECTOR_LEN = array.length;
|
|
348
|
+
return ptr;
|
|
349
|
+
}
|
|
350
|
+
/**
|
|
351
|
+
* @param {({ peer: PeerID, counter: number })[]} frontiers
|
|
352
|
+
* @returns {Uint8Array}
|
|
353
|
+
*/
|
|
354
|
+
export function encodeFrontiers(frontiers) {
|
|
355
|
+
const ptr0 = passArrayJsValueToWasm0(frontiers, wasm.__wbindgen_malloc);
|
|
356
|
+
const len0 = WASM_VECTOR_LEN;
|
|
357
|
+
const ret = wasm.encodeFrontiers(ptr0, len0);
|
|
358
|
+
if (ret[3]) {
|
|
359
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
360
|
+
}
|
|
361
|
+
var v2 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
362
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
363
|
+
return v2;
|
|
364
|
+
}
|
|
365
|
+
|
|
365
366
|
export function run() {
|
|
366
367
|
wasm.run();
|
|
367
368
|
}
|
|
368
369
|
|
|
369
370
|
function __wbg_adapter_62(arg0, arg1, arg2) {
|
|
370
|
-
wasm.
|
|
371
|
+
wasm.closure9_externref_shim(arg0, arg1, arg2);
|
|
371
372
|
}
|
|
372
373
|
|
|
373
374
|
function __wbg_adapter_65(arg0, arg1) {
|
|
374
|
-
wasm.
|
|
375
|
+
wasm._dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h423c5eefcad13156(arg0, arg1);
|
|
375
376
|
}
|
|
376
377
|
|
|
377
378
|
const AwarenessWasmFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
@@ -5547,6 +5548,10 @@ export function __wbg_entries_c8a90a7ed73e84ce(arg0) {
|
|
|
5547
5548
|
return ret;
|
|
5548
5549
|
};
|
|
5549
5550
|
|
|
5551
|
+
export function __wbg_error_1cb1bf0bb7e0da2b(arg0, arg1) {
|
|
5552
|
+
console.error(getStringFromWasm0(arg0, arg1));
|
|
5553
|
+
};
|
|
5554
|
+
|
|
5550
5555
|
export function __wbg_error_7534b8e9a36f1ab4(arg0, arg1) {
|
|
5551
5556
|
let deferred0_0;
|
|
5552
5557
|
let deferred0_1;
|
|
@@ -5559,10 +5564,6 @@ export function __wbg_error_7534b8e9a36f1ab4(arg0, arg1) {
|
|
|
5559
5564
|
}
|
|
5560
5565
|
};
|
|
5561
5566
|
|
|
5562
|
-
export function __wbg_error_fb60fcc2bf54ad8d(arg0, arg1) {
|
|
5563
|
-
console.error(getStringFromWasm0(arg0, arg1));
|
|
5564
|
-
};
|
|
5565
|
-
|
|
5566
5567
|
export function __wbg_from_2a5d3e218e67aa85(arg0) {
|
|
5567
5568
|
const ret = Array.from(arg0);
|
|
5568
5569
|
return ret;
|
|
@@ -5666,6 +5667,10 @@ export function __wbg_length_e2d2a49132c1b256(arg0) {
|
|
|
5666
5667
|
return ret;
|
|
5667
5668
|
};
|
|
5668
5669
|
|
|
5670
|
+
export function __wbg_log_0671e6aa34e04626(arg0, arg1) {
|
|
5671
|
+
console.log(getStringFromWasm0(arg0, arg1));
|
|
5672
|
+
};
|
|
5673
|
+
|
|
5669
5674
|
export function __wbg_log_0cc1b7768397bcfe(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7) {
|
|
5670
5675
|
let deferred0_0;
|
|
5671
5676
|
let deferred0_1;
|
|
@@ -5678,10 +5683,6 @@ export function __wbg_log_0cc1b7768397bcfe(arg0, arg1, arg2, arg3, arg4, arg5, a
|
|
|
5678
5683
|
}
|
|
5679
5684
|
};
|
|
5680
5685
|
|
|
5681
|
-
export function __wbg_log_c442f7198a667311(arg0, arg1) {
|
|
5682
|
-
console.log(getStringFromWasm0(arg0, arg1));
|
|
5683
|
-
};
|
|
5684
|
-
|
|
5685
5686
|
export function __wbg_log_cb9e190acc5753fb(arg0, arg1) {
|
|
5686
5687
|
let deferred0_0;
|
|
5687
5688
|
let deferred0_1;
|
|
@@ -5928,7 +5929,7 @@ export function __wbg_versionvector_new(arg0) {
|
|
|
5928
5929
|
return ret;
|
|
5929
5930
|
};
|
|
5930
5931
|
|
|
5931
|
-
export function
|
|
5932
|
+
export function __wbg_warn_90235b184e422485(arg0, arg1) {
|
|
5932
5933
|
console.warn(getStringFromWasm0(arg0, arg1));
|
|
5933
5934
|
};
|
|
5934
5935
|
|
|
@@ -5975,7 +5976,7 @@ export function __wbindgen_closure_wrapper718(arg0, arg1, arg2) {
|
|
|
5975
5976
|
return ret;
|
|
5976
5977
|
};
|
|
5977
5978
|
|
|
5978
|
-
export function
|
|
5979
|
+
export function __wbindgen_closure_wrapper721(arg0, arg1, arg2) {
|
|
5979
5980
|
const ret = makeMutClosure(arg0, arg1, 10, __wbg_adapter_65);
|
|
5980
5981
|
return ret;
|
|
5981
5982
|
};
|
|
Binary file
|
|
@@ -325,6 +325,6 @@ export const __wbindgen_free: (a: number, b: number, c: number) => void;
|
|
|
325
325
|
export const __wbindgen_export_6: WebAssembly.Table;
|
|
326
326
|
export const __externref_table_dealloc: (a: number) => void;
|
|
327
327
|
export const __externref_drop_slice: (a: number, b: number) => void;
|
|
328
|
-
export const
|
|
329
|
-
export const
|
|
328
|
+
export const closure9_externref_shim: (a: number, b: number, c: any) => void;
|
|
329
|
+
export const _dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h423c5eefcad13156: (a: number, b: number) => void;
|
|
330
330
|
export const __wbindgen_start: () => void;
|
package/nodejs/loro_wasm.d.ts
CHANGED
|
@@ -1,25 +1,11 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
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;
|
|
3
|
+
export function callPendingEvents(): void;
|
|
4
|
+
export function decodeFrontiers(bytes: Uint8Array): { peer: PeerID, counter: number }[];
|
|
16
5
|
/**
|
|
17
6
|
* Enable debug info of Loro
|
|
18
7
|
*/
|
|
19
8
|
export function setDebug(): void;
|
|
20
|
-
export function callPendingEvents(): void;
|
|
21
|
-
export function decodeFrontiers(bytes: Uint8Array): { peer: PeerID, counter: number }[];
|
|
22
|
-
export function encodeFrontiers(frontiers: ({ peer: PeerID, counter: number })[]): Uint8Array;
|
|
23
9
|
/**
|
|
24
10
|
* Redacts sensitive content in JSON updates within the specified version range.
|
|
25
11
|
*
|
|
@@ -44,6 +30,20 @@ export function redactJsonUpdates(json_updates: string | JsonSchema, version_ran
|
|
|
44
30
|
* Get the version of Loro
|
|
45
31
|
*/
|
|
46
32
|
export function LORO_VERSION(): string;
|
|
33
|
+
/**
|
|
34
|
+
* Decode the metadata of the import blob.
|
|
35
|
+
*
|
|
36
|
+
* This method is useful to get the following metadata of the import blob:
|
|
37
|
+
*
|
|
38
|
+
* - startVersionVector
|
|
39
|
+
* - endVersionVector
|
|
40
|
+
* - startTimestamp
|
|
41
|
+
* - endTimestamp
|
|
42
|
+
* - mode
|
|
43
|
+
* - changeNum
|
|
44
|
+
*/
|
|
45
|
+
export function decodeImportBlobMeta(blob: Uint8Array, check_checksum: boolean): ImportBlobMetadata;
|
|
46
|
+
export function encodeFrontiers(frontiers: ({ peer: PeerID, counter: number })[]): Uint8Array;
|
|
47
47
|
export function run(): void;
|
|
48
48
|
|
|
49
49
|
/**
|
package/nodejs/loro_wasm.js
CHANGED
|
@@ -236,37 +236,6 @@ function getArrayJsValueFromWasm0(ptr, len) {
|
|
|
236
236
|
wasm.__externref_drop_slice(ptr, len);
|
|
237
237
|
return result;
|
|
238
238
|
}
|
|
239
|
-
/**
|
|
240
|
-
* Decode the metadata of the import blob.
|
|
241
|
-
*
|
|
242
|
-
* This method is useful to get the following metadata of the import blob:
|
|
243
|
-
*
|
|
244
|
-
* - startVersionVector
|
|
245
|
-
* - endVersionVector
|
|
246
|
-
* - startTimestamp
|
|
247
|
-
* - endTimestamp
|
|
248
|
-
* - mode
|
|
249
|
-
* - changeNum
|
|
250
|
-
* @param {Uint8Array} blob
|
|
251
|
-
* @param {boolean} check_checksum
|
|
252
|
-
* @returns {ImportBlobMetadata}
|
|
253
|
-
*/
|
|
254
|
-
module.exports.decodeImportBlobMeta = function(blob, check_checksum) {
|
|
255
|
-
const ptr0 = passArray8ToWasm0(blob, wasm.__wbindgen_malloc);
|
|
256
|
-
const len0 = WASM_VECTOR_LEN;
|
|
257
|
-
const ret = wasm.decodeImportBlobMeta(ptr0, len0, check_checksum);
|
|
258
|
-
if (ret[2]) {
|
|
259
|
-
throw takeFromExternrefTable0(ret[1]);
|
|
260
|
-
}
|
|
261
|
-
return takeFromExternrefTable0(ret[0]);
|
|
262
|
-
};
|
|
263
|
-
|
|
264
|
-
/**
|
|
265
|
-
* Enable debug info of Loro
|
|
266
|
-
*/
|
|
267
|
-
module.exports.setDebug = function() {
|
|
268
|
-
wasm.setDebug();
|
|
269
|
-
};
|
|
270
239
|
|
|
271
240
|
module.exports.callPendingEvents = function() {
|
|
272
241
|
wasm.callPendingEvents();
|
|
@@ -286,29 +255,11 @@ module.exports.decodeFrontiers = function(bytes) {
|
|
|
286
255
|
return takeFromExternrefTable0(ret[0]);
|
|
287
256
|
};
|
|
288
257
|
|
|
289
|
-
function passArrayJsValueToWasm0(array, malloc) {
|
|
290
|
-
const ptr = malloc(array.length * 4, 4) >>> 0;
|
|
291
|
-
for (let i = 0; i < array.length; i++) {
|
|
292
|
-
const add = addToExternrefTable0(array[i]);
|
|
293
|
-
getDataViewMemory0().setUint32(ptr + 4 * i, add, true);
|
|
294
|
-
}
|
|
295
|
-
WASM_VECTOR_LEN = array.length;
|
|
296
|
-
return ptr;
|
|
297
|
-
}
|
|
298
258
|
/**
|
|
299
|
-
*
|
|
300
|
-
* @returns {Uint8Array}
|
|
259
|
+
* Enable debug info of Loro
|
|
301
260
|
*/
|
|
302
|
-
module.exports.
|
|
303
|
-
|
|
304
|
-
const len0 = WASM_VECTOR_LEN;
|
|
305
|
-
const ret = wasm.encodeFrontiers(ptr0, len0);
|
|
306
|
-
if (ret[3]) {
|
|
307
|
-
throw takeFromExternrefTable0(ret[2]);
|
|
308
|
-
}
|
|
309
|
-
var v2 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
310
|
-
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
311
|
-
return v2;
|
|
261
|
+
module.exports.setDebug = function() {
|
|
262
|
+
wasm.setDebug();
|
|
312
263
|
};
|
|
313
264
|
|
|
314
265
|
/**
|
|
@@ -358,16 +309,66 @@ module.exports.LORO_VERSION = function() {
|
|
|
358
309
|
}
|
|
359
310
|
};
|
|
360
311
|
|
|
312
|
+
/**
|
|
313
|
+
* Decode the metadata of the import blob.
|
|
314
|
+
*
|
|
315
|
+
* This method is useful to get the following metadata of the import blob:
|
|
316
|
+
*
|
|
317
|
+
* - startVersionVector
|
|
318
|
+
* - endVersionVector
|
|
319
|
+
* - startTimestamp
|
|
320
|
+
* - endTimestamp
|
|
321
|
+
* - mode
|
|
322
|
+
* - changeNum
|
|
323
|
+
* @param {Uint8Array} blob
|
|
324
|
+
* @param {boolean} check_checksum
|
|
325
|
+
* @returns {ImportBlobMetadata}
|
|
326
|
+
*/
|
|
327
|
+
module.exports.decodeImportBlobMeta = function(blob, check_checksum) {
|
|
328
|
+
const ptr0 = passArray8ToWasm0(blob, wasm.__wbindgen_malloc);
|
|
329
|
+
const len0 = WASM_VECTOR_LEN;
|
|
330
|
+
const ret = wasm.decodeImportBlobMeta(ptr0, len0, check_checksum);
|
|
331
|
+
if (ret[2]) {
|
|
332
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
333
|
+
}
|
|
334
|
+
return takeFromExternrefTable0(ret[0]);
|
|
335
|
+
};
|
|
336
|
+
|
|
337
|
+
function passArrayJsValueToWasm0(array, malloc) {
|
|
338
|
+
const ptr = malloc(array.length * 4, 4) >>> 0;
|
|
339
|
+
for (let i = 0; i < array.length; i++) {
|
|
340
|
+
const add = addToExternrefTable0(array[i]);
|
|
341
|
+
getDataViewMemory0().setUint32(ptr + 4 * i, add, true);
|
|
342
|
+
}
|
|
343
|
+
WASM_VECTOR_LEN = array.length;
|
|
344
|
+
return ptr;
|
|
345
|
+
}
|
|
346
|
+
/**
|
|
347
|
+
* @param {({ peer: PeerID, counter: number })[]} frontiers
|
|
348
|
+
* @returns {Uint8Array}
|
|
349
|
+
*/
|
|
350
|
+
module.exports.encodeFrontiers = function(frontiers) {
|
|
351
|
+
const ptr0 = passArrayJsValueToWasm0(frontiers, wasm.__wbindgen_malloc);
|
|
352
|
+
const len0 = WASM_VECTOR_LEN;
|
|
353
|
+
const ret = wasm.encodeFrontiers(ptr0, len0);
|
|
354
|
+
if (ret[3]) {
|
|
355
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
356
|
+
}
|
|
357
|
+
var v2 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
358
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
359
|
+
return v2;
|
|
360
|
+
};
|
|
361
|
+
|
|
361
362
|
module.exports.run = function() {
|
|
362
363
|
wasm.run();
|
|
363
364
|
};
|
|
364
365
|
|
|
365
366
|
function __wbg_adapter_62(arg0, arg1, arg2) {
|
|
366
|
-
wasm.
|
|
367
|
+
wasm.closure9_externref_shim(arg0, arg1, arg2);
|
|
367
368
|
}
|
|
368
369
|
|
|
369
370
|
function __wbg_adapter_65(arg0, arg1) {
|
|
370
|
-
wasm.
|
|
371
|
+
wasm._dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h423c5eefcad13156(arg0, arg1);
|
|
371
372
|
}
|
|
372
373
|
|
|
373
374
|
const AwarenessWasmFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
@@ -5557,6 +5558,10 @@ module.exports.__wbg_entries_c8a90a7ed73e84ce = function(arg0) {
|
|
|
5557
5558
|
return ret;
|
|
5558
5559
|
};
|
|
5559
5560
|
|
|
5561
|
+
module.exports.__wbg_error_1cb1bf0bb7e0da2b = function(arg0, arg1) {
|
|
5562
|
+
console.error(getStringFromWasm0(arg0, arg1));
|
|
5563
|
+
};
|
|
5564
|
+
|
|
5560
5565
|
module.exports.__wbg_error_7534b8e9a36f1ab4 = function(arg0, arg1) {
|
|
5561
5566
|
let deferred0_0;
|
|
5562
5567
|
let deferred0_1;
|
|
@@ -5569,10 +5574,6 @@ module.exports.__wbg_error_7534b8e9a36f1ab4 = function(arg0, arg1) {
|
|
|
5569
5574
|
}
|
|
5570
5575
|
};
|
|
5571
5576
|
|
|
5572
|
-
module.exports.__wbg_error_fb60fcc2bf54ad8d = function(arg0, arg1) {
|
|
5573
|
-
console.error(getStringFromWasm0(arg0, arg1));
|
|
5574
|
-
};
|
|
5575
|
-
|
|
5576
5577
|
module.exports.__wbg_from_2a5d3e218e67aa85 = function(arg0) {
|
|
5577
5578
|
const ret = Array.from(arg0);
|
|
5578
5579
|
return ret;
|
|
@@ -5676,6 +5677,10 @@ module.exports.__wbg_length_e2d2a49132c1b256 = function(arg0) {
|
|
|
5676
5677
|
return ret;
|
|
5677
5678
|
};
|
|
5678
5679
|
|
|
5680
|
+
module.exports.__wbg_log_0671e6aa34e04626 = function(arg0, arg1) {
|
|
5681
|
+
console.log(getStringFromWasm0(arg0, arg1));
|
|
5682
|
+
};
|
|
5683
|
+
|
|
5679
5684
|
module.exports.__wbg_log_0cc1b7768397bcfe = function(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7) {
|
|
5680
5685
|
let deferred0_0;
|
|
5681
5686
|
let deferred0_1;
|
|
@@ -5688,10 +5693,6 @@ module.exports.__wbg_log_0cc1b7768397bcfe = function(arg0, arg1, arg2, arg3, arg
|
|
|
5688
5693
|
}
|
|
5689
5694
|
};
|
|
5690
5695
|
|
|
5691
|
-
module.exports.__wbg_log_c442f7198a667311 = function(arg0, arg1) {
|
|
5692
|
-
console.log(getStringFromWasm0(arg0, arg1));
|
|
5693
|
-
};
|
|
5694
|
-
|
|
5695
5696
|
module.exports.__wbg_log_cb9e190acc5753fb = function(arg0, arg1) {
|
|
5696
5697
|
let deferred0_0;
|
|
5697
5698
|
let deferred0_1;
|
|
@@ -5938,7 +5939,7 @@ module.exports.__wbg_versionvector_new = function(arg0) {
|
|
|
5938
5939
|
return ret;
|
|
5939
5940
|
};
|
|
5940
5941
|
|
|
5941
|
-
module.exports.
|
|
5942
|
+
module.exports.__wbg_warn_90235b184e422485 = function(arg0, arg1) {
|
|
5942
5943
|
console.warn(getStringFromWasm0(arg0, arg1));
|
|
5943
5944
|
};
|
|
5944
5945
|
|
|
@@ -5985,7 +5986,7 @@ module.exports.__wbindgen_closure_wrapper718 = function(arg0, arg1, arg2) {
|
|
|
5985
5986
|
return ret;
|
|
5986
5987
|
};
|
|
5987
5988
|
|
|
5988
|
-
module.exports.
|
|
5989
|
+
module.exports.__wbindgen_closure_wrapper721 = function(arg0, arg1, arg2) {
|
|
5989
5990
|
const ret = makeMutClosure(arg0, arg1, 10, __wbg_adapter_65);
|
|
5990
5991
|
return ret;
|
|
5991
5992
|
};
|
package/nodejs/loro_wasm_bg.wasm
CHANGED
|
Binary file
|
|
@@ -325,6 +325,6 @@ export const __wbindgen_free: (a: number, b: number, c: number) => void;
|
|
|
325
325
|
export const __wbindgen_export_6: WebAssembly.Table;
|
|
326
326
|
export const __externref_table_dealloc: (a: number) => void;
|
|
327
327
|
export const __externref_drop_slice: (a: number, b: number) => void;
|
|
328
|
-
export const
|
|
329
|
-
export const
|
|
328
|
+
export const closure9_externref_shim: (a: number, b: number, c: any) => void;
|
|
329
|
+
export const _dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h423c5eefcad13156: (a: number, b: number) => void;
|
|
330
330
|
export const __wbindgen_start: () => void;
|
package/package.json
CHANGED
package/web/loro_wasm.d.ts
CHANGED
|
@@ -1,25 +1,11 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
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;
|
|
3
|
+
export function callPendingEvents(): void;
|
|
4
|
+
export function decodeFrontiers(bytes: Uint8Array): { peer: PeerID, counter: number }[];
|
|
16
5
|
/**
|
|
17
6
|
* Enable debug info of Loro
|
|
18
7
|
*/
|
|
19
8
|
export function setDebug(): void;
|
|
20
|
-
export function callPendingEvents(): void;
|
|
21
|
-
export function decodeFrontiers(bytes: Uint8Array): { peer: PeerID, counter: number }[];
|
|
22
|
-
export function encodeFrontiers(frontiers: ({ peer: PeerID, counter: number })[]): Uint8Array;
|
|
23
9
|
/**
|
|
24
10
|
* Redacts sensitive content in JSON updates within the specified version range.
|
|
25
11
|
*
|
|
@@ -44,6 +30,20 @@ export function redactJsonUpdates(json_updates: string | JsonSchema, version_ran
|
|
|
44
30
|
* Get the version of Loro
|
|
45
31
|
*/
|
|
46
32
|
export function LORO_VERSION(): string;
|
|
33
|
+
/**
|
|
34
|
+
* Decode the metadata of the import blob.
|
|
35
|
+
*
|
|
36
|
+
* This method is useful to get the following metadata of the import blob:
|
|
37
|
+
*
|
|
38
|
+
* - startVersionVector
|
|
39
|
+
* - endVersionVector
|
|
40
|
+
* - startTimestamp
|
|
41
|
+
* - endTimestamp
|
|
42
|
+
* - mode
|
|
43
|
+
* - changeNum
|
|
44
|
+
*/
|
|
45
|
+
export function decodeImportBlobMeta(blob: Uint8Array, check_checksum: boolean): ImportBlobMetadata;
|
|
46
|
+
export function encodeFrontiers(frontiers: ({ peer: PeerID, counter: number })[]): Uint8Array;
|
|
47
47
|
export function run(): void;
|
|
48
48
|
|
|
49
49
|
/**
|
|
@@ -4050,8 +4050,8 @@ export interface InitOutput {
|
|
|
4050
4050
|
readonly __wbindgen_export_6: WebAssembly.Table;
|
|
4051
4051
|
readonly __externref_table_dealloc: (a: number) => void;
|
|
4052
4052
|
readonly __externref_drop_slice: (a: number, b: number) => void;
|
|
4053
|
-
readonly
|
|
4054
|
-
readonly
|
|
4053
|
+
readonly closure9_externref_shim: (a: number, b: number, c: any) => void;
|
|
4054
|
+
readonly _dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h423c5eefcad13156: (a: number, b: number) => void;
|
|
4055
4055
|
readonly __wbindgen_start: () => void;
|
|
4056
4056
|
}
|
|
4057
4057
|
|