@quillmark/wasm 0.35.1 → 0.37.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/bundler/wasm.d.ts +63 -63
- package/bundler/wasm_bg.js +103 -103
- package/bundler/wasm_bg.wasm +0 -0
- package/bundler/wasm_bg.wasm.d.ts +14 -14
- package/node-esm/wasm.d.ts +63 -63
- package/node-esm/wasm_bg.js +103 -103
- package/node-esm/wasm_bg.wasm +0 -0
- package/node-esm/wasm_bg.wasm.d.ts +14 -14
- package/package.json +1 -1
package/bundler/wasm.d.ts
CHANGED
|
@@ -4,10 +4,14 @@
|
|
|
4
4
|
* Initialize the WASM module with panic hooks for better error messages
|
|
5
5
|
*/
|
|
6
6
|
export function init(): void;
|
|
7
|
-
export
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
export type OutputFormat = "pdf" | "svg" | "txt";
|
|
8
|
+
|
|
9
|
+
export type Severity = "error" | "warning" | "note";
|
|
10
|
+
|
|
11
|
+
export interface Location {
|
|
12
|
+
file: string;
|
|
13
|
+
line: number;
|
|
14
|
+
column: number;
|
|
11
15
|
}
|
|
12
16
|
|
|
13
17
|
export interface Diagnostic {
|
|
@@ -19,6 +23,12 @@ export interface Diagnostic {
|
|
|
19
23
|
sourceChain: string[];
|
|
20
24
|
}
|
|
21
25
|
|
|
26
|
+
export interface Artifact {
|
|
27
|
+
format: OutputFormat;
|
|
28
|
+
bytes: Uint8Array;
|
|
29
|
+
mimeType: string;
|
|
30
|
+
}
|
|
31
|
+
|
|
22
32
|
export interface RenderResult {
|
|
23
33
|
artifacts: Artifact[];
|
|
24
34
|
warnings: Diagnostic[];
|
|
@@ -26,23 +36,6 @@ export interface RenderResult {
|
|
|
26
36
|
renderTimeMs: number;
|
|
27
37
|
}
|
|
28
38
|
|
|
29
|
-
export interface Location {
|
|
30
|
-
file: string;
|
|
31
|
-
line: number;
|
|
32
|
-
column: number;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
export interface ParsedDocument {
|
|
36
|
-
fields: Record<string, any>;
|
|
37
|
-
quillName: string;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
export interface Artifact {
|
|
41
|
-
format: OutputFormat;
|
|
42
|
-
bytes: Uint8Array;
|
|
43
|
-
mimeType: string;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
39
|
export interface QuillInfo {
|
|
47
40
|
name: string;
|
|
48
41
|
backend: string;
|
|
@@ -54,9 +47,16 @@ export interface QuillInfo {
|
|
|
54
47
|
supportedFormats: OutputFormat[];
|
|
55
48
|
}
|
|
56
49
|
|
|
57
|
-
export
|
|
50
|
+
export interface ParsedDocument {
|
|
51
|
+
fields: Record<string, any>;
|
|
52
|
+
quillName: string;
|
|
53
|
+
}
|
|
58
54
|
|
|
59
|
-
export
|
|
55
|
+
export interface RenderOptions {
|
|
56
|
+
format?: OutputFormat;
|
|
57
|
+
assets?: Record<string, Uint8Array | number[]>;
|
|
58
|
+
quillName?: string;
|
|
59
|
+
}
|
|
60
60
|
|
|
61
61
|
/**
|
|
62
62
|
* Quillmark WASM Engine
|
|
@@ -67,33 +67,9 @@ export class Quillmark {
|
|
|
67
67
|
free(): void;
|
|
68
68
|
[Symbol.dispose](): void;
|
|
69
69
|
/**
|
|
70
|
-
*
|
|
71
|
-
*
|
|
72
|
-
* Returns strings in the format "name@version" (e.g. "resume-template@2.1.0")
|
|
73
|
-
*/
|
|
74
|
-
listQuills(): string[];
|
|
75
|
-
/**
|
|
76
|
-
* Compile markdown to JSON data without rendering artifacts.
|
|
77
|
-
*
|
|
78
|
-
* This exposes the intermediate data structure that would be passed to the backend.
|
|
79
|
-
* Useful for debugging and validation.
|
|
80
|
-
*/
|
|
81
|
-
compileData(markdown: string): any;
|
|
82
|
-
/**
|
|
83
|
-
* Resolve a Quill reference to a registered Quill, or null if not available
|
|
84
|
-
*
|
|
85
|
-
* Accepts a quill reference string like "resume-template", "resume-template@2",
|
|
86
|
-
* or "resume-template@2.1.0". Returns QuillInfo if the engine can resolve it
|
|
87
|
-
* locally, or null if an external fetch is needed.
|
|
88
|
-
*/
|
|
89
|
-
resolveQuill(quill_ref: string): any;
|
|
90
|
-
/**
|
|
91
|
-
* Get shallow information about a registered Quill
|
|
92
|
-
*
|
|
93
|
-
* This returns metadata, backend info, field schemas, and supported formats
|
|
94
|
-
* that consumers need to configure render options for the next step.
|
|
70
|
+
* JavaScript constructor: `new Quillmark()`
|
|
95
71
|
*/
|
|
96
|
-
|
|
72
|
+
constructor();
|
|
97
73
|
/**
|
|
98
74
|
* Parse markdown into a ParsedDocument
|
|
99
75
|
*
|
|
@@ -109,13 +85,12 @@ export class Quillmark {
|
|
|
109
85
|
*/
|
|
110
86
|
registerQuill(quill_json: any): QuillInfo;
|
|
111
87
|
/**
|
|
112
|
-
*
|
|
88
|
+
* Get shallow information about a registered Quill
|
|
113
89
|
*
|
|
114
|
-
*
|
|
115
|
-
*
|
|
116
|
-
* Returns true if something was unregistered, false if not found.
|
|
90
|
+
* This returns metadata, backend info, field schemas, and supported formats
|
|
91
|
+
* that consumers need to configure render options for the next step.
|
|
117
92
|
*/
|
|
118
|
-
|
|
93
|
+
getQuillInfo(name: string): QuillInfo;
|
|
119
94
|
/**
|
|
120
95
|
* Get the stripped JSON schema of a Quill (removes UI metadata)
|
|
121
96
|
*
|
|
@@ -124,9 +99,24 @@ export class Quillmark {
|
|
|
124
99
|
*/
|
|
125
100
|
getStrippedSchema(name: string): any;
|
|
126
101
|
/**
|
|
127
|
-
*
|
|
102
|
+
* Perform a dry run validation without backend compilation.
|
|
103
|
+
*
|
|
104
|
+
* Executes parsing, schema validation, and template composition to
|
|
105
|
+
* surface input errors quickly. Returns successfully on valid input,
|
|
106
|
+
* or throws an error with diagnostic payload on failure.
|
|
107
|
+
*
|
|
108
|
+
* The quill name is inferred from the markdown's QUILL tag (or defaults to "__default__").
|
|
109
|
+
*
|
|
110
|
+
* This is useful for fast feedback loops in LLM-driven document generation.
|
|
128
111
|
*/
|
|
129
|
-
|
|
112
|
+
dryRun(markdown: string): void;
|
|
113
|
+
/**
|
|
114
|
+
* Compile markdown to JSON data without rendering artifacts.
|
|
115
|
+
*
|
|
116
|
+
* This exposes the intermediate data structure that would be passed to the backend.
|
|
117
|
+
* Useful for debugging and validation.
|
|
118
|
+
*/
|
|
119
|
+
compileData(markdown: string): any;
|
|
130
120
|
/**
|
|
131
121
|
* Render a ParsedDocument to final artifacts (PDF, SVG, TXT)
|
|
132
122
|
*
|
|
@@ -135,15 +125,25 @@ export class Quillmark {
|
|
|
135
125
|
*/
|
|
136
126
|
render(parsed: ParsedDocument, opts: RenderOptions): RenderResult;
|
|
137
127
|
/**
|
|
138
|
-
*
|
|
128
|
+
* Resolve a Quill reference to a registered Quill, or null if not available
|
|
139
129
|
*
|
|
140
|
-
*
|
|
141
|
-
*
|
|
142
|
-
* or
|
|
130
|
+
* Accepts a quill reference string like "resume-template", "resume-template@2",
|
|
131
|
+
* or "resume-template@2.1.0". Returns QuillInfo if the engine can resolve it
|
|
132
|
+
* locally, or null if an external fetch is needed.
|
|
133
|
+
*/
|
|
134
|
+
resolveQuill(quill_ref: string): any;
|
|
135
|
+
/**
|
|
136
|
+
* List registered Quills with their exact versions
|
|
143
137
|
*
|
|
144
|
-
*
|
|
138
|
+
* Returns strings in the format "name@version" (e.g. "resume-template@2.1.0")
|
|
139
|
+
*/
|
|
140
|
+
listQuills(): string[];
|
|
141
|
+
/**
|
|
142
|
+
* Unregister a Quill by name or specific version
|
|
145
143
|
*
|
|
146
|
-
*
|
|
144
|
+
* If a base name is provided (e.g., "my-quill"), all versions of that quill are freed.
|
|
145
|
+
* If a versioned name is provided (e.g., "my-quill@2.1.0"), only that specific version is freed.
|
|
146
|
+
* Returns true if something was unregistered, false if not found.
|
|
147
147
|
*/
|
|
148
|
-
|
|
148
|
+
unregisterQuill(name_or_ref: string): boolean;
|
|
149
149
|
}
|
package/bundler/wasm_bg.js
CHANGED
|
@@ -207,12 +207,6 @@ 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
|
-
}
|
|
216
210
|
|
|
217
211
|
function getArrayJsValueFromWasm0(ptr, len) {
|
|
218
212
|
ptr = ptr >>> 0;
|
|
@@ -223,6 +217,12 @@ function getArrayJsValueFromWasm0(ptr, len) {
|
|
|
223
217
|
}
|
|
224
218
|
return result;
|
|
225
219
|
}
|
|
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,38 +246,51 @@ export class Quillmark {
|
|
|
246
246
|
wasm.__wbg_quillmark_free(ptr, 0);
|
|
247
247
|
}
|
|
248
248
|
/**
|
|
249
|
-
*
|
|
249
|
+
* JavaScript constructor: `new Quillmark()`
|
|
250
|
+
*/
|
|
251
|
+
constructor() {
|
|
252
|
+
const ret = wasm.quillmark_new();
|
|
253
|
+
this.__wbg_ptr = ret >>> 0;
|
|
254
|
+
QuillmarkFinalization.register(this, this.__wbg_ptr, this);
|
|
255
|
+
return this;
|
|
256
|
+
}
|
|
257
|
+
/**
|
|
258
|
+
* Parse markdown into a ParsedDocument
|
|
250
259
|
*
|
|
251
|
-
*
|
|
252
|
-
*
|
|
260
|
+
* This is the first step in the workflow. The returned ParsedDocument contains
|
|
261
|
+
* the parsed YAML frontmatter fields and the quill_name (from QUILL field or "__default__").
|
|
262
|
+
* @param {string} markdown
|
|
263
|
+
* @returns {ParsedDocument}
|
|
253
264
|
*/
|
|
254
|
-
|
|
265
|
+
static parseMarkdown(markdown) {
|
|
255
266
|
try {
|
|
256
267
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
257
|
-
wasm.
|
|
268
|
+
const ptr0 = passStringToWasm0(markdown, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
269
|
+
const len0 = WASM_VECTOR_LEN;
|
|
270
|
+
wasm.quillmark_parseMarkdown(retptr, ptr0, len0);
|
|
258
271
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
259
272
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
260
|
-
var
|
|
261
|
-
|
|
262
|
-
|
|
273
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
274
|
+
if (r2) {
|
|
275
|
+
throw takeObject(r1);
|
|
276
|
+
}
|
|
277
|
+
return takeObject(r0);
|
|
263
278
|
} finally {
|
|
264
279
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
265
280
|
}
|
|
266
281
|
}
|
|
267
282
|
/**
|
|
268
|
-
*
|
|
283
|
+
* Register a Quill template bundle
|
|
269
284
|
*
|
|
270
|
-
*
|
|
271
|
-
*
|
|
272
|
-
* @param {
|
|
273
|
-
* @returns {
|
|
285
|
+
* Accepts either a JSON string or a JsValue object representing the Quill file tree.
|
|
286
|
+
* Validation happens automatically on registration.
|
|
287
|
+
* @param {any} quill_json
|
|
288
|
+
* @returns {QuillInfo}
|
|
274
289
|
*/
|
|
275
|
-
|
|
290
|
+
registerQuill(quill_json) {
|
|
276
291
|
try {
|
|
277
292
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
278
|
-
|
|
279
|
-
const len0 = WASM_VECTOR_LEN;
|
|
280
|
-
wasm.quillmark_compileData(retptr, this.__wbg_ptr, ptr0, len0);
|
|
293
|
+
wasm.quillmark_registerQuill(retptr, this.__wbg_ptr, addHeapObject(quill_json));
|
|
281
294
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
282
295
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
283
296
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
@@ -289,21 +302,6 @@ export class Quillmark {
|
|
|
289
302
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
290
303
|
}
|
|
291
304
|
}
|
|
292
|
-
/**
|
|
293
|
-
* Resolve a Quill reference to a registered Quill, or null if not available
|
|
294
|
-
*
|
|
295
|
-
* Accepts a quill reference string like "resume-template", "resume-template@2",
|
|
296
|
-
* or "resume-template@2.1.0". Returns QuillInfo if the engine can resolve it
|
|
297
|
-
* locally, or null if an external fetch is needed.
|
|
298
|
-
* @param {string} quill_ref
|
|
299
|
-
* @returns {any}
|
|
300
|
-
*/
|
|
301
|
-
resolveQuill(quill_ref) {
|
|
302
|
-
const ptr0 = passStringToWasm0(quill_ref, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
303
|
-
const len0 = WASM_VECTOR_LEN;
|
|
304
|
-
const ret = wasm.quillmark_resolveQuill(this.__wbg_ptr, ptr0, len0);
|
|
305
|
-
return takeObject(ret);
|
|
306
|
-
}
|
|
307
305
|
/**
|
|
308
306
|
* Get shallow information about a registered Quill
|
|
309
307
|
*
|
|
@@ -330,19 +328,19 @@ export class Quillmark {
|
|
|
330
328
|
}
|
|
331
329
|
}
|
|
332
330
|
/**
|
|
333
|
-
*
|
|
331
|
+
* Get the stripped JSON schema of a Quill (removes UI metadata)
|
|
334
332
|
*
|
|
335
|
-
* This
|
|
336
|
-
*
|
|
337
|
-
* @param {string}
|
|
338
|
-
* @returns {
|
|
333
|
+
* This returns the schema in a format suitable for feeding to LLMs or
|
|
334
|
+
* other consumers that don't need the UI configuration "x-ui" fields.
|
|
335
|
+
* @param {string} name
|
|
336
|
+
* @returns {any}
|
|
339
337
|
*/
|
|
340
|
-
|
|
338
|
+
getStrippedSchema(name) {
|
|
341
339
|
try {
|
|
342
340
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
343
|
-
const ptr0 = passStringToWasm0(
|
|
341
|
+
const ptr0 = passStringToWasm0(name, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
344
342
|
const len0 = WASM_VECTOR_LEN;
|
|
345
|
-
wasm.
|
|
343
|
+
wasm.quillmark_getStrippedSchema(retptr, this.__wbg_ptr, ptr0, len0);
|
|
346
344
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
347
345
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
348
346
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
@@ -355,57 +353,46 @@ export class Quillmark {
|
|
|
355
353
|
}
|
|
356
354
|
}
|
|
357
355
|
/**
|
|
358
|
-
*
|
|
356
|
+
* Perform a dry run validation without backend compilation.
|
|
359
357
|
*
|
|
360
|
-
*
|
|
361
|
-
*
|
|
362
|
-
*
|
|
363
|
-
*
|
|
358
|
+
* Executes parsing, schema validation, and template composition to
|
|
359
|
+
* surface input errors quickly. Returns successfully on valid input,
|
|
360
|
+
* or throws an error with diagnostic payload on failure.
|
|
361
|
+
*
|
|
362
|
+
* The quill name is inferred from the markdown's QUILL tag (or defaults to "__default__").
|
|
363
|
+
*
|
|
364
|
+
* This is useful for fast feedback loops in LLM-driven document generation.
|
|
365
|
+
* @param {string} markdown
|
|
364
366
|
*/
|
|
365
|
-
|
|
367
|
+
dryRun(markdown) {
|
|
366
368
|
try {
|
|
367
369
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
368
|
-
|
|
370
|
+
const ptr0 = passStringToWasm0(markdown, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
371
|
+
const len0 = WASM_VECTOR_LEN;
|
|
372
|
+
wasm.quillmark_dryRun(retptr, this.__wbg_ptr, ptr0, len0);
|
|
369
373
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
370
374
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
throw takeObject(r1);
|
|
375
|
+
if (r1) {
|
|
376
|
+
throw takeObject(r0);
|
|
374
377
|
}
|
|
375
|
-
return takeObject(r0);
|
|
376
378
|
} finally {
|
|
377
379
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
378
380
|
}
|
|
379
381
|
}
|
|
380
382
|
/**
|
|
381
|
-
*
|
|
382
|
-
*
|
|
383
|
-
* If a base name is provided (e.g., "my-quill"), all versions of that quill are freed.
|
|
384
|
-
* If a versioned name is provided (e.g., "my-quill@2.1.0"), only that specific version is freed.
|
|
385
|
-
* Returns true if something was unregistered, false if not found.
|
|
386
|
-
* @param {string} name_or_ref
|
|
387
|
-
* @returns {boolean}
|
|
388
|
-
*/
|
|
389
|
-
unregisterQuill(name_or_ref) {
|
|
390
|
-
const ptr0 = passStringToWasm0(name_or_ref, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
391
|
-
const len0 = WASM_VECTOR_LEN;
|
|
392
|
-
const ret = wasm.quillmark_unregisterQuill(this.__wbg_ptr, ptr0, len0);
|
|
393
|
-
return ret !== 0;
|
|
394
|
-
}
|
|
395
|
-
/**
|
|
396
|
-
* Get the stripped JSON schema of a Quill (removes UI metadata)
|
|
383
|
+
* Compile markdown to JSON data without rendering artifacts.
|
|
397
384
|
*
|
|
398
|
-
* This
|
|
399
|
-
*
|
|
400
|
-
* @param {string}
|
|
385
|
+
* This exposes the intermediate data structure that would be passed to the backend.
|
|
386
|
+
* Useful for debugging and validation.
|
|
387
|
+
* @param {string} markdown
|
|
401
388
|
* @returns {any}
|
|
402
389
|
*/
|
|
403
|
-
|
|
390
|
+
compileData(markdown) {
|
|
404
391
|
try {
|
|
405
392
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
406
|
-
const ptr0 = passStringToWasm0(
|
|
393
|
+
const ptr0 = passStringToWasm0(markdown, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
407
394
|
const len0 = WASM_VECTOR_LEN;
|
|
408
|
-
wasm.
|
|
395
|
+
wasm.quillmark_compileData(retptr, this.__wbg_ptr, ptr0, len0);
|
|
409
396
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
410
397
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
411
398
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
@@ -417,15 +404,6 @@ export class Quillmark {
|
|
|
417
404
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
418
405
|
}
|
|
419
406
|
}
|
|
420
|
-
/**
|
|
421
|
-
* JavaScript constructor: `new Quillmark()`
|
|
422
|
-
*/
|
|
423
|
-
constructor() {
|
|
424
|
-
const ret = wasm.quillmark_new();
|
|
425
|
-
this.__wbg_ptr = ret >>> 0;
|
|
426
|
-
QuillmarkFinalization.register(this, this.__wbg_ptr, this);
|
|
427
|
-
return this;
|
|
428
|
-
}
|
|
429
407
|
/**
|
|
430
408
|
* Render a ParsedDocument to final artifacts (PDF, SVG, TXT)
|
|
431
409
|
*
|
|
@@ -451,32 +429,54 @@ export class Quillmark {
|
|
|
451
429
|
}
|
|
452
430
|
}
|
|
453
431
|
/**
|
|
454
|
-
*
|
|
455
|
-
*
|
|
456
|
-
* Executes parsing, schema validation, and template composition to
|
|
457
|
-
* surface input errors quickly. Returns successfully on valid input,
|
|
458
|
-
* or throws an error with diagnostic payload on failure.
|
|
432
|
+
* Resolve a Quill reference to a registered Quill, or null if not available
|
|
459
433
|
*
|
|
460
|
-
*
|
|
434
|
+
* Accepts a quill reference string like "resume-template", "resume-template@2",
|
|
435
|
+
* or "resume-template@2.1.0". Returns QuillInfo if the engine can resolve it
|
|
436
|
+
* locally, or null if an external fetch is needed.
|
|
437
|
+
* @param {string} quill_ref
|
|
438
|
+
* @returns {any}
|
|
439
|
+
*/
|
|
440
|
+
resolveQuill(quill_ref) {
|
|
441
|
+
const ptr0 = passStringToWasm0(quill_ref, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
442
|
+
const len0 = WASM_VECTOR_LEN;
|
|
443
|
+
const ret = wasm.quillmark_resolveQuill(this.__wbg_ptr, ptr0, len0);
|
|
444
|
+
return takeObject(ret);
|
|
445
|
+
}
|
|
446
|
+
/**
|
|
447
|
+
* List registered Quills with their exact versions
|
|
461
448
|
*
|
|
462
|
-
*
|
|
463
|
-
* @
|
|
449
|
+
* Returns strings in the format "name@version" (e.g. "resume-template@2.1.0")
|
|
450
|
+
* @returns {string[]}
|
|
464
451
|
*/
|
|
465
|
-
|
|
452
|
+
listQuills() {
|
|
466
453
|
try {
|
|
467
454
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
468
|
-
|
|
469
|
-
const len0 = WASM_VECTOR_LEN;
|
|
470
|
-
wasm.quillmark_dryRun(retptr, this.__wbg_ptr, ptr0, len0);
|
|
455
|
+
wasm.quillmark_listQuills(retptr, this.__wbg_ptr);
|
|
471
456
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
472
457
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
458
|
+
var v1 = getArrayJsValueFromWasm0(r0, r1).slice();
|
|
459
|
+
wasm.__wbindgen_export_3(r0, r1 * 4, 4);
|
|
460
|
+
return v1;
|
|
476
461
|
} finally {
|
|
477
462
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
478
463
|
}
|
|
479
464
|
}
|
|
465
|
+
/**
|
|
466
|
+
* Unregister a Quill by name or specific version
|
|
467
|
+
*
|
|
468
|
+
* If a base name is provided (e.g., "my-quill"), all versions of that quill are freed.
|
|
469
|
+
* If a versioned name is provided (e.g., "my-quill@2.1.0"), only that specific version is freed.
|
|
470
|
+
* Returns true if something was unregistered, false if not found.
|
|
471
|
+
* @param {string} name_or_ref
|
|
472
|
+
* @returns {boolean}
|
|
473
|
+
*/
|
|
474
|
+
unregisterQuill(name_or_ref) {
|
|
475
|
+
const ptr0 = passStringToWasm0(name_or_ref, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
476
|
+
const len0 = WASM_VECTOR_LEN;
|
|
477
|
+
const ret = wasm.quillmark_unregisterQuill(this.__wbg_ptr, ptr0, len0);
|
|
478
|
+
return ret !== 0;
|
|
479
|
+
}
|
|
480
480
|
}
|
|
481
481
|
if (Symbol.dispose) Quillmark.prototype[Symbol.dispose] = Quillmark.prototype.free;
|
|
482
482
|
|
package/bundler/wasm_bg.wasm
CHANGED
|
Binary file
|
|
@@ -2,31 +2,31 @@
|
|
|
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;
|
|
11
5
|
export const quillmark_new: () => number;
|
|
12
6
|
export const quillmark_parseMarkdown: (a: number, b: number, c: number) => void;
|
|
13
7
|
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_getStrippedSchema: (a: number, b: number, c: number, d: number) => void;
|
|
10
|
+
export const quillmark_dryRun: (a: number, b: number, c: number, d: number) => void;
|
|
11
|
+
export const quillmark_compileData: (a: number, b: number, c: number, d: number) => void;
|
|
14
12
|
export const quillmark_render: (a: number, b: number, c: number, d: number) => void;
|
|
15
13
|
export const quillmark_resolveQuill: (a: number, b: number, c: number) => number;
|
|
14
|
+
export const quillmark_listQuills: (a: number, b: number) => void;
|
|
16
15
|
export const quillmark_unregisterQuill: (a: number, b: number, c: number) => number;
|
|
17
|
-
export const
|
|
18
|
-
export const
|
|
16
|
+
export const init: () => void;
|
|
17
|
+
export const qcms_profile_is_bogus: (a: number) => number;
|
|
19
18
|
export const qcms_white_point_sRGB: (a: number) => void;
|
|
20
|
-
export const
|
|
21
|
-
export const qcms_transform_data_rgba_out_lut: (a: number, b: number, c: number, d: number) => void;
|
|
22
|
-
export const qcms_transform_data_bgra_out_lut: (a: number, b: number, c: number, d: number) => void;
|
|
19
|
+
export const qcms_profile_precache_output_transform: (a: number) => void;
|
|
23
20
|
export const qcms_transform_data_rgb_out_lut_precache: (a: number, b: number, c: number, d: number) => void;
|
|
24
21
|
export const qcms_transform_data_rgba_out_lut_precache: (a: number, b: number, c: number, d: number) => void;
|
|
25
22
|
export const qcms_transform_data_bgra_out_lut_precache: (a: number, b: number, c: number, d: number) => void;
|
|
26
|
-
export const
|
|
27
|
-
export const
|
|
28
|
-
export const
|
|
23
|
+
export const qcms_transform_data_rgb_out_lut: (a: number, b: number, c: number, d: number) => void;
|
|
24
|
+
export const qcms_transform_data_rgba_out_lut: (a: number, b: number, c: number, d: number) => void;
|
|
25
|
+
export const qcms_transform_data_bgra_out_lut: (a: number, b: number, c: number, d: number) => void;
|
|
29
26
|
export const qcms_transform_release: (a: number) => void;
|
|
27
|
+
export const qcms_enable_iccv4: () => void;
|
|
28
|
+
export const lut_interp_linear16: (a: number, b: number, c: number) => number;
|
|
29
|
+
export const lut_inverse_interp16: (a: number, b: number, c: number) => number;
|
|
30
30
|
export const __wbindgen_export_0: (a: number, b: number) => number;
|
|
31
31
|
export const __wbindgen_export_1: (a: number, b: number, c: number, d: number) => number;
|
|
32
32
|
export const __wbindgen_export_2: (a: number) => void;
|
package/node-esm/wasm.d.ts
CHANGED
|
@@ -4,10 +4,14 @@
|
|
|
4
4
|
* Initialize the WASM module with panic hooks for better error messages
|
|
5
5
|
*/
|
|
6
6
|
export function init(): void;
|
|
7
|
-
export
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
export type OutputFormat = "pdf" | "svg" | "txt";
|
|
8
|
+
|
|
9
|
+
export type Severity = "error" | "warning" | "note";
|
|
10
|
+
|
|
11
|
+
export interface Location {
|
|
12
|
+
file: string;
|
|
13
|
+
line: number;
|
|
14
|
+
column: number;
|
|
11
15
|
}
|
|
12
16
|
|
|
13
17
|
export interface Diagnostic {
|
|
@@ -19,6 +23,12 @@ export interface Diagnostic {
|
|
|
19
23
|
sourceChain: string[];
|
|
20
24
|
}
|
|
21
25
|
|
|
26
|
+
export interface Artifact {
|
|
27
|
+
format: OutputFormat;
|
|
28
|
+
bytes: Uint8Array;
|
|
29
|
+
mimeType: string;
|
|
30
|
+
}
|
|
31
|
+
|
|
22
32
|
export interface RenderResult {
|
|
23
33
|
artifacts: Artifact[];
|
|
24
34
|
warnings: Diagnostic[];
|
|
@@ -26,23 +36,6 @@ export interface RenderResult {
|
|
|
26
36
|
renderTimeMs: number;
|
|
27
37
|
}
|
|
28
38
|
|
|
29
|
-
export interface Location {
|
|
30
|
-
file: string;
|
|
31
|
-
line: number;
|
|
32
|
-
column: number;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
export interface ParsedDocument {
|
|
36
|
-
fields: Record<string, any>;
|
|
37
|
-
quillName: string;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
export interface Artifact {
|
|
41
|
-
format: OutputFormat;
|
|
42
|
-
bytes: Uint8Array;
|
|
43
|
-
mimeType: string;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
39
|
export interface QuillInfo {
|
|
47
40
|
name: string;
|
|
48
41
|
backend: string;
|
|
@@ -54,9 +47,16 @@ export interface QuillInfo {
|
|
|
54
47
|
supportedFormats: OutputFormat[];
|
|
55
48
|
}
|
|
56
49
|
|
|
57
|
-
export
|
|
50
|
+
export interface ParsedDocument {
|
|
51
|
+
fields: Record<string, any>;
|
|
52
|
+
quillName: string;
|
|
53
|
+
}
|
|
58
54
|
|
|
59
|
-
export
|
|
55
|
+
export interface RenderOptions {
|
|
56
|
+
format?: OutputFormat;
|
|
57
|
+
assets?: Record<string, Uint8Array | number[]>;
|
|
58
|
+
quillName?: string;
|
|
59
|
+
}
|
|
60
60
|
|
|
61
61
|
/**
|
|
62
62
|
* Quillmark WASM Engine
|
|
@@ -67,33 +67,9 @@ export class Quillmark {
|
|
|
67
67
|
free(): void;
|
|
68
68
|
[Symbol.dispose](): void;
|
|
69
69
|
/**
|
|
70
|
-
*
|
|
71
|
-
*
|
|
72
|
-
* Returns strings in the format "name@version" (e.g. "resume-template@2.1.0")
|
|
73
|
-
*/
|
|
74
|
-
listQuills(): string[];
|
|
75
|
-
/**
|
|
76
|
-
* Compile markdown to JSON data without rendering artifacts.
|
|
77
|
-
*
|
|
78
|
-
* This exposes the intermediate data structure that would be passed to the backend.
|
|
79
|
-
* Useful for debugging and validation.
|
|
80
|
-
*/
|
|
81
|
-
compileData(markdown: string): any;
|
|
82
|
-
/**
|
|
83
|
-
* Resolve a Quill reference to a registered Quill, or null if not available
|
|
84
|
-
*
|
|
85
|
-
* Accepts a quill reference string like "resume-template", "resume-template@2",
|
|
86
|
-
* or "resume-template@2.1.0". Returns QuillInfo if the engine can resolve it
|
|
87
|
-
* locally, or null if an external fetch is needed.
|
|
88
|
-
*/
|
|
89
|
-
resolveQuill(quill_ref: string): any;
|
|
90
|
-
/**
|
|
91
|
-
* Get shallow information about a registered Quill
|
|
92
|
-
*
|
|
93
|
-
* This returns metadata, backend info, field schemas, and supported formats
|
|
94
|
-
* that consumers need to configure render options for the next step.
|
|
70
|
+
* JavaScript constructor: `new Quillmark()`
|
|
95
71
|
*/
|
|
96
|
-
|
|
72
|
+
constructor();
|
|
97
73
|
/**
|
|
98
74
|
* Parse markdown into a ParsedDocument
|
|
99
75
|
*
|
|
@@ -109,13 +85,12 @@ export class Quillmark {
|
|
|
109
85
|
*/
|
|
110
86
|
registerQuill(quill_json: any): QuillInfo;
|
|
111
87
|
/**
|
|
112
|
-
*
|
|
88
|
+
* Get shallow information about a registered Quill
|
|
113
89
|
*
|
|
114
|
-
*
|
|
115
|
-
*
|
|
116
|
-
* Returns true if something was unregistered, false if not found.
|
|
90
|
+
* This returns metadata, backend info, field schemas, and supported formats
|
|
91
|
+
* that consumers need to configure render options for the next step.
|
|
117
92
|
*/
|
|
118
|
-
|
|
93
|
+
getQuillInfo(name: string): QuillInfo;
|
|
119
94
|
/**
|
|
120
95
|
* Get the stripped JSON schema of a Quill (removes UI metadata)
|
|
121
96
|
*
|
|
@@ -124,9 +99,24 @@ export class Quillmark {
|
|
|
124
99
|
*/
|
|
125
100
|
getStrippedSchema(name: string): any;
|
|
126
101
|
/**
|
|
127
|
-
*
|
|
102
|
+
* Perform a dry run validation without backend compilation.
|
|
103
|
+
*
|
|
104
|
+
* Executes parsing, schema validation, and template composition to
|
|
105
|
+
* surface input errors quickly. Returns successfully on valid input,
|
|
106
|
+
* or throws an error with diagnostic payload on failure.
|
|
107
|
+
*
|
|
108
|
+
* The quill name is inferred from the markdown's QUILL tag (or defaults to "__default__").
|
|
109
|
+
*
|
|
110
|
+
* This is useful for fast feedback loops in LLM-driven document generation.
|
|
128
111
|
*/
|
|
129
|
-
|
|
112
|
+
dryRun(markdown: string): void;
|
|
113
|
+
/**
|
|
114
|
+
* Compile markdown to JSON data without rendering artifacts.
|
|
115
|
+
*
|
|
116
|
+
* This exposes the intermediate data structure that would be passed to the backend.
|
|
117
|
+
* Useful for debugging and validation.
|
|
118
|
+
*/
|
|
119
|
+
compileData(markdown: string): any;
|
|
130
120
|
/**
|
|
131
121
|
* Render a ParsedDocument to final artifacts (PDF, SVG, TXT)
|
|
132
122
|
*
|
|
@@ -135,15 +125,25 @@ export class Quillmark {
|
|
|
135
125
|
*/
|
|
136
126
|
render(parsed: ParsedDocument, opts: RenderOptions): RenderResult;
|
|
137
127
|
/**
|
|
138
|
-
*
|
|
128
|
+
* Resolve a Quill reference to a registered Quill, or null if not available
|
|
139
129
|
*
|
|
140
|
-
*
|
|
141
|
-
*
|
|
142
|
-
* or
|
|
130
|
+
* Accepts a quill reference string like "resume-template", "resume-template@2",
|
|
131
|
+
* or "resume-template@2.1.0". Returns QuillInfo if the engine can resolve it
|
|
132
|
+
* locally, or null if an external fetch is needed.
|
|
133
|
+
*/
|
|
134
|
+
resolveQuill(quill_ref: string): any;
|
|
135
|
+
/**
|
|
136
|
+
* List registered Quills with their exact versions
|
|
143
137
|
*
|
|
144
|
-
*
|
|
138
|
+
* Returns strings in the format "name@version" (e.g. "resume-template@2.1.0")
|
|
139
|
+
*/
|
|
140
|
+
listQuills(): string[];
|
|
141
|
+
/**
|
|
142
|
+
* Unregister a Quill by name or specific version
|
|
145
143
|
*
|
|
146
|
-
*
|
|
144
|
+
* If a base name is provided (e.g., "my-quill"), all versions of that quill are freed.
|
|
145
|
+
* If a versioned name is provided (e.g., "my-quill@2.1.0"), only that specific version is freed.
|
|
146
|
+
* Returns true if something was unregistered, false if not found.
|
|
147
147
|
*/
|
|
148
|
-
|
|
148
|
+
unregisterQuill(name_or_ref: string): boolean;
|
|
149
149
|
}
|
package/node-esm/wasm_bg.js
CHANGED
|
@@ -201,12 +201,6 @@ 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
|
-
}
|
|
210
204
|
|
|
211
205
|
function getArrayJsValueFromWasm0(ptr, len) {
|
|
212
206
|
ptr = ptr >>> 0;
|
|
@@ -217,6 +211,12 @@ function getArrayJsValueFromWasm0(ptr, len) {
|
|
|
217
211
|
}
|
|
218
212
|
return result;
|
|
219
213
|
}
|
|
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,38 +240,51 @@ export class Quillmark {
|
|
|
240
240
|
wasm.__wbg_quillmark_free(ptr, 0);
|
|
241
241
|
}
|
|
242
242
|
/**
|
|
243
|
-
*
|
|
243
|
+
* JavaScript constructor: `new Quillmark()`
|
|
244
|
+
*/
|
|
245
|
+
constructor() {
|
|
246
|
+
const ret = wasm.quillmark_new();
|
|
247
|
+
this.__wbg_ptr = ret >>> 0;
|
|
248
|
+
QuillmarkFinalization.register(this, this.__wbg_ptr, this);
|
|
249
|
+
return this;
|
|
250
|
+
}
|
|
251
|
+
/**
|
|
252
|
+
* Parse markdown into a ParsedDocument
|
|
244
253
|
*
|
|
245
|
-
*
|
|
246
|
-
*
|
|
254
|
+
* This is the first step in the workflow. The returned ParsedDocument contains
|
|
255
|
+
* the parsed YAML frontmatter fields and the quill_name (from QUILL field or "__default__").
|
|
256
|
+
* @param {string} markdown
|
|
257
|
+
* @returns {ParsedDocument}
|
|
247
258
|
*/
|
|
248
|
-
|
|
259
|
+
static parseMarkdown(markdown) {
|
|
249
260
|
try {
|
|
250
261
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
251
|
-
wasm.
|
|
262
|
+
const ptr0 = passStringToWasm0(markdown, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
263
|
+
const len0 = WASM_VECTOR_LEN;
|
|
264
|
+
wasm.quillmark_parseMarkdown(retptr, ptr0, len0);
|
|
252
265
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
253
266
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
254
|
-
var
|
|
255
|
-
|
|
256
|
-
|
|
267
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
268
|
+
if (r2) {
|
|
269
|
+
throw takeObject(r1);
|
|
270
|
+
}
|
|
271
|
+
return takeObject(r0);
|
|
257
272
|
} finally {
|
|
258
273
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
259
274
|
}
|
|
260
275
|
}
|
|
261
276
|
/**
|
|
262
|
-
*
|
|
277
|
+
* Register a Quill template bundle
|
|
263
278
|
*
|
|
264
|
-
*
|
|
265
|
-
*
|
|
266
|
-
* @param {
|
|
267
|
-
* @returns {
|
|
279
|
+
* Accepts either a JSON string or a JsValue object representing the Quill file tree.
|
|
280
|
+
* Validation happens automatically on registration.
|
|
281
|
+
* @param {any} quill_json
|
|
282
|
+
* @returns {QuillInfo}
|
|
268
283
|
*/
|
|
269
|
-
|
|
284
|
+
registerQuill(quill_json) {
|
|
270
285
|
try {
|
|
271
286
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
272
|
-
|
|
273
|
-
const len0 = WASM_VECTOR_LEN;
|
|
274
|
-
wasm.quillmark_compileData(retptr, this.__wbg_ptr, ptr0, len0);
|
|
287
|
+
wasm.quillmark_registerQuill(retptr, this.__wbg_ptr, addHeapObject(quill_json));
|
|
275
288
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
276
289
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
277
290
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
@@ -283,21 +296,6 @@ export class Quillmark {
|
|
|
283
296
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
284
297
|
}
|
|
285
298
|
}
|
|
286
|
-
/**
|
|
287
|
-
* Resolve a Quill reference to a registered Quill, or null if not available
|
|
288
|
-
*
|
|
289
|
-
* Accepts a quill reference string like "resume-template", "resume-template@2",
|
|
290
|
-
* or "resume-template@2.1.0". Returns QuillInfo if the engine can resolve it
|
|
291
|
-
* locally, or null if an external fetch is needed.
|
|
292
|
-
* @param {string} quill_ref
|
|
293
|
-
* @returns {any}
|
|
294
|
-
*/
|
|
295
|
-
resolveQuill(quill_ref) {
|
|
296
|
-
const ptr0 = passStringToWasm0(quill_ref, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
297
|
-
const len0 = WASM_VECTOR_LEN;
|
|
298
|
-
const ret = wasm.quillmark_resolveQuill(this.__wbg_ptr, ptr0, len0);
|
|
299
|
-
return takeObject(ret);
|
|
300
|
-
}
|
|
301
299
|
/**
|
|
302
300
|
* Get shallow information about a registered Quill
|
|
303
301
|
*
|
|
@@ -324,19 +322,19 @@ export class Quillmark {
|
|
|
324
322
|
}
|
|
325
323
|
}
|
|
326
324
|
/**
|
|
327
|
-
*
|
|
325
|
+
* Get the stripped JSON schema of a Quill (removes UI metadata)
|
|
328
326
|
*
|
|
329
|
-
* This
|
|
330
|
-
*
|
|
331
|
-
* @param {string}
|
|
332
|
-
* @returns {
|
|
327
|
+
* This returns the schema in a format suitable for feeding to LLMs or
|
|
328
|
+
* other consumers that don't need the UI configuration "x-ui" fields.
|
|
329
|
+
* @param {string} name
|
|
330
|
+
* @returns {any}
|
|
333
331
|
*/
|
|
334
|
-
|
|
332
|
+
getStrippedSchema(name) {
|
|
335
333
|
try {
|
|
336
334
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
337
|
-
const ptr0 = passStringToWasm0(
|
|
335
|
+
const ptr0 = passStringToWasm0(name, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
338
336
|
const len0 = WASM_VECTOR_LEN;
|
|
339
|
-
wasm.
|
|
337
|
+
wasm.quillmark_getStrippedSchema(retptr, this.__wbg_ptr, ptr0, len0);
|
|
340
338
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
341
339
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
342
340
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
@@ -349,57 +347,46 @@ export class Quillmark {
|
|
|
349
347
|
}
|
|
350
348
|
}
|
|
351
349
|
/**
|
|
352
|
-
*
|
|
350
|
+
* Perform a dry run validation without backend compilation.
|
|
353
351
|
*
|
|
354
|
-
*
|
|
355
|
-
*
|
|
356
|
-
*
|
|
357
|
-
*
|
|
352
|
+
* Executes parsing, schema validation, and template composition to
|
|
353
|
+
* surface input errors quickly. Returns successfully on valid input,
|
|
354
|
+
* or throws an error with diagnostic payload on failure.
|
|
355
|
+
*
|
|
356
|
+
* The quill name is inferred from the markdown's QUILL tag (or defaults to "__default__").
|
|
357
|
+
*
|
|
358
|
+
* This is useful for fast feedback loops in LLM-driven document generation.
|
|
359
|
+
* @param {string} markdown
|
|
358
360
|
*/
|
|
359
|
-
|
|
361
|
+
dryRun(markdown) {
|
|
360
362
|
try {
|
|
361
363
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
362
|
-
|
|
364
|
+
const ptr0 = passStringToWasm0(markdown, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
365
|
+
const len0 = WASM_VECTOR_LEN;
|
|
366
|
+
wasm.quillmark_dryRun(retptr, this.__wbg_ptr, ptr0, len0);
|
|
363
367
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
364
368
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
throw takeObject(r1);
|
|
369
|
+
if (r1) {
|
|
370
|
+
throw takeObject(r0);
|
|
368
371
|
}
|
|
369
|
-
return takeObject(r0);
|
|
370
372
|
} finally {
|
|
371
373
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
372
374
|
}
|
|
373
375
|
}
|
|
374
376
|
/**
|
|
375
|
-
*
|
|
376
|
-
*
|
|
377
|
-
* If a base name is provided (e.g., "my-quill"), all versions of that quill are freed.
|
|
378
|
-
* If a versioned name is provided (e.g., "my-quill@2.1.0"), only that specific version is freed.
|
|
379
|
-
* Returns true if something was unregistered, false if not found.
|
|
380
|
-
* @param {string} name_or_ref
|
|
381
|
-
* @returns {boolean}
|
|
382
|
-
*/
|
|
383
|
-
unregisterQuill(name_or_ref) {
|
|
384
|
-
const ptr0 = passStringToWasm0(name_or_ref, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
385
|
-
const len0 = WASM_VECTOR_LEN;
|
|
386
|
-
const ret = wasm.quillmark_unregisterQuill(this.__wbg_ptr, ptr0, len0);
|
|
387
|
-
return ret !== 0;
|
|
388
|
-
}
|
|
389
|
-
/**
|
|
390
|
-
* Get the stripped JSON schema of a Quill (removes UI metadata)
|
|
377
|
+
* Compile markdown to JSON data without rendering artifacts.
|
|
391
378
|
*
|
|
392
|
-
* This
|
|
393
|
-
*
|
|
394
|
-
* @param {string}
|
|
379
|
+
* This exposes the intermediate data structure that would be passed to the backend.
|
|
380
|
+
* Useful for debugging and validation.
|
|
381
|
+
* @param {string} markdown
|
|
395
382
|
* @returns {any}
|
|
396
383
|
*/
|
|
397
|
-
|
|
384
|
+
compileData(markdown) {
|
|
398
385
|
try {
|
|
399
386
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
400
|
-
const ptr0 = passStringToWasm0(
|
|
387
|
+
const ptr0 = passStringToWasm0(markdown, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
401
388
|
const len0 = WASM_VECTOR_LEN;
|
|
402
|
-
wasm.
|
|
389
|
+
wasm.quillmark_compileData(retptr, this.__wbg_ptr, ptr0, len0);
|
|
403
390
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
404
391
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
405
392
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
@@ -411,15 +398,6 @@ export class Quillmark {
|
|
|
411
398
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
412
399
|
}
|
|
413
400
|
}
|
|
414
|
-
/**
|
|
415
|
-
* JavaScript constructor: `new Quillmark()`
|
|
416
|
-
*/
|
|
417
|
-
constructor() {
|
|
418
|
-
const ret = wasm.quillmark_new();
|
|
419
|
-
this.__wbg_ptr = ret >>> 0;
|
|
420
|
-
QuillmarkFinalization.register(this, this.__wbg_ptr, this);
|
|
421
|
-
return this;
|
|
422
|
-
}
|
|
423
401
|
/**
|
|
424
402
|
* Render a ParsedDocument to final artifacts (PDF, SVG, TXT)
|
|
425
403
|
*
|
|
@@ -445,32 +423,54 @@ export class Quillmark {
|
|
|
445
423
|
}
|
|
446
424
|
}
|
|
447
425
|
/**
|
|
448
|
-
*
|
|
449
|
-
*
|
|
450
|
-
* Executes parsing, schema validation, and template composition to
|
|
451
|
-
* surface input errors quickly. Returns successfully on valid input,
|
|
452
|
-
* or throws an error with diagnostic payload on failure.
|
|
426
|
+
* Resolve a Quill reference to a registered Quill, or null if not available
|
|
453
427
|
*
|
|
454
|
-
*
|
|
428
|
+
* Accepts a quill reference string like "resume-template", "resume-template@2",
|
|
429
|
+
* or "resume-template@2.1.0". Returns QuillInfo if the engine can resolve it
|
|
430
|
+
* locally, or null if an external fetch is needed.
|
|
431
|
+
* @param {string} quill_ref
|
|
432
|
+
* @returns {any}
|
|
433
|
+
*/
|
|
434
|
+
resolveQuill(quill_ref) {
|
|
435
|
+
const ptr0 = passStringToWasm0(quill_ref, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
436
|
+
const len0 = WASM_VECTOR_LEN;
|
|
437
|
+
const ret = wasm.quillmark_resolveQuill(this.__wbg_ptr, ptr0, len0);
|
|
438
|
+
return takeObject(ret);
|
|
439
|
+
}
|
|
440
|
+
/**
|
|
441
|
+
* List registered Quills with their exact versions
|
|
455
442
|
*
|
|
456
|
-
*
|
|
457
|
-
* @
|
|
443
|
+
* Returns strings in the format "name@version" (e.g. "resume-template@2.1.0")
|
|
444
|
+
* @returns {string[]}
|
|
458
445
|
*/
|
|
459
|
-
|
|
446
|
+
listQuills() {
|
|
460
447
|
try {
|
|
461
448
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
462
|
-
|
|
463
|
-
const len0 = WASM_VECTOR_LEN;
|
|
464
|
-
wasm.quillmark_dryRun(retptr, this.__wbg_ptr, ptr0, len0);
|
|
449
|
+
wasm.quillmark_listQuills(retptr, this.__wbg_ptr);
|
|
465
450
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
466
451
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
452
|
+
var v1 = getArrayJsValueFromWasm0(r0, r1).slice();
|
|
453
|
+
wasm.__wbindgen_export_3(r0, r1 * 4, 4);
|
|
454
|
+
return v1;
|
|
470
455
|
} finally {
|
|
471
456
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
472
457
|
}
|
|
473
458
|
}
|
|
459
|
+
/**
|
|
460
|
+
* Unregister a Quill by name or specific version
|
|
461
|
+
*
|
|
462
|
+
* If a base name is provided (e.g., "my-quill"), all versions of that quill are freed.
|
|
463
|
+
* If a versioned name is provided (e.g., "my-quill@2.1.0"), only that specific version is freed.
|
|
464
|
+
* Returns true if something was unregistered, false if not found.
|
|
465
|
+
* @param {string} name_or_ref
|
|
466
|
+
* @returns {boolean}
|
|
467
|
+
*/
|
|
468
|
+
unregisterQuill(name_or_ref) {
|
|
469
|
+
const ptr0 = passStringToWasm0(name_or_ref, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
470
|
+
const len0 = WASM_VECTOR_LEN;
|
|
471
|
+
const ret = wasm.quillmark_unregisterQuill(this.__wbg_ptr, ptr0, len0);
|
|
472
|
+
return ret !== 0;
|
|
473
|
+
}
|
|
474
474
|
}
|
|
475
475
|
if (Symbol.dispose) Quillmark.prototype[Symbol.dispose] = Quillmark.prototype.free;
|
|
476
476
|
|
package/node-esm/wasm_bg.wasm
CHANGED
|
Binary file
|
|
@@ -2,31 +2,31 @@
|
|
|
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;
|
|
11
5
|
export const quillmark_new: () => number;
|
|
12
6
|
export const quillmark_parseMarkdown: (a: number, b: number, c: number) => void;
|
|
13
7
|
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_getStrippedSchema: (a: number, b: number, c: number, d: number) => void;
|
|
10
|
+
export const quillmark_dryRun: (a: number, b: number, c: number, d: number) => void;
|
|
11
|
+
export const quillmark_compileData: (a: number, b: number, c: number, d: number) => void;
|
|
14
12
|
export const quillmark_render: (a: number, b: number, c: number, d: number) => void;
|
|
15
13
|
export const quillmark_resolveQuill: (a: number, b: number, c: number) => number;
|
|
14
|
+
export const quillmark_listQuills: (a: number, b: number) => void;
|
|
16
15
|
export const quillmark_unregisterQuill: (a: number, b: number, c: number) => number;
|
|
17
|
-
export const
|
|
18
|
-
export const
|
|
16
|
+
export const init: () => void;
|
|
17
|
+
export const qcms_profile_is_bogus: (a: number) => number;
|
|
19
18
|
export const qcms_white_point_sRGB: (a: number) => void;
|
|
20
|
-
export const
|
|
21
|
-
export const qcms_transform_data_rgba_out_lut: (a: number, b: number, c: number, d: number) => void;
|
|
22
|
-
export const qcms_transform_data_bgra_out_lut: (a: number, b: number, c: number, d: number) => void;
|
|
19
|
+
export const qcms_profile_precache_output_transform: (a: number) => void;
|
|
23
20
|
export const qcms_transform_data_rgb_out_lut_precache: (a: number, b: number, c: number, d: number) => void;
|
|
24
21
|
export const qcms_transform_data_rgba_out_lut_precache: (a: number, b: number, c: number, d: number) => void;
|
|
25
22
|
export const qcms_transform_data_bgra_out_lut_precache: (a: number, b: number, c: number, d: number) => void;
|
|
26
|
-
export const
|
|
27
|
-
export const
|
|
28
|
-
export const
|
|
23
|
+
export const qcms_transform_data_rgb_out_lut: (a: number, b: number, c: number, d: number) => void;
|
|
24
|
+
export const qcms_transform_data_rgba_out_lut: (a: number, b: number, c: number, d: number) => void;
|
|
25
|
+
export const qcms_transform_data_bgra_out_lut: (a: number, b: number, c: number, d: number) => void;
|
|
29
26
|
export const qcms_transform_release: (a: number) => void;
|
|
27
|
+
export const qcms_enable_iccv4: () => void;
|
|
28
|
+
export const lut_interp_linear16: (a: number, b: number, c: number) => number;
|
|
29
|
+
export const lut_inverse_interp16: (a: number, b: number, c: number) => number;
|
|
30
30
|
export const __wbindgen_export_0: (a: number, b: number) => number;
|
|
31
31
|
export const __wbindgen_export_1: (a: number, b: number, c: number, d: number) => number;
|
|
32
32
|
export const __wbindgen_export_2: (a: number) => void;
|