@diaryx/wasm 0.14.0-dev.62fc475 → 0.14.1-dev.edddcd2
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 +25 -13
- package/diaryx_wasm.js +34 -13
- package/diaryx_wasm_bg.wasm.d.ts +12 -11
- package/package.json +1 -1
package/diaryx_wasm.d.ts
CHANGED
|
@@ -160,10 +160,13 @@ export class DiaryxBackend {
|
|
|
160
160
|
/**
|
|
161
161
|
* Create a new DiaryxBackend with IndexedDB storage.
|
|
162
162
|
*
|
|
163
|
+
* When `db_name` is provided, uses `"diaryx-{db_name}"` as the database name,
|
|
164
|
+
* allowing per-workspace isolation. When `None`, uses the legacy database name.
|
|
165
|
+
*
|
|
163
166
|
* This attempts to use persistent SQLite-based CRDT storage (via sql.js).
|
|
164
167
|
* If SQLite storage is not available, falls back to in-memory CRDT storage.
|
|
165
168
|
*/
|
|
166
|
-
static createIndexedDb(): Promise<DiaryxBackend>;
|
|
169
|
+
static createIndexedDb(db_name?: string | null): Promise<DiaryxBackend>;
|
|
167
170
|
/**
|
|
168
171
|
* Create a new DiaryxBackend with OPFS storage.
|
|
169
172
|
*
|
|
@@ -374,11 +377,19 @@ export class IndexedDbFileSystem {
|
|
|
374
377
|
free(): void;
|
|
375
378
|
[Symbol.dispose](): void;
|
|
376
379
|
/**
|
|
377
|
-
* Create a new IndexedDbFileSystem.
|
|
380
|
+
* Create a new IndexedDbFileSystem with the default database name.
|
|
378
381
|
*
|
|
379
382
|
* Opens or creates the IndexedDB database with the required object stores.
|
|
380
383
|
*/
|
|
381
384
|
static create(): Promise<IndexedDbFileSystem>;
|
|
385
|
+
/**
|
|
386
|
+
* Create a new IndexedDbFileSystem with an optional custom database name.
|
|
387
|
+
*
|
|
388
|
+
* When `db_name` is provided, uses `"diaryx-{db_name}"` as the database name,
|
|
389
|
+
* allowing multiple isolated IndexedDB databases (one per workspace).
|
|
390
|
+
* When `None`, uses the legacy `"diaryx"` database name.
|
|
391
|
+
*/
|
|
392
|
+
static createWithName(db_name?: string | null): Promise<IndexedDbFileSystem>;
|
|
382
393
|
}
|
|
383
394
|
|
|
384
395
|
/**
|
|
@@ -561,11 +572,12 @@ export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembl
|
|
|
561
572
|
|
|
562
573
|
export interface InitOutput {
|
|
563
574
|
readonly memory: WebAssembly.Memory;
|
|
564
|
-
readonly init: () => void;
|
|
565
575
|
readonly __wbg_jsasyncfilesystem_free: (a: number, b: number) => void;
|
|
566
576
|
readonly __wbg_wasmsyncclient_free: (a: number, b: number) => void;
|
|
567
577
|
readonly jsasyncfilesystem_has_callback: (a: number, b: number, c: number) => number;
|
|
568
578
|
readonly jsasyncfilesystem_new: (a: any) => number;
|
|
579
|
+
readonly now_timestamp: () => [number, number];
|
|
580
|
+
readonly today_formatted: (a: number, b: number) => [number, number];
|
|
569
581
|
readonly wasmsyncclient_focusFiles: (a: number, b: number, c: number) => void;
|
|
570
582
|
readonly wasmsyncclient_getServerUrl: (a: number) => [number, number];
|
|
571
583
|
readonly wasmsyncclient_getWorkspaceId: (a: number) => [number, number];
|
|
@@ -583,15 +595,12 @@ export interface InitOutput {
|
|
|
583
595
|
readonly wasmsyncclient_queueLocalUpdate: (a: number, b: number, c: number, d: number, e: number) => any;
|
|
584
596
|
readonly wasmsyncclient_setSessionCode: (a: number, b: number, c: number) => void;
|
|
585
597
|
readonly wasmsyncclient_unfocusFiles: (a: number, b: number, c: number) => void;
|
|
586
|
-
readonly
|
|
587
|
-
readonly __wbg_indexeddbfilesystem_free: (a: number, b: number) => void;
|
|
588
|
-
readonly fsafilesystem_fromHandle: (a: any) => number;
|
|
589
|
-
readonly indexeddbfilesystem_create: () => any;
|
|
598
|
+
readonly init: () => void;
|
|
590
599
|
readonly __wbg_diaryxbackend_free: (a: number, b: number) => void;
|
|
591
600
|
readonly diaryxbackend_create: (a: number, b: number) => any;
|
|
592
601
|
readonly diaryxbackend_createFromDirectoryHandle: (a: any) => [number, number, number];
|
|
593
602
|
readonly diaryxbackend_createInMemory: () => [number, number, number];
|
|
594
|
-
readonly diaryxbackend_createIndexedDb: () => any;
|
|
603
|
+
readonly diaryxbackend_createIndexedDb: (a: number, b: number) => any;
|
|
595
604
|
readonly diaryxbackend_createOpfs: (a: number, b: number) => any;
|
|
596
605
|
readonly diaryxbackend_createSyncClient: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => number;
|
|
597
606
|
readonly diaryxbackend_emitFileSystemEvent: (a: number, b: number, c: number) => [number, number];
|
|
@@ -608,16 +617,19 @@ export interface InitOutput {
|
|
|
608
617
|
readonly diaryxbackend_setCrdtEnabled: (a: number, b: number) => void;
|
|
609
618
|
readonly diaryxbackend_writeBinary: (a: number, b: number, c: number, d: any) => any;
|
|
610
619
|
readonly __wbg_opfsfilesystem_free: (a: number, b: number) => void;
|
|
611
|
-
readonly now_timestamp: () => [number, number];
|
|
612
620
|
readonly opfsfilesystem_create: () => any;
|
|
613
621
|
readonly opfsfilesystem_createWithName: (a: number, b: number) => any;
|
|
614
|
-
readonly
|
|
615
|
-
readonly
|
|
622
|
+
readonly __wbg_fsafilesystem_free: (a: number, b: number) => void;
|
|
623
|
+
readonly __wbg_indexeddbfilesystem_free: (a: number, b: number) => void;
|
|
624
|
+
readonly fsafilesystem_fromHandle: (a: any) => number;
|
|
625
|
+
readonly indexeddbfilesystem_create: () => any;
|
|
626
|
+
readonly indexeddbfilesystem_createWithName: (a: number, b: number) => any;
|
|
627
|
+
readonly wasm_bindgen__closure__destroy__h5cf84bf235290ebc: (a: number, b: number) => void;
|
|
616
628
|
readonly wasm_bindgen__closure__destroy__h54a6b627d1123dca: (a: number, b: number) => void;
|
|
617
629
|
readonly wasm_bindgen__closure__destroy__h440f08373ff30a05: (a: number, b: number) => void;
|
|
618
|
-
readonly
|
|
630
|
+
readonly wasm_bindgen__convert__closures_____invoke__hc572673c1045459b: (a: number, b: number, c: any) => [number, number];
|
|
619
631
|
readonly wasm_bindgen__convert__closures_____invoke__h4e796b59e8c15a06: (a: number, b: number, c: any, d: any) => void;
|
|
620
|
-
readonly
|
|
632
|
+
readonly wasm_bindgen__convert__closures_____invoke__ha33a9e9fcc79e021: (a: number, b: number, c: any) => void;
|
|
621
633
|
readonly wasm_bindgen__convert__closures_____invoke__h7d21c95eeb3011e3: (a: number, b: number, c: any) => void;
|
|
622
634
|
readonly wasm_bindgen__convert__closures_____invoke__h359356b1e0b37746: (a: number, b: number, c: any) => void;
|
|
623
635
|
readonly __wbindgen_malloc: (a: number, b: number) => number;
|
package/diaryx_wasm.js
CHANGED
|
@@ -103,12 +103,18 @@ export class DiaryxBackend {
|
|
|
103
103
|
/**
|
|
104
104
|
* Create a new DiaryxBackend with IndexedDB storage.
|
|
105
105
|
*
|
|
106
|
+
* When `db_name` is provided, uses `"diaryx-{db_name}"` as the database name,
|
|
107
|
+
* allowing per-workspace isolation. When `None`, uses the legacy database name.
|
|
108
|
+
*
|
|
106
109
|
* This attempts to use persistent SQLite-based CRDT storage (via sql.js).
|
|
107
110
|
* If SQLite storage is not available, falls back to in-memory CRDT storage.
|
|
111
|
+
* @param {string | null} [db_name]
|
|
108
112
|
* @returns {Promise<DiaryxBackend>}
|
|
109
113
|
*/
|
|
110
|
-
static createIndexedDb() {
|
|
111
|
-
|
|
114
|
+
static createIndexedDb(db_name) {
|
|
115
|
+
var ptr0 = isLikeNone(db_name) ? 0 : passStringToWasm0(db_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
116
|
+
var len0 = WASM_VECTOR_LEN;
|
|
117
|
+
const ret = wasm.diaryxbackend_createIndexedDb(ptr0, len0);
|
|
112
118
|
return ret;
|
|
113
119
|
}
|
|
114
120
|
/**
|
|
@@ -445,7 +451,7 @@ export class IndexedDbFileSystem {
|
|
|
445
451
|
wasm.__wbg_indexeddbfilesystem_free(ptr, 0);
|
|
446
452
|
}
|
|
447
453
|
/**
|
|
448
|
-
* Create a new IndexedDbFileSystem.
|
|
454
|
+
* Create a new IndexedDbFileSystem with the default database name.
|
|
449
455
|
*
|
|
450
456
|
* Opens or creates the IndexedDB database with the required object stores.
|
|
451
457
|
* @returns {Promise<IndexedDbFileSystem>}
|
|
@@ -454,6 +460,21 @@ export class IndexedDbFileSystem {
|
|
|
454
460
|
const ret = wasm.indexeddbfilesystem_create();
|
|
455
461
|
return ret;
|
|
456
462
|
}
|
|
463
|
+
/**
|
|
464
|
+
* Create a new IndexedDbFileSystem with an optional custom database name.
|
|
465
|
+
*
|
|
466
|
+
* When `db_name` is provided, uses `"diaryx-{db_name}"` as the database name,
|
|
467
|
+
* allowing multiple isolated IndexedDB databases (one per workspace).
|
|
468
|
+
* When `None`, uses the legacy `"diaryx"` database name.
|
|
469
|
+
* @param {string | null} [db_name]
|
|
470
|
+
* @returns {Promise<IndexedDbFileSystem>}
|
|
471
|
+
*/
|
|
472
|
+
static createWithName(db_name) {
|
|
473
|
+
var ptr0 = isLikeNone(db_name) ? 0 : passStringToWasm0(db_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
474
|
+
var len0 = WASM_VECTOR_LEN;
|
|
475
|
+
const ret = wasm.indexeddbfilesystem_createWithName(ptr0, len0);
|
|
476
|
+
return ret;
|
|
477
|
+
}
|
|
457
478
|
}
|
|
458
479
|
if (Symbol.dispose) IndexedDbFileSystem.prototype[Symbol.dispose] = IndexedDbFileSystem.prototype.free;
|
|
459
480
|
|
|
@@ -1517,22 +1538,22 @@ function __wbg_get_imports() {
|
|
|
1517
1538
|
return ret;
|
|
1518
1539
|
}, arguments); },
|
|
1519
1540
|
__wbindgen_cast_0000000000000001: function(arg0, arg1) {
|
|
1520
|
-
// Cast intrinsic for `Closure(Closure { dtor_idx:
|
|
1521
|
-
const ret = makeMutClosure(arg0, arg1, wasm.
|
|
1541
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 574, function: Function { arguments: [NamedExternref("Event")], shim_idx: 552, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
|
|
1542
|
+
const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__h5cf84bf235290ebc, wasm_bindgen__convert__closures_____invoke__hc572673c1045459b);
|
|
1522
1543
|
return ret;
|
|
1523
1544
|
},
|
|
1524
1545
|
__wbindgen_cast_0000000000000002: function(arg0, arg1) {
|
|
1525
|
-
// Cast intrinsic for `Closure(Closure { dtor_idx:
|
|
1526
|
-
const ret = makeMutClosure(arg0, arg1, wasm.
|
|
1546
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 574, function: Function { arguments: [NamedExternref("IDBVersionChangeEvent")], shim_idx: 551, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
1547
|
+
const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__h5cf84bf235290ebc, wasm_bindgen__convert__closures_____invoke__ha33a9e9fcc79e021);
|
|
1527
1548
|
return ret;
|
|
1528
1549
|
},
|
|
1529
1550
|
__wbindgen_cast_0000000000000003: function(arg0, arg1) {
|
|
1530
|
-
// Cast intrinsic for `Closure(Closure { dtor_idx:
|
|
1551
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 785, function: Function { arguments: [NamedExternref("Event")], shim_idx: 786, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
1531
1552
|
const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__h54a6b627d1123dca, wasm_bindgen__convert__closures_____invoke__h7d21c95eeb3011e3);
|
|
1532
1553
|
return ret;
|
|
1533
1554
|
},
|
|
1534
1555
|
__wbindgen_cast_0000000000000004: function(arg0, arg1) {
|
|
1535
|
-
// Cast intrinsic for `Closure(Closure { dtor_idx:
|
|
1556
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 811, function: Function { arguments: [Externref], shim_idx: 812, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
1536
1557
|
const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__h440f08373ff30a05, wasm_bindgen__convert__closures_____invoke__h359356b1e0b37746);
|
|
1537
1558
|
return ret;
|
|
1538
1559
|
},
|
|
@@ -1577,8 +1598,8 @@ function __wbg_get_imports() {
|
|
|
1577
1598
|
};
|
|
1578
1599
|
}
|
|
1579
1600
|
|
|
1580
|
-
function
|
|
1581
|
-
wasm.
|
|
1601
|
+
function wasm_bindgen__convert__closures_____invoke__ha33a9e9fcc79e021(arg0, arg1, arg2) {
|
|
1602
|
+
wasm.wasm_bindgen__convert__closures_____invoke__ha33a9e9fcc79e021(arg0, arg1, arg2);
|
|
1582
1603
|
}
|
|
1583
1604
|
|
|
1584
1605
|
function wasm_bindgen__convert__closures_____invoke__h7d21c95eeb3011e3(arg0, arg1, arg2) {
|
|
@@ -1589,8 +1610,8 @@ function wasm_bindgen__convert__closures_____invoke__h359356b1e0b37746(arg0, arg
|
|
|
1589
1610
|
wasm.wasm_bindgen__convert__closures_____invoke__h359356b1e0b37746(arg0, arg1, arg2);
|
|
1590
1611
|
}
|
|
1591
1612
|
|
|
1592
|
-
function
|
|
1593
|
-
const ret = wasm.
|
|
1613
|
+
function wasm_bindgen__convert__closures_____invoke__hc572673c1045459b(arg0, arg1, arg2) {
|
|
1614
|
+
const ret = wasm.wasm_bindgen__convert__closures_____invoke__hc572673c1045459b(arg0, arg1, arg2);
|
|
1594
1615
|
if (ret[1]) {
|
|
1595
1616
|
throw takeFromExternrefTable0(ret[0]);
|
|
1596
1617
|
}
|
package/diaryx_wasm_bg.wasm.d.ts
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
export const memory: WebAssembly.Memory;
|
|
4
|
-
export const init: () => void;
|
|
5
4
|
export const __wbg_jsasyncfilesystem_free: (a: number, b: number) => void;
|
|
6
5
|
export const __wbg_wasmsyncclient_free: (a: number, b: number) => void;
|
|
7
6
|
export const jsasyncfilesystem_has_callback: (a: number, b: number, c: number) => number;
|
|
8
7
|
export const jsasyncfilesystem_new: (a: any) => number;
|
|
8
|
+
export const now_timestamp: () => [number, number];
|
|
9
|
+
export const today_formatted: (a: number, b: number) => [number, number];
|
|
9
10
|
export const wasmsyncclient_focusFiles: (a: number, b: number, c: number) => void;
|
|
10
11
|
export const wasmsyncclient_getServerUrl: (a: number) => [number, number];
|
|
11
12
|
export const wasmsyncclient_getWorkspaceId: (a: number) => [number, number];
|
|
@@ -23,15 +24,12 @@ export const wasmsyncclient_pollOutgoingText: (a: number) => [number, number];
|
|
|
23
24
|
export const wasmsyncclient_queueLocalUpdate: (a: number, b: number, c: number, d: number, e: number) => any;
|
|
24
25
|
export const wasmsyncclient_setSessionCode: (a: number, b: number, c: number) => void;
|
|
25
26
|
export const wasmsyncclient_unfocusFiles: (a: number, b: number, c: number) => void;
|
|
26
|
-
export const
|
|
27
|
-
export const __wbg_indexeddbfilesystem_free: (a: number, b: number) => void;
|
|
28
|
-
export const fsafilesystem_fromHandle: (a: any) => number;
|
|
29
|
-
export const indexeddbfilesystem_create: () => any;
|
|
27
|
+
export const init: () => void;
|
|
30
28
|
export const __wbg_diaryxbackend_free: (a: number, b: number) => void;
|
|
31
29
|
export const diaryxbackend_create: (a: number, b: number) => any;
|
|
32
30
|
export const diaryxbackend_createFromDirectoryHandle: (a: any) => [number, number, number];
|
|
33
31
|
export const diaryxbackend_createInMemory: () => [number, number, number];
|
|
34
|
-
export const diaryxbackend_createIndexedDb: () => any;
|
|
32
|
+
export const diaryxbackend_createIndexedDb: (a: number, b: number) => any;
|
|
35
33
|
export const diaryxbackend_createOpfs: (a: number, b: number) => any;
|
|
36
34
|
export const diaryxbackend_createSyncClient: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => number;
|
|
37
35
|
export const diaryxbackend_emitFileSystemEvent: (a: number, b: number, c: number) => [number, number];
|
|
@@ -48,16 +46,19 @@ export const diaryxbackend_saveConfig: (a: number, b: any) => any;
|
|
|
48
46
|
export const diaryxbackend_setCrdtEnabled: (a: number, b: number) => void;
|
|
49
47
|
export const diaryxbackend_writeBinary: (a: number, b: number, c: number, d: any) => any;
|
|
50
48
|
export const __wbg_opfsfilesystem_free: (a: number, b: number) => void;
|
|
51
|
-
export const now_timestamp: () => [number, number];
|
|
52
49
|
export const opfsfilesystem_create: () => any;
|
|
53
50
|
export const opfsfilesystem_createWithName: (a: number, b: number) => any;
|
|
54
|
-
export const
|
|
55
|
-
export const
|
|
51
|
+
export const __wbg_fsafilesystem_free: (a: number, b: number) => void;
|
|
52
|
+
export const __wbg_indexeddbfilesystem_free: (a: number, b: number) => void;
|
|
53
|
+
export const fsafilesystem_fromHandle: (a: any) => number;
|
|
54
|
+
export const indexeddbfilesystem_create: () => any;
|
|
55
|
+
export const indexeddbfilesystem_createWithName: (a: number, b: number) => any;
|
|
56
|
+
export const wasm_bindgen__closure__destroy__h5cf84bf235290ebc: (a: number, b: number) => void;
|
|
56
57
|
export const wasm_bindgen__closure__destroy__h54a6b627d1123dca: (a: number, b: number) => void;
|
|
57
58
|
export const wasm_bindgen__closure__destroy__h440f08373ff30a05: (a: number, b: number) => void;
|
|
58
|
-
export const
|
|
59
|
+
export const wasm_bindgen__convert__closures_____invoke__hc572673c1045459b: (a: number, b: number, c: any) => [number, number];
|
|
59
60
|
export const wasm_bindgen__convert__closures_____invoke__h4e796b59e8c15a06: (a: number, b: number, c: any, d: any) => void;
|
|
60
|
-
export const
|
|
61
|
+
export const wasm_bindgen__convert__closures_____invoke__ha33a9e9fcc79e021: (a: number, b: number, c: any) => void;
|
|
61
62
|
export const wasm_bindgen__convert__closures_____invoke__h7d21c95eeb3011e3: (a: number, b: number, c: any) => void;
|
|
62
63
|
export const wasm_bindgen__convert__closures_____invoke__h359356b1e0b37746: (a: number, b: number, c: any) => void;
|
|
63
64
|
export const __wbindgen_malloc: (a: number, b: number) => number;
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@diaryx/wasm",
|
|
3
3
|
"type": "module",
|
|
4
4
|
"description": "WebAssembly bindings for Diaryx core functionality",
|
|
5
|
-
"version": "0.14.
|
|
5
|
+
"version": "0.14.1-dev.edddcd2",
|
|
6
6
|
"license": "SEE LICENSE IN ../../LICENSE.md",
|
|
7
7
|
"repository": {
|
|
8
8
|
"type": "git",
|