loro-crdt 1.13.2 → 1.13.4
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 +30 -0
- package/base64/index.js +68 -67
- package/base64/loro_wasm.d.ts +8 -8
- package/browser/index.js +3 -3
- package/browser/loro_wasm.d.ts +8 -8
- package/browser/loro_wasm.js +9 -9
- package/browser/loro_wasm_bg.js +64 -63
- package/browser/loro_wasm_bg.wasm +0 -0
- package/browser/loro_wasm_bg.wasm.d.ts +2 -2
- package/bundler/index.js +3 -3
- package/bundler/loro_wasm.d.ts +8 -8
- package/bundler/loro_wasm_bg.js +64 -63
- package/bundler/loro_wasm_bg.wasm +0 -0
- package/bundler/loro_wasm_bg.wasm.d.ts +2 -2
- package/nodejs/loro_wasm.d.ts +8 -8
- package/nodejs/loro_wasm.js +64 -63
- 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 +10 -10
- 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/nodejs/loro_wasm.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
|
+
export function encodeFrontiers(frontiers: ({ peer: PeerID, counter: number })[]): Uint8Array;
|
|
4
|
+
export function callPendingEvents(): void;
|
|
3
5
|
/**
|
|
4
6
|
* Decode the metadata of the import blob.
|
|
5
7
|
*
|
|
@@ -13,13 +15,14 @@
|
|
|
13
15
|
* - changeNum
|
|
14
16
|
*/
|
|
15
17
|
export function decodeImportBlobMeta(blob: Uint8Array, check_checksum: boolean): ImportBlobMetadata;
|
|
18
|
+
/**
|
|
19
|
+
* Enable debug info of Loro
|
|
20
|
+
*/
|
|
21
|
+
export function setDebug(): void;
|
|
16
22
|
/**
|
|
17
23
|
* Get the version of Loro
|
|
18
24
|
*/
|
|
19
25
|
export function LORO_VERSION(): string;
|
|
20
|
-
export function run(): void;
|
|
21
|
-
export function decodeFrontiers(bytes: Uint8Array): { peer: PeerID, counter: number }[];
|
|
22
|
-
export function callPendingEvents(): void;
|
|
23
26
|
/**
|
|
24
27
|
* Redacts sensitive content in JSON updates within the specified version range.
|
|
25
28
|
*
|
|
@@ -40,11 +43,8 @@ export function callPendingEvents(): void;
|
|
|
40
43
|
* @returns {Object} The redacted JSON updates
|
|
41
44
|
*/
|
|
42
45
|
export function redactJsonUpdates(json_updates: string | JsonSchema, version_range: any): JsonSchema;
|
|
43
|
-
export function
|
|
44
|
-
|
|
45
|
-
* Enable debug info of Loro
|
|
46
|
-
*/
|
|
47
|
-
export function setDebug(): void;
|
|
46
|
+
export function decodeFrontiers(bytes: Uint8Array): { peer: PeerID, counter: number }[];
|
|
47
|
+
export function run(): void;
|
|
48
48
|
|
|
49
49
|
/**
|
|
50
50
|
* Container types supported by loro.
|
package/nodejs/loro_wasm.js
CHANGED
|
@@ -259,6 +259,45 @@ function getArrayJsValueFromWasm0(ptr, len) {
|
|
|
259
259
|
}
|
|
260
260
|
return result;
|
|
261
261
|
}
|
|
262
|
+
|
|
263
|
+
function passArrayJsValueToWasm0(array, malloc) {
|
|
264
|
+
const ptr = malloc(array.length * 4, 4) >>> 0;
|
|
265
|
+
const mem = getDataViewMemory0();
|
|
266
|
+
for (let i = 0; i < array.length; i++) {
|
|
267
|
+
mem.setUint32(ptr + 4 * i, addHeapObject(array[i]), true);
|
|
268
|
+
}
|
|
269
|
+
WASM_VECTOR_LEN = array.length;
|
|
270
|
+
return ptr;
|
|
271
|
+
}
|
|
272
|
+
/**
|
|
273
|
+
* @param {({ peer: PeerID, counter: number })[]} frontiers
|
|
274
|
+
* @returns {Uint8Array}
|
|
275
|
+
*/
|
|
276
|
+
module.exports.encodeFrontiers = function(frontiers) {
|
|
277
|
+
try {
|
|
278
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
279
|
+
const ptr0 = passArrayJsValueToWasm0(frontiers, wasm.__wbindgen_malloc);
|
|
280
|
+
const len0 = WASM_VECTOR_LEN;
|
|
281
|
+
wasm.encodeFrontiers(retptr, ptr0, len0);
|
|
282
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
283
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
284
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
285
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
286
|
+
if (r3) {
|
|
287
|
+
throw takeObject(r2);
|
|
288
|
+
}
|
|
289
|
+
var v2 = getArrayU8FromWasm0(r0, r1).slice();
|
|
290
|
+
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
291
|
+
return v2;
|
|
292
|
+
} finally {
|
|
293
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
294
|
+
}
|
|
295
|
+
};
|
|
296
|
+
|
|
297
|
+
module.exports.callPendingEvents = function() {
|
|
298
|
+
wasm.callPendingEvents();
|
|
299
|
+
};
|
|
300
|
+
|
|
262
301
|
/**
|
|
263
302
|
* Decode the metadata of the import blob.
|
|
264
303
|
*
|
|
@@ -292,6 +331,13 @@ module.exports.decodeImportBlobMeta = function(blob, check_checksum) {
|
|
|
292
331
|
}
|
|
293
332
|
};
|
|
294
333
|
|
|
334
|
+
/**
|
|
335
|
+
* Enable debug info of Loro
|
|
336
|
+
*/
|
|
337
|
+
module.exports.setDebug = function() {
|
|
338
|
+
wasm.setDebug();
|
|
339
|
+
};
|
|
340
|
+
|
|
295
341
|
/**
|
|
296
342
|
* Get the version of Loro
|
|
297
343
|
* @returns {string}
|
|
@@ -313,36 +359,6 @@ module.exports.LORO_VERSION = function() {
|
|
|
313
359
|
}
|
|
314
360
|
};
|
|
315
361
|
|
|
316
|
-
module.exports.run = function() {
|
|
317
|
-
wasm.run();
|
|
318
|
-
};
|
|
319
|
-
|
|
320
|
-
/**
|
|
321
|
-
* @param {Uint8Array} bytes
|
|
322
|
-
* @returns {{ peer: PeerID, counter: number }[]}
|
|
323
|
-
*/
|
|
324
|
-
module.exports.decodeFrontiers = function(bytes) {
|
|
325
|
-
try {
|
|
326
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
327
|
-
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
328
|
-
const len0 = WASM_VECTOR_LEN;
|
|
329
|
-
wasm.decodeFrontiers(retptr, ptr0, len0);
|
|
330
|
-
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
331
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
332
|
-
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
333
|
-
if (r2) {
|
|
334
|
-
throw takeObject(r1);
|
|
335
|
-
}
|
|
336
|
-
return takeObject(r0);
|
|
337
|
-
} finally {
|
|
338
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
339
|
-
}
|
|
340
|
-
};
|
|
341
|
-
|
|
342
|
-
module.exports.callPendingEvents = function() {
|
|
343
|
-
wasm.callPendingEvents();
|
|
344
|
-
};
|
|
345
|
-
|
|
346
362
|
/**
|
|
347
363
|
* Redacts sensitive content in JSON updates within the specified version range.
|
|
348
364
|
*
|
|
@@ -381,53 +397,38 @@ module.exports.redactJsonUpdates = function(json_updates, version_range) {
|
|
|
381
397
|
}
|
|
382
398
|
};
|
|
383
399
|
|
|
384
|
-
function passArrayJsValueToWasm0(array, malloc) {
|
|
385
|
-
const ptr = malloc(array.length * 4, 4) >>> 0;
|
|
386
|
-
const mem = getDataViewMemory0();
|
|
387
|
-
for (let i = 0; i < array.length; i++) {
|
|
388
|
-
mem.setUint32(ptr + 4 * i, addHeapObject(array[i]), true);
|
|
389
|
-
}
|
|
390
|
-
WASM_VECTOR_LEN = array.length;
|
|
391
|
-
return ptr;
|
|
392
|
-
}
|
|
393
400
|
/**
|
|
394
|
-
* @param {
|
|
395
|
-
* @returns {
|
|
401
|
+
* @param {Uint8Array} bytes
|
|
402
|
+
* @returns {{ peer: PeerID, counter: number }[]}
|
|
396
403
|
*/
|
|
397
|
-
module.exports.
|
|
404
|
+
module.exports.decodeFrontiers = function(bytes) {
|
|
398
405
|
try {
|
|
399
406
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
400
|
-
const ptr0 =
|
|
407
|
+
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
401
408
|
const len0 = WASM_VECTOR_LEN;
|
|
402
|
-
wasm.
|
|
409
|
+
wasm.decodeFrontiers(retptr, ptr0, len0);
|
|
403
410
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
404
411
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
405
412
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
throw takeObject(r2);
|
|
413
|
+
if (r2) {
|
|
414
|
+
throw takeObject(r1);
|
|
409
415
|
}
|
|
410
|
-
|
|
411
|
-
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
412
|
-
return v2;
|
|
416
|
+
return takeObject(r0);
|
|
413
417
|
} finally {
|
|
414
418
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
415
419
|
}
|
|
416
420
|
};
|
|
417
421
|
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
*/
|
|
421
|
-
module.exports.setDebug = function() {
|
|
422
|
-
wasm.setDebug();
|
|
422
|
+
module.exports.run = function() {
|
|
423
|
+
wasm.run();
|
|
423
424
|
};
|
|
424
425
|
|
|
425
426
|
function __wbg_adapter_60(arg0, arg1, arg2) {
|
|
426
|
-
wasm.
|
|
427
|
+
wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__hed608779f4ff852a(arg0, arg1, addHeapObject(arg2));
|
|
427
428
|
}
|
|
428
429
|
|
|
429
430
|
function __wbg_adapter_63(arg0, arg1) {
|
|
430
|
-
wasm.
|
|
431
|
+
wasm._dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h0b205d05825e6af2(arg0, arg1);
|
|
431
432
|
}
|
|
432
433
|
|
|
433
434
|
const AwarenessWasmFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
@@ -7015,7 +7016,7 @@ module.exports.__wbg_error_7534b8e9a36f1ab4 = function(arg0, arg1) {
|
|
|
7015
7016
|
}
|
|
7016
7017
|
};
|
|
7017
7018
|
|
|
7018
|
-
module.exports.
|
|
7019
|
+
module.exports.__wbg_error_efea264b63fa5feb = function(arg0, arg1) {
|
|
7019
7020
|
console.error(getStringFromWasm0(arg0, arg1));
|
|
7020
7021
|
};
|
|
7021
7022
|
|
|
@@ -7134,6 +7135,10 @@ module.exports.__wbg_log_0cc1b7768397bcfe = function(arg0, arg1, arg2, arg3, arg
|
|
|
7134
7135
|
}
|
|
7135
7136
|
};
|
|
7136
7137
|
|
|
7138
|
+
module.exports.__wbg_log_1b4065b9118c2c54 = function(arg0, arg1) {
|
|
7139
|
+
console.log(getStringFromWasm0(arg0, arg1));
|
|
7140
|
+
};
|
|
7141
|
+
|
|
7137
7142
|
module.exports.__wbg_log_cb9e190acc5753fb = function(arg0, arg1) {
|
|
7138
7143
|
let deferred0_0;
|
|
7139
7144
|
let deferred0_1;
|
|
@@ -7146,10 +7151,6 @@ module.exports.__wbg_log_cb9e190acc5753fb = function(arg0, arg1) {
|
|
|
7146
7151
|
}
|
|
7147
7152
|
};
|
|
7148
7153
|
|
|
7149
|
-
module.exports.__wbg_log_d8b98f6c2e2f68e5 = function(arg0, arg1) {
|
|
7150
|
-
console.log(getStringFromWasm0(arg0, arg1));
|
|
7151
|
-
};
|
|
7152
|
-
|
|
7153
7154
|
module.exports.__wbg_lorocounter_new = function(arg0) {
|
|
7154
7155
|
const ret = LoroCounter.__wrap(arg0);
|
|
7155
7156
|
return addHeapObject(ret);
|
|
@@ -7384,7 +7385,7 @@ module.exports.__wbg_versionvector_new = function(arg0) {
|
|
|
7384
7385
|
return addHeapObject(ret);
|
|
7385
7386
|
};
|
|
7386
7387
|
|
|
7387
|
-
module.exports.
|
|
7388
|
+
module.exports.__wbg_warn_e677aaf23eb7ded7 = function(arg0, arg1) {
|
|
7388
7389
|
console.warn(getStringFromWasm0(arg0, arg1));
|
|
7389
7390
|
};
|
|
7390
7391
|
|
package/nodejs/loro_wasm_bg.wasm
CHANGED
|
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__hed608779f4ff852a: (a: number, b: number, c: number) => void;
|
|
334
|
+
export const _dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h0b205d05825e6af2: (a: number, b: number) => void;
|
|
335
335
|
export const __wbindgen_start: () => void;
|
package/package.json
CHANGED
package/web/loro_wasm.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
|
+
export function encodeFrontiers(frontiers: ({ peer: PeerID, counter: number })[]): Uint8Array;
|
|
4
|
+
export function callPendingEvents(): void;
|
|
3
5
|
/**
|
|
4
6
|
* Decode the metadata of the import blob.
|
|
5
7
|
*
|
|
@@ -13,13 +15,14 @@
|
|
|
13
15
|
* - changeNum
|
|
14
16
|
*/
|
|
15
17
|
export function decodeImportBlobMeta(blob: Uint8Array, check_checksum: boolean): ImportBlobMetadata;
|
|
18
|
+
/**
|
|
19
|
+
* Enable debug info of Loro
|
|
20
|
+
*/
|
|
21
|
+
export function setDebug(): void;
|
|
16
22
|
/**
|
|
17
23
|
* Get the version of Loro
|
|
18
24
|
*/
|
|
19
25
|
export function LORO_VERSION(): string;
|
|
20
|
-
export function run(): void;
|
|
21
|
-
export function decodeFrontiers(bytes: Uint8Array): { peer: PeerID, counter: number }[];
|
|
22
|
-
export function callPendingEvents(): void;
|
|
23
26
|
/**
|
|
24
27
|
* Redacts sensitive content in JSON updates within the specified version range.
|
|
25
28
|
*
|
|
@@ -40,11 +43,8 @@ export function callPendingEvents(): void;
|
|
|
40
43
|
* @returns {Object} The redacted JSON updates
|
|
41
44
|
*/
|
|
42
45
|
export function redactJsonUpdates(json_updates: string | JsonSchema, version_range: any): JsonSchema;
|
|
43
|
-
export function
|
|
44
|
-
|
|
45
|
-
* Enable debug info of Loro
|
|
46
|
-
*/
|
|
47
|
-
export function setDebug(): void;
|
|
46
|
+
export function decodeFrontiers(bytes: Uint8Array): { peer: PeerID, counter: number }[];
|
|
47
|
+
export function run(): void;
|
|
48
48
|
|
|
49
49
|
/**
|
|
50
50
|
* Container types supported by loro.
|
|
@@ -4213,8 +4213,8 @@ export interface InitOutput {
|
|
|
4213
4213
|
readonly __wbindgen_free: (a: number, b: number, c: number) => void;
|
|
4214
4214
|
readonly __wbindgen_export_4: WebAssembly.Table;
|
|
4215
4215
|
readonly __wbindgen_add_to_stack_pointer: (a: number) => number;
|
|
4216
|
-
readonly
|
|
4217
|
-
readonly
|
|
4216
|
+
readonly _dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__hed608779f4ff852a: (a: number, b: number, c: number) => void;
|
|
4217
|
+
readonly _dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h0b205d05825e6af2: (a: number, b: number) => void;
|
|
4218
4218
|
readonly __wbindgen_start: () => void;
|
|
4219
4219
|
}
|
|
4220
4220
|
|
package/web/loro_wasm.js
CHANGED
|
@@ -255,6 +255,45 @@ function getArrayJsValueFromWasm0(ptr, len) {
|
|
|
255
255
|
}
|
|
256
256
|
return result;
|
|
257
257
|
}
|
|
258
|
+
|
|
259
|
+
function passArrayJsValueToWasm0(array, malloc) {
|
|
260
|
+
const ptr = malloc(array.length * 4, 4) >>> 0;
|
|
261
|
+
const mem = getDataViewMemory0();
|
|
262
|
+
for (let i = 0; i < array.length; i++) {
|
|
263
|
+
mem.setUint32(ptr + 4 * i, addHeapObject(array[i]), true);
|
|
264
|
+
}
|
|
265
|
+
WASM_VECTOR_LEN = array.length;
|
|
266
|
+
return ptr;
|
|
267
|
+
}
|
|
268
|
+
/**
|
|
269
|
+
* @param {({ peer: PeerID, counter: number })[]} frontiers
|
|
270
|
+
* @returns {Uint8Array}
|
|
271
|
+
*/
|
|
272
|
+
export function encodeFrontiers(frontiers) {
|
|
273
|
+
try {
|
|
274
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
275
|
+
const ptr0 = passArrayJsValueToWasm0(frontiers, wasm.__wbindgen_malloc);
|
|
276
|
+
const len0 = WASM_VECTOR_LEN;
|
|
277
|
+
wasm.encodeFrontiers(retptr, ptr0, len0);
|
|
278
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
279
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
280
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
281
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
282
|
+
if (r3) {
|
|
283
|
+
throw takeObject(r2);
|
|
284
|
+
}
|
|
285
|
+
var v2 = getArrayU8FromWasm0(r0, r1).slice();
|
|
286
|
+
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
287
|
+
return v2;
|
|
288
|
+
} finally {
|
|
289
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
export function callPendingEvents() {
|
|
294
|
+
wasm.callPendingEvents();
|
|
295
|
+
}
|
|
296
|
+
|
|
258
297
|
/**
|
|
259
298
|
* Decode the metadata of the import blob.
|
|
260
299
|
*
|
|
@@ -288,6 +327,13 @@ export function decodeImportBlobMeta(blob, check_checksum) {
|
|
|
288
327
|
}
|
|
289
328
|
}
|
|
290
329
|
|
|
330
|
+
/**
|
|
331
|
+
* Enable debug info of Loro
|
|
332
|
+
*/
|
|
333
|
+
export function setDebug() {
|
|
334
|
+
wasm.setDebug();
|
|
335
|
+
}
|
|
336
|
+
|
|
291
337
|
/**
|
|
292
338
|
* Get the version of Loro
|
|
293
339
|
* @returns {string}
|
|
@@ -309,36 +355,6 @@ export function LORO_VERSION() {
|
|
|
309
355
|
}
|
|
310
356
|
}
|
|
311
357
|
|
|
312
|
-
export function run() {
|
|
313
|
-
wasm.run();
|
|
314
|
-
}
|
|
315
|
-
|
|
316
|
-
/**
|
|
317
|
-
* @param {Uint8Array} bytes
|
|
318
|
-
* @returns {{ peer: PeerID, counter: number }[]}
|
|
319
|
-
*/
|
|
320
|
-
export function decodeFrontiers(bytes) {
|
|
321
|
-
try {
|
|
322
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
323
|
-
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
324
|
-
const len0 = WASM_VECTOR_LEN;
|
|
325
|
-
wasm.decodeFrontiers(retptr, ptr0, len0);
|
|
326
|
-
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
327
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
328
|
-
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
329
|
-
if (r2) {
|
|
330
|
-
throw takeObject(r1);
|
|
331
|
-
}
|
|
332
|
-
return takeObject(r0);
|
|
333
|
-
} finally {
|
|
334
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
335
|
-
}
|
|
336
|
-
}
|
|
337
|
-
|
|
338
|
-
export function callPendingEvents() {
|
|
339
|
-
wasm.callPendingEvents();
|
|
340
|
-
}
|
|
341
|
-
|
|
342
358
|
/**
|
|
343
359
|
* Redacts sensitive content in JSON updates within the specified version range.
|
|
344
360
|
*
|
|
@@ -377,53 +393,38 @@ export function redactJsonUpdates(json_updates, version_range) {
|
|
|
377
393
|
}
|
|
378
394
|
}
|
|
379
395
|
|
|
380
|
-
function passArrayJsValueToWasm0(array, malloc) {
|
|
381
|
-
const ptr = malloc(array.length * 4, 4) >>> 0;
|
|
382
|
-
const mem = getDataViewMemory0();
|
|
383
|
-
for (let i = 0; i < array.length; i++) {
|
|
384
|
-
mem.setUint32(ptr + 4 * i, addHeapObject(array[i]), true);
|
|
385
|
-
}
|
|
386
|
-
WASM_VECTOR_LEN = array.length;
|
|
387
|
-
return ptr;
|
|
388
|
-
}
|
|
389
396
|
/**
|
|
390
|
-
* @param {
|
|
391
|
-
* @returns {
|
|
397
|
+
* @param {Uint8Array} bytes
|
|
398
|
+
* @returns {{ peer: PeerID, counter: number }[]}
|
|
392
399
|
*/
|
|
393
|
-
export function
|
|
400
|
+
export function decodeFrontiers(bytes) {
|
|
394
401
|
try {
|
|
395
402
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
396
|
-
const ptr0 =
|
|
403
|
+
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
397
404
|
const len0 = WASM_VECTOR_LEN;
|
|
398
|
-
wasm.
|
|
405
|
+
wasm.decodeFrontiers(retptr, ptr0, len0);
|
|
399
406
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
400
407
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
401
408
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
throw takeObject(r2);
|
|
409
|
+
if (r2) {
|
|
410
|
+
throw takeObject(r1);
|
|
405
411
|
}
|
|
406
|
-
|
|
407
|
-
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
408
|
-
return v2;
|
|
412
|
+
return takeObject(r0);
|
|
409
413
|
} finally {
|
|
410
414
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
411
415
|
}
|
|
412
416
|
}
|
|
413
417
|
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
*/
|
|
417
|
-
export function setDebug() {
|
|
418
|
-
wasm.setDebug();
|
|
418
|
+
export function run() {
|
|
419
|
+
wasm.run();
|
|
419
420
|
}
|
|
420
421
|
|
|
421
422
|
function __wbg_adapter_60(arg0, arg1, arg2) {
|
|
422
|
-
wasm.
|
|
423
|
+
wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__hed608779f4ff852a(arg0, arg1, addHeapObject(arg2));
|
|
423
424
|
}
|
|
424
425
|
|
|
425
426
|
function __wbg_adapter_63(arg0, arg1) {
|
|
426
|
-
wasm.
|
|
427
|
+
wasm._dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h0b205d05825e6af2(arg0, arg1);
|
|
427
428
|
}
|
|
428
429
|
|
|
429
430
|
const AwarenessWasmFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
@@ -7016,7 +7017,7 @@ function __wbg_get_imports() {
|
|
|
7016
7017
|
wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
|
|
7017
7018
|
}
|
|
7018
7019
|
};
|
|
7019
|
-
imports.wbg.
|
|
7020
|
+
imports.wbg.__wbg_error_efea264b63fa5feb = function(arg0, arg1) {
|
|
7020
7021
|
console.error(getStringFromWasm0(arg0, arg1));
|
|
7021
7022
|
};
|
|
7022
7023
|
imports.wbg.__wbg_from_2a5d3e218e67aa85 = function(arg0) {
|
|
@@ -7117,6 +7118,9 @@ function __wbg_get_imports() {
|
|
|
7117
7118
|
wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
|
|
7118
7119
|
}
|
|
7119
7120
|
};
|
|
7121
|
+
imports.wbg.__wbg_log_1b4065b9118c2c54 = function(arg0, arg1) {
|
|
7122
|
+
console.log(getStringFromWasm0(arg0, arg1));
|
|
7123
|
+
};
|
|
7120
7124
|
imports.wbg.__wbg_log_cb9e190acc5753fb = function(arg0, arg1) {
|
|
7121
7125
|
let deferred0_0;
|
|
7122
7126
|
let deferred0_1;
|
|
@@ -7128,9 +7132,6 @@ function __wbg_get_imports() {
|
|
|
7128
7132
|
wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
|
|
7129
7133
|
}
|
|
7130
7134
|
};
|
|
7131
|
-
imports.wbg.__wbg_log_d8b98f6c2e2f68e5 = function(arg0, arg1) {
|
|
7132
|
-
console.log(getStringFromWasm0(arg0, arg1));
|
|
7133
|
-
};
|
|
7134
7135
|
imports.wbg.__wbg_lorocounter_new = function(arg0) {
|
|
7135
7136
|
const ret = LoroCounter.__wrap(arg0);
|
|
7136
7137
|
return addHeapObject(ret);
|
|
@@ -7320,7 +7321,7 @@ function __wbg_get_imports() {
|
|
|
7320
7321
|
const ret = VersionVector.__wrap(arg0);
|
|
7321
7322
|
return addHeapObject(ret);
|
|
7322
7323
|
};
|
|
7323
|
-
imports.wbg.
|
|
7324
|
+
imports.wbg.__wbg_warn_e677aaf23eb7ded7 = function(arg0, arg1) {
|
|
7324
7325
|
console.warn(getStringFromWasm0(arg0, arg1));
|
|
7325
7326
|
};
|
|
7326
7327
|
imports.wbg.__wbindgen_as_number = function(arg0) {
|
package/web/loro_wasm_bg.wasm
CHANGED
|
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__hed608779f4ff852a: (a: number, b: number, c: number) => void;
|
|
334
|
+
export const _dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h0b205d05825e6af2: (a: number, b: number) => void;
|
|
335
335
|
export const __wbindgen_start: () => void;
|