@quillmark/wasm 0.25.0 → 0.27.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 +47 -47
- package/bundler/wasm_bg.js +100 -100
- package/bundler/wasm_bg.wasm +0 -0
- package/bundler/wasm_bg.wasm.d.ts +14 -14
- package/node-esm/wasm.d.ts +47 -47
- package/node-esm/wasm_bg.js +100 -100
- 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,9 +4,11 @@
|
|
|
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
|
-
|
|
7
|
+
export interface Artifact {
|
|
8
|
+
format: OutputFormat;
|
|
9
|
+
bytes: Uint8Array;
|
|
10
|
+
mimeType: string;
|
|
11
|
+
}
|
|
10
12
|
|
|
11
13
|
export interface Location {
|
|
12
14
|
file: string;
|
|
@@ -14,21 +16,6 @@ export interface Location {
|
|
|
14
16
|
column: number;
|
|
15
17
|
}
|
|
16
18
|
|
|
17
|
-
export interface Diagnostic {
|
|
18
|
-
severity: Severity;
|
|
19
|
-
code?: string;
|
|
20
|
-
message: string;
|
|
21
|
-
location?: Location;
|
|
22
|
-
hint?: string;
|
|
23
|
-
sourceChain: string[];
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
export interface Artifact {
|
|
27
|
-
format: OutputFormat;
|
|
28
|
-
bytes: Uint8Array;
|
|
29
|
-
mimeType: string;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
19
|
export interface RenderResult {
|
|
33
20
|
artifacts: Artifact[];
|
|
34
21
|
warnings: Diagnostic[];
|
|
@@ -36,6 +23,8 @@ export interface RenderResult {
|
|
|
36
23
|
renderTimeMs: number;
|
|
37
24
|
}
|
|
38
25
|
|
|
26
|
+
export type OutputFormat = "pdf" | "svg" | "txt";
|
|
27
|
+
|
|
39
28
|
export interface QuillInfo {
|
|
40
29
|
name: string;
|
|
41
30
|
backend: string;
|
|
@@ -47,10 +36,7 @@ export interface QuillInfo {
|
|
|
47
36
|
supportedFormats: OutputFormat[];
|
|
48
37
|
}
|
|
49
38
|
|
|
50
|
-
export
|
|
51
|
-
fields: Record<string, any>;
|
|
52
|
-
quillTag: string;
|
|
53
|
-
}
|
|
39
|
+
export type Severity = "error" | "warning" | "note";
|
|
54
40
|
|
|
55
41
|
export interface RenderOptions {
|
|
56
42
|
format?: OutputFormat;
|
|
@@ -58,6 +44,20 @@ export interface RenderOptions {
|
|
|
58
44
|
quillName?: string;
|
|
59
45
|
}
|
|
60
46
|
|
|
47
|
+
export interface Diagnostic {
|
|
48
|
+
severity: Severity;
|
|
49
|
+
code?: string;
|
|
50
|
+
message: string;
|
|
51
|
+
location?: Location;
|
|
52
|
+
hint?: string;
|
|
53
|
+
sourceChain: string[];
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export interface ParsedDocument {
|
|
57
|
+
fields: Record<string, any>;
|
|
58
|
+
quillTag: string;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
61
|
/**
|
|
62
62
|
* Quillmark WASM Engine
|
|
63
63
|
*
|
|
@@ -67,9 +67,22 @@ 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
|
+
* Process markdown through template engine (debugging)
|
|
75
|
+
*
|
|
76
|
+
* Returns template source code (Typst, LaTeX, etc.)
|
|
77
|
+
*/
|
|
78
|
+
processPlate(quill_name: string, markdown: string): string;
|
|
79
|
+
/**
|
|
80
|
+
* Get shallow information about a registered Quill
|
|
81
|
+
*
|
|
82
|
+
* This returns metadata, backend info, field schemas, and supported formats
|
|
83
|
+
* that consumers need to configure render options for the next step.
|
|
84
|
+
*/
|
|
85
|
+
getQuillInfo(name: string): QuillInfo;
|
|
73
86
|
/**
|
|
74
87
|
* Parse markdown into a ParsedDocument
|
|
75
88
|
*
|
|
@@ -85,12 +98,9 @@ export class Quillmark {
|
|
|
85
98
|
*/
|
|
86
99
|
registerQuill(quill_json: any): QuillInfo;
|
|
87
100
|
/**
|
|
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.
|
|
101
|
+
* Unregister a Quill (free memory)
|
|
92
102
|
*/
|
|
93
|
-
|
|
103
|
+
unregisterQuill(name: string): void;
|
|
94
104
|
/**
|
|
95
105
|
* Get shallow information about a registered Quill with UI metadata stripped
|
|
96
106
|
*
|
|
@@ -98,11 +108,16 @@ export class Quillmark {
|
|
|
98
108
|
*/
|
|
99
109
|
getQuillInfoSlim(name: string): QuillInfo;
|
|
100
110
|
/**
|
|
101
|
-
*
|
|
111
|
+
* JavaScript constructor: `new Quillmark()`
|
|
112
|
+
*/
|
|
113
|
+
constructor();
|
|
114
|
+
/**
|
|
115
|
+
* Render a ParsedDocument to final artifacts (PDF, SVG, TXT)
|
|
102
116
|
*
|
|
103
|
-
*
|
|
117
|
+
* Uses the Quill specified in options.quill_name if provided,
|
|
118
|
+
* otherwise infers it from the ParsedDocument's quill_tag field.
|
|
104
119
|
*/
|
|
105
|
-
|
|
120
|
+
render(parsed: ParsedDocument, opts: RenderOptions): RenderResult;
|
|
106
121
|
/**
|
|
107
122
|
* Perform a dry run validation without backend compilation.
|
|
108
123
|
*
|
|
@@ -115,19 +130,4 @@ export class Quillmark {
|
|
|
115
130
|
* This is useful for fast feedback loops in LLM-driven document generation.
|
|
116
131
|
*/
|
|
117
132
|
dryRun(markdown: string): void;
|
|
118
|
-
/**
|
|
119
|
-
* Render a ParsedDocument to final artifacts (PDF, SVG, TXT)
|
|
120
|
-
*
|
|
121
|
-
* Uses the Quill specified in options.quill_name if provided,
|
|
122
|
-
* otherwise infers it from the ParsedDocument's quill_tag field.
|
|
123
|
-
*/
|
|
124
|
-
render(parsed: ParsedDocument, opts: RenderOptions): RenderResult;
|
|
125
|
-
/**
|
|
126
|
-
* List registered Quill names
|
|
127
|
-
*/
|
|
128
|
-
listQuills(): string[];
|
|
129
|
-
/**
|
|
130
|
-
* Unregister a Quill (free memory)
|
|
131
|
-
*/
|
|
132
|
-
unregisterQuill(name: string): void;
|
|
133
133
|
}
|
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,60 +246,56 @@ export class Quillmark {
|
|
|
246
246
|
wasm.__wbg_quillmark_free(ptr, 0);
|
|
247
247
|
}
|
|
248
248
|
/**
|
|
249
|
-
*
|
|
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
|
|
259
|
-
*
|
|
260
|
-
* This is the first step in the workflow. The returned ParsedDocument contains
|
|
261
|
-
* the parsed YAML frontmatter fields and the quill_tag (from QUILL field or "__default__").
|
|
262
|
-
* @param {string} markdown
|
|
263
|
-
* @returns {ParsedDocument}
|
|
249
|
+
* List registered Quill names
|
|
250
|
+
* @returns {string[]}
|
|
264
251
|
*/
|
|
265
|
-
|
|
252
|
+
listQuills() {
|
|
266
253
|
try {
|
|
267
254
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
268
|
-
|
|
269
|
-
const len0 = WASM_VECTOR_LEN;
|
|
270
|
-
wasm.quillmark_parseMarkdown(retptr, ptr0, len0);
|
|
255
|
+
wasm.quillmark_listQuills(retptr, this.__wbg_ptr);
|
|
271
256
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
272
257
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
273
|
-
var
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
}
|
|
277
|
-
return takeObject(r0);
|
|
258
|
+
var v1 = getArrayJsValueFromWasm0(r0, r1).slice();
|
|
259
|
+
wasm.__wbindgen_export_3(r0, r1 * 4, 4);
|
|
260
|
+
return v1;
|
|
278
261
|
} finally {
|
|
279
262
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
280
263
|
}
|
|
281
264
|
}
|
|
282
265
|
/**
|
|
283
|
-
*
|
|
266
|
+
* Process markdown through template engine (debugging)
|
|
284
267
|
*
|
|
285
|
-
*
|
|
286
|
-
*
|
|
287
|
-
* @param {
|
|
288
|
-
* @returns {
|
|
268
|
+
* Returns template source code (Typst, LaTeX, etc.)
|
|
269
|
+
* @param {string} quill_name
|
|
270
|
+
* @param {string} markdown
|
|
271
|
+
* @returns {string}
|
|
289
272
|
*/
|
|
290
|
-
|
|
273
|
+
processPlate(quill_name, markdown) {
|
|
274
|
+
let deferred4_0;
|
|
275
|
+
let deferred4_1;
|
|
291
276
|
try {
|
|
292
277
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
293
|
-
|
|
278
|
+
const ptr0 = passStringToWasm0(quill_name, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
279
|
+
const len0 = WASM_VECTOR_LEN;
|
|
280
|
+
const ptr1 = passStringToWasm0(markdown, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
281
|
+
const len1 = WASM_VECTOR_LEN;
|
|
282
|
+
wasm.quillmark_processPlate(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1);
|
|
294
283
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
295
284
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
296
285
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
297
|
-
|
|
298
|
-
|
|
286
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
287
|
+
var ptr3 = r0;
|
|
288
|
+
var len3 = r1;
|
|
289
|
+
if (r3) {
|
|
290
|
+
ptr3 = 0; len3 = 0;
|
|
291
|
+
throw takeObject(r2);
|
|
299
292
|
}
|
|
300
|
-
|
|
293
|
+
deferred4_0 = ptr3;
|
|
294
|
+
deferred4_1 = len3;
|
|
295
|
+
return getStringFromWasm0(ptr3, len3);
|
|
301
296
|
} finally {
|
|
302
297
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
298
|
+
wasm.__wbindgen_export_3(deferred4_0, deferred4_1, 1);
|
|
303
299
|
}
|
|
304
300
|
}
|
|
305
301
|
/**
|
|
@@ -328,18 +324,19 @@ export class Quillmark {
|
|
|
328
324
|
}
|
|
329
325
|
}
|
|
330
326
|
/**
|
|
331
|
-
*
|
|
327
|
+
* Parse markdown into a ParsedDocument
|
|
332
328
|
*
|
|
333
|
-
*
|
|
334
|
-
*
|
|
335
|
-
* @
|
|
329
|
+
* This is the first step in the workflow. The returned ParsedDocument contains
|
|
330
|
+
* the parsed YAML frontmatter fields and the quill_tag (from QUILL field or "__default__").
|
|
331
|
+
* @param {string} markdown
|
|
332
|
+
* @returns {ParsedDocument}
|
|
336
333
|
*/
|
|
337
|
-
|
|
334
|
+
static parseMarkdown(markdown) {
|
|
338
335
|
try {
|
|
339
336
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
340
|
-
const ptr0 = passStringToWasm0(
|
|
337
|
+
const ptr0 = passStringToWasm0(markdown, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
341
338
|
const len0 = WASM_VECTOR_LEN;
|
|
342
|
-
wasm.
|
|
339
|
+
wasm.quillmark_parseMarkdown(retptr, ptr0, len0);
|
|
343
340
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
344
341
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
345
342
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
@@ -352,68 +349,70 @@ export class Quillmark {
|
|
|
352
349
|
}
|
|
353
350
|
}
|
|
354
351
|
/**
|
|
355
|
-
*
|
|
352
|
+
* Register a Quill template bundle
|
|
356
353
|
*
|
|
357
|
-
*
|
|
358
|
-
*
|
|
359
|
-
* @param {
|
|
360
|
-
* @returns {
|
|
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}
|
|
361
358
|
*/
|
|
362
|
-
|
|
363
|
-
let deferred4_0;
|
|
364
|
-
let deferred4_1;
|
|
359
|
+
registerQuill(quill_json) {
|
|
365
360
|
try {
|
|
366
361
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
367
|
-
|
|
368
|
-
const len0 = WASM_VECTOR_LEN;
|
|
369
|
-
const ptr1 = passStringToWasm0(markdown, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
370
|
-
const len1 = WASM_VECTOR_LEN;
|
|
371
|
-
wasm.quillmark_processPlate(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1);
|
|
362
|
+
wasm.quillmark_registerQuill(retptr, this.__wbg_ptr, addHeapObject(quill_json));
|
|
372
363
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
373
364
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
374
365
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
var len3 = r1;
|
|
378
|
-
if (r3) {
|
|
379
|
-
ptr3 = 0; len3 = 0;
|
|
380
|
-
throw takeObject(r2);
|
|
366
|
+
if (r2) {
|
|
367
|
+
throw takeObject(r1);
|
|
381
368
|
}
|
|
382
|
-
|
|
383
|
-
deferred4_1 = len3;
|
|
384
|
-
return getStringFromWasm0(ptr3, len3);
|
|
369
|
+
return takeObject(r0);
|
|
385
370
|
} finally {
|
|
386
371
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
387
|
-
wasm.__wbindgen_export_3(deferred4_0, deferred4_1, 1);
|
|
388
372
|
}
|
|
389
373
|
}
|
|
390
374
|
/**
|
|
391
|
-
*
|
|
392
|
-
*
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
375
|
+
* Unregister a Quill (free memory)
|
|
376
|
+
* @param {string} name
|
|
377
|
+
*/
|
|
378
|
+
unregisterQuill(name) {
|
|
379
|
+
const ptr0 = passStringToWasm0(name, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
380
|
+
const len0 = WASM_VECTOR_LEN;
|
|
381
|
+
wasm.quillmark_unregisterQuill(this.__wbg_ptr, ptr0, len0);
|
|
382
|
+
}
|
|
383
|
+
/**
|
|
384
|
+
* Get shallow information about a registered Quill with UI metadata stripped
|
|
398
385
|
*
|
|
399
|
-
*
|
|
400
|
-
* @param {string}
|
|
386
|
+
* Same as `getQuillInfo`, but removes "x-ui" fields from the schema.
|
|
387
|
+
* @param {string} name
|
|
388
|
+
* @returns {QuillInfo}
|
|
401
389
|
*/
|
|
402
|
-
|
|
390
|
+
getQuillInfoSlim(name) {
|
|
403
391
|
try {
|
|
404
392
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
405
|
-
const ptr0 = passStringToWasm0(
|
|
393
|
+
const ptr0 = passStringToWasm0(name, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
406
394
|
const len0 = WASM_VECTOR_LEN;
|
|
407
|
-
wasm.
|
|
395
|
+
wasm.quillmark_getQuillInfoSlim(retptr, this.__wbg_ptr, ptr0, len0);
|
|
408
396
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
409
397
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
410
|
-
|
|
411
|
-
|
|
398
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
399
|
+
if (r2) {
|
|
400
|
+
throw takeObject(r1);
|
|
412
401
|
}
|
|
402
|
+
return takeObject(r0);
|
|
413
403
|
} finally {
|
|
414
404
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
415
405
|
}
|
|
416
406
|
}
|
|
407
|
+
/**
|
|
408
|
+
* JavaScript constructor: `new Quillmark()`
|
|
409
|
+
*/
|
|
410
|
+
constructor() {
|
|
411
|
+
const ret = wasm.quillmark_new();
|
|
412
|
+
this.__wbg_ptr = ret >>> 0;
|
|
413
|
+
QuillmarkFinalization.register(this, this.__wbg_ptr, this);
|
|
414
|
+
return this;
|
|
415
|
+
}
|
|
417
416
|
/**
|
|
418
417
|
* Render a ParsedDocument to final artifacts (PDF, SVG, TXT)
|
|
419
418
|
*
|
|
@@ -439,31 +438,32 @@ export class Quillmark {
|
|
|
439
438
|
}
|
|
440
439
|
}
|
|
441
440
|
/**
|
|
442
|
-
*
|
|
443
|
-
*
|
|
441
|
+
* Perform a dry run validation without backend compilation.
|
|
442
|
+
*
|
|
443
|
+
* Executes parsing, schema validation, and template composition to
|
|
444
|
+
* surface input errors quickly. Returns successfully on valid input,
|
|
445
|
+
* or throws an error with diagnostic payload on failure.
|
|
446
|
+
*
|
|
447
|
+
* The quill name is inferred from the markdown's QUILL tag (or defaults to "__default__").
|
|
448
|
+
*
|
|
449
|
+
* This is useful for fast feedback loops in LLM-driven document generation.
|
|
450
|
+
* @param {string} markdown
|
|
444
451
|
*/
|
|
445
|
-
|
|
452
|
+
dryRun(markdown) {
|
|
446
453
|
try {
|
|
447
454
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
448
|
-
wasm.
|
|
455
|
+
const ptr0 = passStringToWasm0(markdown, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
456
|
+
const len0 = WASM_VECTOR_LEN;
|
|
457
|
+
wasm.quillmark_dryRun(retptr, this.__wbg_ptr, ptr0, len0);
|
|
449
458
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
450
459
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
460
|
+
if (r1) {
|
|
461
|
+
throw takeObject(r0);
|
|
462
|
+
}
|
|
454
463
|
} finally {
|
|
455
464
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
456
465
|
}
|
|
457
466
|
}
|
|
458
|
-
/**
|
|
459
|
-
* Unregister a Quill (free memory)
|
|
460
|
-
* @param {string} name
|
|
461
|
-
*/
|
|
462
|
-
unregisterQuill(name) {
|
|
463
|
-
const ptr0 = passStringToWasm0(name, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
464
|
-
const len0 = WASM_VECTOR_LEN;
|
|
465
|
-
wasm.quillmark_unregisterQuill(this.__wbg_ptr, ptr0, len0);
|
|
466
|
-
}
|
|
467
467
|
}
|
|
468
468
|
if (Symbol.dispose) Quillmark.prototype[Symbol.dispose] = Quillmark.prototype.free;
|
|
469
469
|
|
package/bundler/wasm_bg.wasm
CHANGED
|
Binary file
|
|
@@ -2,30 +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
|
|
6
|
-
export const
|
|
7
|
-
export const quillmark_registerQuill: (a: number, b: number, c: number) => void;
|
|
5
|
+
export const init: () => void;
|
|
6
|
+
export const quillmark_dryRun: (a: number, b: number, c: number, d: number) => void;
|
|
8
7
|
export const quillmark_getQuillInfo: (a: number, b: number, c: number, d: number) => void;
|
|
9
8
|
export const quillmark_getQuillInfoSlim: (a: number, b: number, c: number, d: number) => void;
|
|
9
|
+
export const quillmark_listQuills: (a: number, b: number) => void;
|
|
10
|
+
export const quillmark_new: () => number;
|
|
11
|
+
export const quillmark_parseMarkdown: (a: number, b: number, c: number) => void;
|
|
10
12
|
export const quillmark_processPlate: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
11
|
-
export const
|
|
13
|
+
export const quillmark_registerQuill: (a: number, b: number, c: number) => void;
|
|
12
14
|
export const quillmark_render: (a: number, b: number, c: number, d: number) => void;
|
|
13
|
-
export const quillmark_listQuills: (a: number, b: number) => void;
|
|
14
15
|
export const quillmark_unregisterQuill: (a: number, b: number, c: number) => void;
|
|
15
|
-
export const
|
|
16
|
-
export const qcms_profile_is_bogus: (a: number) => number;
|
|
17
|
-
export const qcms_white_point_sRGB: (a: number) => void;
|
|
16
|
+
export const lut_inverse_interp16: (a: number, b: number, c: number) => number;
|
|
18
17
|
export const qcms_profile_precache_output_transform: (a: number) => void;
|
|
19
|
-
export const
|
|
20
|
-
export const qcms_transform_data_rgba_out_lut_precache: (a: number, b: number, c: number, d: number) => void;
|
|
21
|
-
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;
|
|
22
19
|
export const qcms_transform_data_rgb_out_lut: (a: number, b: number, c: number, d: number) => void;
|
|
23
20
|
export const qcms_transform_data_rgba_out_lut: (a: number, b: number, c: number, d: number) => void;
|
|
24
21
|
export const qcms_transform_data_bgra_out_lut: (a: number, b: number, c: number, d: number) => void;
|
|
25
|
-
export const
|
|
26
|
-
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;
|
|
27
25
|
export const lut_interp_linear16: (a: number, b: number, c: number) => number;
|
|
28
|
-
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;
|
|
29
29
|
export const __wbindgen_export_0: (a: number, b: number) => number;
|
|
30
30
|
export const __wbindgen_export_1: (a: number, b: number, c: number, d: number) => number;
|
|
31
31
|
export const __wbindgen_export_2: (a: number) => void;
|
package/node-esm/wasm.d.ts
CHANGED
|
@@ -4,9 +4,11 @@
|
|
|
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
|
-
|
|
7
|
+
export interface Artifact {
|
|
8
|
+
format: OutputFormat;
|
|
9
|
+
bytes: Uint8Array;
|
|
10
|
+
mimeType: string;
|
|
11
|
+
}
|
|
10
12
|
|
|
11
13
|
export interface Location {
|
|
12
14
|
file: string;
|
|
@@ -14,21 +16,6 @@ export interface Location {
|
|
|
14
16
|
column: number;
|
|
15
17
|
}
|
|
16
18
|
|
|
17
|
-
export interface Diagnostic {
|
|
18
|
-
severity: Severity;
|
|
19
|
-
code?: string;
|
|
20
|
-
message: string;
|
|
21
|
-
location?: Location;
|
|
22
|
-
hint?: string;
|
|
23
|
-
sourceChain: string[];
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
export interface Artifact {
|
|
27
|
-
format: OutputFormat;
|
|
28
|
-
bytes: Uint8Array;
|
|
29
|
-
mimeType: string;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
19
|
export interface RenderResult {
|
|
33
20
|
artifacts: Artifact[];
|
|
34
21
|
warnings: Diagnostic[];
|
|
@@ -36,6 +23,8 @@ export interface RenderResult {
|
|
|
36
23
|
renderTimeMs: number;
|
|
37
24
|
}
|
|
38
25
|
|
|
26
|
+
export type OutputFormat = "pdf" | "svg" | "txt";
|
|
27
|
+
|
|
39
28
|
export interface QuillInfo {
|
|
40
29
|
name: string;
|
|
41
30
|
backend: string;
|
|
@@ -47,10 +36,7 @@ export interface QuillInfo {
|
|
|
47
36
|
supportedFormats: OutputFormat[];
|
|
48
37
|
}
|
|
49
38
|
|
|
50
|
-
export
|
|
51
|
-
fields: Record<string, any>;
|
|
52
|
-
quillTag: string;
|
|
53
|
-
}
|
|
39
|
+
export type Severity = "error" | "warning" | "note";
|
|
54
40
|
|
|
55
41
|
export interface RenderOptions {
|
|
56
42
|
format?: OutputFormat;
|
|
@@ -58,6 +44,20 @@ export interface RenderOptions {
|
|
|
58
44
|
quillName?: string;
|
|
59
45
|
}
|
|
60
46
|
|
|
47
|
+
export interface Diagnostic {
|
|
48
|
+
severity: Severity;
|
|
49
|
+
code?: string;
|
|
50
|
+
message: string;
|
|
51
|
+
location?: Location;
|
|
52
|
+
hint?: string;
|
|
53
|
+
sourceChain: string[];
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export interface ParsedDocument {
|
|
57
|
+
fields: Record<string, any>;
|
|
58
|
+
quillTag: string;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
61
|
/**
|
|
62
62
|
* Quillmark WASM Engine
|
|
63
63
|
*
|
|
@@ -67,9 +67,22 @@ 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
|
+
* Process markdown through template engine (debugging)
|
|
75
|
+
*
|
|
76
|
+
* Returns template source code (Typst, LaTeX, etc.)
|
|
77
|
+
*/
|
|
78
|
+
processPlate(quill_name: string, markdown: string): string;
|
|
79
|
+
/**
|
|
80
|
+
* Get shallow information about a registered Quill
|
|
81
|
+
*
|
|
82
|
+
* This returns metadata, backend info, field schemas, and supported formats
|
|
83
|
+
* that consumers need to configure render options for the next step.
|
|
84
|
+
*/
|
|
85
|
+
getQuillInfo(name: string): QuillInfo;
|
|
73
86
|
/**
|
|
74
87
|
* Parse markdown into a ParsedDocument
|
|
75
88
|
*
|
|
@@ -85,12 +98,9 @@ export class Quillmark {
|
|
|
85
98
|
*/
|
|
86
99
|
registerQuill(quill_json: any): QuillInfo;
|
|
87
100
|
/**
|
|
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.
|
|
101
|
+
* Unregister a Quill (free memory)
|
|
92
102
|
*/
|
|
93
|
-
|
|
103
|
+
unregisterQuill(name: string): void;
|
|
94
104
|
/**
|
|
95
105
|
* Get shallow information about a registered Quill with UI metadata stripped
|
|
96
106
|
*
|
|
@@ -98,11 +108,16 @@ export class Quillmark {
|
|
|
98
108
|
*/
|
|
99
109
|
getQuillInfoSlim(name: string): QuillInfo;
|
|
100
110
|
/**
|
|
101
|
-
*
|
|
111
|
+
* JavaScript constructor: `new Quillmark()`
|
|
112
|
+
*/
|
|
113
|
+
constructor();
|
|
114
|
+
/**
|
|
115
|
+
* Render a ParsedDocument to final artifacts (PDF, SVG, TXT)
|
|
102
116
|
*
|
|
103
|
-
*
|
|
117
|
+
* Uses the Quill specified in options.quill_name if provided,
|
|
118
|
+
* otherwise infers it from the ParsedDocument's quill_tag field.
|
|
104
119
|
*/
|
|
105
|
-
|
|
120
|
+
render(parsed: ParsedDocument, opts: RenderOptions): RenderResult;
|
|
106
121
|
/**
|
|
107
122
|
* Perform a dry run validation without backend compilation.
|
|
108
123
|
*
|
|
@@ -115,19 +130,4 @@ export class Quillmark {
|
|
|
115
130
|
* This is useful for fast feedback loops in LLM-driven document generation.
|
|
116
131
|
*/
|
|
117
132
|
dryRun(markdown: string): void;
|
|
118
|
-
/**
|
|
119
|
-
* Render a ParsedDocument to final artifacts (PDF, SVG, TXT)
|
|
120
|
-
*
|
|
121
|
-
* Uses the Quill specified in options.quill_name if provided,
|
|
122
|
-
* otherwise infers it from the ParsedDocument's quill_tag field.
|
|
123
|
-
*/
|
|
124
|
-
render(parsed: ParsedDocument, opts: RenderOptions): RenderResult;
|
|
125
|
-
/**
|
|
126
|
-
* List registered Quill names
|
|
127
|
-
*/
|
|
128
|
-
listQuills(): string[];
|
|
129
|
-
/**
|
|
130
|
-
* Unregister a Quill (free memory)
|
|
131
|
-
*/
|
|
132
|
-
unregisterQuill(name: string): void;
|
|
133
133
|
}
|
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,60 +240,56 @@ export class Quillmark {
|
|
|
240
240
|
wasm.__wbg_quillmark_free(ptr, 0);
|
|
241
241
|
}
|
|
242
242
|
/**
|
|
243
|
-
*
|
|
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
|
|
253
|
-
*
|
|
254
|
-
* This is the first step in the workflow. The returned ParsedDocument contains
|
|
255
|
-
* the parsed YAML frontmatter fields and the quill_tag (from QUILL field or "__default__").
|
|
256
|
-
* @param {string} markdown
|
|
257
|
-
* @returns {ParsedDocument}
|
|
243
|
+
* List registered Quill names
|
|
244
|
+
* @returns {string[]}
|
|
258
245
|
*/
|
|
259
|
-
|
|
246
|
+
listQuills() {
|
|
260
247
|
try {
|
|
261
248
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
262
|
-
|
|
263
|
-
const len0 = WASM_VECTOR_LEN;
|
|
264
|
-
wasm.quillmark_parseMarkdown(retptr, ptr0, len0);
|
|
249
|
+
wasm.quillmark_listQuills(retptr, this.__wbg_ptr);
|
|
265
250
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
266
251
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
267
|
-
var
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
}
|
|
271
|
-
return takeObject(r0);
|
|
252
|
+
var v1 = getArrayJsValueFromWasm0(r0, r1).slice();
|
|
253
|
+
wasm.__wbindgen_export_3(r0, r1 * 4, 4);
|
|
254
|
+
return v1;
|
|
272
255
|
} finally {
|
|
273
256
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
274
257
|
}
|
|
275
258
|
}
|
|
276
259
|
/**
|
|
277
|
-
*
|
|
260
|
+
* Process markdown through template engine (debugging)
|
|
278
261
|
*
|
|
279
|
-
*
|
|
280
|
-
*
|
|
281
|
-
* @param {
|
|
282
|
-
* @returns {
|
|
262
|
+
* Returns template source code (Typst, LaTeX, etc.)
|
|
263
|
+
* @param {string} quill_name
|
|
264
|
+
* @param {string} markdown
|
|
265
|
+
* @returns {string}
|
|
283
266
|
*/
|
|
284
|
-
|
|
267
|
+
processPlate(quill_name, markdown) {
|
|
268
|
+
let deferred4_0;
|
|
269
|
+
let deferred4_1;
|
|
285
270
|
try {
|
|
286
271
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
287
|
-
|
|
272
|
+
const ptr0 = passStringToWasm0(quill_name, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
273
|
+
const len0 = WASM_VECTOR_LEN;
|
|
274
|
+
const ptr1 = passStringToWasm0(markdown, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
275
|
+
const len1 = WASM_VECTOR_LEN;
|
|
276
|
+
wasm.quillmark_processPlate(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1);
|
|
288
277
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
289
278
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
290
279
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
291
|
-
|
|
292
|
-
|
|
280
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
281
|
+
var ptr3 = r0;
|
|
282
|
+
var len3 = r1;
|
|
283
|
+
if (r3) {
|
|
284
|
+
ptr3 = 0; len3 = 0;
|
|
285
|
+
throw takeObject(r2);
|
|
293
286
|
}
|
|
294
|
-
|
|
287
|
+
deferred4_0 = ptr3;
|
|
288
|
+
deferred4_1 = len3;
|
|
289
|
+
return getStringFromWasm0(ptr3, len3);
|
|
295
290
|
} finally {
|
|
296
291
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
292
|
+
wasm.__wbindgen_export_3(deferred4_0, deferred4_1, 1);
|
|
297
293
|
}
|
|
298
294
|
}
|
|
299
295
|
/**
|
|
@@ -322,18 +318,19 @@ export class Quillmark {
|
|
|
322
318
|
}
|
|
323
319
|
}
|
|
324
320
|
/**
|
|
325
|
-
*
|
|
321
|
+
* Parse markdown into a ParsedDocument
|
|
326
322
|
*
|
|
327
|
-
*
|
|
328
|
-
*
|
|
329
|
-
* @
|
|
323
|
+
* This is the first step in the workflow. The returned ParsedDocument contains
|
|
324
|
+
* the parsed YAML frontmatter fields and the quill_tag (from QUILL field or "__default__").
|
|
325
|
+
* @param {string} markdown
|
|
326
|
+
* @returns {ParsedDocument}
|
|
330
327
|
*/
|
|
331
|
-
|
|
328
|
+
static parseMarkdown(markdown) {
|
|
332
329
|
try {
|
|
333
330
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
334
|
-
const ptr0 = passStringToWasm0(
|
|
331
|
+
const ptr0 = passStringToWasm0(markdown, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
335
332
|
const len0 = WASM_VECTOR_LEN;
|
|
336
|
-
wasm.
|
|
333
|
+
wasm.quillmark_parseMarkdown(retptr, ptr0, len0);
|
|
337
334
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
338
335
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
339
336
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
@@ -346,68 +343,70 @@ export class Quillmark {
|
|
|
346
343
|
}
|
|
347
344
|
}
|
|
348
345
|
/**
|
|
349
|
-
*
|
|
346
|
+
* Register a Quill template bundle
|
|
350
347
|
*
|
|
351
|
-
*
|
|
352
|
-
*
|
|
353
|
-
* @param {
|
|
354
|
-
* @returns {
|
|
348
|
+
* Accepts either a JSON string or a JsValue object representing the Quill file tree.
|
|
349
|
+
* Validation happens automatically on registration.
|
|
350
|
+
* @param {any} quill_json
|
|
351
|
+
* @returns {QuillInfo}
|
|
355
352
|
*/
|
|
356
|
-
|
|
357
|
-
let deferred4_0;
|
|
358
|
-
let deferred4_1;
|
|
353
|
+
registerQuill(quill_json) {
|
|
359
354
|
try {
|
|
360
355
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
361
|
-
|
|
362
|
-
const len0 = WASM_VECTOR_LEN;
|
|
363
|
-
const ptr1 = passStringToWasm0(markdown, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
364
|
-
const len1 = WASM_VECTOR_LEN;
|
|
365
|
-
wasm.quillmark_processPlate(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1);
|
|
356
|
+
wasm.quillmark_registerQuill(retptr, this.__wbg_ptr, addHeapObject(quill_json));
|
|
366
357
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
367
358
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
368
359
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
var len3 = r1;
|
|
372
|
-
if (r3) {
|
|
373
|
-
ptr3 = 0; len3 = 0;
|
|
374
|
-
throw takeObject(r2);
|
|
360
|
+
if (r2) {
|
|
361
|
+
throw takeObject(r1);
|
|
375
362
|
}
|
|
376
|
-
|
|
377
|
-
deferred4_1 = len3;
|
|
378
|
-
return getStringFromWasm0(ptr3, len3);
|
|
363
|
+
return takeObject(r0);
|
|
379
364
|
} finally {
|
|
380
365
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
381
|
-
wasm.__wbindgen_export_3(deferred4_0, deferred4_1, 1);
|
|
382
366
|
}
|
|
383
367
|
}
|
|
384
368
|
/**
|
|
385
|
-
*
|
|
386
|
-
*
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
369
|
+
* Unregister a Quill (free memory)
|
|
370
|
+
* @param {string} name
|
|
371
|
+
*/
|
|
372
|
+
unregisterQuill(name) {
|
|
373
|
+
const ptr0 = passStringToWasm0(name, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
374
|
+
const len0 = WASM_VECTOR_LEN;
|
|
375
|
+
wasm.quillmark_unregisterQuill(this.__wbg_ptr, ptr0, len0);
|
|
376
|
+
}
|
|
377
|
+
/**
|
|
378
|
+
* Get shallow information about a registered Quill with UI metadata stripped
|
|
392
379
|
*
|
|
393
|
-
*
|
|
394
|
-
* @param {string}
|
|
380
|
+
* Same as `getQuillInfo`, but removes "x-ui" fields from the schema.
|
|
381
|
+
* @param {string} name
|
|
382
|
+
* @returns {QuillInfo}
|
|
395
383
|
*/
|
|
396
|
-
|
|
384
|
+
getQuillInfoSlim(name) {
|
|
397
385
|
try {
|
|
398
386
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
399
|
-
const ptr0 = passStringToWasm0(
|
|
387
|
+
const ptr0 = passStringToWasm0(name, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
400
388
|
const len0 = WASM_VECTOR_LEN;
|
|
401
|
-
wasm.
|
|
389
|
+
wasm.quillmark_getQuillInfoSlim(retptr, this.__wbg_ptr, ptr0, len0);
|
|
402
390
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
403
391
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
404
|
-
|
|
405
|
-
|
|
392
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
393
|
+
if (r2) {
|
|
394
|
+
throw takeObject(r1);
|
|
406
395
|
}
|
|
396
|
+
return takeObject(r0);
|
|
407
397
|
} finally {
|
|
408
398
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
409
399
|
}
|
|
410
400
|
}
|
|
401
|
+
/**
|
|
402
|
+
* JavaScript constructor: `new Quillmark()`
|
|
403
|
+
*/
|
|
404
|
+
constructor() {
|
|
405
|
+
const ret = wasm.quillmark_new();
|
|
406
|
+
this.__wbg_ptr = ret >>> 0;
|
|
407
|
+
QuillmarkFinalization.register(this, this.__wbg_ptr, this);
|
|
408
|
+
return this;
|
|
409
|
+
}
|
|
411
410
|
/**
|
|
412
411
|
* Render a ParsedDocument to final artifacts (PDF, SVG, TXT)
|
|
413
412
|
*
|
|
@@ -433,31 +432,32 @@ export class Quillmark {
|
|
|
433
432
|
}
|
|
434
433
|
}
|
|
435
434
|
/**
|
|
436
|
-
*
|
|
437
|
-
*
|
|
435
|
+
* Perform a dry run validation without backend compilation.
|
|
436
|
+
*
|
|
437
|
+
* Executes parsing, schema validation, and template composition to
|
|
438
|
+
* surface input errors quickly. Returns successfully on valid input,
|
|
439
|
+
* or throws an error with diagnostic payload on failure.
|
|
440
|
+
*
|
|
441
|
+
* The quill name is inferred from the markdown's QUILL tag (or defaults to "__default__").
|
|
442
|
+
*
|
|
443
|
+
* This is useful for fast feedback loops in LLM-driven document generation.
|
|
444
|
+
* @param {string} markdown
|
|
438
445
|
*/
|
|
439
|
-
|
|
446
|
+
dryRun(markdown) {
|
|
440
447
|
try {
|
|
441
448
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
442
|
-
wasm.
|
|
449
|
+
const ptr0 = passStringToWasm0(markdown, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
450
|
+
const len0 = WASM_VECTOR_LEN;
|
|
451
|
+
wasm.quillmark_dryRun(retptr, this.__wbg_ptr, ptr0, len0);
|
|
443
452
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
444
453
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
454
|
+
if (r1) {
|
|
455
|
+
throw takeObject(r0);
|
|
456
|
+
}
|
|
448
457
|
} finally {
|
|
449
458
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
450
459
|
}
|
|
451
460
|
}
|
|
452
|
-
/**
|
|
453
|
-
* Unregister a Quill (free memory)
|
|
454
|
-
* @param {string} name
|
|
455
|
-
*/
|
|
456
|
-
unregisterQuill(name) {
|
|
457
|
-
const ptr0 = passStringToWasm0(name, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
458
|
-
const len0 = WASM_VECTOR_LEN;
|
|
459
|
-
wasm.quillmark_unregisterQuill(this.__wbg_ptr, ptr0, len0);
|
|
460
|
-
}
|
|
461
461
|
}
|
|
462
462
|
if (Symbol.dispose) Quillmark.prototype[Symbol.dispose] = Quillmark.prototype.free;
|
|
463
463
|
|
package/node-esm/wasm_bg.wasm
CHANGED
|
Binary file
|
|
@@ -2,30 +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
|
|
6
|
-
export const
|
|
7
|
-
export const quillmark_registerQuill: (a: number, b: number, c: number) => void;
|
|
5
|
+
export const init: () => void;
|
|
6
|
+
export const quillmark_dryRun: (a: number, b: number, c: number, d: number) => void;
|
|
8
7
|
export const quillmark_getQuillInfo: (a: number, b: number, c: number, d: number) => void;
|
|
9
8
|
export const quillmark_getQuillInfoSlim: (a: number, b: number, c: number, d: number) => void;
|
|
9
|
+
export const quillmark_listQuills: (a: number, b: number) => void;
|
|
10
|
+
export const quillmark_new: () => number;
|
|
11
|
+
export const quillmark_parseMarkdown: (a: number, b: number, c: number) => void;
|
|
10
12
|
export const quillmark_processPlate: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
11
|
-
export const
|
|
13
|
+
export const quillmark_registerQuill: (a: number, b: number, c: number) => void;
|
|
12
14
|
export const quillmark_render: (a: number, b: number, c: number, d: number) => void;
|
|
13
|
-
export const quillmark_listQuills: (a: number, b: number) => void;
|
|
14
15
|
export const quillmark_unregisterQuill: (a: number, b: number, c: number) => void;
|
|
15
|
-
export const
|
|
16
|
-
export const qcms_profile_is_bogus: (a: number) => number;
|
|
17
|
-
export const qcms_white_point_sRGB: (a: number) => void;
|
|
16
|
+
export const lut_inverse_interp16: (a: number, b: number, c: number) => number;
|
|
18
17
|
export const qcms_profile_precache_output_transform: (a: number) => void;
|
|
19
|
-
export const
|
|
20
|
-
export const qcms_transform_data_rgba_out_lut_precache: (a: number, b: number, c: number, d: number) => void;
|
|
21
|
-
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;
|
|
22
19
|
export const qcms_transform_data_rgb_out_lut: (a: number, b: number, c: number, d: number) => void;
|
|
23
20
|
export const qcms_transform_data_rgba_out_lut: (a: number, b: number, c: number, d: number) => void;
|
|
24
21
|
export const qcms_transform_data_bgra_out_lut: (a: number, b: number, c: number, d: number) => void;
|
|
25
|
-
export const
|
|
26
|
-
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;
|
|
27
25
|
export const lut_interp_linear16: (a: number, b: number, c: number) => number;
|
|
28
|
-
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;
|
|
29
29
|
export const __wbindgen_export_0: (a: number, b: number) => number;
|
|
30
30
|
export const __wbindgen_export_1: (a: number, b: number, c: number, d: number) => number;
|
|
31
31
|
export const __wbindgen_export_2: (a: number) => void;
|