@diaryx/wasm-node 0.13.0 → 0.13.1-dev.9e5e63e
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/diaryx_wasm.d.ts +15 -1
- package/diaryx_wasm.js +20 -1
- package/diaryx_wasm_bg.wasm +0 -0
- package/diaryx_wasm_bg.wasm.d.ts +3 -1
- package/package.json +1 -1
package/diaryx_wasm.d.ts
CHANGED
|
@@ -234,6 +234,10 @@ export class DiaryxBackend {
|
|
|
234
234
|
* provides a unified approach that works across all platforms.
|
|
235
235
|
*/
|
|
236
236
|
hasNativeSync(): boolean;
|
|
237
|
+
/**
|
|
238
|
+
* Check whether CrdtFs is currently enabled.
|
|
239
|
+
*/
|
|
240
|
+
isCrdtEnabled(): boolean;
|
|
237
241
|
/**
|
|
238
242
|
* Unsubscribe from filesystem events.
|
|
239
243
|
*
|
|
@@ -281,6 +285,14 @@ export class DiaryxBackend {
|
|
|
281
285
|
* Config keys are stored as `diaryx_*` properties.
|
|
282
286
|
*/
|
|
283
287
|
saveConfig(config_js: any): Promise<any>;
|
|
288
|
+
/**
|
|
289
|
+
* Enable or disable the CrdtFs decorator.
|
|
290
|
+
*
|
|
291
|
+
* When disabled, file writes pass through to storage without updating CRDTs.
|
|
292
|
+
* CrdtFs starts disabled by default and should be enabled after sync
|
|
293
|
+
* handshake completes (or immediately in local-only mode).
|
|
294
|
+
*/
|
|
295
|
+
setCrdtEnabled(enabled: boolean): void;
|
|
284
296
|
/**
|
|
285
297
|
* Write binary file.
|
|
286
298
|
*
|
|
@@ -458,10 +470,12 @@ export interface InitOutput {
|
|
|
458
470
|
readonly diaryxbackend_executeJs: (a: number, b: any) => any;
|
|
459
471
|
readonly diaryxbackend_getConfig: (a: number) => any;
|
|
460
472
|
readonly diaryxbackend_hasNativeSync: (a: number) => number;
|
|
473
|
+
readonly diaryxbackend_isCrdtEnabled: (a: number) => number;
|
|
461
474
|
readonly diaryxbackend_offFileSystemEvent: (a: number, b: bigint) => number;
|
|
462
475
|
readonly diaryxbackend_onFileSystemEvent: (a: number, b: any) => bigint;
|
|
463
476
|
readonly diaryxbackend_readBinary: (a: number, b: number, c: number) => any;
|
|
464
477
|
readonly diaryxbackend_saveConfig: (a: number, b: any) => any;
|
|
478
|
+
readonly diaryxbackend_setCrdtEnabled: (a: number, b: number) => void;
|
|
465
479
|
readonly diaryxbackend_writeBinary: (a: number, b: number, c: number, d: any) => any;
|
|
466
480
|
readonly now_timestamp: () => [number, number];
|
|
467
481
|
readonly today_formatted: (a: number, b: number) => [number, number];
|
|
@@ -482,10 +496,10 @@ export interface InitOutput {
|
|
|
482
496
|
readonly wasmsyncclient_queueLocalUpdate: (a: number, b: number, c: number, d: number, e: number) => any;
|
|
483
497
|
readonly wasmsyncclient_setSessionCode: (a: number, b: number, c: number) => void;
|
|
484
498
|
readonly wasmsyncclient_unfocusFiles: (a: number, b: number, c: number) => void;
|
|
499
|
+
readonly init: () => void;
|
|
485
500
|
readonly __wbg_jsasyncfilesystem_free: (a: number, b: number) => void;
|
|
486
501
|
readonly jsasyncfilesystem_has_callback: (a: number, b: number, c: number) => number;
|
|
487
502
|
readonly jsasyncfilesystem_new: (a: any) => number;
|
|
488
|
-
readonly init: () => void;
|
|
489
503
|
readonly wasm_bindgen__closure__destroy__h358403ff5b31de35: (a: number, b: number) => void;
|
|
490
504
|
readonly wasm_bindgen__convert__closures_____invoke__h9824f9855d7aa260: (a: number, b: number, c: any, d: any) => void;
|
|
491
505
|
readonly wasm_bindgen__convert__closures_____invoke__h4b881ac518a5291a: (a: number, b: number, c: any) => void;
|
package/diaryx_wasm.js
CHANGED
|
@@ -214,6 +214,14 @@ export class DiaryxBackend {
|
|
|
214
214
|
const ret = wasm.diaryxbackend_hasNativeSync(this.__wbg_ptr);
|
|
215
215
|
return ret !== 0;
|
|
216
216
|
}
|
|
217
|
+
/**
|
|
218
|
+
* Check whether CrdtFs is currently enabled.
|
|
219
|
+
* @returns {boolean}
|
|
220
|
+
*/
|
|
221
|
+
isCrdtEnabled() {
|
|
222
|
+
const ret = wasm.diaryxbackend_isCrdtEnabled(this.__wbg_ptr);
|
|
223
|
+
return ret !== 0;
|
|
224
|
+
}
|
|
217
225
|
/**
|
|
218
226
|
* Unsubscribe from filesystem events.
|
|
219
227
|
*
|
|
@@ -283,6 +291,17 @@ export class DiaryxBackend {
|
|
|
283
291
|
const ret = wasm.diaryxbackend_saveConfig(this.__wbg_ptr, config_js);
|
|
284
292
|
return ret;
|
|
285
293
|
}
|
|
294
|
+
/**
|
|
295
|
+
* Enable or disable the CrdtFs decorator.
|
|
296
|
+
*
|
|
297
|
+
* When disabled, file writes pass through to storage without updating CRDTs.
|
|
298
|
+
* CrdtFs starts disabled by default and should be enabled after sync
|
|
299
|
+
* handshake completes (or immediately in local-only mode).
|
|
300
|
+
* @param {boolean} enabled
|
|
301
|
+
*/
|
|
302
|
+
setCrdtEnabled(enabled) {
|
|
303
|
+
wasm.diaryxbackend_setCrdtEnabled(this.__wbg_ptr, enabled);
|
|
304
|
+
}
|
|
286
305
|
/**
|
|
287
306
|
* Write binary file.
|
|
288
307
|
*
|
|
@@ -984,7 +1003,7 @@ function __wbg_get_imports() {
|
|
|
984
1003
|
console.warn(arg0, arg1, arg2, arg3);
|
|
985
1004
|
},
|
|
986
1005
|
__wbindgen_cast_0000000000000001: function(arg0, arg1) {
|
|
987
|
-
// Cast intrinsic for `Closure(Closure { dtor_idx:
|
|
1006
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 609, function: Function { arguments: [Externref], shim_idx: 610, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
988
1007
|
const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__h358403ff5b31de35, wasm_bindgen__convert__closures_____invoke__h4b881ac518a5291a);
|
|
989
1008
|
return ret;
|
|
990
1009
|
},
|
package/diaryx_wasm_bg.wasm
CHANGED
|
Binary file
|
package/diaryx_wasm_bg.wasm.d.ts
CHANGED
|
@@ -12,10 +12,12 @@ export const diaryxbackend_execute: (a: number, b: number, c: number) => any;
|
|
|
12
12
|
export const diaryxbackend_executeJs: (a: number, b: any) => any;
|
|
13
13
|
export const diaryxbackend_getConfig: (a: number) => any;
|
|
14
14
|
export const diaryxbackend_hasNativeSync: (a: number) => number;
|
|
15
|
+
export const diaryxbackend_isCrdtEnabled: (a: number) => number;
|
|
15
16
|
export const diaryxbackend_offFileSystemEvent: (a: number, b: bigint) => number;
|
|
16
17
|
export const diaryxbackend_onFileSystemEvent: (a: number, b: any) => bigint;
|
|
17
18
|
export const diaryxbackend_readBinary: (a: number, b: number, c: number) => any;
|
|
18
19
|
export const diaryxbackend_saveConfig: (a: number, b: any) => any;
|
|
20
|
+
export const diaryxbackend_setCrdtEnabled: (a: number, b: number) => void;
|
|
19
21
|
export const diaryxbackend_writeBinary: (a: number, b: number, c: number, d: any) => any;
|
|
20
22
|
export const now_timestamp: () => [number, number];
|
|
21
23
|
export const today_formatted: (a: number, b: number) => [number, number];
|
|
@@ -36,10 +38,10 @@ export const wasmsyncclient_pollOutgoingText: (a: number) => [number, number];
|
|
|
36
38
|
export const wasmsyncclient_queueLocalUpdate: (a: number, b: number, c: number, d: number, e: number) => any;
|
|
37
39
|
export const wasmsyncclient_setSessionCode: (a: number, b: number, c: number) => void;
|
|
38
40
|
export const wasmsyncclient_unfocusFiles: (a: number, b: number, c: number) => void;
|
|
41
|
+
export const init: () => void;
|
|
39
42
|
export const __wbg_jsasyncfilesystem_free: (a: number, b: number) => void;
|
|
40
43
|
export const jsasyncfilesystem_has_callback: (a: number, b: number, c: number) => number;
|
|
41
44
|
export const jsasyncfilesystem_new: (a: any) => number;
|
|
42
|
-
export const init: () => void;
|
|
43
45
|
export const wasm_bindgen__closure__destroy__h358403ff5b31de35: (a: number, b: number) => void;
|
|
44
46
|
export const wasm_bindgen__convert__closures_____invoke__h9824f9855d7aa260: (a: number, b: number, c: any, d: any) => void;
|
|
45
47
|
export const wasm_bindgen__convert__closures_____invoke__h4b881ac518a5291a: (a: number, b: number, c: any) => void;
|
package/package.json
CHANGED