@quillmark/wasm 0.54.1 → 0.58.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.
Binary file
@@ -1,36 +1,30 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
3
  export const memory: WebAssembly.Memory;
4
- export const __wbg_compileddocument_free: (a: number, b: number) => void;
5
4
  export const __wbg_quillmark_free: (a: number, b: number) => void;
6
- export const compileddocument_pageCount: (a: number) => number;
7
- export const compileddocument_renderPages: (a: number, b: number, c: number, d: number, e: number) => void;
8
- export const init: () => void;
9
- export const quillmark_compile: (a: number, b: number, c: number, d: number) => void;
10
- export const quillmark_compileData: (a: number, b: number, c: number, d: number) => void;
11
- export const quillmark_dryRun: (a: number, b: number, c: number, d: number) => void;
12
- export const quillmark_getQuillInfo: (a: number, b: number, c: number, d: number) => void;
13
- export const quillmark_getQuillSchema: (a: number, b: number, c: number, d: number) => void;
14
- export const quillmark_listQuills: (a: number, b: number) => void;
5
+ export const __wbg_quill_free: (a: number, b: number) => void;
6
+ export const __wbg_rendersession_free: (a: number, b: number) => void;
15
7
  export const quillmark_new: () => number;
16
- export const quillmark_parseMarkdown: (a: number, b: number, c: number) => void;
17
- export const quillmark_registerQuill: (a: number, b: number, c: number) => void;
18
- export const quillmark_render: (a: number, b: number, c: number, d: number) => void;
19
- export const quillmark_resolveQuill: (a: number, b: number, c: number) => number;
20
- export const quillmark_unregisterQuill: (a: number, b: number, c: number) => number;
21
- export const lut_inverse_interp16: (a: number, b: number, c: number) => number;
22
- export const qcms_profile_precache_output_transform: (a: number) => void;
8
+ export const quillmark_quill: (a: number, b: number, c: number) => void;
9
+ export const quill_render: (a: number, b: number, c: number, d: number) => void;
10
+ export const quill_open: (a: number, b: number, c: number) => void;
11
+ export const parseddocument_fromMarkdown: (a: number, b: number, c: number) => void;
12
+ export const rendersession_pageCount: (a: number) => number;
13
+ export const rendersession_render: (a: number, b: number, c: number) => void;
14
+ export const init: () => void;
15
+ export const qcms_profile_is_bogus: (a: number) => number;
23
16
  export const qcms_white_point_sRGB: (a: number) => void;
24
- export const qcms_transform_data_rgb_out_lut: (a: number, b: number, c: number, d: number) => void;
25
- export const qcms_transform_data_rgba_out_lut: (a: number, b: number, c: number, d: number) => void;
26
- export const qcms_transform_data_bgra_out_lut: (a: number, b: number, c: number, d: number) => void;
17
+ export const qcms_profile_precache_output_transform: (a: number) => void;
27
18
  export const qcms_transform_data_rgb_out_lut_precache: (a: number, b: number, c: number, d: number) => void;
28
19
  export const qcms_transform_data_rgba_out_lut_precache: (a: number, b: number, c: number, d: number) => void;
29
20
  export const qcms_transform_data_bgra_out_lut_precache: (a: number, b: number, c: number, d: number) => void;
30
- export const lut_interp_linear16: (a: number, b: number, c: number) => number;
31
- export const qcms_enable_iccv4: () => void;
32
- export const qcms_profile_is_bogus: (a: number) => number;
21
+ export const qcms_transform_data_rgb_out_lut: (a: number, b: number, c: number, d: number) => void;
22
+ export const qcms_transform_data_rgba_out_lut: (a: number, b: number, c: number, d: number) => void;
23
+ export const qcms_transform_data_bgra_out_lut: (a: number, b: number, c: number, d: number) => void;
33
24
  export const qcms_transform_release: (a: number) => void;
25
+ export const qcms_enable_iccv4: () => void;
26
+ export const lut_interp_linear16: (a: number, b: number, c: number) => number;
27
+ export const lut_inverse_interp16: (a: number, b: number, c: number) => number;
34
28
  export const __wbindgen_export: (a: number, b: number) => number;
35
29
  export const __wbindgen_export2: (a: number, b: number, c: number, d: number) => number;
36
30
  export const __wbindgen_export3: (a: number) => void;
@@ -6,8 +6,6 @@ export interface Artifact {
6
6
  mimeType: string;
7
7
  }
8
8
 
