@diaryx/wasm 1.1.0-dev.f6f6c50 → 1.2.0-dev.d069796

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 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
  *
@@ -601,9 +648,16 @@ export interface InitOutput {
601
648
  readonly wasmsyncclient_setSessionCode: (a: number, b: number, c: number) => void;
602
649
  readonly wasmsyncclient_syncBodyFiles: (a: number, b: number, c: number) => any;
603
650
  readonly wasmsyncclient_unfocusFiles: (a: number, b: number, c: number) => void;
651
+ readonly __wbg_indexeddbfilesystem_free: (a: number, b: number) => void;
652
+ readonly __wbg_opfsfilesystem_free: (a: number, b: number) => void;
653
+ readonly indexeddbfilesystem_create: () => any;
654
+ readonly indexeddbfilesystem_createWithName: (a: number, b: number) => any;
655
+ readonly opfsfilesystem_create: () => any;
656
+ readonly opfsfilesystem_createWithName: (a: number, b: number) => any;
604
657
  readonly __wbg_diaryxbackend_free: (a: number, b: number) => void;
605
658
  readonly diaryxbackend_create: (a: number, b: number) => any;
606
659
  readonly diaryxbackend_createFromDirectoryHandle: (a: any) => [number, number, number];
660
+ readonly diaryxbackend_createFromJsFileSystem: (a: any) => [number, number, number];
607
661
  readonly diaryxbackend_createInMemory: () => [number, number, number];
608
662
  readonly diaryxbackend_createIndexedDb: (a: number, b: number) => any;
609
663
  readonly diaryxbackend_createOpfs: (a: number, b: number) => any;
@@ -617,27 +671,23 @@ export interface InitOutput {
617
671
  readonly diaryxbackend_isCrdtEnabled: (a: number) => number;
618
672
  readonly diaryxbackend_offFileSystemEvent: (a: number, b: bigint) => number;
619
673
  readonly diaryxbackend_onFileSystemEvent: (a: number, b: any) => bigint;
674
+ readonly diaryxbackend_parseDayOneJson: (a: number, b: number, c: number) => [number, number, number, number];
675
+ readonly diaryxbackend_parseMarkdownFile: (a: number, b: number, c: number, d: number, e: number) => [number, number, number, number];
620
676
  readonly diaryxbackend_readBinary: (a: number, b: number, c: number) => any;
621
677
  readonly diaryxbackend_saveConfig: (a: number, b: any) => any;
622
678
  readonly diaryxbackend_setCrdtEnabled: (a: number, b: number) => void;
623
679
  readonly diaryxbackend_writeBinary: (a: number, b: number, c: number, d: any) => any;
624
680
  readonly init: () => void;
625
- readonly __wbg_opfsfilesystem_free: (a: number, b: number) => void;
626
- readonly now_timestamp: () => [number, number];
627
- readonly opfsfilesystem_create: () => any;
628
- readonly opfsfilesystem_createWithName: (a: number, b: number) => any;
629
- readonly today_formatted: (a: number, b: number) => [number, number];
630
681
  readonly __wbg_fsafilesystem_free: (a: number, b: number) => void;
631
- readonly __wbg_indexeddbfilesystem_free: (a: number, b: number) => void;
632
682
  readonly fsafilesystem_fromHandle: (a: any) => number;
633
- readonly indexeddbfilesystem_create: () => any;
634
- readonly indexeddbfilesystem_createWithName: (a: number, b: number) => any;
635
- readonly wasm_bindgen__closure__destroy__hfa094efcaf5741ee: (a: number, b: number) => void;
683
+ readonly now_timestamp: () => [number, number];
684
+ readonly today_formatted: (a: number, b: number) => [number, number];
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 wasm_bindgen__convert__closures_____invoke__h2edd821bb947d12c: (a: number, b: number, c: any) => [number, number];
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 wasm_bindgen__convert__closures_____invoke__he04e15cd7947560c: (a: number, b: number, c: any) => void;
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: 714, function: Function { arguments: [NamedExternref("Event")], shim_idx: 715, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
1556
- const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__hfa094efcaf5741ee, wasm_bindgen__convert__closures_____invoke__h2edd821bb947d12c);
1681
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 724, function: Function { arguments: [NamedExternref("Event")], shim_idx: 675, 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: 714, function: Function { arguments: [NamedExternref("IDBVersionChangeEvent")], shim_idx: 716, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1561
- const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__hfa094efcaf5741ee, wasm_bindgen__convert__closures_____invoke__he04e15cd7947560c);
1686
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 724, function: Function { arguments: [NamedExternref("IDBVersionChangeEvent")], shim_idx: 674, 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: 790, function: Function { arguments: [NamedExternref("Event")], shim_idx: 791, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1691
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 843, function: Function { arguments: [NamedExternref("Event")], shim_idx: 844, 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: 816, function: Function { arguments: [Externref], shim_idx: 817, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1696
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 869, function: Function { arguments: [Externref], shim_idx: 870, 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 wasm_bindgen__convert__closures_____invoke__he04e15cd7947560c(arg0, arg1, arg2) {
1616
- wasm.wasm_bindgen__convert__closures_____invoke__he04e15cd7947560c(arg0, arg1, arg2);
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 wasm_bindgen__convert__closures_____invoke__h2edd821bb947d12c(arg0, arg1, arg2) {
1628
- const ret = wasm.wasm_bindgen__convert__closures_____invoke__h2edd821bb947d12c(arg0, arg1, arg2);
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
  }
@@ -23,9 +23,16 @@ export const wasmsyncclient_queueLocalUpdate: (a: number, b: number, c: number,
23
23
  export const wasmsyncclient_setSessionCode: (a: number, b: number, c: number) => void;
24
24
  export const wasmsyncclient_syncBodyFiles: (a: number, b: number, c: number) => any;
25
25
  export const wasmsyncclient_unfocusFiles: (a: number, b: number, c: number) => void;
26
+ export const __wbg_indexeddbfilesystem_free: (a: number, b: number) => void;
27
+ export const __wbg_opfsfilesystem_free: (a: number, b: number) => void;
28
+ export const indexeddbfilesystem_create: () => any;
29
+ export const indexeddbfilesystem_createWithName: (a: number, b: number) => any;
30
+ export const opfsfilesystem_create: () => any;
31
+ export const opfsfilesystem_createWithName: (a: number, b: number) => any;
26
32
  export const __wbg_diaryxbackend_free: (a: number, b: number) => void;
27
33
  export const diaryxbackend_create: (a: number, b: number) => any;
28
34
  export const diaryxbackend_createFromDirectoryHandle: (a: any) => [number, number, number];
35
+ export const diaryxbackend_createFromJsFileSystem: (a: any) => [number, number, number];
29
36
  export const diaryxbackend_createInMemory: () => [number, number, number];
30
37
  export const diaryxbackend_createIndexedDb: (a: number, b: number) => any;
31
38
  export const diaryxbackend_createOpfs: (a: number, b: number) => any;
@@ -39,27 +46,23 @@ export const diaryxbackend_hasNativeSync: (a: number) => number;
39
46
  export const diaryxbackend_isCrdtEnabled: (a: number) => number;
40
47
  export const diaryxbackend_offFileSystemEvent: (a: number, b: bigint) => number;
41
48
  export const diaryxbackend_onFileSystemEvent: (a: number, b: any) => bigint;
49
+ export const diaryxbackend_parseDayOneJson: (a: number, b: number, c: number) => [number, number, number, number];
50
+ export const diaryxbackend_parseMarkdownFile: (a: number, b: number, c: number, d: number, e: number) => [number, number, number, number];
42
51
  export const diaryxbackend_readBinary: (a: number, b: number, c: number) => any;
43
52
  export const diaryxbackend_saveConfig: (a: number, b: any) => any;
44
53
  export const diaryxbackend_setCrdtEnabled: (a: number, b: number) => void;
45
54
  export const diaryxbackend_writeBinary: (a: number, b: number, c: number, d: any) => any;
46
55
  export const init: () => void;
47
- export const __wbg_opfsfilesystem_free: (a: number, b: number) => void;
48
- export const now_timestamp: () => [number, number];
49
- export const opfsfilesystem_create: () => any;
50
- export const opfsfilesystem_createWithName: (a: number, b: number) => any;
51
- export const today_formatted: (a: number, b: number) => [number, number];
52
56
  export const __wbg_fsafilesystem_free: (a: number, b: number) => void;
53
- export const __wbg_indexeddbfilesystem_free: (a: number, b: number) => void;
54
57
  export const fsafilesystem_fromHandle: (a: any) => number;
55
- export const indexeddbfilesystem_create: () => any;
56
- export const indexeddbfilesystem_createWithName: (a: number, b: number) => any;
57
- export const wasm_bindgen__closure__destroy__hfa094efcaf5741ee: (a: number, b: number) => void;
58
+ export const now_timestamp: () => [number, number];
59
+ export const today_formatted: (a: number, b: number) => [number, number];
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 wasm_bindgen__convert__closures_____invoke__h2edd821bb947d12c: (a: number, b: number, c: any) => [number, number];
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 wasm_bindgen__convert__closures_____invoke__he04e15cd7947560c: (a: number, b: number, c: any) => void;
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
@@ -2,7 +2,7 @@
2
2
  "name": "@diaryx/wasm",
3
3
  "type": "module",
4
4
  "description": "WebAssembly bindings for Diaryx core functionality",
5
- "version": "1.1.0-dev.f6f6c50",
5
+ "version": "1.2.0-dev.d069796",
6
6
  "license": "SEE LICENSE IN ../../LICENSE.md",
7
7
  "repository": {
8
8
  "type": "git",