@quillmark/wasm 0.45.0 → 0.47.0

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.
@@ -201,11 +201,15 @@ function debugString(val) {
201
201
  // TODO we could test for more things here, like `Set`s and `Map`s.
202
202
  return className;
203
203
  }
204
- /**
205
- * Initialize the WASM module with panic hooks for better error messages
206
- */
207
- export function init() {
208
- wasm.init();
204
+
205
+ function getArrayJsValueFromWasm0(ptr, len) {
206
+ ptr = ptr >>> 0;
207
+ const mem = getDataViewMemory0();
208
+ const result = [];
209
+ for (let i = ptr; i < ptr + 4 * len; i += 4) {
210
+ result.push(takeObject(mem.getUint32(i, true)));
211
+ }
212
+ return result;
209
213
  }
210
214
 
211
215
  let cachedUint32ArrayMemory0 = null;
@@ -223,15 +227,11 @@ function passArray32ToWasm0(arg, malloc) {
223
227
  WASM_VECTOR_LEN = arg.length;
224
228
  return ptr;
225
229
  }
226
-
227
- function getArrayJsValueFromWasm0(ptr, len) {
228
- ptr = ptr >>> 0;
229
- const mem = getDataViewMemory0();
230
- const result = [];
231
- for (let i = ptr; i < ptr + 4 * len; i += 4) {
232
- result.push(takeObject(mem.getUint32(i, true)));
233
- }
234
- return result;
230
+ /**
231
+ * Initialize the WASM module with panic hooks for better error messages
232
+ */
233
+ export function init() {
234
+ wasm.init();
235
235
  }
236
236
 
237
237
  const CompiledDocumentFinalization = (typeof FinalizationRegistry === 'undefined')
@@ -315,38 +315,51 @@ export class Quillmark {
315
315
  wasm.__wbg_quillmark_free(ptr, 0);
316
316
  }
317
317
  /**
318
- * List registered Quills with their exact versions
318
+ * JavaScript constructor: `new Quillmark()`
319
+ */
320
+ constructor() {
321
+ const ret = wasm.quillmark_new();
322
+ this.__wbg_ptr = ret >>> 0;
323
+ QuillmarkFinalization.register(this, this.__wbg_ptr, this);
324
+ return this;
325
+ }
326
+ /**
327
+ * Parse markdown into a ParsedDocument
319
328
  *
320
- * Returns strings in the format "name@version" (e.g. "resume-template@2.1.0")
321
- * @returns {string[]}
329
+ * This is the first step in the workflow. The returned ParsedDocument contains
330
+ * the parsed YAML frontmatter fields and the quill_ref (from QUILL field or "__default__").
331
+ * @param {string} markdown
332
+ * @returns {ParsedDocument}
322
333
  */
323
- listQuills() {
334
+ static parseMarkdown(markdown) {
324
335
  try {
325
336
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
326
- wasm.quillmark_listQuills(retptr, this.__wbg_ptr);
337
+ const ptr0 = passStringToWasm0(markdown, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
338
+ const len0 = WASM_VECTOR_LEN;
339
+ wasm.quillmark_parseMarkdown(retptr, ptr0, len0);
327
340
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
328
341
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
329
- var v1 = getArrayJsValueFromWasm0(r0, r1).slice();
330
- wasm.__wbindgen_export_3(r0, r1 * 4, 4);
331
- return v1;
342
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
343
+ if (r2) {
344
+ throw takeObject(r1);
345
+ }
346
+ return takeObject(r0);
332
347
  } finally {
333
348
  wasm.__wbindgen_add_to_stack_pointer(16);
334
349
  }
335
350
  }
336
351
  /**
337
- * Compile markdown to JSON data without rendering artifacts.
352
+ * Register a Quill template bundle
338
353
  *
339
- * This exposes the intermediate data structure that would be passed to the backend.
340
- * Useful for debugging and validation.
341
- * @param {string} markdown
342
- * @returns {any}
354
+ * Accepts either a JSON string or a JsValue object representing the Quill file tree.
355
+ * Validation happens automatically on registration.
356
+ * @param {any} quill_json
357
+ * @returns {QuillInfo}
343
358
  */
344
- compileData(markdown) {
359
+ registerQuill(quill_json) {
345
360
  try {
346
361
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
347
- const ptr0 = passStringToWasm0(markdown, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
348
- const len0 = WASM_VECTOR_LEN;
349
- wasm.quillmark_compileData(retptr, this.__wbg_ptr, ptr0, len0);
362
+ wasm.quillmark_registerQuill(retptr, this.__wbg_ptr, addHeapObject(quill_json));
350
363
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
351
364
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
352
365
  var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
@@ -358,21 +371,6 @@ export class Quillmark {
358
371
  wasm.__wbindgen_add_to_stack_pointer(16);
359
372
  }
360
373
  }
361
- /**
362
- * Resolve a Quill reference to a registered Quill, or null if not available
363
- *
364
- * Accepts a quill reference string like "resume-template", "resume-template@2",
365
- * or "resume-template@2.1.0". Returns QuillInfo if the engine can resolve it
366
- * locally, or null if an external fetch is needed.
367
- * @param {string} quill_ref
368
- * @returns {any}
369
- */
370
- resolveQuill(quill_ref) {
371
- const ptr0 = passStringToWasm0(quill_ref, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
372
- const len0 = WASM_VECTOR_LEN;
373
- const ret = wasm.quillmark_resolveQuill(this.__wbg_ptr, ptr0, len0);
374
- return takeObject(ret);
375
- }
376
374
  /**
377
375
  * Get shallow information about a registered Quill
378
376
  *
@@ -399,19 +397,19 @@ export class Quillmark {
399
397
  }
400
398
  }
401
399
  /**
402
- * Parse markdown into a ParsedDocument
400
+ * Get the stripped JSON schema of a Quill (removes UI metadata)
403
401
  *
404
- * This is the first step in the workflow. The returned ParsedDocument contains
405
- * the parsed YAML frontmatter fields and the quill_ref (from QUILL field or "__default__").
406
- * @param {string} markdown
407
- * @returns {ParsedDocument}
402
+ * This returns the schema in a format suitable for feeding to LLMs or
403
+ * other consumers that don't need the UI configuration "x-ui" fields.
404
+ * @param {string} name
405
+ * @returns {any}
408
406
  */
409
- static parseMarkdown(markdown) {
407
+ getStrippedSchema(name) {
410
408
  try {
411
409
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
412
- const ptr0 = passStringToWasm0(markdown, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
410
+ const ptr0 = passStringToWasm0(name, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
413
411
  const len0 = WASM_VECTOR_LEN;
414
- wasm.quillmark_parseMarkdown(retptr, ptr0, len0);
412
+ wasm.quillmark_getStrippedSchema(retptr, this.__wbg_ptr, ptr0, len0);
415
413
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
416
414
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
417
415
  var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
@@ -424,57 +422,46 @@ export class Quillmark {
424
422
  }
425
423
  }
426
424
  /**
427
- * Register a Quill template bundle
425
+ * Perform a dry run validation without backend compilation.
428
426
  *
429
- * Accepts either a JSON string or a JsValue object representing the Quill file tree.
430
- * Validation happens automatically on registration.
431
- * @param {any} quill_json
432
- * @returns {QuillInfo}
427
+ * Executes parsing, schema validation, and template composition to
428
+ * surface input errors quickly. Returns successfully on valid input,
429
+ * or throws an error with diagnostic payload on failure.
430
+ *
431
+ * The quill name is inferred from the markdown's QUILL tag (or defaults to "__default__").
432
+ *
433
+ * This is useful for fast feedback loops in LLM-driven document generation.
434
+ * @param {string} markdown
433
435
  */
434
- registerQuill(quill_json) {
436
+ dryRun(markdown) {
435
437
  try {
436
438
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
437
- wasm.quillmark_registerQuill(retptr, this.__wbg_ptr, addHeapObject(quill_json));
439
+ const ptr0 = passStringToWasm0(markdown, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
440
+ const len0 = WASM_VECTOR_LEN;
441
+ wasm.quillmark_dryRun(retptr, this.__wbg_ptr, ptr0, len0);
438
442
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
439
443
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
440
- var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
441
- if (r2) {
442
- throw takeObject(r1);
444
+ if (r1) {
445
+ throw takeObject(r0);
443
446
  }
444
- return takeObject(r0);
445
447
  } finally {
446
448
  wasm.__wbindgen_add_to_stack_pointer(16);
447
449
  }
448
450
  }
449
451
  /**
450
- * Unregister a Quill by name or specific version
451
- *
452
- * If a base name is provided (e.g., "my-quill"), all versions of that quill are freed.
453
- * If a versioned name is provided (e.g., "my-quill@2.1.0"), only that specific version is freed.
454
- * Returns true if something was unregistered, false if not found.
455
- * @param {string} name_or_ref
456
- * @returns {boolean}
457
- */
458
- unregisterQuill(name_or_ref) {
459
- const ptr0 = passStringToWasm0(name_or_ref, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
460
- const len0 = WASM_VECTOR_LEN;
461
- const ret = wasm.quillmark_unregisterQuill(this.__wbg_ptr, ptr0, len0);
462
- return ret !== 0;
463
- }
464
- /**
465
- * Get the stripped JSON schema of a Quill (removes UI metadata)
452
+ * Compile markdown to JSON data without rendering artifacts.
466
453
  *
467
- * This returns the schema in a format suitable for feeding to LLMs or
468
- * other consumers that don't need the UI configuration "x-ui" fields.
469
- * @param {string} name
454
+ * This exposes the intermediate data structure that would be passed to the backend.
455
+ * Useful for debugging and validation.
456
+ * @param {string} markdown
470
457
  * @returns {any}
471
458
  */
472
- getStrippedSchema(name) {
459
+ compileData(markdown) {
473
460
  try {
474
461
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
475
- const ptr0 = passStringToWasm0(name, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
462
+ const ptr0 = passStringToWasm0(markdown, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
476
463
  const len0 = WASM_VECTOR_LEN;
477
- wasm.quillmark_getStrippedSchema(retptr, this.__wbg_ptr, ptr0, len0);
464
+ wasm.quillmark_compileData(retptr, this.__wbg_ptr, ptr0, len0);
478
465
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
479
466
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
480
467
  var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
@@ -486,15 +473,6 @@ export class Quillmark {
486
473
  wasm.__wbindgen_add_to_stack_pointer(16);
487
474
  }
488
475
  }
489
- /**
490
- * JavaScript constructor: `new Quillmark()`
491
- */
492
- constructor() {
493
- const ret = wasm.quillmark_new();
494
- this.__wbg_ptr = ret >>> 0;
495
- QuillmarkFinalization.register(this, this.__wbg_ptr, this);
496
- return this;
497
- }
498
476
  /**
499
477
  * Render a ParsedDocument to final artifacts (PDF, SVG, TXT)
500
478
  *
@@ -542,32 +520,54 @@ export class Quillmark {
542
520
  }
543
521
  }
544
522
  /**
545
- * Perform a dry run validation without backend compilation.
546
- *
547
- * Executes parsing, schema validation, and template composition to
548
- * surface input errors quickly. Returns successfully on valid input,
549
- * or throws an error with diagnostic payload on failure.
523
+ * Resolve a Quill reference to a registered Quill, or null if not available
550
524
  *
551
- * The quill name is inferred from the markdown's QUILL tag (or defaults to "__default__").
525
+ * Accepts a quill reference string like "resume-template", "resume-template@2",
526
+ * or "resume-template@2.1.0". Returns QuillInfo if the engine can resolve it
527
+ * locally, or null if an external fetch is needed.
528
+ * @param {string} quill_ref
529
+ * @returns {any}
530
+ */
531
+ resolveQuill(quill_ref) {
532
+ const ptr0 = passStringToWasm0(quill_ref, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
533
+ const len0 = WASM_VECTOR_LEN;
534
+ const ret = wasm.quillmark_resolveQuill(this.__wbg_ptr, ptr0, len0);
535
+ return takeObject(ret);
536
+ }
537
+ /**
538
+ * List registered Quills with their exact versions
552
539
  *
553
- * This is useful for fast feedback loops in LLM-driven document generation.
554
- * @param {string} markdown
540
+ * Returns strings in the format "name@version" (e.g. "resume-template@2.1.0")
541
+ * @returns {string[]}
555
542
  */
556
- dryRun(markdown) {
543
+ listQuills() {
557
544
  try {
558
545
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
559
- const ptr0 = passStringToWasm0(markdown, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
560
- const len0 = WASM_VECTOR_LEN;
561
- wasm.quillmark_dryRun(retptr, this.__wbg_ptr, ptr0, len0);
546
+ wasm.quillmark_listQuills(retptr, this.__wbg_ptr);
562
547
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
563
548
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
564
- if (r1) {
565
- throw takeObject(r0);
566
- }
549
+ var v1 = getArrayJsValueFromWasm0(r0, r1).slice();
550
+ wasm.__wbindgen_export_3(r0, r1 * 4, 4);
551
+ return v1;
567
552
  } finally {
568
553
  wasm.__wbindgen_add_to_stack_pointer(16);
569
554
  }
570
555
  }
556
+ /**
557
+ * Unregister a Quill by name or specific version
558
+ *
559
+ * If a base name is provided (e.g., "my-quill"), all versions of that quill are freed.
560
+ * If a versioned name is provided (e.g., "my-quill@2.1.0"), only that specific version is freed.
561
+ * Returns true if something was unregistered, false if not found.
562
+ * @param {string} name_or_ref
563
+ * @returns {boolean}
564
+ */
565
+ unregisterQuill(name_or_ref) {
566
+ const ptr0 = passStringToWasm0(name_or_ref, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
567
+ const len0 = WASM_VECTOR_LEN;
568
+ const ret = wasm.quillmark_unregisterQuill(this.__wbg_ptr, ptr0, len0);
569
+ return ret !== 0;
570
+ }
571
571
  }
572
572
  if (Symbol.dispose) Quillmark.prototype[Symbol.dispose] = Quillmark.prototype.free;
573
573
 
Binary file
@@ -1,39 +1,39 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
3
  export const memory: WebAssembly.Memory;
4
- export const __wbg_compileddocument_free: (a: number, b: number) => void;
5
4
  export const __wbg_quillmark_free: (a: number, b: number) => void;
6
- export const compileddocument_pageCount: (a: number) => number;
7
- export const compileddocument_renderPages: (a: number, b: number, c: number, d: number, e: number) => void;
8
- export const init: () => void;
9
- export const quillmark_compile: (a: number, b: number, c: number, d: number) => void;
10
- export const quillmark_compileData: (a: number, b: number, c: number, d: number) => void;
11
- export const quillmark_dryRun: (a: number, b: number, c: number, d: number) => void;
12
- export const quillmark_getQuillInfo: (a: number, b: number, c: number, d: number) => void;
13
- export const quillmark_getStrippedSchema: (a: number, b: number, c: number, d: number) => void;
14
- export const quillmark_listQuills: (a: number, b: number) => void;
5
+ export const __wbg_compileddocument_free: (a: number, b: number) => void;
15
6
  export const quillmark_new: () => number;
16
7
  export const quillmark_parseMarkdown: (a: number, b: number, c: number) => void;
17
8
  export const quillmark_registerQuill: (a: number, b: number, c: number) => void;
9
+ export const quillmark_getQuillInfo: (a: number, b: number, c: number, d: number) => void;
10
+ export const quillmark_getStrippedSchema: (a: number, b: number, c: number, d: number) => void;
11
+ export const quillmark_dryRun: (a: number, b: number, c: number, d: number) => void;
12
+ export const quillmark_compileData: (a: number, b: number, c: number, d: number) => void;
18
13
  export const quillmark_render: (a: number, b: number, c: number, d: number) => void;
14
+ export const quillmark_compile: (a: number, b: number, c: number, d: number) => void;
19
15
  export const quillmark_resolveQuill: (a: number, b: number, c: number) => number;
16
+ export const quillmark_listQuills: (a: number, b: number) => void;
20
17
  export const quillmark_unregisterQuill: (a: number, b: number, c: number) => number;
21
- export const lut_inverse_interp16: (a: number, b: number, c: number) => number;
22
- export const qcms_profile_precache_output_transform: (a: number) => void;
18
+ export const compileddocument_pageCount: (a: number) => number;
19
+ export const compileddocument_renderPages: (a: number, b: number, c: number, d: number, e: number) => void;
20
+ export const init: () => void;
21
+ export const qcms_profile_is_bogus: (a: number) => number;
23
22
  export const qcms_white_point_sRGB: (a: number) => void;
24
- export const qcms_transform_data_rgb_out_lut: (a: number, b: number, c: number, d: number) => void;
25
- export const qcms_transform_data_rgba_out_lut: (a: number, b: number, c: number, d: number) => void;
26
- export const qcms_transform_data_bgra_out_lut: (a: number, b: number, c: number, d: number) => void;
23
+ export const qcms_profile_precache_output_transform: (a: number) => void;
27
24
  export const qcms_transform_data_rgb_out_lut_precache: (a: number, b: number, c: number, d: number) => void;
28
25
  export const qcms_transform_data_rgba_out_lut_precache: (a: number, b: number, c: number, d: number) => void;
29
26
  export const qcms_transform_data_bgra_out_lut_precache: (a: number, b: number, c: number, d: number) => void;
30
- export const lut_interp_linear16: (a: number, b: number, c: number) => number;
31
- export const qcms_enable_iccv4: () => void;
32
- export const qcms_profile_is_bogus: (a: number) => number;
27
+ export const qcms_transform_data_rgb_out_lut: (a: number, b: number, c: number, d: number) => void;
28
+ export const qcms_transform_data_rgba_out_lut: (a: number, b: number, c: number, d: number) => void;
29
+ export const qcms_transform_data_bgra_out_lut: (a: number, b: number, c: number, d: number) => void;
33
30
  export const qcms_transform_release: (a: number) => void;
34
- export const __wbindgen_export_0: (a: number, b: number) => number;
35
- export const __wbindgen_export_1: (a: number, b: number, c: number, d: number) => number;
36
- export const __wbindgen_export_2: (a: number) => void;
37
- export const __wbindgen_export_3: (a: number, b: number, c: number) => void;
31
+ export const qcms_enable_iccv4: () => void;
32
+ export const lut_interp_linear16: (a: number, b: number, c: number) => number;
33
+ export const lut_inverse_interp16: (a: number, b: number, c: number) => number;
34
+ export const __wbindgen_export: (a: number, b: number) => number;
35
+ export const __wbindgen_export2: (a: number, b: number, c: number, d: number) => number;
36
+ export const __wbindgen_export3: (a: number) => void;
37
+ export const __wbindgen_export4: (a: number, b: number, c: number) => void;
38
38
  export const __wbindgen_add_to_stack_pointer: (a: number) => number;
39
39
  export const __wbindgen_start: () => void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quillmark/wasm",
3
- "version": "0.45.0",
3
+ "version": "0.47.0",
4
4
  "description": "WebAssembly bindings for quillmark",
5
5
  "type": "module",
6
6
  "license": "MIT OR Apache-2.0",