@diaryx/wasm-node 1.2.1-dev.5be7aae → 1.2.1-dev.902e2c4

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 CHANGED
@@ -220,35 +220,6 @@ export class DiaryxBackend {
220
220
  * ```
221
221
  */
222
222
  onFileSystemEvent(callback: Function): bigint;
223
- /**
224
- * Parse a Day One export (ZIP or JSON) and return entries as JSON.
225
- *
226
- * Auto-detects the format: ZIP files (with media directories) have
227
- * attachments populated with binary data. Plain JSON files are parsed
228
- * with empty attachment data (backward compatible).
229
- *
230
- * ## Example
231
- * ```javascript
232
- * const bytes = new Uint8Array(await file.arrayBuffer());
233
- * const result = backend.parseDayOneJson(bytes);
234
- * const { entries, errors } = JSON.parse(result);
235
- * ```
236
- */
237
- parseDayOneJson(bytes: Uint8Array): string;
238
- /**
239
- * Parse a single markdown file and return the entry as JSON.
240
- *
241
- * Takes the raw bytes of a `.md` file and its filename, and returns
242
- * a JSON-serialized `ImportedEntry`.
243
- *
244
- * ## Example
245
- * ```javascript
246
- * const bytes = new Uint8Array(await file.arrayBuffer());
247
- * const entryJson = backend.parseMarkdownFile(bytes, file.name);
248
- * const entry = JSON.parse(entryJson);
249
- * ```
250
- */
251
- parseMarkdownFile(bytes: Uint8Array, filename: string): string;
252
223
  /**
253
224
  * Read binary file.
254
225
  *
@@ -325,12 +296,8 @@ export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembl
325
296
 
326
297
  export interface InitOutput {
327
298
  readonly memory: WebAssembly.Memory;
328
- readonly now_timestamp: () => [number, number];
329
- readonly today_formatted: (a: number, b: number) => [number, number];
330
- readonly __wbg_jsasyncfilesystem_free: (a: number, b: number) => void;
331
- readonly jsasyncfilesystem_has_callback: (a: number, b: number, c: number) => number;
332
- readonly jsasyncfilesystem_new: (a: any) => number;
333
299
  readonly __wbg_diaryxbackend_free: (a: number, b: number) => void;
300
+ readonly __wbg_jsasyncfilesystem_free: (a: number, b: number) => void;
334
301
  readonly diaryxbackend_create: (a: number, b: number) => any;
335
302
  readonly diaryxbackend_createFromJsFileSystem: (a: any) => [number, number, number];
336
303
  readonly diaryxbackend_createInMemory: () => [number, number, number];
@@ -342,17 +309,19 @@ export interface InitOutput {
342
309
  readonly diaryxbackend_hasNativeSync: (a: number) => number;
343
310
  readonly diaryxbackend_offFileSystemEvent: (a: number, b: bigint) => number;
344
311
  readonly diaryxbackend_onFileSystemEvent: (a: number, b: any) => bigint;
345
- readonly diaryxbackend_parseDayOneJson: (a: number, b: number, c: number) => [number, number, number, number];
346
- readonly diaryxbackend_parseMarkdownFile: (a: number, b: number, c: number, d: number, e: number) => [number, number, number, number];
347
312
  readonly diaryxbackend_readBinary: (a: number, b: number, c: number) => any;
348
313
  readonly diaryxbackend_saveConfig: (a: number, b: any) => any;
349
314
  readonly diaryxbackend_setCrdtEnabled: (a: number, b: number) => void;
350
315
  readonly diaryxbackend_writeBinary: (a: number, b: number, c: number, d: any) => any;
316
+ readonly jsasyncfilesystem_has_callback: (a: number, b: number, c: number) => number;
317
+ readonly jsasyncfilesystem_new: (a: any) => number;
318
+ readonly now_timestamp: () => [number, number];
319
+ readonly today_formatted: (a: number, b: number) => [number, number];
351
320
  readonly diaryxbackend_isCrdtEnabled: (a: number) => number;
352
321
  readonly init: () => void;
353
- readonly wasm_bindgen__closure__destroy__h358403ff5b31de35: (a: number, b: number) => void;
354
- readonly wasm_bindgen__convert__closures_____invoke__h9824f9855d7aa260: (a: number, b: number, c: any, d: any) => void;
355
- readonly wasm_bindgen__convert__closures_____invoke__h4b881ac518a5291a: (a: number, b: number, c: any) => void;
322
+ readonly wasm_bindgen__closure__destroy__h88c09826c7bdcc04: (a: number, b: number) => void;
323
+ readonly wasm_bindgen__convert__closures_____invoke__h0d59e9d6e6af2fb0: (a: number, b: number, c: any, d: any) => void;
324
+ readonly wasm_bindgen__convert__closures_____invoke__h225c842405c0a80f: (a: number, b: number, c: any) => void;
356
325
  readonly __wbindgen_malloc: (a: number, b: number) => number;
357
326
  readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
358
327
  readonly __wbindgen_exn_store: (a: number) => void;
package/diaryx_wasm.js CHANGED
@@ -209,80 +209,6 @@ export class DiaryxBackend {
209
209
  const ret = wasm.diaryxbackend_onFileSystemEvent(this.__wbg_ptr, callback);
210
210
  return BigInt.asUintN(64, ret);
211
211
  }
212
- /**
213
- * Parse a Day One export (ZIP or JSON) and return entries as JSON.
214
- *
215
- * Auto-detects the format: ZIP files (with media directories) have
216
- * attachments populated with binary data. Plain JSON files are parsed
217
- * with empty attachment data (backward compatible).
218
- *
219
- * ## Example
220
- * ```javascript
221
- * const bytes = new Uint8Array(await file.arrayBuffer());
222
- * const result = backend.parseDayOneJson(bytes);
223
- * const { entries, errors } = JSON.parse(result);
224
- * ```
225
- * @param {Uint8Array} bytes
226
- * @returns {string}
227
- */
228
- parseDayOneJson(bytes) {
229
- let deferred3_0;
230
- let deferred3_1;
231
- try {
232
- const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
233
- const len0 = WASM_VECTOR_LEN;
234
- const ret = wasm.diaryxbackend_parseDayOneJson(this.__wbg_ptr, ptr0, len0);
235
- var ptr2 = ret[0];
236
- var len2 = ret[1];
237
- if (ret[3]) {
238
- ptr2 = 0; len2 = 0;
239
- throw takeFromExternrefTable0(ret[2]);
240
- }
241
- deferred3_0 = ptr2;
242
- deferred3_1 = len2;
243
- return getStringFromWasm0(ptr2, len2);
244
- } finally {
245
- wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
246
- }
247
- }
248
- /**
249
- * Parse a single markdown file and return the entry as JSON.
250
- *
251
- * Takes the raw bytes of a `.md` file and its filename, and returns
252
- * a JSON-serialized `ImportedEntry`.
253
- *
254
- * ## Example
255
- * ```javascript
256
- * const bytes = new Uint8Array(await file.arrayBuffer());
257
- * const entryJson = backend.parseMarkdownFile(bytes, file.name);
258
- * const entry = JSON.parse(entryJson);
259
- * ```
260
- * @param {Uint8Array} bytes
261
- * @param {string} filename
262
- * @returns {string}
263
- */
264
- parseMarkdownFile(bytes, filename) {
265
- let deferred4_0;
266
- let deferred4_1;
267
- try {
268
- const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
269
- const len0 = WASM_VECTOR_LEN;
270
- const ptr1 = passStringToWasm0(filename, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
271
- const len1 = WASM_VECTOR_LEN;
272
- const ret = wasm.diaryxbackend_parseMarkdownFile(this.__wbg_ptr, ptr0, len0, ptr1, len1);
273
- var ptr3 = ret[0];
274
- var len3 = ret[1];
275
- if (ret[3]) {
276
- ptr3 = 0; len3 = 0;
277
- throw takeFromExternrefTable0(ret[2]);
278
- }
279
- deferred4_0 = ptr3;
280
- deferred4_1 = len3;
281
- return getStringFromWasm0(ptr3, len3);
282
- } finally {
283
- wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
284
- }
285
- }
286
212
  /**
287
213
  * Read binary file.
288
214
  *
@@ -680,7 +606,7 @@ function __wbg_get_imports() {
680
606
  const a = state0.a;
681
607
  state0.a = 0;
682
608
  try {
683
- return wasm_bindgen__convert__closures_____invoke__h9824f9855d7aa260(a, state0.b, arg0, arg1);
609
+ return wasm_bindgen__convert__closures_____invoke__h0d59e9d6e6af2fb0(a, state0.b, arg0, arg1);
684
610
  } finally {
685
611
  state0.a = a;
686
612
  }
@@ -794,8 +720,8 @@ function __wbg_get_imports() {
794
720
  console.warn(arg0, arg1, arg2, arg3);
795
721
  },
796
722
  __wbindgen_cast_0000000000000001: function(arg0, arg1) {
797
- // Cast intrinsic for `Closure(Closure { dtor_idx: 455, function: Function { arguments: [Externref], shim_idx: 456, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
798
- const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__h358403ff5b31de35, wasm_bindgen__convert__closures_____invoke__h4b881ac518a5291a);
723
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 395, function: Function { arguments: [Externref], shim_idx: 396, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
724
+ const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__h88c09826c7bdcc04, wasm_bindgen__convert__closures_____invoke__h225c842405c0a80f);
799
725
  return ret;
800
726
  },
801
727
  __wbindgen_cast_0000000000000002: function(arg0) {
@@ -834,12 +760,12 @@ function __wbg_get_imports() {
834
760
  };
835
761
  }
836
762
 
837
- function wasm_bindgen__convert__closures_____invoke__h4b881ac518a5291a(arg0, arg1, arg2) {
838
- wasm.wasm_bindgen__convert__closures_____invoke__h4b881ac518a5291a(arg0, arg1, arg2);
763
+ function wasm_bindgen__convert__closures_____invoke__h225c842405c0a80f(arg0, arg1, arg2) {
764
+ wasm.wasm_bindgen__convert__closures_____invoke__h225c842405c0a80f(arg0, arg1, arg2);
839
765
  }
840
766
 
841
- function wasm_bindgen__convert__closures_____invoke__h9824f9855d7aa260(arg0, arg1, arg2, arg3) {
842
- wasm.wasm_bindgen__convert__closures_____invoke__h9824f9855d7aa260(arg0, arg1, arg2, arg3);
767
+ function wasm_bindgen__convert__closures_____invoke__h0d59e9d6e6af2fb0(arg0, arg1, arg2, arg3) {
768
+ wasm.wasm_bindgen__convert__closures_____invoke__h0d59e9d6e6af2fb0(arg0, arg1, arg2, arg3);
843
769
  }
844
770
 
845
771
  const DiaryxBackendFinalization = (typeof FinalizationRegistry === 'undefined')
@@ -991,13 +917,6 @@ function makeMutClosure(arg0, arg1, dtor, f) {
991
917
  return real;
992
918
  }
993
919
 
994
- function passArray8ToWasm0(arg, malloc) {
995
- const ptr = malloc(arg.length * 1, 1) >>> 0;
996
- getUint8ArrayMemory0().set(arg, ptr / 1);
997
- WASM_VECTOR_LEN = arg.length;
998
- return ptr;
999
- }
1000
-
1001
920
  function passStringToWasm0(arg, malloc, realloc) {
1002
921
  if (realloc === undefined) {
1003
922
  const buf = cachedTextEncoder.encode(arg);
Binary file
@@ -1,12 +1,8 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
3
  export const memory: WebAssembly.Memory;
4
- export const now_timestamp: () => [number, number];
5
- export const today_formatted: (a: number, b: number) => [number, number];
6
- export const __wbg_jsasyncfilesystem_free: (a: number, b: number) => void;
7
- export const jsasyncfilesystem_has_callback: (a: number, b: number, c: number) => number;
8
- export const jsasyncfilesystem_new: (a: any) => number;
9
4
  export const __wbg_diaryxbackend_free: (a: number, b: number) => void;
5
+ export const __wbg_jsasyncfilesystem_free: (a: number, b: number) => void;
10
6
  export const diaryxbackend_create: (a: number, b: number) => any;
11
7
  export const diaryxbackend_createFromJsFileSystem: (a: any) => [number, number, number];
12
8
  export const diaryxbackend_createInMemory: () => [number, number, number];
@@ -18,17 +14,19 @@ export const diaryxbackend_getConfig: (a: number) => any;
18
14
  export const diaryxbackend_hasNativeSync: (a: number) => number;
19
15
  export const diaryxbackend_offFileSystemEvent: (a: number, b: bigint) => number;
20
16
  export const diaryxbackend_onFileSystemEvent: (a: number, b: any) => bigint;
21
- export const diaryxbackend_parseDayOneJson: (a: number, b: number, c: number) => [number, number, number, number];
22
- export const diaryxbackend_parseMarkdownFile: (a: number, b: number, c: number, d: number, e: number) => [number, number, number, number];
23
17
  export const diaryxbackend_readBinary: (a: number, b: number, c: number) => any;
24
18
  export const diaryxbackend_saveConfig: (a: number, b: any) => any;
25
19
  export const diaryxbackend_setCrdtEnabled: (a: number, b: number) => void;
26
20
  export const diaryxbackend_writeBinary: (a: number, b: number, c: number, d: any) => any;
21
+ export const jsasyncfilesystem_has_callback: (a: number, b: number, c: number) => number;
22
+ export const jsasyncfilesystem_new: (a: any) => number;
23
+ export const now_timestamp: () => [number, number];
24
+ export const today_formatted: (a: number, b: number) => [number, number];
27
25
  export const diaryxbackend_isCrdtEnabled: (a: number) => number;
28
26
  export const init: () => void;
29
- export const wasm_bindgen__closure__destroy__h358403ff5b31de35: (a: number, b: number) => void;
30
- export const wasm_bindgen__convert__closures_____invoke__h9824f9855d7aa260: (a: number, b: number, c: any, d: any) => void;
31
- export const wasm_bindgen__convert__closures_____invoke__h4b881ac518a5291a: (a: number, b: number, c: any) => void;
27
+ export const wasm_bindgen__closure__destroy__h88c09826c7bdcc04: (a: number, b: number) => void;
28
+ export const wasm_bindgen__convert__closures_____invoke__h0d59e9d6e6af2fb0: (a: number, b: number, c: any, d: any) => void;
29
+ export const wasm_bindgen__convert__closures_____invoke__h225c842405c0a80f: (a: number, b: number, c: any) => void;
32
30
  export const __wbindgen_malloc: (a: number, b: number) => number;
33
31
  export const __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
34
32
  export const __wbindgen_exn_store: (a: number) => void;
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@diaryx/wasm-node",
3
3
  "type": "module",
4
4
  "description": "WebAssembly bindings for Diaryx core functionality",
5
- "version": "1.2.1-dev.5be7aae",
5
+ "version": "1.2.1-dev.902e2c4",
6
6
  "license": "SEE LICENSE IN ../../LICENSE.md",
7
7
  "repository": {
8
8
  "type": "git",