@diaryx/wasm 1.2.1-dev.ddf29e2 → 1.3.0-dev.bdbd013
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 +7 -38
- package/diaryx_wasm.js +16 -97
- package/diaryx_wasm_bg.wasm.d.ts +7 -9
- package/package.json +1 -1
package/diaryx_wasm.d.ts
CHANGED
|
@@ -232,35 +232,6 @@ export class DiaryxBackend {
|
|
|
232
232
|
* ```
|
|
233
233
|
*/
|
|
234
234
|
onFileSystemEvent(callback: Function): bigint;
|
|
235
|
-
/**
|
|
236
|
-
* Parse a Day One export (ZIP or JSON) and return entries as JSON.
|
|
237
|
-
*
|
|
238
|
-
* Auto-detects the format: ZIP files (with media directories) have
|
|
239
|
-
* attachments populated with binary data. Plain JSON files are parsed
|
|
240
|
-
* with empty attachment data (backward compatible).
|
|
241
|
-
*
|
|
242
|
-
* ## Example
|
|
243
|
-
* ```javascript
|
|
244
|
-
* const bytes = new Uint8Array(await file.arrayBuffer());
|
|
245
|
-
* const result = backend.parseDayOneJson(bytes);
|
|
246
|
-
* const { entries, errors } = JSON.parse(result);
|
|
247
|
-
* ```
|
|
248
|
-
*/
|
|
249
|
-
parseDayOneJson(bytes: Uint8Array): string;
|
|
250
|
-
/**
|
|
251
|
-
* Parse a single markdown file and return the entry as JSON.
|
|
252
|
-
*
|
|
253
|
-
* Takes the raw bytes of a `.md` file and its filename, and returns
|
|
254
|
-
* a JSON-serialized `ImportedEntry`.
|
|
255
|
-
*
|
|
256
|
-
* ## Example
|
|
257
|
-
* ```javascript
|
|
258
|
-
* const bytes = new Uint8Array(await file.arrayBuffer());
|
|
259
|
-
* const entryJson = backend.parseMarkdownFile(bytes, file.name);
|
|
260
|
-
* const entry = JSON.parse(entryJson);
|
|
261
|
-
* ```
|
|
262
|
-
*/
|
|
263
|
-
parseMarkdownFile(bytes: Uint8Array, filename: string): string;
|
|
264
235
|
/**
|
|
265
236
|
* Read binary file.
|
|
266
237
|
*
|
|
@@ -421,8 +392,6 @@ export interface InitOutput {
|
|
|
421
392
|
readonly diaryxbackend_hasNativeSync: (a: number) => number;
|
|
422
393
|
readonly diaryxbackend_offFileSystemEvent: (a: number, b: bigint) => number;
|
|
423
394
|
readonly diaryxbackend_onFileSystemEvent: (a: number, b: any) => bigint;
|
|
424
|
-
readonly diaryxbackend_parseDayOneJson: (a: number, b: number, c: number) => [number, number, number, number];
|
|
425
|
-
readonly diaryxbackend_parseMarkdownFile: (a: number, b: number, c: number, d: number, e: number) => [number, number, number, number];
|
|
426
395
|
readonly diaryxbackend_readBinary: (a: number, b: number, c: number) => any;
|
|
427
396
|
readonly diaryxbackend_saveConfig: (a: number, b: any) => any;
|
|
428
397
|
readonly diaryxbackend_setCrdtEnabled: (a: number, b: number) => void;
|
|
@@ -439,14 +408,14 @@ export interface InitOutput {
|
|
|
439
408
|
readonly init: () => void;
|
|
440
409
|
readonly jsasyncfilesystem_new: (a: any) => number;
|
|
441
410
|
readonly __wbg_opfsfilesystem_free: (a: number, b: number) => void;
|
|
442
|
-
readonly
|
|
443
|
-
readonly
|
|
444
|
-
readonly
|
|
445
|
-
readonly
|
|
411
|
+
readonly wasm_bindgen__closure__destroy__h5014fd323cc31ff9: (a: number, b: number) => void;
|
|
412
|
+
readonly wasm_bindgen__closure__destroy__h8cbeca5d5a286ce5: (a: number, b: number) => void;
|
|
413
|
+
readonly wasm_bindgen__closure__destroy__h54530733e565125e: (a: number, b: number) => void;
|
|
414
|
+
readonly wasm_bindgen__convert__closures_____invoke__hf5f678ae557f5b2d: (a: number, b: number, c: any) => [number, number];
|
|
446
415
|
readonly wasm_bindgen__convert__closures_____invoke__h2225c3190ed38e97: (a: number, b: number, c: any, d: any) => void;
|
|
447
|
-
readonly
|
|
448
|
-
readonly
|
|
449
|
-
readonly
|
|
416
|
+
readonly wasm_bindgen__convert__closures_____invoke__h564cce8299ee9e62: (a: number, b: number, c: any) => void;
|
|
417
|
+
readonly wasm_bindgen__convert__closures_____invoke__hce19dfcc00f4d0b4: (a: number, b: number, c: any) => void;
|
|
418
|
+
readonly wasm_bindgen__convert__closures_____invoke__h7a6e8b2052e57d0f: (a: number, b: number, c: any) => void;
|
|
450
419
|
readonly __wbindgen_malloc: (a: number, b: number) => number;
|
|
451
420
|
readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|
|
452
421
|
readonly __wbindgen_exn_store: (a: number) => void;
|
package/diaryx_wasm.js
CHANGED
|
@@ -243,80 +243,6 @@ export class DiaryxBackend {
|
|
|
243
243
|
const ret = wasm.diaryxbackend_onFileSystemEvent(this.__wbg_ptr, callback);
|
|
244
244
|
return BigInt.asUintN(64, ret);
|
|
245
245
|
}
|
|
246
|
-
/**
|
|
247
|
-
* Parse a Day One export (ZIP or JSON) and return entries as JSON.
|
|
248
|
-
*
|
|
249
|
-
* Auto-detects the format: ZIP files (with media directories) have
|
|
250
|
-
* attachments populated with binary data. Plain JSON files are parsed
|
|
251
|
-
* with empty attachment data (backward compatible).
|
|
252
|
-
*
|
|
253
|
-
* ## Example
|
|
254
|
-
* ```javascript
|
|
255
|
-
* const bytes = new Uint8Array(await file.arrayBuffer());
|
|
256
|
-
* const result = backend.parseDayOneJson(bytes);
|
|
257
|
-
* const { entries, errors } = JSON.parse(result);
|
|
258
|
-
* ```
|
|
259
|
-
* @param {Uint8Array} bytes
|
|
260
|
-
* @returns {string}
|
|
261
|
-
*/
|
|
262
|
-
parseDayOneJson(bytes) {
|
|
263
|
-
let deferred3_0;
|
|
264
|
-
let deferred3_1;
|
|
265
|
-
try {
|
|
266
|
-
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
267
|
-
const len0 = WASM_VECTOR_LEN;
|
|
268
|
-
const ret = wasm.diaryxbackend_parseDayOneJson(this.__wbg_ptr, ptr0, len0);
|
|
269
|
-
var ptr2 = ret[0];
|
|
270
|
-
var len2 = ret[1];
|
|
271
|
-
if (ret[3]) {
|
|
272
|
-
ptr2 = 0; len2 = 0;
|
|
273
|
-
throw takeFromExternrefTable0(ret[2]);
|
|
274
|
-
}
|
|
275
|
-
deferred3_0 = ptr2;
|
|
276
|
-
deferred3_1 = len2;
|
|
277
|
-
return getStringFromWasm0(ptr2, len2);
|
|
278
|
-
} finally {
|
|
279
|
-
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
280
|
-
}
|
|
281
|
-
}
|
|
282
|
-
/**
|
|
283
|
-
* Parse a single markdown file and return the entry as JSON.
|
|
284
|
-
*
|
|
285
|
-
* Takes the raw bytes of a `.md` file and its filename, and returns
|
|
286
|
-
* a JSON-serialized `ImportedEntry`.
|
|
287
|
-
*
|
|
288
|
-
* ## Example
|
|
289
|
-
* ```javascript
|
|
290
|
-
* const bytes = new Uint8Array(await file.arrayBuffer());
|
|
291
|
-
* const entryJson = backend.parseMarkdownFile(bytes, file.name);
|
|
292
|
-
* const entry = JSON.parse(entryJson);
|
|
293
|
-
* ```
|
|
294
|
-
* @param {Uint8Array} bytes
|
|
295
|
-
* @param {string} filename
|
|
296
|
-
* @returns {string}
|
|
297
|
-
*/
|
|
298
|
-
parseMarkdownFile(bytes, filename) {
|
|
299
|
-
let deferred4_0;
|
|
300
|
-
let deferred4_1;
|
|
301
|
-
try {
|
|
302
|
-
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
303
|
-
const len0 = WASM_VECTOR_LEN;
|
|
304
|
-
const ptr1 = passStringToWasm0(filename, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
305
|
-
const len1 = WASM_VECTOR_LEN;
|
|
306
|
-
const ret = wasm.diaryxbackend_parseMarkdownFile(this.__wbg_ptr, ptr0, len0, ptr1, len1);
|
|
307
|
-
var ptr3 = ret[0];
|
|
308
|
-
var len3 = ret[1];
|
|
309
|
-
if (ret[3]) {
|
|
310
|
-
ptr3 = 0; len3 = 0;
|
|
311
|
-
throw takeFromExternrefTable0(ret[2]);
|
|
312
|
-
}
|
|
313
|
-
deferred4_0 = ptr3;
|
|
314
|
-
deferred4_1 = len3;
|
|
315
|
-
return getStringFromWasm0(ptr3, len3);
|
|
316
|
-
} finally {
|
|
317
|
-
wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
|
|
318
|
-
}
|
|
319
|
-
}
|
|
320
246
|
/**
|
|
321
247
|
* Read binary file.
|
|
322
248
|
*
|
|
@@ -1269,23 +1195,23 @@ function __wbg_get_imports() {
|
|
|
1269
1195
|
return ret;
|
|
1270
1196
|
}, arguments); },
|
|
1271
1197
|
__wbindgen_cast_0000000000000001: function(arg0, arg1) {
|
|
1272
|
-
// Cast intrinsic for `Closure(Closure { dtor_idx:
|
|
1273
|
-
const ret = makeMutClosure(arg0, arg1, wasm.
|
|
1198
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 1, function: Function { arguments: [NamedExternref("Event")], shim_idx: 2, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
|
|
1199
|
+
const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__h5014fd323cc31ff9, wasm_bindgen__convert__closures_____invoke__hf5f678ae557f5b2d);
|
|
1274
1200
|
return ret;
|
|
1275
1201
|
},
|
|
1276
1202
|
__wbindgen_cast_0000000000000002: function(arg0, arg1) {
|
|
1277
|
-
// Cast intrinsic for `Closure(Closure { dtor_idx:
|
|
1278
|
-
const ret = makeMutClosure(arg0, arg1, wasm.
|
|
1203
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 1, function: Function { arguments: [NamedExternref("IDBVersionChangeEvent")], shim_idx: 3, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
1204
|
+
const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__h5014fd323cc31ff9, wasm_bindgen__convert__closures_____invoke__h564cce8299ee9e62);
|
|
1279
1205
|
return ret;
|
|
1280
1206
|
},
|
|
1281
1207
|
__wbindgen_cast_0000000000000003: function(arg0, arg1) {
|
|
1282
|
-
// Cast intrinsic for `Closure(Closure { dtor_idx:
|
|
1283
|
-
const ret = makeMutClosure(arg0, arg1, wasm.
|
|
1208
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 521, function: Function { arguments: [NamedExternref("Event")], shim_idx: 522, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
1209
|
+
const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__h8cbeca5d5a286ce5, wasm_bindgen__convert__closures_____invoke__hce19dfcc00f4d0b4);
|
|
1284
1210
|
return ret;
|
|
1285
1211
|
},
|
|
1286
1212
|
__wbindgen_cast_0000000000000004: function(arg0, arg1) {
|
|
1287
|
-
// Cast intrinsic for `Closure(Closure { dtor_idx:
|
|
1288
|
-
const ret = makeMutClosure(arg0, arg1, wasm.
|
|
1213
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 537, function: Function { arguments: [Externref], shim_idx: 538, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
1214
|
+
const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__h54530733e565125e, wasm_bindgen__convert__closures_____invoke__h7a6e8b2052e57d0f);
|
|
1289
1215
|
return ret;
|
|
1290
1216
|
},
|
|
1291
1217
|
__wbindgen_cast_0000000000000005: function(arg0) {
|
|
@@ -1324,20 +1250,20 @@ function __wbg_get_imports() {
|
|
|
1324
1250
|
};
|
|
1325
1251
|
}
|
|
1326
1252
|
|
|
1327
|
-
function
|
|
1328
|
-
wasm.
|
|
1253
|
+
function wasm_bindgen__convert__closures_____invoke__h564cce8299ee9e62(arg0, arg1, arg2) {
|
|
1254
|
+
wasm.wasm_bindgen__convert__closures_____invoke__h564cce8299ee9e62(arg0, arg1, arg2);
|
|
1329
1255
|
}
|
|
1330
1256
|
|
|
1331
|
-
function
|
|
1332
|
-
wasm.
|
|
1257
|
+
function wasm_bindgen__convert__closures_____invoke__hce19dfcc00f4d0b4(arg0, arg1, arg2) {
|
|
1258
|
+
wasm.wasm_bindgen__convert__closures_____invoke__hce19dfcc00f4d0b4(arg0, arg1, arg2);
|
|
1333
1259
|
}
|
|
1334
1260
|
|
|
1335
|
-
function
|
|
1336
|
-
wasm.
|
|
1261
|
+
function wasm_bindgen__convert__closures_____invoke__h7a6e8b2052e57d0f(arg0, arg1, arg2) {
|
|
1262
|
+
wasm.wasm_bindgen__convert__closures_____invoke__h7a6e8b2052e57d0f(arg0, arg1, arg2);
|
|
1337
1263
|
}
|
|
1338
1264
|
|
|
1339
|
-
function
|
|
1340
|
-
const ret = wasm.
|
|
1265
|
+
function wasm_bindgen__convert__closures_____invoke__hf5f678ae557f5b2d(arg0, arg1, arg2) {
|
|
1266
|
+
const ret = wasm.wasm_bindgen__convert__closures_____invoke__hf5f678ae557f5b2d(arg0, arg1, arg2);
|
|
1341
1267
|
if (ret[1]) {
|
|
1342
1268
|
throw takeFromExternrefTable0(ret[0]);
|
|
1343
1269
|
}
|
|
@@ -1510,13 +1436,6 @@ function makeMutClosure(arg0, arg1, dtor, f) {
|
|
|
1510
1436
|
return real;
|
|
1511
1437
|
}
|
|
1512
1438
|
|
|
1513
|
-
function passArray8ToWasm0(arg, malloc) {
|
|
1514
|
-
const ptr = malloc(arg.length * 1, 1) >>> 0;
|
|
1515
|
-
getUint8ArrayMemory0().set(arg, ptr / 1);
|
|
1516
|
-
WASM_VECTOR_LEN = arg.length;
|
|
1517
|
-
return ptr;
|
|
1518
|
-
}
|
|
1519
|
-
|
|
1520
1439
|
function passStringToWasm0(arg, malloc, realloc) {
|
|
1521
1440
|
if (realloc === undefined) {
|
|
1522
1441
|
const buf = cachedTextEncoder.encode(arg);
|
package/diaryx_wasm_bg.wasm.d.ts
CHANGED
|
@@ -19,8 +19,6 @@ export const diaryxbackend_getConfig: (a: number) => any;
|
|
|
19
19
|
export const diaryxbackend_hasNativeSync: (a: number) => number;
|
|
20
20
|
export const diaryxbackend_offFileSystemEvent: (a: number, b: bigint) => number;
|
|
21
21
|
export const diaryxbackend_onFileSystemEvent: (a: number, b: any) => bigint;
|
|
22
|
-
export const diaryxbackend_parseDayOneJson: (a: number, b: number, c: number) => [number, number, number, number];
|
|
23
|
-
export const diaryxbackend_parseMarkdownFile: (a: number, b: number, c: number, d: number, e: number) => [number, number, number, number];
|
|
24
22
|
export const diaryxbackend_readBinary: (a: number, b: number, c: number) => any;
|
|
25
23
|
export const diaryxbackend_saveConfig: (a: number, b: any) => any;
|
|
26
24
|
export const diaryxbackend_setCrdtEnabled: (a: number, b: number) => void;
|
|
@@ -37,14 +35,14 @@ export const diaryxbackend_isCrdtEnabled: (a: number) => number;
|
|
|
37
35
|
export const init: () => void;
|
|
38
36
|
export const jsasyncfilesystem_new: (a: any) => number;
|
|
39
37
|
export const __wbg_opfsfilesystem_free: (a: number, b: number) => void;
|
|
40
|
-
export const
|
|
41
|
-
export const
|
|
42
|
-
export const
|
|
43
|
-
export const
|
|
38
|
+
export const wasm_bindgen__closure__destroy__h5014fd323cc31ff9: (a: number, b: number) => void;
|
|
39
|
+
export const wasm_bindgen__closure__destroy__h8cbeca5d5a286ce5: (a: number, b: number) => void;
|
|
40
|
+
export const wasm_bindgen__closure__destroy__h54530733e565125e: (a: number, b: number) => void;
|
|
41
|
+
export const wasm_bindgen__convert__closures_____invoke__hf5f678ae557f5b2d: (a: number, b: number, c: any) => [number, number];
|
|
44
42
|
export const wasm_bindgen__convert__closures_____invoke__h2225c3190ed38e97: (a: number, b: number, c: any, d: any) => void;
|
|
45
|
-
export const
|
|
46
|
-
export const
|
|
47
|
-
export const
|
|
43
|
+
export const wasm_bindgen__convert__closures_____invoke__h564cce8299ee9e62: (a: number, b: number, c: any) => void;
|
|
44
|
+
export const wasm_bindgen__convert__closures_____invoke__hce19dfcc00f4d0b4: (a: number, b: number, c: any) => void;
|
|
45
|
+
export const wasm_bindgen__convert__closures_____invoke__h7a6e8b2052e57d0f: (a: number, b: number, c: any) => void;
|
|
48
46
|
export const __wbindgen_malloc: (a: number, b: number) => number;
|
|
49
47
|
export const __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|
|
50
48
|
export const __wbindgen_exn_store: (a: number) => void;
|
package/package.json
CHANGED