@quillmark/wasm 0.29.0 → 0.31.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.
- package/README.md +4 -4
- package/bundler/wasm.d.ts +56 -49
- package/bundler/wasm_bg.js +96 -71
- package/bundler/wasm_bg.wasm +0 -0
- package/bundler/wasm_bg.wasm.d.ts +14 -13
- package/node-esm/wasm.d.ts +56 -49
- package/node-esm/wasm_bg.js +96 -71
- package/node-esm/wasm_bg.wasm +0 -0
- package/node-esm/wasm_bg.wasm.d.ts +14 -13
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -54,7 +54,7 @@ import { Quillmark } from '@quillmark-test/wasm';
|
|
|
54
54
|
const markdown = `---
|
|
55
55
|
title: My Document
|
|
56
56
|
author: Alice
|
|
57
|
-
QUILL:
|
|
57
|
+
QUILL: my_quill
|
|
58
58
|
---
|
|
59
59
|
|
|
60
60
|
# Hello World
|
|
@@ -70,7 +70,7 @@ const engine = new Quillmark();
|
|
|
70
70
|
const quillJson = {
|
|
71
71
|
files: {
|
|
72
72
|
'Quill.toml': {
|
|
73
|
-
contents: '[Quill]\nname = "
|
|
73
|
+
contents: '[Quill]\nname = "my_quill"\nversion = "1.0"\nbackend = "typst"\nplate_file = "plate.typ"\ndescription = "My template"\n'
|
|
74
74
|
},
|
|
75
75
|
'plate.typ': {
|
|
76
76
|
contents: '= {{ title }}\n\n{{ body | Content }}'
|
|
@@ -123,7 +123,7 @@ Additional methods for managing the engine and debugging:
|
|
|
123
123
|
{
|
|
124
124
|
format?: 'pdf' | 'svg' | 'txt', // Output format (default: 'pdf')
|
|
125
125
|
assets?: Record<string, Uint8Array>, // Additional assets to inject as plain object (not Map)
|
|
126
|
-
quillName?: string // Override
|
|
126
|
+
quillName?: string // Override quillName from ParsedDocument
|
|
127
127
|
}
|
|
128
128
|
```
|
|
129
129
|
|
|
@@ -134,7 +134,7 @@ Returned by `parseMarkdown()`:
|
|
|
134
134
|
```typescript
|
|
135
135
|
{
|
|
136
136
|
fields: object, // YAML frontmatter fields
|
|
137
|
-
|
|
137
|
+
quillName: string // Template name from QUILL field (or "__default__")
|
|
138
138
|
}
|
|
139
139
|
```
|
|
140
140
|
|
package/bundler/wasm.d.ts
CHANGED
|
@@ -4,14 +4,19 @@
|
|
|
4
4
|
* Initialize the WASM module with panic hooks for better error messages
|
|
5
5
|
*/
|
|
6
6
|
export function init(): void;
|
|
7
|
-
export type OutputFormat = "pdf" | "svg" | "txt";
|
|
8
|
-
|
|
9
7
|
export type Severity = "error" | "warning" | "note";
|
|
10
8
|
|
|
11
|
-
export interface
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
9
|
+
export interface Artifact {
|
|
10
|
+
format: OutputFormat;
|
|
11
|
+
bytes: Uint8Array;
|
|
12
|
+
mimeType: string;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export interface RenderResult {
|
|
16
|
+
artifacts: Artifact[];
|
|
17
|
+
warnings: Diagnostic[];
|
|
18
|
+
outputFormat: OutputFormat;
|
|
19
|
+
renderTimeMs: number;
|
|
15
20
|
}
|
|
16
21
|
|
|
17
22
|
export interface Diagnostic {
|
|
@@ -23,17 +28,17 @@ export interface Diagnostic {
|
|
|
23
28
|
sourceChain: string[];
|
|
24
29
|
}
|
|
25
30
|
|
|
26
|
-
export
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
31
|
+
export type OutputFormat = "pdf" | "svg" | "txt";
|
|
32
|
+
|
|
33
|
+
export interface Location {
|
|
34
|
+
file: string;
|
|
35
|
+
line: number;
|
|
36
|
+
column: number;
|
|
30
37
|
}
|
|
31
38
|
|
|
32
|
-
export interface
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
outputFormat: OutputFormat;
|
|
36
|
-
renderTimeMs: number;
|
|
39
|
+
export interface ParsedDocument {
|
|
40
|
+
fields: Record<string, any>;
|
|
41
|
+
quillName: string;
|
|
37
42
|
}
|
|
38
43
|
|
|
39
44
|
export interface QuillInfo {
|
|
@@ -47,11 +52,6 @@ export interface QuillInfo {
|
|
|
47
52
|
supportedFormats: OutputFormat[];
|
|
48
53
|
}
|
|
49
54
|
|
|
50
|
-
export interface ParsedDocument {
|
|
51
|
-
fields: Record<string, any>;
|
|
52
|
-
quillTag: string;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
55
|
export interface RenderOptions {
|
|
56
56
|
format?: OutputFormat;
|
|
57
57
|
assets?: Record<string, Uint8Array | number[]>;
|
|
@@ -67,14 +67,28 @@ export class Quillmark {
|
|
|
67
67
|
free(): void;
|
|
68
68
|
[Symbol.dispose](): void;
|
|
69
69
|
/**
|
|
70
|
-
*
|
|
70
|
+
* List registered Quill names
|
|
71
71
|
*/
|
|
72
|
-
|
|
72
|
+
listQuills(): string[];
|
|
73
|
+
/**
|
|
74
|
+
* Compile markdown to JSON data without rendering artifacts.
|
|
75
|
+
*
|
|
76
|
+
* This exposes the intermediate data structure that would be passed to the backend.
|
|
77
|
+
* Useful for debugging and validation.
|
|
78
|
+
*/
|
|
79
|
+
compileData(markdown: string): any;
|
|
80
|
+
/**
|
|
81
|
+
* Get shallow information about a registered Quill
|
|
82
|
+
*
|
|
83
|
+
* This returns metadata, backend info, field schemas, and supported formats
|
|
84
|
+
* that consumers need to configure render options for the next step.
|
|
85
|
+
*/
|
|
86
|
+
getQuillInfo(name: string): QuillInfo;
|
|
73
87
|
/**
|
|
74
88
|
* Parse markdown into a ParsedDocument
|
|
75
89
|
*
|
|
76
90
|
* This is the first step in the workflow. The returned ParsedDocument contains
|
|
77
|
-
* the parsed YAML frontmatter fields and the
|
|
91
|
+
* the parsed YAML frontmatter fields and the quill_name (from QUILL field or "__default__").
|
|
78
92
|
*/
|
|
79
93
|
static parseMarkdown(markdown: string): ParsedDocument;
|
|
80
94
|
/**
|
|
@@ -85,44 +99,37 @@ export class Quillmark {
|
|
|
85
99
|
*/
|
|
86
100
|
registerQuill(quill_json: any): QuillInfo;
|
|
87
101
|
/**
|
|
88
|
-
*
|
|
89
|
-
*
|
|
90
|
-
* This returns metadata, backend info, field schemas, and supported formats
|
|
91
|
-
* that consumers need to configure render options for the next step.
|
|
102
|
+
* Unregister a Quill (free memory)
|
|
92
103
|
*/
|
|
93
|
-
|
|
104
|
+
unregisterQuill(name: string): void;
|
|
94
105
|
/**
|
|
95
|
-
*
|
|
96
|
-
*
|
|
97
|
-
* Executes parsing, schema validation, and template composition to
|
|
98
|
-
* surface input errors quickly. Returns successfully on valid input,
|
|
99
|
-
* or throws an error with diagnostic payload on failure.
|
|
100
|
-
*
|
|
101
|
-
* The quill name is inferred from the markdown's QUILL tag (or defaults to "__default__").
|
|
106
|
+
* Get the stripped JSON schema of a Quill (removes UI metadata)
|
|
102
107
|
*
|
|
103
|
-
* This
|
|
108
|
+
* This returns the schema in a format suitable for feeding to LLMs or
|
|
109
|
+
* other consumers that don't need the UI configuration "x-ui" fields.
|
|
104
110
|
*/
|
|
105
|
-
|
|
111
|
+
getStrippedSchema(name: string): any;
|
|
106
112
|
/**
|
|
107
|
-
*
|
|
108
|
-
*
|
|
109
|
-
* This exposes the intermediate data structure that would be passed to the backend.
|
|
110
|
-
* Useful for debugging and validation.
|
|
113
|
+
* JavaScript constructor: `new Quillmark()`
|
|
111
114
|
*/
|
|
112
|
-
|
|
115
|
+
constructor();
|
|
113
116
|
/**
|
|
114
117
|
* Render a ParsedDocument to final artifacts (PDF, SVG, TXT)
|
|
115
118
|
*
|
|
116
119
|
* Uses the Quill specified in options.quill_name if provided,
|
|
117
|
-
* otherwise infers it from the ParsedDocument's
|
|
120
|
+
* otherwise infers it from the ParsedDocument's quill_name field.
|
|
118
121
|
*/
|
|
119
122
|
render(parsed: ParsedDocument, opts: RenderOptions): RenderResult;
|
|
120
123
|
/**
|
|
121
|
-
*
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
*
|
|
124
|
+
* Perform a dry run validation without backend compilation.
|
|
125
|
+
*
|
|
126
|
+
* Executes parsing, schema validation, and template composition to
|
|
127
|
+
* surface input errors quickly. Returns successfully on valid input,
|
|
128
|
+
* or throws an error with diagnostic payload on failure.
|
|
129
|
+
*
|
|
130
|
+
* The quill name is inferred from the markdown's QUILL tag (or defaults to "__default__").
|
|
131
|
+
*
|
|
132
|
+
* This is useful for fast feedback loops in LLM-driven document generation.
|
|
126
133
|
*/
|
|
127
|
-
|
|
134
|
+
dryRun(markdown: string): void;
|
|
128
135
|
}
|
package/bundler/wasm_bg.js
CHANGED
|
@@ -207,6 +207,12 @@ function debugString(val) {
|
|
|
207
207
|
// TODO we could test for more things here, like `Set`s and `Map`s.
|
|
208
208
|
return className;
|
|
209
209
|
}
|
|
210
|
+
/**
|
|
211
|
+
* Initialize the WASM module with panic hooks for better error messages
|
|
212
|
+
*/
|
|
213
|
+
export function init() {
|
|
214
|
+
wasm.init();
|
|
215
|
+
}
|
|
210
216
|
|
|
211
217
|
function getArrayJsValueFromWasm0(ptr, len) {
|
|
212
218
|
ptr = ptr >>> 0;
|
|
@@ -217,12 +223,6 @@ function getArrayJsValueFromWasm0(ptr, len) {
|
|
|
217
223
|
}
|
|
218
224
|
return result;
|
|
219
225
|
}
|
|
220
|
-
/**
|
|
221
|
-
* Initialize the WASM module with panic hooks for better error messages
|
|
222
|
-
*/
|
|
223
|
-
export function init() {
|
|
224
|
-
wasm.init();
|
|
225
|
-
}
|
|
226
226
|
|
|
227
227
|
const QuillmarkFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
228
228
|
? { register: () => {}, unregister: () => {} }
|
|
@@ -246,28 +246,36 @@ export class Quillmark {
|
|
|
246
246
|
wasm.__wbg_quillmark_free(ptr, 0);
|
|
247
247
|
}
|
|
248
248
|
/**
|
|
249
|
-
*
|
|
249
|
+
* List registered Quill names
|
|
250
|
+
* @returns {string[]}
|
|
250
251
|
*/
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
252
|
+
listQuills() {
|
|
253
|
+
try {
|
|
254
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
255
|
+
wasm.quillmark_listQuills(retptr, this.__wbg_ptr);
|
|
256
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
257
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
258
|
+
var v1 = getArrayJsValueFromWasm0(r0, r1).slice();
|
|
259
|
+
wasm.__wbindgen_export_3(r0, r1 * 4, 4);
|
|
260
|
+
return v1;
|
|
261
|
+
} finally {
|
|
262
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
263
|
+
}
|
|
256
264
|
}
|
|
257
265
|
/**
|
|
258
|
-
*
|
|
266
|
+
* Compile markdown to JSON data without rendering artifacts.
|
|
259
267
|
*
|
|
260
|
-
* This
|
|
261
|
-
*
|
|
268
|
+
* This exposes the intermediate data structure that would be passed to the backend.
|
|
269
|
+
* Useful for debugging and validation.
|
|
262
270
|
* @param {string} markdown
|
|
263
|
-
* @returns {
|
|
271
|
+
* @returns {any}
|
|
264
272
|
*/
|
|
265
|
-
|
|
273
|
+
compileData(markdown) {
|
|
266
274
|
try {
|
|
267
275
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
268
276
|
const ptr0 = passStringToWasm0(markdown, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
269
277
|
const len0 = WASM_VECTOR_LEN;
|
|
270
|
-
wasm.
|
|
278
|
+
wasm.quillmark_compileData(retptr, this.__wbg_ptr, ptr0, len0);
|
|
271
279
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
272
280
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
273
281
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
@@ -280,17 +288,19 @@ export class Quillmark {
|
|
|
280
288
|
}
|
|
281
289
|
}
|
|
282
290
|
/**
|
|
283
|
-
*
|
|
291
|
+
* Get shallow information about a registered Quill
|
|
284
292
|
*
|
|
285
|
-
*
|
|
286
|
-
*
|
|
287
|
-
* @param {
|
|
293
|
+
* This returns metadata, backend info, field schemas, and supported formats
|
|
294
|
+
* that consumers need to configure render options for the next step.
|
|
295
|
+
* @param {string} name
|
|
288
296
|
* @returns {QuillInfo}
|
|
289
297
|
*/
|
|
290
|
-
|
|
298
|
+
getQuillInfo(name) {
|
|
291
299
|
try {
|
|
292
300
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
293
|
-
|
|
301
|
+
const ptr0 = passStringToWasm0(name, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
302
|
+
const len0 = WASM_VECTOR_LEN;
|
|
303
|
+
wasm.quillmark_getQuillInfo(retptr, this.__wbg_ptr, ptr0, len0);
|
|
294
304
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
295
305
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
296
306
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
@@ -303,19 +313,19 @@ export class Quillmark {
|
|
|
303
313
|
}
|
|
304
314
|
}
|
|
305
315
|
/**
|
|
306
|
-
*
|
|
316
|
+
* Parse markdown into a ParsedDocument
|
|
307
317
|
*
|
|
308
|
-
* This
|
|
309
|
-
*
|
|
310
|
-
* @param {string}
|
|
311
|
-
* @returns {
|
|
318
|
+
* This is the first step in the workflow. The returned ParsedDocument contains
|
|
319
|
+
* the parsed YAML frontmatter fields and the quill_name (from QUILL field or "__default__").
|
|
320
|
+
* @param {string} markdown
|
|
321
|
+
* @returns {ParsedDocument}
|
|
312
322
|
*/
|
|
313
|
-
|
|
323
|
+
static parseMarkdown(markdown) {
|
|
314
324
|
try {
|
|
315
325
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
316
|
-
const ptr0 = passStringToWasm0(
|
|
326
|
+
const ptr0 = passStringToWasm0(markdown, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
317
327
|
const len0 = WASM_VECTOR_LEN;
|
|
318
|
-
wasm.
|
|
328
|
+
wasm.quillmark_parseMarkdown(retptr, ptr0, len0);
|
|
319
329
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
320
330
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
321
331
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
@@ -328,46 +338,51 @@ export class Quillmark {
|
|
|
328
338
|
}
|
|
329
339
|
}
|
|
330
340
|
/**
|
|
331
|
-
*
|
|
332
|
-
*
|
|
333
|
-
* Executes parsing, schema validation, and template composition to
|
|
334
|
-
* surface input errors quickly. Returns successfully on valid input,
|
|
335
|
-
* or throws an error with diagnostic payload on failure.
|
|
336
|
-
*
|
|
337
|
-
* The quill name is inferred from the markdown's QUILL tag (or defaults to "__default__").
|
|
341
|
+
* Register a Quill template bundle
|
|
338
342
|
*
|
|
339
|
-
*
|
|
340
|
-
*
|
|
343
|
+
* Accepts either a JSON string or a JsValue object representing the Quill file tree.
|
|
344
|
+
* Validation happens automatically on registration.
|
|
345
|
+
* @param {any} quill_json
|
|
346
|
+
* @returns {QuillInfo}
|
|
341
347
|
*/
|
|
342
|
-
|
|
348
|
+
registerQuill(quill_json) {
|
|
343
349
|
try {
|
|
344
350
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
345
|
-
|
|
346
|
-
const len0 = WASM_VECTOR_LEN;
|
|
347
|
-
wasm.quillmark_dryRun(retptr, this.__wbg_ptr, ptr0, len0);
|
|
351
|
+
wasm.quillmark_registerQuill(retptr, this.__wbg_ptr, addHeapObject(quill_json));
|
|
348
352
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
349
353
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
350
|
-
|
|
351
|
-
|
|
354
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
355
|
+
if (r2) {
|
|
356
|
+
throw takeObject(r1);
|
|
352
357
|
}
|
|
358
|
+
return takeObject(r0);
|
|
353
359
|
} finally {
|
|
354
360
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
355
361
|
}
|
|
356
362
|
}
|
|
357
363
|
/**
|
|
358
|
-
*
|
|
364
|
+
* Unregister a Quill (free memory)
|
|
365
|
+
* @param {string} name
|
|
366
|
+
*/
|
|
367
|
+
unregisterQuill(name) {
|
|
368
|
+
const ptr0 = passStringToWasm0(name, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
369
|
+
const len0 = WASM_VECTOR_LEN;
|
|
370
|
+
wasm.quillmark_unregisterQuill(this.__wbg_ptr, ptr0, len0);
|
|
371
|
+
}
|
|
372
|
+
/**
|
|
373
|
+
* Get the stripped JSON schema of a Quill (removes UI metadata)
|
|
359
374
|
*
|
|
360
|
-
* This
|
|
361
|
-
*
|
|
362
|
-
* @param {string}
|
|
375
|
+
* This returns the schema in a format suitable for feeding to LLMs or
|
|
376
|
+
* other consumers that don't need the UI configuration "x-ui" fields.
|
|
377
|
+
* @param {string} name
|
|
363
378
|
* @returns {any}
|
|
364
379
|
*/
|
|
365
|
-
|
|
380
|
+
getStrippedSchema(name) {
|
|
366
381
|
try {
|
|
367
382
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
368
|
-
const ptr0 = passStringToWasm0(
|
|
383
|
+
const ptr0 = passStringToWasm0(name, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
369
384
|
const len0 = WASM_VECTOR_LEN;
|
|
370
|
-
wasm.
|
|
385
|
+
wasm.quillmark_getStrippedSchema(retptr, this.__wbg_ptr, ptr0, len0);
|
|
371
386
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
372
387
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
373
388
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
@@ -379,11 +394,20 @@ export class Quillmark {
|
|
|
379
394
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
380
395
|
}
|
|
381
396
|
}
|
|
397
|
+
/**
|
|
398
|
+
* JavaScript constructor: `new Quillmark()`
|
|
399
|
+
*/
|
|
400
|
+
constructor() {
|
|
401
|
+
const ret = wasm.quillmark_new();
|
|
402
|
+
this.__wbg_ptr = ret >>> 0;
|
|
403
|
+
QuillmarkFinalization.register(this, this.__wbg_ptr, this);
|
|
404
|
+
return this;
|
|
405
|
+
}
|
|
382
406
|
/**
|
|
383
407
|
* Render a ParsedDocument to final artifacts (PDF, SVG, TXT)
|
|
384
408
|
*
|
|
385
409
|
* Uses the Quill specified in options.quill_name if provided,
|
|
386
|
-
* otherwise infers it from the ParsedDocument's
|
|
410
|
+
* otherwise infers it from the ParsedDocument's quill_name field.
|
|
387
411
|
* @param {ParsedDocument} parsed
|
|
388
412
|
* @param {RenderOptions} opts
|
|
389
413
|
* @returns {RenderResult}
|
|
@@ -404,31 +428,32 @@ export class Quillmark {
|
|
|
404
428
|
}
|
|
405
429
|
}
|
|
406
430
|
/**
|
|
407
|
-
*
|
|
408
|
-
*
|
|
431
|
+
* Perform a dry run validation without backend compilation.
|
|
432
|
+
*
|
|
433
|
+
* Executes parsing, schema validation, and template composition to
|
|
434
|
+
* surface input errors quickly. Returns successfully on valid input,
|
|
435
|
+
* or throws an error with diagnostic payload on failure.
|
|
436
|
+
*
|
|
437
|
+
* The quill name is inferred from the markdown's QUILL tag (or defaults to "__default__").
|
|
438
|
+
*
|
|
439
|
+
* This is useful for fast feedback loops in LLM-driven document generation.
|
|
440
|
+
* @param {string} markdown
|
|
409
441
|
*/
|
|
410
|
-
|
|
442
|
+
dryRun(markdown) {
|
|
411
443
|
try {
|
|
412
444
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
413
|
-
wasm.
|
|
445
|
+
const ptr0 = passStringToWasm0(markdown, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
446
|
+
const len0 = WASM_VECTOR_LEN;
|
|
447
|
+
wasm.quillmark_dryRun(retptr, this.__wbg_ptr, ptr0, len0);
|
|
414
448
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
415
449
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
450
|
+
if (r1) {
|
|
451
|
+
throw takeObject(r0);
|
|
452
|
+
}
|
|
419
453
|
} finally {
|
|
420
454
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
421
455
|
}
|
|
422
456
|
}
|
|
423
|
-
/**
|
|
424
|
-
* Unregister a Quill (free memory)
|
|
425
|
-
* @param {string} name
|
|
426
|
-
*/
|
|
427
|
-
unregisterQuill(name) {
|
|
428
|
-
const ptr0 = passStringToWasm0(name, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
429
|
-
const len0 = WASM_VECTOR_LEN;
|
|
430
|
-
wasm.quillmark_unregisterQuill(this.__wbg_ptr, ptr0, len0);
|
|
431
|
-
}
|
|
432
457
|
}
|
|
433
458
|
if (Symbol.dispose) Quillmark.prototype[Symbol.dispose] = Quillmark.prototype.free;
|
|
434
459
|
|
package/bundler/wasm_bg.wasm
CHANGED
|
Binary file
|
|
@@ -2,29 +2,30 @@
|
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
export const memory: WebAssembly.Memory;
|
|
4
4
|
export const __wbg_quillmark_free: (a: number, b: number) => void;
|
|
5
|
+
export const init: () => void;
|
|
6
|
+
export const quillmark_compileData: (a: number, b: number, c: number, d: number) => void;
|
|
7
|
+
export const quillmark_dryRun: (a: number, b: number, c: number, d: number) => void;
|
|
8
|
+
export const quillmark_getQuillInfo: (a: number, b: number, c: number, d: number) => void;
|
|
9
|
+
export const quillmark_getStrippedSchema: (a: number, b: number, c: number, d: number) => void;
|
|
10
|
+
export const quillmark_listQuills: (a: number, b: number) => void;
|
|
5
11
|
export const quillmark_new: () => number;
|
|
6
12
|
export const quillmark_parseMarkdown: (a: number, b: number, c: number) => void;
|
|
7
13
|
export const quillmark_registerQuill: (a: number, b: number, c: number) => void;
|
|
8
|
-
export const quillmark_getQuillInfo: (a: number, b: number, c: number, d: number) => void;
|
|
9
|
-
export const quillmark_dryRun: (a: number, b: number, c: number, d: number) => void;
|
|
10
|
-
export const quillmark_compileData: (a: number, b: number, c: number, d: number) => void;
|
|
11
14
|
export const quillmark_render: (a: number, b: number, c: number, d: number) => void;
|
|
12
|
-
export const quillmark_listQuills: (a: number, b: number) => void;
|
|
13
15
|
export const quillmark_unregisterQuill: (a: number, b: number, c: number) => void;
|
|
14
|
-
export const
|
|
15
|
-
export const qcms_profile_is_bogus: (a: number) => number;
|
|
16
|
-
export const qcms_white_point_sRGB: (a: number) => void;
|
|
16
|
+
export const lut_inverse_interp16: (a: number, b: number, c: number) => number;
|
|
17
17
|
export const qcms_profile_precache_output_transform: (a: number) => void;
|
|
18
|
-
export const
|
|
19
|
-
export const qcms_transform_data_rgba_out_lut_precache: (a: number, b: number, c: number, d: number) => void;
|
|
20
|
-
export const qcms_transform_data_bgra_out_lut_precache: (a: number, b: number, c: number, d: number) => void;
|
|
18
|
+
export const qcms_white_point_sRGB: (a: number) => void;
|
|
21
19
|
export const qcms_transform_data_rgb_out_lut: (a: number, b: number, c: number, d: number) => void;
|
|
22
20
|
export const qcms_transform_data_rgba_out_lut: (a: number, b: number, c: number, d: number) => void;
|
|
23
21
|
export const qcms_transform_data_bgra_out_lut: (a: number, b: number, c: number, d: number) => void;
|
|
24
|
-
export const
|
|
25
|
-
export const
|
|
22
|
+
export const qcms_transform_data_rgb_out_lut_precache: (a: number, b: number, c: number, d: number) => void;
|
|
23
|
+
export const qcms_transform_data_rgba_out_lut_precache: (a: number, b: number, c: number, d: number) => void;
|
|
24
|
+
export const qcms_transform_data_bgra_out_lut_precache: (a: number, b: number, c: number, d: number) => void;
|
|
26
25
|
export const lut_interp_linear16: (a: number, b: number, c: number) => number;
|
|
27
|
-
export const
|
|
26
|
+
export const qcms_enable_iccv4: () => void;
|
|
27
|
+
export const qcms_profile_is_bogus: (a: number) => number;
|
|
28
|
+
export const qcms_transform_release: (a: number) => void;
|
|
28
29
|
export const __wbindgen_export_0: (a: number, b: number) => number;
|
|
29
30
|
export const __wbindgen_export_1: (a: number, b: number, c: number, d: number) => number;
|
|
30
31
|
export const __wbindgen_export_2: (a: number) => void;
|
package/node-esm/wasm.d.ts
CHANGED
|
@@ -4,14 +4,19 @@
|
|
|
4
4
|
* Initialize the WASM module with panic hooks for better error messages
|
|
5
5
|
*/
|
|
6
6
|
export function init(): void;
|
|
7
|
-
export type OutputFormat = "pdf" | "svg" | "txt";
|
|
8
|
-
|
|
9
7
|
export type Severity = "error" | "warning" | "note";
|
|
10
8
|
|
|
11
|
-
export interface
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
9
|
+
export interface Artifact {
|
|
10
|
+
format: OutputFormat;
|
|
11
|
+
bytes: Uint8Array;
|
|
12
|
+
mimeType: string;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export interface RenderResult {
|
|
16
|
+
artifacts: Artifact[];
|
|
17
|
+
warnings: Diagnostic[];
|
|
18
|
+
outputFormat: OutputFormat;
|
|
19
|
+
renderTimeMs: number;
|
|
15
20
|
}
|
|
16
21
|
|
|
17
22
|
export interface Diagnostic {
|
|
@@ -23,17 +28,17 @@ export interface Diagnostic {
|
|
|
23
28
|
sourceChain: string[];
|
|
24
29
|
}
|
|
25
30
|
|
|
26
|
-
export
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
31
|
+
export type OutputFormat = "pdf" | "svg" | "txt";
|
|
32
|
+
|
|
33
|
+
export interface Location {
|
|
34
|
+
file: string;
|
|
35
|
+
line: number;
|
|
36
|
+
column: number;
|
|
30
37
|
}
|
|
31
38
|
|
|
32
|
-
export interface
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
outputFormat: OutputFormat;
|
|
36
|
-
renderTimeMs: number;
|
|
39
|
+
export interface ParsedDocument {
|
|
40
|
+
fields: Record<string, any>;
|
|
41
|
+
quillName: string;
|
|
37
42
|
}
|
|
38
43
|
|
|
39
44
|
export interface QuillInfo {
|
|
@@ -47,11 +52,6 @@ export interface QuillInfo {
|
|
|
47
52
|
supportedFormats: OutputFormat[];
|
|
48
53
|
}
|
|
49
54
|
|
|
50
|
-
export interface ParsedDocument {
|
|
51
|
-
fields: Record<string, any>;
|
|
52
|
-
quillTag: string;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
55
|
export interface RenderOptions {
|
|
56
56
|
format?: OutputFormat;
|
|
57
57
|
assets?: Record<string, Uint8Array | number[]>;
|
|
@@ -67,14 +67,28 @@ export class Quillmark {
|
|
|
67
67
|
free(): void;
|
|
68
68
|
[Symbol.dispose](): void;
|
|
69
69
|
/**
|
|
70
|
-
*
|
|
70
|
+
* List registered Quill names
|
|
71
71
|
*/
|
|
72
|
-
|
|
72
|
+
listQuills(): string[];
|
|
73
|
+
/**
|
|
74
|
+
* Compile markdown to JSON data without rendering artifacts.
|
|
75
|
+
*
|
|
76
|
+
* This exposes the intermediate data structure that would be passed to the backend.
|
|
77
|
+
* Useful for debugging and validation.
|
|
78
|
+
*/
|
|
79
|
+
compileData(markdown: string): any;
|
|
80
|
+
/**
|
|
81
|
+
* Get shallow information about a registered Quill
|
|
82
|
+
*
|
|
83
|
+
* This returns metadata, backend info, field schemas, and supported formats
|
|
84
|
+
* that consumers need to configure render options for the next step.
|
|
85
|
+
*/
|
|
86
|
+
getQuillInfo(name: string): QuillInfo;
|
|
73
87
|
/**
|
|
74
88
|
* Parse markdown into a ParsedDocument
|
|
75
89
|
*
|
|
76
90
|
* This is the first step in the workflow. The returned ParsedDocument contains
|
|
77
|
-
* the parsed YAML frontmatter fields and the
|
|
91
|
+
* the parsed YAML frontmatter fields and the quill_name (from QUILL field or "__default__").
|
|
78
92
|
*/
|
|
79
93
|
static parseMarkdown(markdown: string): ParsedDocument;
|
|
80
94
|
/**
|
|
@@ -85,44 +99,37 @@ export class Quillmark {
|
|
|
85
99
|
*/
|
|
86
100
|
registerQuill(quill_json: any): QuillInfo;
|
|
87
101
|
/**
|
|
88
|
-
*
|
|
89
|
-
*
|
|
90
|
-
* This returns metadata, backend info, field schemas, and supported formats
|
|
91
|
-
* that consumers need to configure render options for the next step.
|
|
102
|
+
* Unregister a Quill (free memory)
|
|
92
103
|
*/
|
|
93
|
-
|
|
104
|
+
unregisterQuill(name: string): void;
|
|
94
105
|
/**
|
|
95
|
-
*
|
|
96
|
-
*
|
|
97
|
-
* Executes parsing, schema validation, and template composition to
|
|
98
|
-
* surface input errors quickly. Returns successfully on valid input,
|
|
99
|
-
* or throws an error with diagnostic payload on failure.
|
|
100
|
-
*
|
|
101
|
-
* The quill name is inferred from the markdown's QUILL tag (or defaults to "__default__").
|
|
106
|
+
* Get the stripped JSON schema of a Quill (removes UI metadata)
|
|
102
107
|
*
|
|
103
|
-
* This
|
|
108
|
+
* This returns the schema in a format suitable for feeding to LLMs or
|
|
109
|
+
* other consumers that don't need the UI configuration "x-ui" fields.
|
|
104
110
|
*/
|
|
105
|
-
|
|
111
|
+
getStrippedSchema(name: string): any;
|
|
106
112
|
/**
|
|
107
|
-
*
|
|
108
|
-
*
|
|
109
|
-
* This exposes the intermediate data structure that would be passed to the backend.
|
|
110
|
-
* Useful for debugging and validation.
|
|
113
|
+
* JavaScript constructor: `new Quillmark()`
|
|
111
114
|
*/
|
|
112
|
-
|
|
115
|
+
constructor();
|
|
113
116
|
/**
|
|
114
117
|
* Render a ParsedDocument to final artifacts (PDF, SVG, TXT)
|
|
115
118
|
*
|
|
116
119
|
* Uses the Quill specified in options.quill_name if provided,
|
|
117
|
-
* otherwise infers it from the ParsedDocument's
|
|
120
|
+
* otherwise infers it from the ParsedDocument's quill_name field.
|
|
118
121
|
*/
|
|
119
122
|
render(parsed: ParsedDocument, opts: RenderOptions): RenderResult;
|
|
120
123
|
/**
|
|
121
|
-
*
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
*
|
|
124
|
+
* Perform a dry run validation without backend compilation.
|
|
125
|
+
*
|
|
126
|
+
* Executes parsing, schema validation, and template composition to
|
|
127
|
+
* surface input errors quickly. Returns successfully on valid input,
|
|
128
|
+
* or throws an error with diagnostic payload on failure.
|
|
129
|
+
*
|
|
130
|
+
* The quill name is inferred from the markdown's QUILL tag (or defaults to "__default__").
|
|
131
|
+
*
|
|
132
|
+
* This is useful for fast feedback loops in LLM-driven document generation.
|
|
126
133
|
*/
|
|
127
|
-
|
|
134
|
+
dryRun(markdown: string): void;
|
|
128
135
|
}
|
package/node-esm/wasm_bg.js
CHANGED
|
@@ -201,6 +201,12 @@ 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();
|
|
209
|
+
}
|
|
204
210
|
|
|
205
211
|
function getArrayJsValueFromWasm0(ptr, len) {
|
|
206
212
|
ptr = ptr >>> 0;
|
|
@@ -211,12 +217,6 @@ function getArrayJsValueFromWasm0(ptr, len) {
|
|
|
211
217
|
}
|
|
212
218
|
return result;
|
|
213
219
|
}
|
|
214
|
-
/**
|
|
215
|
-
* Initialize the WASM module with panic hooks for better error messages
|
|
216
|
-
*/
|
|
217
|
-
export function init() {
|
|
218
|
-
wasm.init();
|
|
219
|
-
}
|
|
220
220
|
|
|
221
221
|
const QuillmarkFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
222
222
|
? { register: () => {}, unregister: () => {} }
|
|
@@ -240,28 +240,36 @@ export class Quillmark {
|
|
|
240
240
|
wasm.__wbg_quillmark_free(ptr, 0);
|
|
241
241
|
}
|
|
242
242
|
/**
|
|
243
|
-
*
|
|
243
|
+
* List registered Quill names
|
|
244
|
+
* @returns {string[]}
|
|
244
245
|
*/
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
246
|
+
listQuills() {
|
|
247
|
+
try {
|
|
248
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
249
|
+
wasm.quillmark_listQuills(retptr, this.__wbg_ptr);
|
|
250
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
251
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
252
|
+
var v1 = getArrayJsValueFromWasm0(r0, r1).slice();
|
|
253
|
+
wasm.__wbindgen_export_3(r0, r1 * 4, 4);
|
|
254
|
+
return v1;
|
|
255
|
+
} finally {
|
|
256
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
257
|
+
}
|
|
250
258
|
}
|
|
251
259
|
/**
|
|
252
|
-
*
|
|
260
|
+
* Compile markdown to JSON data without rendering artifacts.
|
|
253
261
|
*
|
|
254
|
-
* This
|
|
255
|
-
*
|
|
262
|
+
* This exposes the intermediate data structure that would be passed to the backend.
|
|
263
|
+
* Useful for debugging and validation.
|
|
256
264
|
* @param {string} markdown
|
|
257
|
-
* @returns {
|
|
265
|
+
* @returns {any}
|
|
258
266
|
*/
|
|
259
|
-
|
|
267
|
+
compileData(markdown) {
|
|
260
268
|
try {
|
|
261
269
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
262
270
|
const ptr0 = passStringToWasm0(markdown, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
263
271
|
const len0 = WASM_VECTOR_LEN;
|
|
264
|
-
wasm.
|
|
272
|
+
wasm.quillmark_compileData(retptr, this.__wbg_ptr, ptr0, len0);
|
|
265
273
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
266
274
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
267
275
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
@@ -274,17 +282,19 @@ export class Quillmark {
|
|
|
274
282
|
}
|
|
275
283
|
}
|
|
276
284
|
/**
|
|
277
|
-
*
|
|
285
|
+
* Get shallow information about a registered Quill
|
|
278
286
|
*
|
|
279
|
-
*
|
|
280
|
-
*
|
|
281
|
-
* @param {
|
|
287
|
+
* This returns metadata, backend info, field schemas, and supported formats
|
|
288
|
+
* that consumers need to configure render options for the next step.
|
|
289
|
+
* @param {string} name
|
|
282
290
|
* @returns {QuillInfo}
|
|
283
291
|
*/
|
|
284
|
-
|
|
292
|
+
getQuillInfo(name) {
|
|
285
293
|
try {
|
|
286
294
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
287
|
-
|
|
295
|
+
const ptr0 = passStringToWasm0(name, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
296
|
+
const len0 = WASM_VECTOR_LEN;
|
|
297
|
+
wasm.quillmark_getQuillInfo(retptr, this.__wbg_ptr, ptr0, len0);
|
|
288
298
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
289
299
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
290
300
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
@@ -297,19 +307,19 @@ export class Quillmark {
|
|
|
297
307
|
}
|
|
298
308
|
}
|
|
299
309
|
/**
|
|
300
|
-
*
|
|
310
|
+
* Parse markdown into a ParsedDocument
|
|
301
311
|
*
|
|
302
|
-
* This
|
|
303
|
-
*
|
|
304
|
-
* @param {string}
|
|
305
|
-
* @returns {
|
|
312
|
+
* This is the first step in the workflow. The returned ParsedDocument contains
|
|
313
|
+
* the parsed YAML frontmatter fields and the quill_name (from QUILL field or "__default__").
|
|
314
|
+
* @param {string} markdown
|
|
315
|
+
* @returns {ParsedDocument}
|
|
306
316
|
*/
|
|
307
|
-
|
|
317
|
+
static parseMarkdown(markdown) {
|
|
308
318
|
try {
|
|
309
319
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
310
|
-
const ptr0 = passStringToWasm0(
|
|
320
|
+
const ptr0 = passStringToWasm0(markdown, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
311
321
|
const len0 = WASM_VECTOR_LEN;
|
|
312
|
-
wasm.
|
|
322
|
+
wasm.quillmark_parseMarkdown(retptr, ptr0, len0);
|
|
313
323
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
314
324
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
315
325
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
@@ -322,46 +332,51 @@ export class Quillmark {
|
|
|
322
332
|
}
|
|
323
333
|
}
|
|
324
334
|
/**
|
|
325
|
-
*
|
|
326
|
-
*
|
|
327
|
-
* Executes parsing, schema validation, and template composition to
|
|
328
|
-
* surface input errors quickly. Returns successfully on valid input,
|
|
329
|
-
* or throws an error with diagnostic payload on failure.
|
|
330
|
-
*
|
|
331
|
-
* The quill name is inferred from the markdown's QUILL tag (or defaults to "__default__").
|
|
335
|
+
* Register a Quill template bundle
|
|
332
336
|
*
|
|
333
|
-
*
|
|
334
|
-
*
|
|
337
|
+
* Accepts either a JSON string or a JsValue object representing the Quill file tree.
|
|
338
|
+
* Validation happens automatically on registration.
|
|
339
|
+
* @param {any} quill_json
|
|
340
|
+
* @returns {QuillInfo}
|
|
335
341
|
*/
|
|
336
|
-
|
|
342
|
+
registerQuill(quill_json) {
|
|
337
343
|
try {
|
|
338
344
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
339
|
-
|
|
340
|
-
const len0 = WASM_VECTOR_LEN;
|
|
341
|
-
wasm.quillmark_dryRun(retptr, this.__wbg_ptr, ptr0, len0);
|
|
345
|
+
wasm.quillmark_registerQuill(retptr, this.__wbg_ptr, addHeapObject(quill_json));
|
|
342
346
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
343
347
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
344
|
-
|
|
345
|
-
|
|
348
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
349
|
+
if (r2) {
|
|
350
|
+
throw takeObject(r1);
|
|
346
351
|
}
|
|
352
|
+
return takeObject(r0);
|
|
347
353
|
} finally {
|
|
348
354
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
349
355
|
}
|
|
350
356
|
}
|
|
351
357
|
/**
|
|
352
|
-
*
|
|
358
|
+
* Unregister a Quill (free memory)
|
|
359
|
+
* @param {string} name
|
|
360
|
+
*/
|
|
361
|
+
unregisterQuill(name) {
|
|
362
|
+
const ptr0 = passStringToWasm0(name, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
363
|
+
const len0 = WASM_VECTOR_LEN;
|
|
364
|
+
wasm.quillmark_unregisterQuill(this.__wbg_ptr, ptr0, len0);
|
|
365
|
+
}
|
|
366
|
+
/**
|
|
367
|
+
* Get the stripped JSON schema of a Quill (removes UI metadata)
|
|
353
368
|
*
|
|
354
|
-
* This
|
|
355
|
-
*
|
|
356
|
-
* @param {string}
|
|
369
|
+
* This returns the schema in a format suitable for feeding to LLMs or
|
|
370
|
+
* other consumers that don't need the UI configuration "x-ui" fields.
|
|
371
|
+
* @param {string} name
|
|
357
372
|
* @returns {any}
|
|
358
373
|
*/
|
|
359
|
-
|
|
374
|
+
getStrippedSchema(name) {
|
|
360
375
|
try {
|
|
361
376
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
362
|
-
const ptr0 = passStringToWasm0(
|
|
377
|
+
const ptr0 = passStringToWasm0(name, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
363
378
|
const len0 = WASM_VECTOR_LEN;
|
|
364
|
-
wasm.
|
|
379
|
+
wasm.quillmark_getStrippedSchema(retptr, this.__wbg_ptr, ptr0, len0);
|
|
365
380
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
366
381
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
367
382
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
@@ -373,11 +388,20 @@ export class Quillmark {
|
|
|
373
388
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
374
389
|
}
|
|
375
390
|
}
|
|
391
|
+
/**
|
|
392
|
+
* JavaScript constructor: `new Quillmark()`
|
|
393
|
+
*/
|
|
394
|
+
constructor() {
|
|
395
|
+
const ret = wasm.quillmark_new();
|
|
396
|
+
this.__wbg_ptr = ret >>> 0;
|
|
397
|
+
QuillmarkFinalization.register(this, this.__wbg_ptr, this);
|
|
398
|
+
return this;
|
|
399
|
+
}
|
|
376
400
|
/**
|
|
377
401
|
* Render a ParsedDocument to final artifacts (PDF, SVG, TXT)
|
|
378
402
|
*
|
|
379
403
|
* Uses the Quill specified in options.quill_name if provided,
|
|
380
|
-
* otherwise infers it from the ParsedDocument's
|
|
404
|
+
* otherwise infers it from the ParsedDocument's quill_name field.
|
|
381
405
|
* @param {ParsedDocument} parsed
|
|
382
406
|
* @param {RenderOptions} opts
|
|
383
407
|
* @returns {RenderResult}
|
|
@@ -398,31 +422,32 @@ export class Quillmark {
|
|
|
398
422
|
}
|
|
399
423
|
}
|
|
400
424
|
/**
|
|
401
|
-
*
|
|
402
|
-
*
|
|
425
|
+
* Perform a dry run validation without backend compilation.
|
|
426
|
+
*
|
|
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
|
|
403
435
|
*/
|
|
404
|
-
|
|
436
|
+
dryRun(markdown) {
|
|
405
437
|
try {
|
|
406
438
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
407
|
-
wasm.
|
|
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);
|
|
408
442
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
409
443
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
444
|
+
if (r1) {
|
|
445
|
+
throw takeObject(r0);
|
|
446
|
+
}
|
|
413
447
|
} finally {
|
|
414
448
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
415
449
|
}
|
|
416
450
|
}
|
|
417
|
-
/**
|
|
418
|
-
* Unregister a Quill (free memory)
|
|
419
|
-
* @param {string} name
|
|
420
|
-
*/
|
|
421
|
-
unregisterQuill(name) {
|
|
422
|
-
const ptr0 = passStringToWasm0(name, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
423
|
-
const len0 = WASM_VECTOR_LEN;
|
|
424
|
-
wasm.quillmark_unregisterQuill(this.__wbg_ptr, ptr0, len0);
|
|
425
|
-
}
|
|
426
451
|
}
|
|
427
452
|
if (Symbol.dispose) Quillmark.prototype[Symbol.dispose] = Quillmark.prototype.free;
|
|
428
453
|
|
package/node-esm/wasm_bg.wasm
CHANGED
|
Binary file
|
|
@@ -2,29 +2,30 @@
|
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
export const memory: WebAssembly.Memory;
|
|
4
4
|
export const __wbg_quillmark_free: (a: number, b: number) => void;
|
|
5
|
+
export const init: () => void;
|
|
6
|
+
export const quillmark_compileData: (a: number, b: number, c: number, d: number) => void;
|
|
7
|
+
export const quillmark_dryRun: (a: number, b: number, c: number, d: number) => void;
|
|
8
|
+
export const quillmark_getQuillInfo: (a: number, b: number, c: number, d: number) => void;
|
|
9
|
+
export const quillmark_getStrippedSchema: (a: number, b: number, c: number, d: number) => void;
|
|
10
|
+
export const quillmark_listQuills: (a: number, b: number) => void;
|
|
5
11
|
export const quillmark_new: () => number;
|
|
6
12
|
export const quillmark_parseMarkdown: (a: number, b: number, c: number) => void;
|
|
7
13
|
export const quillmark_registerQuill: (a: number, b: number, c: number) => void;
|
|
8
|
-
export const quillmark_getQuillInfo: (a: number, b: number, c: number, d: number) => void;
|
|
9
|
-
export const quillmark_dryRun: (a: number, b: number, c: number, d: number) => void;
|
|
10
|
-
export const quillmark_compileData: (a: number, b: number, c: number, d: number) => void;
|
|
11
14
|
export const quillmark_render: (a: number, b: number, c: number, d: number) => void;
|
|
12
|
-
export const quillmark_listQuills: (a: number, b: number) => void;
|
|
13
15
|
export const quillmark_unregisterQuill: (a: number, b: number, c: number) => void;
|
|
14
|
-
export const
|
|
15
|
-
export const qcms_profile_is_bogus: (a: number) => number;
|
|
16
|
-
export const qcms_white_point_sRGB: (a: number) => void;
|
|
16
|
+
export const lut_inverse_interp16: (a: number, b: number, c: number) => number;
|
|
17
17
|
export const qcms_profile_precache_output_transform: (a: number) => void;
|
|
18
|
-
export const
|
|
19
|
-
export const qcms_transform_data_rgba_out_lut_precache: (a: number, b: number, c: number, d: number) => void;
|
|
20
|
-
export const qcms_transform_data_bgra_out_lut_precache: (a: number, b: number, c: number, d: number) => void;
|
|
18
|
+
export const qcms_white_point_sRGB: (a: number) => void;
|
|
21
19
|
export const qcms_transform_data_rgb_out_lut: (a: number, b: number, c: number, d: number) => void;
|
|
22
20
|
export const qcms_transform_data_rgba_out_lut: (a: number, b: number, c: number, d: number) => void;
|
|
23
21
|
export const qcms_transform_data_bgra_out_lut: (a: number, b: number, c: number, d: number) => void;
|
|
24
|
-
export const
|
|
25
|
-
export const
|
|
22
|
+
export const qcms_transform_data_rgb_out_lut_precache: (a: number, b: number, c: number, d: number) => void;
|
|
23
|
+
export const qcms_transform_data_rgba_out_lut_precache: (a: number, b: number, c: number, d: number) => void;
|
|
24
|
+
export const qcms_transform_data_bgra_out_lut_precache: (a: number, b: number, c: number, d: number) => void;
|
|
26
25
|
export const lut_interp_linear16: (a: number, b: number, c: number) => number;
|
|
27
|
-
export const
|
|
26
|
+
export const qcms_enable_iccv4: () => void;
|
|
27
|
+
export const qcms_profile_is_bogus: (a: number) => number;
|
|
28
|
+
export const qcms_transform_release: (a: number) => void;
|
|
28
29
|
export const __wbindgen_export_0: (a: number, b: number) => number;
|
|
29
30
|
export const __wbindgen_export_1: (a: number, b: number, c: number, d: number) => number;
|
|
30
31
|
export const __wbindgen_export_2: (a: number) => void;
|