@diaryx/wasm 1.1.0-dev.f174888 → 1.2.0-dev.b48ccde
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/README.md +66 -0
- package/diaryx_wasm.d.ts +64 -14
- package/diaryx_wasm.js +136 -10
- package/diaryx_wasm_bg.wasm.d.ts +17 -14
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -360,6 +360,72 @@ CRDT operations use `doc_type` to specify which document to operate on:
|
|
|
360
360
|
| `body` | file path | Per-file body content (e.g., `notes/a.md`) |
|
|
361
361
|
|
|
362
362
|
|
|
363
|
+
## Node.js / Obsidian / Electron Usage
|
|
364
|
+
|
|
365
|
+
The `@diaryx/wasm-node` npm package is a build of this crate without browser-specific storage backends. It's published automatically by CI and works in any JavaScript environment that supports WebAssembly.
|
|
366
|
+
|
|
367
|
+
### Setup
|
|
368
|
+
|
|
369
|
+
```javascript
|
|
370
|
+
import init, { DiaryxBackend } from '@diaryx/wasm-node';
|
|
371
|
+
import fs from 'fs';
|
|
372
|
+
|
|
373
|
+
// Load WASM binary and initialize
|
|
374
|
+
const wasmPath = new URL('./diaryx_wasm_bg.wasm', import.meta.url);
|
|
375
|
+
await init(fs.readFileSync(wasmPath));
|
|
376
|
+
|
|
377
|
+
// Create backend with JavaScript filesystem callbacks
|
|
378
|
+
const backend = DiaryxBackend.createFromJsFileSystem({
|
|
379
|
+
readToString: (path) => fs.promises.readFile(path, 'utf8'),
|
|
380
|
+
writeFile: (path, content) => fs.promises.writeFile(path, content),
|
|
381
|
+
exists: (path) => fs.promises.access(path).then(() => true).catch(() => false),
|
|
382
|
+
isDir: (path) => fs.promises.stat(path).then(s => s.isDirectory()).catch(() => false),
|
|
383
|
+
listFiles: (dir) => fs.promises.readdir(dir),
|
|
384
|
+
listMdFiles: (dir) => fs.promises.readdir(dir).then(f => f.filter(n => n.endsWith('.md'))),
|
|
385
|
+
createDirAll: (path) => fs.promises.mkdir(path, { recursive: true }),
|
|
386
|
+
moveFile: (from, to) => fs.promises.rename(from, to),
|
|
387
|
+
deleteFile: (path) => fs.promises.unlink(path),
|
|
388
|
+
readBinary: (path) => fs.promises.readFile(path),
|
|
389
|
+
writeBinary: (path, data) => fs.promises.writeFile(path, data),
|
|
390
|
+
});
|
|
391
|
+
```
|
|
392
|
+
|
|
393
|
+
### Obsidian Plugin Integration
|
|
394
|
+
|
|
395
|
+
For Obsidian plugins, bridge the Vault adapter API:
|
|
396
|
+
|
|
397
|
+
```javascript
|
|
398
|
+
const backend = DiaryxBackend.createFromJsFileSystem({
|
|
399
|
+
readToString: (path) => app.vault.adapter.read(path),
|
|
400
|
+
writeFile: (path, content) => app.vault.adapter.write(path, content),
|
|
401
|
+
exists: (path) => app.vault.adapter.exists(path),
|
|
402
|
+
isDir: (path) => app.vault.adapter.stat(path).then(s => s?.type === 'folder'),
|
|
403
|
+
listFiles: (dir) => app.vault.adapter.list(dir).then(r => [...r.files, ...r.folders]),
|
|
404
|
+
listMdFiles: (dir) => app.vault.adapter.list(dir).then(r => r.files.filter(f => f.endsWith('.md'))),
|
|
405
|
+
createDirAll: (path) => app.vault.adapter.mkdir(path),
|
|
406
|
+
moveFile: (from, to) => app.vault.adapter.rename(from, to),
|
|
407
|
+
deleteFile: (path) => app.vault.adapter.remove(path),
|
|
408
|
+
readBinary: (path) => app.vault.adapter.readBinary(path),
|
|
409
|
+
writeBinary: (path, data) => app.vault.adapter.writeBinary(path, data),
|
|
410
|
+
});
|
|
411
|
+
```
|
|
412
|
+
|
|
413
|
+
### Reacting to External File Moves
|
|
414
|
+
|
|
415
|
+
When an external tool (Obsidian, VS Code, etc.) has already moved a file, use `SyncMoveMetadata` to update the workspace hierarchy metadata without re-doing the filesystem move:
|
|
416
|
+
|
|
417
|
+
```javascript
|
|
418
|
+
// Obsidian fires this after a file is moved/renamed
|
|
419
|
+
app.vault.on('rename', async (file, oldPath) => {
|
|
420
|
+
await backend.executeJs({
|
|
421
|
+
type: 'SyncMoveMetadata',
|
|
422
|
+
params: { old_path: oldPath, new_path: file.path }
|
|
423
|
+
});
|
|
424
|
+
});
|
|
425
|
+
```
|
|
426
|
+
|
|
427
|
+
This updates `contents` in the old and new parent indexes and `part_of` in the moved file.
|
|
428
|
+
|
|
363
429
|
## Error Handling
|
|
364
430
|
|
|
365
431
|
All methods return `Result<T, JsValue>` for JavaScript interop. Errors are converted to JavaScript exceptions with descriptive messages.
|
package/diaryx_wasm.d.ts
CHANGED
|
@@ -140,6 +140,24 @@ export class DiaryxBackend {
|
|
|
140
140
|
* ```
|
|
141
141
|
*/
|
|
142
142
|
static createFromDirectoryHandle(handle: FileSystemDirectoryHandle): DiaryxBackend;
|
|
143
|
+
/**
|
|
144
|
+
* Create a new DiaryxBackend backed by JavaScript filesystem callbacks.
|
|
145
|
+
*
|
|
146
|
+
* This is the primary way to use diaryx from non-browser environments
|
|
147
|
+
* (Node.js, Obsidian, Electron). The `callbacks` object must implement
|
|
148
|
+
* the `JsFileSystemCallbacks` interface.
|
|
149
|
+
*
|
|
150
|
+
* ## Example
|
|
151
|
+
* ```javascript
|
|
152
|
+
* const backend = DiaryxBackend.createFromJsFileSystem({
|
|
153
|
+
* readToString: async (path) => fs.readFile(path, 'utf8'),
|
|
154
|
+
* writeFile: async (path, content) => fs.writeFile(path, content),
|
|
155
|
+
* exists: async (path) => fs.access(path).then(() => true).catch(() => false),
|
|
156
|
+
* // ... other callbacks
|
|
157
|
+
* });
|
|
158
|
+
* ```
|
|
159
|
+
*/
|
|
160
|
+
static createFromJsFileSystem(callbacks: any): DiaryxBackend;
|
|
143
161
|
/**
|
|
144
162
|
* Create a new DiaryxBackend with in-memory storage.
|
|
145
163
|
*
|
|
@@ -321,6 +339,35 @@ export class DiaryxBackend {
|
|
|
321
339
|
* ```
|
|
322
340
|
*/
|
|
323
341
|
onFileSystemEvent(callback: Function): bigint;
|
|
342
|
+
/**
|
|
343
|
+
* Parse a Day One export (ZIP or JSON) and return entries as JSON.
|
|
344
|
+
*
|
|
345
|
+
* Auto-detects the format: ZIP files (with media directories) have
|
|
346
|
+
* attachments populated with binary data. Plain JSON files are parsed
|
|
347
|
+
* with empty attachment data (backward compatible).
|
|
348
|
+
*
|
|
349
|
+
* ## Example
|
|
350
|
+
* ```javascript
|
|
351
|
+
* const bytes = new Uint8Array(await file.arrayBuffer());
|
|
352
|
+
* const result = backend.parseDayOneJson(bytes);
|
|
353
|
+
* const { entries, errors } = JSON.parse(result);
|
|
354
|
+
* ```
|
|
355
|
+
*/
|
|
356
|
+
parseDayOneJson(bytes: Uint8Array): string;
|
|
357
|
+
/**
|
|
358
|
+
* Parse a single markdown file and return the entry as JSON.
|
|
359
|
+
*
|
|
360
|
+
* Takes the raw bytes of a `.md` file and its filename, and returns
|
|
361
|
+
* a JSON-serialized `ImportedEntry`.
|
|
362
|
+
*
|
|
363
|
+
* ## Example
|
|
364
|
+
* ```javascript
|
|
365
|
+
* const bytes = new Uint8Array(await file.arrayBuffer());
|
|
366
|
+
* const entryJson = backend.parseMarkdownFile(bytes, file.name);
|
|
367
|
+
* const entry = JSON.parse(entryJson);
|
|
368
|
+
* ```
|
|
369
|
+
*/
|
|
370
|
+
parseMarkdownFile(bytes: Uint8Array, filename: string): string;
|
|
324
371
|
/**
|
|
325
372
|
* Read binary file.
|
|
326
373
|
*
|
|
@@ -579,10 +626,16 @@ export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembl
|
|
|
579
626
|
|
|
580
627
|
export interface InitOutput {
|
|
581
628
|
readonly memory: WebAssembly.Memory;
|
|
582
|
-
readonly
|
|
629
|
+
readonly __wbg_indexeddbfilesystem_free: (a: number, b: number) => void;
|
|
630
|
+
readonly __wbg_opfsfilesystem_free: (a: number, b: number) => void;
|
|
631
|
+
readonly indexeddbfilesystem_create: () => any;
|
|
632
|
+
readonly indexeddbfilesystem_createWithName: (a: number, b: number) => any;
|
|
633
|
+
readonly opfsfilesystem_create: () => any;
|
|
634
|
+
readonly opfsfilesystem_createWithName: (a: number, b: number) => any;
|
|
583
635
|
readonly __wbg_diaryxbackend_free: (a: number, b: number) => void;
|
|
584
636
|
readonly diaryxbackend_create: (a: number, b: number) => any;
|
|
585
637
|
readonly diaryxbackend_createFromDirectoryHandle: (a: any) => [number, number, number];
|
|
638
|
+
readonly diaryxbackend_createFromJsFileSystem: (a: any) => [number, number, number];
|
|
586
639
|
readonly diaryxbackend_createInMemory: () => [number, number, number];
|
|
587
640
|
readonly diaryxbackend_createIndexedDb: (a: number, b: number) => any;
|
|
588
641
|
readonly diaryxbackend_createOpfs: (a: number, b: number) => any;
|
|
@@ -596,14 +649,21 @@ export interface InitOutput {
|
|
|
596
649
|
readonly diaryxbackend_isCrdtEnabled: (a: number) => number;
|
|
597
650
|
readonly diaryxbackend_offFileSystemEvent: (a: number, b: bigint) => number;
|
|
598
651
|
readonly diaryxbackend_onFileSystemEvent: (a: number, b: any) => bigint;
|
|
652
|
+
readonly diaryxbackend_parseDayOneJson: (a: number, b: number, c: number) => [number, number, number, number];
|
|
653
|
+
readonly diaryxbackend_parseMarkdownFile: (a: number, b: number, c: number, d: number, e: number) => [number, number, number, number];
|
|
599
654
|
readonly diaryxbackend_readBinary: (a: number, b: number, c: number) => any;
|
|
600
655
|
readonly diaryxbackend_saveConfig: (a: number, b: any) => any;
|
|
601
656
|
readonly diaryxbackend_setCrdtEnabled: (a: number, b: number) => void;
|
|
602
657
|
readonly diaryxbackend_writeBinary: (a: number, b: number, c: number, d: any) => any;
|
|
658
|
+
readonly init: () => void;
|
|
659
|
+
readonly __wbg_fsafilesystem_free: (a: number, b: number) => void;
|
|
660
|
+
readonly fsafilesystem_fromHandle: (a: any) => number;
|
|
603
661
|
readonly __wbg_jsasyncfilesystem_free: (a: number, b: number) => void;
|
|
604
662
|
readonly __wbg_wasmsyncclient_free: (a: number, b: number) => void;
|
|
605
663
|
readonly jsasyncfilesystem_has_callback: (a: number, b: number, c: number) => number;
|
|
606
664
|
readonly jsasyncfilesystem_new: (a: any) => number;
|
|
665
|
+
readonly now_timestamp: () => [number, number];
|
|
666
|
+
readonly today_formatted: (a: number, b: number) => [number, number];
|
|
607
667
|
readonly wasmsyncclient_focusFiles: (a: number, b: number, c: number) => void;
|
|
608
668
|
readonly wasmsyncclient_getServerUrl: (a: number) => [number, number];
|
|
609
669
|
readonly wasmsyncclient_getWorkspaceId: (a: number) => [number, number];
|
|
@@ -622,22 +682,12 @@ export interface InitOutput {
|
|
|
622
682
|
readonly wasmsyncclient_setSessionCode: (a: number, b: number, c: number) => void;
|
|
623
683
|
readonly wasmsyncclient_syncBodyFiles: (a: number, b: number, c: number) => any;
|
|
624
684
|
readonly wasmsyncclient_unfocusFiles: (a: number, b: number, c: number) => void;
|
|
625
|
-
readonly
|
|
626
|
-
readonly __wbg_indexeddbfilesystem_free: (a: number, b: number) => void;
|
|
627
|
-
readonly fsafilesystem_fromHandle: (a: any) => number;
|
|
628
|
-
readonly indexeddbfilesystem_create: () => any;
|
|
629
|
-
readonly indexeddbfilesystem_createWithName: (a: number, b: number) => any;
|
|
630
|
-
readonly __wbg_opfsfilesystem_free: (a: number, b: number) => void;
|
|
631
|
-
readonly now_timestamp: () => [number, number];
|
|
632
|
-
readonly opfsfilesystem_create: () => any;
|
|
633
|
-
readonly opfsfilesystem_createWithName: (a: number, b: number) => any;
|
|
634
|
-
readonly today_formatted: (a: number, b: number) => [number, number];
|
|
635
|
-
readonly wasm_bindgen__closure__destroy__hfa094efcaf5741ee: (a: number, b: number) => void;
|
|
685
|
+
readonly wasm_bindgen__closure__destroy__h4c3bc21aabb0cdba: (a: number, b: number) => void;
|
|
636
686
|
readonly wasm_bindgen__closure__destroy__h54a6b627d1123dca: (a: number, b: number) => void;
|
|
637
687
|
readonly wasm_bindgen__closure__destroy__h440f08373ff30a05: (a: number, b: number) => void;
|
|
638
|
-
readonly
|
|
688
|
+
readonly wasm_bindgen__convert__closures_____invoke__hc73185828886e792: (a: number, b: number, c: any) => [number, number];
|
|
639
689
|
readonly wasm_bindgen__convert__closures_____invoke__h4e796b59e8c15a06: (a: number, b: number, c: any, d: any) => void;
|
|
640
|
-
readonly
|
|
690
|
+
readonly wasm_bindgen__convert__closures_____invoke__h307b88b750192cbb: (a: number, b: number, c: any) => void;
|
|
641
691
|
readonly wasm_bindgen__convert__closures_____invoke__h7d21c95eeb3011e3: (a: number, b: number, c: any) => void;
|
|
642
692
|
readonly wasm_bindgen__convert__closures_____invoke__h359356b1e0b37746: (a: number, b: number, c: any) => void;
|
|
643
693
|
readonly __wbindgen_malloc: (a: number, b: number) => number;
|
package/diaryx_wasm.js
CHANGED
|
@@ -76,6 +76,32 @@ export class DiaryxBackend {
|
|
|
76
76
|
}
|
|
77
77
|
return DiaryxBackend.__wrap(ret[0]);
|
|
78
78
|
}
|
|
79
|
+
/**
|
|
80
|
+
* Create a new DiaryxBackend backed by JavaScript filesystem callbacks.
|
|
81
|
+
*
|
|
82
|
+
* This is the primary way to use diaryx from non-browser environments
|
|
83
|
+
* (Node.js, Obsidian, Electron). The `callbacks` object must implement
|
|
84
|
+
* the `JsFileSystemCallbacks` interface.
|
|
85
|
+
*
|
|
86
|
+
* ## Example
|
|
87
|
+
* ```javascript
|
|
88
|
+
* const backend = DiaryxBackend.createFromJsFileSystem({
|
|
89
|
+
* readToString: async (path) => fs.readFile(path, 'utf8'),
|
|
90
|
+
* writeFile: async (path, content) => fs.writeFile(path, content),
|
|
91
|
+
* exists: async (path) => fs.access(path).then(() => true).catch(() => false),
|
|
92
|
+
* // ... other callbacks
|
|
93
|
+
* });
|
|
94
|
+
* ```
|
|
95
|
+
* @param {any} callbacks
|
|
96
|
+
* @returns {DiaryxBackend}
|
|
97
|
+
*/
|
|
98
|
+
static createFromJsFileSystem(callbacks) {
|
|
99
|
+
const ret = wasm.diaryxbackend_createFromJsFileSystem(callbacks);
|
|
100
|
+
if (ret[2]) {
|
|
101
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
102
|
+
}
|
|
103
|
+
return DiaryxBackend.__wrap(ret[0]);
|
|
104
|
+
}
|
|
79
105
|
/**
|
|
80
106
|
* Create a new DiaryxBackend with in-memory storage.
|
|
81
107
|
*
|
|
@@ -337,6 +363,80 @@ export class DiaryxBackend {
|
|
|
337
363
|
const ret = wasm.diaryxbackend_onFileSystemEvent(this.__wbg_ptr, callback);
|
|
338
364
|
return BigInt.asUintN(64, ret);
|
|
339
365
|
}
|
|
366
|
+
/**
|
|
367
|
+
* Parse a Day One export (ZIP or JSON) and return entries as JSON.
|
|
368
|
+
*
|
|
369
|
+
* Auto-detects the format: ZIP files (with media directories) have
|
|
370
|
+
* attachments populated with binary data. Plain JSON files are parsed
|
|
371
|
+
* with empty attachment data (backward compatible).
|
|
372
|
+
*
|
|
373
|
+
* ## Example
|
|
374
|
+
* ```javascript
|
|
375
|
+
* const bytes = new Uint8Array(await file.arrayBuffer());
|
|
376
|
+
* const result = backend.parseDayOneJson(bytes);
|
|
377
|
+
* const { entries, errors } = JSON.parse(result);
|
|
378
|
+
* ```
|
|
379
|
+
* @param {Uint8Array} bytes
|
|
380
|
+
* @returns {string}
|
|
381
|
+
*/
|
|
382
|
+
parseDayOneJson(bytes) {
|
|
383
|
+
let deferred3_0;
|
|
384
|
+
let deferred3_1;
|
|
385
|
+
try {
|
|
386
|
+
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
387
|
+
const len0 = WASM_VECTOR_LEN;
|
|
388
|
+
const ret = wasm.diaryxbackend_parseDayOneJson(this.__wbg_ptr, ptr0, len0);
|
|
389
|
+
var ptr2 = ret[0];
|
|
390
|
+
var len2 = ret[1];
|
|
391
|
+
if (ret[3]) {
|
|
392
|
+
ptr2 = 0; len2 = 0;
|
|
393
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
394
|
+
}
|
|
395
|
+
deferred3_0 = ptr2;
|
|
396
|
+
deferred3_1 = len2;
|
|
397
|
+
return getStringFromWasm0(ptr2, len2);
|
|
398
|
+
} finally {
|
|
399
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
400
|
+
}
|
|
401
|
+
}
|
|
402
|
+
/**
|
|
403
|
+
* Parse a single markdown file and return the entry as JSON.
|
|
404
|
+
*
|
|
405
|
+
* Takes the raw bytes of a `.md` file and its filename, and returns
|
|
406
|
+
* a JSON-serialized `ImportedEntry`.
|
|
407
|
+
*
|
|
408
|
+
* ## Example
|
|
409
|
+
* ```javascript
|
|
410
|
+
* const bytes = new Uint8Array(await file.arrayBuffer());
|
|
411
|
+
* const entryJson = backend.parseMarkdownFile(bytes, file.name);
|
|
412
|
+
* const entry = JSON.parse(entryJson);
|
|
413
|
+
* ```
|
|
414
|
+
* @param {Uint8Array} bytes
|
|
415
|
+
* @param {string} filename
|
|
416
|
+
* @returns {string}
|
|
417
|
+
*/
|
|
418
|
+
parseMarkdownFile(bytes, filename) {
|
|
419
|
+
let deferred4_0;
|
|
420
|
+
let deferred4_1;
|
|
421
|
+
try {
|
|
422
|
+
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
423
|
+
const len0 = WASM_VECTOR_LEN;
|
|
424
|
+
const ptr1 = passStringToWasm0(filename, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
425
|
+
const len1 = WASM_VECTOR_LEN;
|
|
426
|
+
const ret = wasm.diaryxbackend_parseMarkdownFile(this.__wbg_ptr, ptr0, len0, ptr1, len1);
|
|
427
|
+
var ptr3 = ret[0];
|
|
428
|
+
var len3 = ret[1];
|
|
429
|
+
if (ret[3]) {
|
|
430
|
+
ptr3 = 0; len3 = 0;
|
|
431
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
432
|
+
}
|
|
433
|
+
deferred4_0 = ptr3;
|
|
434
|
+
deferred4_1 = len3;
|
|
435
|
+
return getStringFromWasm0(ptr3, len3);
|
|
436
|
+
} finally {
|
|
437
|
+
wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
|
|
438
|
+
}
|
|
439
|
+
}
|
|
340
440
|
/**
|
|
341
441
|
* Read binary file.
|
|
342
442
|
*
|
|
@@ -980,6 +1080,10 @@ function __wbg_get_imports() {
|
|
|
980
1080
|
const ret = Reflect.apply(arg0, arg1, arg2);
|
|
981
1081
|
return ret;
|
|
982
1082
|
}, arguments); },
|
|
1083
|
+
__wbg_apply_ada2ee1a60ac7b3c: function() { return handleError(function (arg0, arg1, arg2) {
|
|
1084
|
+
const ret = arg0.apply(arg1, arg2);
|
|
1085
|
+
return ret;
|
|
1086
|
+
}, arguments); },
|
|
983
1087
|
__wbg_arrayBuffer_05ce1af23e9064e8: function(arg0) {
|
|
984
1088
|
const ret = arg0.arrayBuffer();
|
|
985
1089
|
return ret;
|
|
@@ -992,6 +1096,14 @@ function __wbg_get_imports() {
|
|
|
992
1096
|
const ret = arg0.call(arg1, arg2);
|
|
993
1097
|
return ret;
|
|
994
1098
|
}, arguments); },
|
|
1099
|
+
__wbg_call_812d25f1510c13c8: function() { return handleError(function (arg0, arg1, arg2, arg3) {
|
|
1100
|
+
const ret = arg0.call(arg1, arg2, arg3);
|
|
1101
|
+
return ret;
|
|
1102
|
+
}, arguments); },
|
|
1103
|
+
__wbg_call_e8c868596c950cf6: function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
|
|
1104
|
+
const ret = arg0.call(arg1, arg2, arg3, arg4);
|
|
1105
|
+
return ret;
|
|
1106
|
+
}, arguments); },
|
|
995
1107
|
__wbg_close_83fb809aca3de7f9: function(arg0) {
|
|
996
1108
|
const ret = arg0.close();
|
|
997
1109
|
return ret;
|
|
@@ -1204,6 +1316,16 @@ function __wbg_get_imports() {
|
|
|
1204
1316
|
const ret = result;
|
|
1205
1317
|
return ret;
|
|
1206
1318
|
},
|
|
1319
|
+
__wbg_instanceof_Object_1c6af87502b733ed: function(arg0) {
|
|
1320
|
+
let result;
|
|
1321
|
+
try {
|
|
1322
|
+
result = arg0 instanceof Object;
|
|
1323
|
+
} catch (_) {
|
|
1324
|
+
result = false;
|
|
1325
|
+
}
|
|
1326
|
+
const ret = result;
|
|
1327
|
+
return ret;
|
|
1328
|
+
},
|
|
1207
1329
|
__wbg_instanceof_Promise_0094681e3519d6ec: function(arg0) {
|
|
1208
1330
|
let result;
|
|
1209
1331
|
try {
|
|
@@ -1528,6 +1650,10 @@ function __wbg_get_imports() {
|
|
|
1528
1650
|
const ret = arg0.then(arg1);
|
|
1529
1651
|
return ret;
|
|
1530
1652
|
},
|
|
1653
|
+
__wbg_toString_964ff7fe6eca8362: function(arg0) {
|
|
1654
|
+
const ret = arg0.toString();
|
|
1655
|
+
return ret;
|
|
1656
|
+
},
|
|
1531
1657
|
__wbg_transaction_5124caf7db668498: function(arg0) {
|
|
1532
1658
|
const ret = arg0.transaction;
|
|
1533
1659
|
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
@@ -1552,22 +1678,22 @@ function __wbg_get_imports() {
|
|
|
1552
1678
|
return ret;
|
|
1553
1679
|
}, arguments); },
|
|
1554
1680
|
__wbindgen_cast_0000000000000001: function(arg0, arg1) {
|
|
1555
|
-
// Cast intrinsic for `Closure(Closure { dtor_idx:
|
|
1556
|
-
const ret = makeMutClosure(arg0, arg1, wasm.
|
|
1681
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 677, function: Function { arguments: [NamedExternref("Event")], shim_idx: 676, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
|
|
1682
|
+
const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__h4c3bc21aabb0cdba, wasm_bindgen__convert__closures_____invoke__hc73185828886e792);
|
|
1557
1683
|
return ret;
|
|
1558
1684
|
},
|
|
1559
1685
|
__wbindgen_cast_0000000000000002: function(arg0, arg1) {
|
|
1560
|
-
// Cast intrinsic for `Closure(Closure { dtor_idx:
|
|
1561
|
-
const ret = makeMutClosure(arg0, arg1, wasm.
|
|
1686
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 677, function: Function { arguments: [NamedExternref("IDBVersionChangeEvent")], shim_idx: 675, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
1687
|
+
const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__h4c3bc21aabb0cdba, wasm_bindgen__convert__closures_____invoke__h307b88b750192cbb);
|
|
1562
1688
|
return ret;
|
|
1563
1689
|
},
|
|
1564
1690
|
__wbindgen_cast_0000000000000003: function(arg0, arg1) {
|
|
1565
|
-
// Cast intrinsic for `Closure(Closure { dtor_idx:
|
|
1691
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 847, function: Function { arguments: [NamedExternref("Event")], shim_idx: 848, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
1566
1692
|
const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__h54a6b627d1123dca, wasm_bindgen__convert__closures_____invoke__h7d21c95eeb3011e3);
|
|
1567
1693
|
return ret;
|
|
1568
1694
|
},
|
|
1569
1695
|
__wbindgen_cast_0000000000000004: function(arg0, arg1) {
|
|
1570
|
-
// Cast intrinsic for `Closure(Closure { dtor_idx:
|
|
1696
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 873, function: Function { arguments: [Externref], shim_idx: 874, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
1571
1697
|
const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__h440f08373ff30a05, wasm_bindgen__convert__closures_____invoke__h359356b1e0b37746);
|
|
1572
1698
|
return ret;
|
|
1573
1699
|
},
|
|
@@ -1612,8 +1738,8 @@ function __wbg_get_imports() {
|
|
|
1612
1738
|
};
|
|
1613
1739
|
}
|
|
1614
1740
|
|
|
1615
|
-
function
|
|
1616
|
-
wasm.
|
|
1741
|
+
function wasm_bindgen__convert__closures_____invoke__h307b88b750192cbb(arg0, arg1, arg2) {
|
|
1742
|
+
wasm.wasm_bindgen__convert__closures_____invoke__h307b88b750192cbb(arg0, arg1, arg2);
|
|
1617
1743
|
}
|
|
1618
1744
|
|
|
1619
1745
|
function wasm_bindgen__convert__closures_____invoke__h7d21c95eeb3011e3(arg0, arg1, arg2) {
|
|
@@ -1624,8 +1750,8 @@ function wasm_bindgen__convert__closures_____invoke__h359356b1e0b37746(arg0, arg
|
|
|
1624
1750
|
wasm.wasm_bindgen__convert__closures_____invoke__h359356b1e0b37746(arg0, arg1, arg2);
|
|
1625
1751
|
}
|
|
1626
1752
|
|
|
1627
|
-
function
|
|
1628
|
-
const ret = wasm.
|
|
1753
|
+
function wasm_bindgen__convert__closures_____invoke__hc73185828886e792(arg0, arg1, arg2) {
|
|
1754
|
+
const ret = wasm.wasm_bindgen__convert__closures_____invoke__hc73185828886e792(arg0, arg1, arg2);
|
|
1629
1755
|
if (ret[1]) {
|
|
1630
1756
|
throw takeFromExternrefTable0(ret[0]);
|
|
1631
1757
|
}
|
package/diaryx_wasm_bg.wasm.d.ts
CHANGED
|
@@ -1,10 +1,16 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
export const memory: WebAssembly.Memory;
|
|
4
|
-
export const
|
|
4
|
+
export const __wbg_indexeddbfilesystem_free: (a: number, b: number) => void;
|
|
5
|
+
export const __wbg_opfsfilesystem_free: (a: number, b: number) => void;
|
|
6
|
+
export const indexeddbfilesystem_create: () => any;
|
|
7
|
+
export const indexeddbfilesystem_createWithName: (a: number, b: number) => any;
|
|
8
|
+
export const opfsfilesystem_create: () => any;
|
|
9
|
+
export const opfsfilesystem_createWithName: (a: number, b: number) => any;
|
|
5
10
|
export const __wbg_diaryxbackend_free: (a: number, b: number) => void;
|
|
6
11
|
export const diaryxbackend_create: (a: number, b: number) => any;
|
|
7
12
|
export const diaryxbackend_createFromDirectoryHandle: (a: any) => [number, number, number];
|
|
13
|
+
export const diaryxbackend_createFromJsFileSystem: (a: any) => [number, number, number];
|
|
8
14
|
export const diaryxbackend_createInMemory: () => [number, number, number];
|
|
9
15
|
export const diaryxbackend_createIndexedDb: (a: number, b: number) => any;
|
|
10
16
|
export const diaryxbackend_createOpfs: (a: number, b: number) => any;
|
|
@@ -18,14 +24,21 @@ export const diaryxbackend_hasNativeSync: (a: number) => number;
|
|
|
18
24
|
export const diaryxbackend_isCrdtEnabled: (a: number) => number;
|
|
19
25
|
export const diaryxbackend_offFileSystemEvent: (a: number, b: bigint) => number;
|
|
20
26
|
export const diaryxbackend_onFileSystemEvent: (a: number, b: any) => bigint;
|
|
27
|
+
export const diaryxbackend_parseDayOneJson: (a: number, b: number, c: number) => [number, number, number, number];
|
|
28
|
+
export const diaryxbackend_parseMarkdownFile: (a: number, b: number, c: number, d: number, e: number) => [number, number, number, number];
|
|
21
29
|
export const diaryxbackend_readBinary: (a: number, b: number, c: number) => any;
|
|
22
30
|
export const diaryxbackend_saveConfig: (a: number, b: any) => any;
|
|
23
31
|
export const diaryxbackend_setCrdtEnabled: (a: number, b: number) => void;
|
|
24
32
|
export const diaryxbackend_writeBinary: (a: number, b: number, c: number, d: any) => any;
|
|
33
|
+
export const init: () => void;
|
|
34
|
+
export const __wbg_fsafilesystem_free: (a: number, b: number) => void;
|
|
35
|
+
export const fsafilesystem_fromHandle: (a: any) => number;
|
|
25
36
|
export const __wbg_jsasyncfilesystem_free: (a: number, b: number) => void;
|
|
26
37
|
export const __wbg_wasmsyncclient_free: (a: number, b: number) => void;
|
|
27
38
|
export const jsasyncfilesystem_has_callback: (a: number, b: number, c: number) => number;
|
|
28
39
|
export const jsasyncfilesystem_new: (a: any) => number;
|
|
40
|
+
export const now_timestamp: () => [number, number];
|
|
41
|
+
export const today_formatted: (a: number, b: number) => [number, number];
|
|
29
42
|
export const wasmsyncclient_focusFiles: (a: number, b: number, c: number) => void;
|
|
30
43
|
export const wasmsyncclient_getServerUrl: (a: number) => [number, number];
|
|
31
44
|
export const wasmsyncclient_getWorkspaceId: (a: number) => [number, number];
|
|
@@ -44,22 +57,12 @@ export const wasmsyncclient_queueLocalUpdate: (a: number, b: number, c: number,
|
|
|
44
57
|
export const wasmsyncclient_setSessionCode: (a: number, b: number, c: number) => void;
|
|
45
58
|
export const wasmsyncclient_syncBodyFiles: (a: number, b: number, c: number) => any;
|
|
46
59
|
export const wasmsyncclient_unfocusFiles: (a: number, b: number, c: number) => void;
|
|
47
|
-
export const
|
|
48
|
-
export const __wbg_indexeddbfilesystem_free: (a: number, b: number) => void;
|
|
49
|
-
export const fsafilesystem_fromHandle: (a: any) => number;
|
|
50
|
-
export const indexeddbfilesystem_create: () => any;
|
|
51
|
-
export const indexeddbfilesystem_createWithName: (a: number, b: number) => any;
|
|
52
|
-
export const __wbg_opfsfilesystem_free: (a: number, b: number) => void;
|
|
53
|
-
export const now_timestamp: () => [number, number];
|
|
54
|
-
export const opfsfilesystem_create: () => any;
|
|
55
|
-
export const opfsfilesystem_createWithName: (a: number, b: number) => any;
|
|
56
|
-
export const today_formatted: (a: number, b: number) => [number, number];
|
|
57
|
-
export const wasm_bindgen__closure__destroy__hfa094efcaf5741ee: (a: number, b: number) => void;
|
|
60
|
+
export const wasm_bindgen__closure__destroy__h4c3bc21aabb0cdba: (a: number, b: number) => void;
|
|
58
61
|
export const wasm_bindgen__closure__destroy__h54a6b627d1123dca: (a: number, b: number) => void;
|
|
59
62
|
export const wasm_bindgen__closure__destroy__h440f08373ff30a05: (a: number, b: number) => void;
|
|
60
|
-
export const
|
|
63
|
+
export const wasm_bindgen__convert__closures_____invoke__hc73185828886e792: (a: number, b: number, c: any) => [number, number];
|
|
61
64
|
export const wasm_bindgen__convert__closures_____invoke__h4e796b59e8c15a06: (a: number, b: number, c: any, d: any) => void;
|
|
62
|
-
export const
|
|
65
|
+
export const wasm_bindgen__convert__closures_____invoke__h307b88b750192cbb: (a: number, b: number, c: any) => void;
|
|
63
66
|
export const wasm_bindgen__convert__closures_____invoke__h7d21c95eeb3011e3: (a: number, b: number, c: any) => void;
|
|
64
67
|
export const wasm_bindgen__convert__closures_____invoke__h359356b1e0b37746: (a: number, b: number, c: any) => void;
|
|
65
68
|
export const __wbindgen_malloc: (a: number, b: number) => number;
|
package/package.json
CHANGED