9
- export interface CompileOptions {}
10
-
11
9
  export interface Diagnostic {
12
10
  severity: Severity;
13
11
  code?: string;
@@ -28,26 +26,11 @@ export interface ParsedDocument {
28
26
  quillRef: string;
29
27
  }
30
28
 
31
- export interface QuillInfo {
32
- name: string;
33
- backend: string;
34
- metadata: Record<string, any>;
35
- example?: string;
36
- schema: string;
37
- defaults: Record<string, any>;
38
- examples: Record<string, any[]>;
39
- supportedFormats: OutputFormat[];
40
- }
41
-
42
29
  export interface RenderOptions {
43
30
  format?: OutputFormat;
44
31
  assets?: Record<string, Uint8Array | number[]>;
45
32
  ppi?: number;
46
- }
47
-
48
- export interface RenderPagesOptions {
49
- format: OutputFormat;
50
- ppi?: number;
33
+ pages?: number[];
51
34
  }
52
35
 
53
36
  export interface RenderResult {
@@ -62,108 +45,53 @@ export type OutputFormat = "pdf" | "svg" | "txt" | "png";
62
45
  export type Severity = "error" | "warning" | "note";
63
46
 
64
47
 
65
- export class CompiledDocument {
48
+ /**
49
+ * Opaque, shareable Quill handle.
50
+ */
51
+ export class Quill {
66
52
  private constructor();
67
53
  free(): void;
68
54
  [Symbol.dispose](): void;
69
55
  /**
70
- * Render selected pages. `pages = null/undefined` renders all pages.
56
+ * Open an iterative render session for page-selective rendering.
71
57
  */
72
- renderPages(pages: Uint32Array | null | undefined, opts: RenderPagesOptions): RenderResult;
58
+ open(parsed: ParsedDocument): RenderSession;
73
59
  /**
74
- * Number of pages in this compiled document.
60
+ * Render a document to final artifacts.
75
61
  */
76
- readonly pageCount: number;
62
+ render(parsed: ParsedDocument, opts: RenderOptions): RenderResult;
77
63
  }
78
64
 
79
65
  /**
80
66
  * Quillmark WASM Engine
81
- *
82
- * Create once, register Quills, render markdown. That's it.
83
67
  */
84
68
  export class Quillmark {
85
69
  free(): void;
86
70
  [Symbol.dispose](): void;
87
- /**
88
- * Compile a parsed document into an opaque compiled document handle.
89
- */
90
- compile(parsed: ParsedDocument, opts?: CompileOptions | null): CompiledDocument;
91
- /**
92
- * Compile markdown to JSON data without rendering artifacts.
93
- *
94
- * This exposes the intermediate data structure that would be passed to the backend.
95
- * Useful for debugging and validation.
96
- */
97
- compileData(markdown: string): any;
98
- /**
99
- * Perform a dry run validation without backend compilation.
100
- *
101
- * Executes parsing, schema validation, and template composition to
102
- * surface input errors quickly. Returns successfully on valid input,
103
- * or throws an error with diagnostic payload on failure.
104
- *
105
- * The quill name is read from the markdown's required QUILL tag.
106
- *
107
- * This is useful for fast feedback loops in LLM-driven document generation.
108
- */
109
- dryRun(markdown: string): void;
110
- /**
111
- * Get shallow information about a registered Quill
112
- *
113
- * This returns metadata, backend info, field schemas, and supported formats
114
- * that consumers need to configure render options for the next step.
115
- */
116
- getQuillInfo(name: string): QuillInfo;
117
- /**
118
- * Get the public YAML schema contract for a registered quill.
119
- */
120
- getQuillSchema(name: string): string;
121
- /**
122
- * List registered Quills with their exact versions
123
- *
124
- * Returns strings in the format "name@version" (e.g. "resume-template@2.1.0")
125
- */
126
- listQuills(): string[];
127
71
  /**
128
72
  * JavaScript constructor: `new Quillmark()`
129
73
  */
130
74
  constructor();
131
75
  /**
132
- * Parse markdown into a ParsedDocument
133
- *
134
- * This is the first step in the workflow. The returned ParsedDocument contains
135
- * the parsed YAML frontmatter fields and the quill_ref from QUILL.
136
- */
137
- static parseMarkdown(markdown: string): ParsedDocument;
138
- /**
139
- * Register a Quill template bundle
140
- *
141
- * Accepts either a JSON string or a JsValue object representing the Quill file tree.
142
- * Validation happens automatically on registration.
143
- */
144
- registerQuill(quill_json: any): QuillInfo;
145
- /**
146
- * Render a ParsedDocument to final artifacts (PDF, SVG, TXT)
76
+ * Load a quill from a file tree and attach the appropriate backend.
147
77
  *
148
- * Uses the Quill specified in the ParsedDocument's quill_ref field.
78
+ * The tree must be a `Map<string, Uint8Array>`.
149
79
  */
150
- render(parsed: ParsedDocument, opts: RenderOptions): RenderResult;
80
+ quill(tree: any): Quill;
81
+ }
82
+
83
+ export class RenderSession {
84
+ private constructor();
85
+ free(): void;
86
+ [Symbol.dispose](): void;
151
87
  /**
152
- * Resolve a Quill reference to a registered Quill, or null if not available
153
- *
154
- * Accepts a quill reference string like "resume-template", "resume-template@2",
155
- * or "resume-template@2.1.0". Returns QuillInfo if the engine can resolve it
156
- * locally, or null if an external fetch is needed.
88
+ * Render all or selected pages from this session.
157
89
  */
158
- resolveQuill(quill_ref: string): any;
90
+ render(opts: RenderOptions): RenderResult;
159
91
  /**
160
- * Unregister a Quill by name or specific version
161
- *
162
- * If a base name is provided (e.g., "my-quill"), all versions of that quill are freed.
163
- * If a versioned name is provided (e.g., "my-quill@2.1.0"), only that specific version is freed.
164
- * Returns true if something was unregistered, false if not found.
92
+ * Number of pages in this render session.
165
93
  */
166
- unregisterQuill(name_or_ref: string): boolean;
94
+ readonly pageCount: number;
167
95
  }
168
96
 
169
97
  /**