@quillmark/wasm 0.55.0 → 0.58.2-rc.4

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/node-esm/wasm.js CHANGED
@@ -1,137 +1,164 @@
1
1
  /* @ts-self-types="./wasm.d.ts" */
2
+ import { readFileSync } from 'node:fs';
3
+
2
4
 
3
- export class CompiledDocument {
5
+ /**
6
+ * Typed in-memory Quillmark document.
7
+ *
8
+ * Created via `Document.fromMarkdown(markdown)`. Exposes:
9
+ * - `quillRef` (string)
10
+ * - `frontmatter` (JS object/Record)
11
+ * - `body` (string)
12
+ * - `cards` (array of Card objects)
13
+ * - `warnings` (array of Diagnostic objects)
14
+ *
15
+ * `toMarkdown()` emits canonical Quillmark Markdown that round-trips back to
16
+ * an equal `Document` by value and by type.
17
+ */
18
+ export class Document {
4
19
  static __wrap(ptr) {
5
20
  ptr = ptr >>> 0;
6
- const obj = Object.create(CompiledDocument.prototype);
21
+ const obj = Object.create(Document.prototype);
7
22
  obj.__wbg_ptr = ptr;
8
- CompiledDocumentFinalization.register(obj, obj.__wbg_ptr, obj);
23
+ DocumentFinalization.register(obj, obj.__wbg_ptr, obj);
9
24
  return obj;
10
25
  }
11
26
  __destroy_into_raw() {
12
27
  const ptr = this.__wbg_ptr;
13
28
  this.__wbg_ptr = 0;
14
- CompiledDocumentFinalization.unregister(this);
29
+ DocumentFinalization.unregister(this);
15
30
  return ptr;
16
31
  }
17
32
  free() {
18
33
  const ptr = this.__destroy_into_raw();
19
- wasm.__wbg_compileddocument_free(ptr, 0);
34
+ wasm.__wbg_document_free(ptr, 0);
20
35
  }
21
36
  /**
22
- * Number of pages in this compiled document.
23
- * @returns {number}
37
+ * Global Markdown body between frontmatter and the first card.
38
+ *
39
+ * Trailing newlines are stripped — those are structural separators in
40
+ * the Markdown wire format, not content the consumer wrote.
41
+ *
42
+ * Empty string when no body is present.
43
+ * @returns {string}
24
44
  */
25
- get pageCount() {
26
- const ret = wasm.compileddocument_pageCount(this.__wbg_ptr);
27
- return ret >>> 0;
45
+ get body() {
46
+ let deferred1_0;
47
+ let deferred1_1;
48
+ try {
49
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
50
+ wasm.document_body(retptr, this.__wbg_ptr);
51
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
52
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
53
+ deferred1_0 = r0;
54
+ deferred1_1 = r1;
55
+ return getStringFromWasm0(r0, r1);
56
+ } finally {
57
+ wasm.__wbindgen_add_to_stack_pointer(16);
58
+ wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
59
+ }
28
60
  }
29
61
  /**
30
- * Render selected pages. `pages = null/undefined` renders all pages.
31
- * @param {Uint32Array | null | undefined} pages
32
- * @param {RenderPagesOptions} opts
33
- * @returns {RenderResult}
62
+ * Ordered list of card blocks as JS objects with `tag`, `fields`, and `body`.
63
+ * @returns {any}
34
64
  */
35
- renderPages(pages, opts) {
65
+ get cards() {
66
+ const ret = wasm.document_cards(this.__wbg_ptr);
67
+ return takeObject(ret);
68
+ }
69
+ /**
70
+ * Parse markdown into a typed Document.
71
+ *
72
+ * Returns the document with any parse-time warnings accessible via `.warnings`.
73
+ * Throws on parse errors.
74
+ * @param {string} markdown
75
+ * @returns {Document}
76
+ */
77
+ static fromMarkdown(markdown) {
36
78
  try {
37
79
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
38
- var ptr0 = isLikeNone(pages) ? 0 : passArray32ToWasm0(pages, wasm.__wbindgen_export);
39
- var len0 = WASM_VECTOR_LEN;
40
- wasm.compileddocument_renderPages(retptr, this.__wbg_ptr, ptr0, len0, addHeapObject(opts));
80
+ const ptr0 = passStringToWasm0(markdown, wasm.__wbindgen_export, wasm.__wbindgen_export2);
81
+ const len0 = WASM_VECTOR_LEN;
82
+ wasm.document_fromMarkdown(retptr, ptr0, len0);
41
83
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
42
84
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
43
85
  var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
44
86
  if (r2) {
45
87
  throw takeObject(r1);
46
88
  }
47
- return takeObject(r0);
89
+ return Document.__wrap(r0);
48
90
  } finally {
49
91
  wasm.__wbindgen_add_to_stack_pointer(16);
50
92
  }
51
93
  }
52
- }
53
- if (Symbol.dispose) CompiledDocument.prototype[Symbol.dispose] = CompiledDocument.prototype.free;
54
-
55
- /**
56
- * Quillmark WASM Engine
57
- *
58
- * Create once, register Quills, render markdown. That's it.
59
- */
60
- export class Quillmark {
61
- __destroy_into_raw() {
62
- const ptr = this.__wbg_ptr;
63
- this.__wbg_ptr = 0;
64
- QuillmarkFinalization.unregister(this);
65
- return ptr;
66
- }
67
- free() {
68
- const ptr = this.__destroy_into_raw();
69
- wasm.__wbg_quillmark_free(ptr, 0);
94
+ /**
95
+ * Typed YAML frontmatter fields as a JS object (no QUILL, BODY, or CARDS keys).
96
+ * @returns {any}
97
+ */
98
+ get frontmatter() {
99
+ const ret = wasm.document_frontmatter(this.__wbg_ptr);
100
+ return takeObject(ret);
70
101
  }
71
102
  /**
72
- * Compile a parsed document into an opaque compiled document handle.
73
- * @param {ParsedDocument} parsed
74
- * @param {CompileOptions | null} [opts]
75
- * @returns {CompiledDocument}
103
+ * Insert a card at the given index.
104
+ *
105
+ * `index` must be in `0..=cards.length`. Out-of-range throws an `Error`.
106
+ *
107
+ * Mutators never modify `warnings`.
108
+ * @param {number} index
109
+ * @param {any} card
76
110
  */
77
- compile(parsed, opts) {
111
+ insertCard(index, card) {
78
112
  try {
79
113
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
80
- wasm.quillmark_compile(retptr, this.__wbg_ptr, addHeapObject(parsed), isLikeNone(opts) ? 0 : addHeapObject(opts));
114
+ wasm.document_insertCard(retptr, this.__wbg_ptr, index, addHeapObject(card));
81
115
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
82
116
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
83
- var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
84
- if (r2) {
85
- throw takeObject(r1);
117
+ if (r1) {
118
+ throw takeObject(r0);
86
119
  }
87
- return CompiledDocument.__wrap(r0);
88
120
  } finally {
89
121
  wasm.__wbindgen_add_to_stack_pointer(16);
90
122
  }
91
123
  }
92
124
  /**
93
- * Compile markdown to JSON data without rendering artifacts.
125
+ * Move the card at `from` to position `to`.
94
126
  *
95
- * This exposes the intermediate data structure that would be passed to the backend.
96
- * Useful for debugging and validation.
97
- * @param {string} markdown
98
- * @returns {any}
127
+ * `from == to` is a no-op. Both indices must be in `0..cards.length`.
128
+ * Out-of-range throws an `Error`.
129
+ *
130
+ * Mutators never modify `warnings`.
131
+ * @param {number} from
132
+ * @param {number} to
99
133
  */
100
- compileData(markdown) {
134
+ moveCard(from, to) {
101
135
  try {
102
136
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
103
- const ptr0 = passStringToWasm0(markdown, wasm.__wbindgen_export, wasm.__wbindgen_export2);
104
- const len0 = WASM_VECTOR_LEN;
105
- wasm.quillmark_compileData(retptr, this.__wbg_ptr, ptr0, len0);
137
+ wasm.document_moveCard(retptr, this.__wbg_ptr, from, to);
106
138
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
107
139
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
108
- var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
109
- if (r2) {
110
- throw takeObject(r1);
140
+ if (r1) {
141
+ throw takeObject(r0);
111
142
  }
112
- return takeObject(r0);
113
143
  } finally {
114
144
  wasm.__wbindgen_add_to_stack_pointer(16);
115
145
  }
116
146
  }
117
147
  /**
118
- * Perform a dry run validation without backend compilation.
148
+ * Append a card to the end of the card list.
119
149
  *
120
- * Executes parsing, schema validation, and template composition to
121
- * surface input errors quickly. Returns successfully on valid input,
122
- * or throws an error with diagnostic payload on failure.
150
+ * `card` must be a JS object with a `tag` string field and optional
151
+ * `fields` (object) and `body` (string).
123
152
  *
124
- * The quill name is read from the markdown's required QUILL tag.
153
+ * Throws an `Error` if `card.tag` is not a valid tag name.
125
154
  *
126
- * This is useful for fast feedback loops in LLM-driven document generation.
127
- * @param {string} markdown
155
+ * Mutators never modify `warnings`.
156
+ * @param {any} card
128
157
  */
129
- dryRun(markdown) {
158
+ pushCard(card) {
130
159
  try {
131
160
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
132
- const ptr0 = passStringToWasm0(markdown, wasm.__wbindgen_export, wasm.__wbindgen_export2);
133
- const len0 = WASM_VECTOR_LEN;
134
- wasm.quillmark_dryRun(retptr, this.__wbg_ptr, ptr0, len0);
161
+ wasm.document_pushCard(retptr, this.__wbg_ptr, addHeapObject(card));
135
162
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
136
163
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
137
164
  if (r1) {
@@ -142,126 +169,286 @@ export class Quillmark {
142
169
  }
143
170
  }
144
171
  /**
145
- * Get shallow information about a registered Quill
172
+ * The QUILL reference string (e.g. `"usaf_memo@0.1"`).
173
+ * @returns {string}
174
+ */
175
+ get quillRef() {
176
+ let deferred1_0;
177
+ let deferred1_1;
178
+ try {
179
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
180
+ wasm.document_quillRef(retptr, this.__wbg_ptr);
181
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
182
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
183
+ deferred1_0 = r0;
184
+ deferred1_1 = r1;
185
+ return getStringFromWasm0(r0, r1);
186
+ } finally {
187
+ wasm.__wbindgen_add_to_stack_pointer(16);
188
+ wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
189
+ }
190
+ }
191
+ /**
192
+ * Remove the card at `index` and return it, or `undefined` if out of range.
193
+ *
194
+ * Mutators never modify `warnings`.
195
+ * @param {number} index
196
+ * @returns {any}
197
+ */
198
+ removeCard(index) {
199
+ const ret = wasm.document_removeCard(this.__wbg_ptr, index);
200
+ return takeObject(ret);
201
+ }
202
+ /**
203
+ * Remove a frontmatter field, returning the removed value or `undefined`.
204
+ *
205
+ * Mutators never modify `warnings`.
206
+ * @param {string} name
207
+ * @returns {any}
208
+ */
209
+ removeField(name) {
210
+ const ptr0 = passStringToWasm0(name, wasm.__wbindgen_export, wasm.__wbindgen_export2);
211
+ const len0 = WASM_VECTOR_LEN;
212
+ const ret = wasm.document_removeField(this.__wbg_ptr, ptr0, len0);
213
+ return takeObject(ret);
214
+ }
215
+ /**
216
+ * Replace the global Markdown body.
217
+ *
218
+ * Mutators never modify `warnings`.
219
+ * @param {string} body
220
+ */
221
+ replaceBody(body) {
222
+ const ptr0 = passStringToWasm0(body, wasm.__wbindgen_export, wasm.__wbindgen_export2);
223
+ const len0 = WASM_VECTOR_LEN;
224
+ wasm.document_replaceBody(this.__wbg_ptr, ptr0, len0);
225
+ }
226
+ /**
227
+ * Set a frontmatter field.
228
+ *
229
+ * Throws an `Error` whose message includes the `EditError` variant name and
230
+ * details if `name` is reserved (`BODY`, `CARDS`, `QUILL`, `CARD`) or does
231
+ * not match `[a-z_][a-z0-9_]*`.
146
232
  *
147
- * This returns metadata, backend info, field schemas, and supported formats
148
- * that consumers need to configure render options for the next step.
233
+ * Mutators never modify `warnings`.
149
234
  * @param {string} name
150
- * @returns {QuillInfo}
235
+ * @param {any} value
151
236
  */
152
- getQuillInfo(name) {
237
+ setField(name, value) {
153
238
  try {
154
239
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
155
240
  const ptr0 = passStringToWasm0(name, wasm.__wbindgen_export, wasm.__wbindgen_export2);
156
241
  const len0 = WASM_VECTOR_LEN;
157
- wasm.quillmark_getQuillInfo(retptr, this.__wbg_ptr, ptr0, len0);
242
+ wasm.document_setField(retptr, this.__wbg_ptr, ptr0, len0, addHeapObject(value));
158
243
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
159
244
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
160
- var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
161
- if (r2) {
162
- throw takeObject(r1);
245
+ if (r1) {
246
+ throw takeObject(r0);
163
247
  }
164
- return takeObject(r0);
165
248
  } finally {
166
249
  wasm.__wbindgen_add_to_stack_pointer(16);
167
250
  }
168
251
  }
169
252
  /**
170
- * Get the public YAML schema contract for a registered quill.
171
- * @param {string} name
172
- * @returns {string}
253
+ * Replace the QUILL reference string.
254
+ *
255
+ * Throws if `ref_str` is not a valid `QuillReference`.
256
+ *
257
+ * Mutators never modify `warnings`.
258
+ * @param {string} ref_str
173
259
  */
174
- getQuillSchema(name) {
175
- let deferred3_0;
176
- let deferred3_1;
260
+ setQuillRef(ref_str) {
177
261
  try {
178
262
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
179
- const ptr0 = passStringToWasm0(name, wasm.__wbindgen_export, wasm.__wbindgen_export2);
263
+ const ptr0 = passStringToWasm0(ref_str, wasm.__wbindgen_export, wasm.__wbindgen_export2);
180
264
  const len0 = WASM_VECTOR_LEN;
181
- wasm.quillmark_getQuillSchema(retptr, this.__wbg_ptr, ptr0, len0);
265
+ wasm.document_setQuillRef(retptr, this.__wbg_ptr, ptr0, len0);
182
266
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
183
267
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
184
- var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
185
- var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
186
- var ptr2 = r0;
187
- var len2 = r1;
188
- if (r3) {
189
- ptr2 = 0; len2 = 0;
190
- throw takeObject(r2);
268
+ if (r1) {
269
+ throw takeObject(r0);
191
270
  }
192
- deferred3_0 = ptr2;
193
- deferred3_1 = len2;
194
- return getStringFromWasm0(ptr2, len2);
195
271
  } finally {
196
272
  wasm.__wbindgen_add_to_stack_pointer(16);
197
- wasm.__wbindgen_export4(deferred3_0, deferred3_1, 1);
198
273
  }
199
274
  }
200
275
  /**
201
- * List registered Quills with their exact versions
276
+ * Emit canonical Quillmark Markdown.
202
277
  *
203
- * Returns strings in the format "name@version" (e.g. "resume-template@2.1.0")
204
- * @returns {string[]}
278
+ * Returns the document serialised as a Quillmark Markdown string.
279
+ * The output is type-fidelity round-trip safe: re-parsing the result
280
+ * produces a `Document` equal to `self` by value and by type.
281
+ * @returns {string}
205
282
  */
206
- listQuills() {
283
+ toMarkdown() {
284
+ let deferred1_0;
285
+ let deferred1_1;
207
286
  try {
208
287
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
209
- wasm.quillmark_listQuills(retptr, this.__wbg_ptr);
288
+ wasm.document_toMarkdown(retptr, this.__wbg_ptr);
210
289
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
211
290
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
212
- var v1 = getArrayJsValueFromWasm0(r0, r1).slice();
213
- wasm.__wbindgen_export4(r0, r1 * 4, 4);
214
- return v1;
291
+ deferred1_0 = r0;
292
+ deferred1_1 = r1;
293
+ return getStringFromWasm0(r0, r1);
215
294
  } finally {
216
295
  wasm.__wbindgen_add_to_stack_pointer(16);
296
+ wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
217
297
  }
218
298
  }
219
299
  /**
220
- * JavaScript constructor: `new Quillmark()`
300
+ * Replace the body of the card at `index`.
301
+ *
302
+ * Throws if `index` is out of range.
303
+ *
304
+ * Mutators never modify `warnings`.
305
+ * @param {number} index
306
+ * @param {string} body
221
307
  */
222
- constructor() {
223
- const ret = wasm.quillmark_new();
224
- this.__wbg_ptr = ret >>> 0;
225
- QuillmarkFinalization.register(this, this.__wbg_ptr, this);
226
- return this;
308
+ updateCardBody(index, body) {
309
+ try {
310
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
311
+ const ptr0 = passStringToWasm0(body, wasm.__wbindgen_export, wasm.__wbindgen_export2);
312
+ const len0 = WASM_VECTOR_LEN;
313
+ wasm.document_updateCardBody(retptr, this.__wbg_ptr, index, ptr0, len0);
314
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
315
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
316
+ if (r1) {
317
+ throw takeObject(r0);
318
+ }
319
+ } finally {
320
+ wasm.__wbindgen_add_to_stack_pointer(16);
321
+ }
227
322
  }
228
323
  /**
229
- * Parse markdown into a ParsedDocument
324
+ * Update a field on the card at `index`.
230
325
  *
231
- * This is the first step in the workflow. The returned ParsedDocument contains
232
- * the parsed YAML frontmatter fields and the quill_ref from QUILL.
233
- * @param {string} markdown
234
- * @returns {ParsedDocument}
326
+ * Convenience method: equivalent to `doc.card_mut(index)?.set_field(name, value)`.
327
+ *
328
+ * Throws if `index` is out of range, `name` is reserved or invalid, or
329
+ * `value` cannot be serialized.
330
+ *
331
+ * Mutators never modify `warnings`.
332
+ * @param {number} index
333
+ * @param {string} name
334
+ * @param {any} value
235
335
  */
236
- static parseMarkdown(markdown) {
336
+ updateCardField(index, name, value) {
237
337
  try {
238
338
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
239
- const ptr0 = passStringToWasm0(markdown, wasm.__wbindgen_export, wasm.__wbindgen_export2);
339
+ const ptr0 = passStringToWasm0(name, wasm.__wbindgen_export, wasm.__wbindgen_export2);
240
340
  const len0 = WASM_VECTOR_LEN;
241
- wasm.quillmark_parseMarkdown(retptr, ptr0, len0);
341
+ wasm.document_updateCardField(retptr, this.__wbg_ptr, index, ptr0, len0, addHeapObject(value));
342
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
343
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
344
+ if (r1) {
345
+ throw takeObject(r0);
346
+ }
347
+ } finally {
348
+ wasm.__wbindgen_add_to_stack_pointer(16);
349
+ }
350
+ }
351
+ /**
352
+ * Non-fatal parse-time warnings as a JS array of Diagnostic objects.
353
+ * @returns {any}
354
+ */
355
+ get warnings() {
356
+ const ret = wasm.document_warnings(this.__wbg_ptr);
357
+ return takeObject(ret);
358
+ }
359
+ }
360
+ if (Symbol.dispose) Document.prototype[Symbol.dispose] = Document.prototype.free;
361
+
362
+ /**
363
+ * Opaque, shareable Quill handle.
364
+ */
365
+ export class Quill {
366
+ static __wrap(ptr) {
367
+ ptr = ptr >>> 0;
368
+ const obj = Object.create(Quill.prototype);
369
+ obj.__wbg_ptr = ptr;
370
+ QuillFinalization.register(obj, obj.__wbg_ptr, obj);
371
+ return obj;
372
+ }
373
+ __destroy_into_raw() {
374
+ const ptr = this.__wbg_ptr;
375
+ this.__wbg_ptr = 0;
376
+ QuillFinalization.unregister(this);
377
+ return ptr;
378
+ }
379
+ free() {
380
+ const ptr = this.__destroy_into_raw();
381
+ wasm.__wbg_quill_free(ptr, 0);
382
+ }
383
+ /**
384
+ * The resolved backend identifier (e.g. `"typst"`).
385
+ * @returns {string}
386
+ */
387
+ get backendId() {
388
+ let deferred1_0;
389
+ let deferred1_1;
390
+ try {
391
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
392
+ wasm.quill_backendId(retptr, this.__wbg_ptr);
393
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
394
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
395
+ deferred1_0 = r0;
396
+ deferred1_1 = r1;
397
+ return getStringFromWasm0(r0, r1);
398
+ } finally {
399
+ wasm.__wbindgen_add_to_stack_pointer(16);
400
+ wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
401
+ }
402
+ }
403
+ /**
404
+ * Open an iterative render session for page-selective rendering.
405
+ * @param {Document} doc
406
+ * @returns {RenderSession}
407
+ */
408
+ open(doc) {
409
+ try {
410
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
411
+ _assertClass(doc, Document);
412
+ var ptr0 = doc.__destroy_into_raw();
413
+ wasm.quill_open(retptr, this.__wbg_ptr, ptr0);
242
414
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
243
415
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
244
416
  var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
245
417
  if (r2) {
246
418
  throw takeObject(r1);
247
419
  }
248
- return takeObject(r0);
420
+ return RenderSession.__wrap(r0);
249
421
  } finally {
250
422
  wasm.__wbindgen_add_to_stack_pointer(16);
251
423
  }
252
424
  }
253
425
  /**
254
- * Register a Quill template bundle
426
+ * Project a document through this quill's schema.
255
427
  *
256
- * Accepts either a JSON string or a JsValue object representing the Quill file tree.
257
- * Validation happens automatically on registration.
258
- * @param {any} quill_json
259
- * @returns {QuillInfo}
428
+ * Returns a plain JS object (not a class) that is immediately
429
+ * `JSON.stringify`-able. The shape mirrors [`FormProjection`]:
430
+ *
431
+ * ```json
432
+ * {
433
+ * "main": { "schema": {...}, "values": { "field": {...} } },
434
+ * "cards": [ ... ],
435
+ * "diagnostics": [ ... ]
436
+ * }
437
+ * ```
438
+ *
439
+ * **Snapshot semantics.** This is a read-only snapshot of the document
440
+ * at call time. Subsequent edits to `doc` require calling `projectForm`
441
+ * again.
442
+ *
443
+ * [`FormProjection`]: quillmark::form::FormProjection
444
+ * @param {Document} doc
445
+ * @returns {any}
260
446
  */
261
- registerQuill(quill_json) {
447
+ projectForm(doc) {
262
448
  try {
263
449
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
264
- wasm.quillmark_registerQuill(retptr, this.__wbg_ptr, addHeapObject(quill_json));
450
+ _assertClass(doc, Document);
451
+ wasm.quill_projectForm(retptr, this.__wbg_ptr, doc.__wbg_ptr);
265
452
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
266
453
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
267
454
  var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
@@ -274,17 +461,17 @@ export class Quillmark {
274
461
  }
275
462
  }
276
463
  /**
277
- * Render a ParsedDocument to final artifacts (PDF, SVG, TXT)
278
- *
279
- * Uses the Quill specified in the ParsedDocument's quill_ref field.
280
- * @param {ParsedDocument} parsed
281
- * @param {RenderOptions} opts
464
+ * Render a document to final artifacts.
465
+ * @param {Document} doc
466
+ * @param {RenderOptions | null} [opts]
282
467
  * @returns {RenderResult}
283
468
  */
284
- render(parsed, opts) {
469
+ render(doc, opts) {
285
470
  try {
286
471
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
287
- wasm.quillmark_render(retptr, this.__wbg_ptr, addHeapObject(parsed), addHeapObject(opts));
472
+ _assertClass(doc, Document);
473
+ var ptr0 = doc.__destroy_into_raw();
474
+ wasm.quill_render(retptr, this.__wbg_ptr, ptr0, isLikeNone(opts) ? 0 : addHeapObject(opts));
288
475
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
289
476
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
290
477
  var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
@@ -296,53 +483,130 @@ export class Quillmark {
296
483
  wasm.__wbindgen_add_to_stack_pointer(16);
297
484
  }
298
485
  }
486
+ }
487
+ if (Symbol.dispose) Quill.prototype[Symbol.dispose] = Quill.prototype.free;
488
+
489
+ /**
490
+ * Quillmark WASM Engine
491
+ */
492
+ export class Quillmark {
493
+ __destroy_into_raw() {
494
+ const ptr = this.__wbg_ptr;
495
+ this.__wbg_ptr = 0;
496
+ QuillmarkFinalization.unregister(this);
497
+ return ptr;
498
+ }
499
+ free() {
500
+ const ptr = this.__destroy_into_raw();
501
+ wasm.__wbg_quillmark_free(ptr, 0);
502
+ }
299
503
  /**
300
- * Resolve a Quill reference to a registered Quill, or null if not available
301
- *
302
- * Accepts a quill reference string like "resume-template", "resume-template@2",
303
- * or "resume-template@2.1.0". Returns QuillInfo if the engine can resolve it
304
- * locally, or null if an external fetch is needed.
305
- * @param {string} quill_ref
306
- * @returns {any}
504
+ * JavaScript constructor: `new Quillmark()`
307
505
  */
308
- resolveQuill(quill_ref) {
309
- const ptr0 = passStringToWasm0(quill_ref, wasm.__wbindgen_export, wasm.__wbindgen_export2);
310
- const len0 = WASM_VECTOR_LEN;
311
- const ret = wasm.quillmark_resolveQuill(this.__wbg_ptr, ptr0, len0);
312
- return takeObject(ret);
506
+ constructor() {
507
+ const ret = wasm.quillmark_new();
508
+ this.__wbg_ptr = ret >>> 0;
509
+ QuillmarkFinalization.register(this, this.__wbg_ptr, this);
510
+ return this;
313
511
  }
314
512
  /**
315
- * Unregister a Quill by name or specific version
513
+ * Load a quill from a file tree and attach the appropriate backend.
316
514
  *
317
- * If a base name is provided (e.g., "my-quill"), all versions of that quill are freed.
318
- * If a versioned name is provided (e.g., "my-quill@2.1.0"), only that specific version is freed.
319
- * Returns true if something was unregistered, false if not found.
320
- * @param {string} name_or_ref
321
- * @returns {boolean}
515
+ * The tree must be a `Map<string, Uint8Array>`.
516
+ * @param {any} tree
517
+ * @returns {Quill}
322
518
  */
323
- unregisterQuill(name_or_ref) {
324
- const ptr0 = passStringToWasm0(name_or_ref, wasm.__wbindgen_export, wasm.__wbindgen_export2);
325
- const len0 = WASM_VECTOR_LEN;
326
- const ret = wasm.quillmark_unregisterQuill(this.__wbg_ptr, ptr0, len0);
327
- return ret !== 0;
519
+ quill(tree) {
520
+ try {
521
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
522
+ wasm.quillmark_quill(retptr, this.__wbg_ptr, addHeapObject(tree));
523
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
524
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
525
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
526
+ if (r2) {
527
+ throw takeObject(r1);
528
+ }
529
+ return Quill.__wrap(r0);
530
+ } finally {
531
+ wasm.__wbindgen_add_to_stack_pointer(16);
532
+ }
328
533
  }
329
534
  }
330
535
  if (Symbol.dispose) Quillmark.prototype[Symbol.dispose] = Quillmark.prototype.free;
331
536
 
537
+ export class RenderSession {
538
+ static __wrap(ptr) {
539
+ ptr = ptr >>> 0;
540
+ const obj = Object.create(RenderSession.prototype);
541
+ obj.__wbg_ptr = ptr;
542
+ RenderSessionFinalization.register(obj, obj.__wbg_ptr, obj);
543
+ return obj;
544
+ }
545
+ __destroy_into_raw() {
546
+ const ptr = this.__wbg_ptr;
547
+ this.__wbg_ptr = 0;
548
+ RenderSessionFinalization.unregister(this);
549
+ return ptr;
550
+ }
551
+ free() {
552
+ const ptr = this.__destroy_into_raw();
553
+ wasm.__wbg_rendersession_free(ptr, 0);
554
+ }
555
+ /**
556
+ * Number of pages in this render session.
557
+ * @returns {number}
558
+ */
559
+ get pageCount() {
560
+ const ret = wasm.rendersession_pageCount(this.__wbg_ptr);
561
+ return ret >>> 0;
562
+ }
563
+ /**
564
+ * Render all or selected pages from this session.
565
+ * @param {RenderOptions | null} [opts]
566
+ * @returns {RenderResult}
567
+ */
568
+ render(opts) {
569
+ try {
570
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
571
+ wasm.rendersession_render(retptr, this.__wbg_ptr, isLikeNone(opts) ? 0 : addHeapObject(opts));
572
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
573
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
574
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
575
+ if (r2) {
576
+ throw takeObject(r1);
577
+ }
578
+ return takeObject(r0);
579
+ } finally {
580
+ wasm.__wbindgen_add_to_stack_pointer(16);
581
+ }
582
+ }
583
+ }
584
+ if (Symbol.dispose) RenderSession.prototype[Symbol.dispose] = RenderSession.prototype.free;
585
+
332
586
  /**
333
587
  * Initialize the WASM module with panic hooks for better error messages
334
588
  */
335
589
  export function init() {
336
590
  wasm.init();
337
591
  }
338
-
339
592
  function __wbg_get_imports() {
340
593
  const import0 = {
341
594
  __proto__: null,
342
- __wbg_Error_2e59b1b37a9a34c3: function(arg0, arg1) {
595
+ __wbg_Error_960c155d3d49e4c2: function(arg0, arg1) {
343
596
  const ret = Error(getStringFromWasm0(arg0, arg1));
344
597
  return addHeapObject(ret);
345
598
  },
599
+ __wbg_Number_32bf70a599af1d4b: function(arg0) {
600
+ const ret = Number(getObject(arg0));
601
+ return ret;
602
+ },
603
+ __wbg_String_8564e559799eccda: function(arg0, arg1) {
604
+ const ret = String(getObject(arg1));
605
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
606
+ const len1 = WASM_VECTOR_LEN;
607
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
608
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
609
+ },
346
610
  __wbg_String_b51de6b05a10845b: function(arg0, arg1) {
347
611
  const ret = String(getObject(arg1));
348
612
  const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
@@ -350,64 +614,64 @@ function __wbg_get_imports() {
350
614
  getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
351
615
  getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
352
616
  },
353
- __wbg___wbindgen_bigint_get_as_i64_2c5082002e4826e2: function(arg0, arg1) {
617
+ __wbg___wbindgen_bigint_get_as_i64_3d3aba5d616c6a51: function(arg0, arg1) {
354
618
  const v = getObject(arg1);
355
619
  const ret = typeof(v) === 'bigint' ? v : undefined;
356
620
  getDataViewMemory0().setBigInt64(arg0 + 8 * 1, isLikeNone(ret) ? BigInt(0) : ret, true);
357
621
  getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
358
622
  },
359
- __wbg___wbindgen_boolean_get_a86c216575a75c30: function(arg0) {
623
+ __wbg___wbindgen_boolean_get_6ea149f0a8dcc5ff: function(arg0) {
360
624
  const v = getObject(arg0);
361
625
  const ret = typeof(v) === 'boolean' ? v : undefined;
362
626
  return isLikeNone(ret) ? 0xFFFFFF : ret ? 1 : 0;
363
627
  },
364
- __wbg___wbindgen_debug_string_dd5d2d07ce9e6c57: function(arg0, arg1) {
628
+ __wbg___wbindgen_debug_string_ab4b34d23d6778bd: function(arg0, arg1) {
365
629
  const ret = debugString(getObject(arg1));
366
630
  const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
367
631
  const len1 = WASM_VECTOR_LEN;
368
632
  getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
369
633
  getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
370
634
  },
371
- __wbg___wbindgen_in_4bd7a57e54337366: function(arg0, arg1) {
635
+ __wbg___wbindgen_in_a5d8b22e52b24dd1: function(arg0, arg1) {
372
636
  const ret = getObject(arg0) in getObject(arg1);
373
637
  return ret;
374
638
  },
375
- __wbg___wbindgen_is_bigint_6c98f7e945dacdde: function(arg0) {
639
+ __wbg___wbindgen_is_bigint_ec25c7f91b4d9e93: function(arg0) {
376
640
  const ret = typeof(getObject(arg0)) === 'bigint';
377
641
  return ret;
378
642
  },
379
- __wbg___wbindgen_is_function_49868bde5eb1e745: function(arg0) {
643
+ __wbg___wbindgen_is_function_3baa9db1a987f47d: function(arg0) {
380
644
  const ret = typeof(getObject(arg0)) === 'function';
381
645
  return ret;
382
646
  },
383
- __wbg___wbindgen_is_object_40c5a80572e8f9d3: function(arg0) {
647
+ __wbg___wbindgen_is_object_63322ec0cd6ea4ef: function(arg0) {
384
648
  const val = getObject(arg0);
385
649
  const ret = typeof(val) === 'object' && val !== null;
386
650
  return ret;
387
651
  },
388
- __wbg___wbindgen_is_string_b29b5c5a8065ba1a: function(arg0) {
652
+ __wbg___wbindgen_is_string_6df3bf7ef1164ed3: function(arg0) {
389
653
  const ret = typeof(getObject(arg0)) === 'string';
390
654
  return ret;
391
655
  },
392
- __wbg___wbindgen_is_undefined_c0cca72b82b86f4d: function(arg0) {
656
+ __wbg___wbindgen_is_undefined_29a43b4d42920abd: function(arg0) {
393
657
  const ret = getObject(arg0) === undefined;
394
658
  return ret;
395
659
  },
396
- __wbg___wbindgen_jsval_eq_7d430e744a913d26: function(arg0, arg1) {
660
+ __wbg___wbindgen_jsval_eq_d3465d8a07697228: function(arg0, arg1) {
397
661
  const ret = getObject(arg0) === getObject(arg1);
398
662
  return ret;
399
663
  },
400
- __wbg___wbindgen_jsval_loose_eq_3a72ae764d46d944: function(arg0, arg1) {
664
+ __wbg___wbindgen_jsval_loose_eq_cac3565e89b4134c: function(arg0, arg1) {
401
665
  const ret = getObject(arg0) == getObject(arg1);
402
666
  return ret;
403
667
  },
404
- __wbg___wbindgen_number_get_7579aab02a8a620c: function(arg0, arg1) {
668
+ __wbg___wbindgen_number_get_c7f42aed0525c451: function(arg0, arg1) {
405
669
  const obj = getObject(arg1);
406
670
  const ret = typeof(obj) === 'number' ? obj : undefined;
407
671
  getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
408
672
  getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
409
673
  },
410
- __wbg___wbindgen_string_get_914df97fcfa788f2: function(arg0, arg1) {
674
+ __wbg___wbindgen_string_get_7ed5322991caaec5: function(arg0, arg1) {
411
675
  const obj = getObject(arg1);
412
676
  const ret = typeof(obj) === 'string' ? obj : undefined;
413
677
  var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
@@ -415,18 +679,22 @@ function __wbg_get_imports() {
415
679
  getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
416
680
  getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
417
681
  },
418
- __wbg___wbindgen_throw_81fc77679af83bc6: function(arg0, arg1) {
682
+ __wbg___wbindgen_throw_6b64449b9b9ed33c: function(arg0, arg1) {
419
683
  throw new Error(getStringFromWasm0(arg0, arg1));
420
684
  },
421
- __wbg_call_7f2987183bb62793: function() { return handleError(function (arg0, arg1) {
685
+ __wbg_call_14b169f759b26747: function() { return handleError(function (arg0, arg1) {
422
686
  const ret = getObject(arg0).call(getObject(arg1));
423
687
  return addHeapObject(ret);
424
688
  }, arguments); },
425
- __wbg_done_547d467e97529006: function(arg0) {
689
+ __wbg_done_9158f7cc8751ba32: function(arg0) {
426
690
  const ret = getObject(arg0).done;
427
691
  return ret;
428
692
  },
429
- __wbg_entries_616b1a459b85be0b: function(arg0) {
693
+ __wbg_entries_2bf997cf82353e47: function(arg0) {
694
+ const ret = getObject(arg0).entries();
695
+ return addHeapObject(ret);
696
+ },
697
+ __wbg_entries_e0b73aa8571ddb56: function(arg0) {
430
698
  const ret = Object.entries(getObject(arg0));
431
699
  return addHeapObject(ret);
432
700
  },
@@ -441,42 +709,50 @@ function __wbg_get_imports() {
441
709
  wasm.__wbindgen_export4(deferred0_0, deferred0_1, 1);
442
710
  }
443
711
  },
712
+ __wbg_from_0dbf29f09e7fb200: function(arg0) {
713
+ const ret = Array.from(getObject(arg0));
714
+ return addHeapObject(ret);
715
+ },
444
716
  __wbg_getRandomValues_3f44b700395062e5: function() { return handleError(function (arg0, arg1) {
445
717
  globalThis.crypto.getRandomValues(getArrayU8FromWasm0(arg0, arg1));
446
718
  }, arguments); },
447
- __wbg_getTime_f6ac312467f7cf09: function(arg0) {
719
+ __wbg_getTime_da7c55f52b71e8c6: function(arg0) {
448
720
  const ret = getObject(arg0).getTime();
449
721
  return ret;
450
722
  },
451
- __wbg_getUTCDate_9b73619d33527a0e: function(arg0) {
723
+ __wbg_getUTCDate_5cd8b68e971333f7: function(arg0) {
452
724
  const ret = getObject(arg0).getUTCDate();
453
725
  return ret;
454
726
  },
455
- __wbg_getUTCFullYear_1c80c08b216993d4: function(arg0) {
727
+ __wbg_getUTCFullYear_f3b3950a0ccb9165: function(arg0) {
456
728
  const ret = getObject(arg0).getUTCFullYear();
457
729
  return ret;
458
730
  },
459
- __wbg_getUTCMonth_ea2d5842542c5998: function(arg0) {
731
+ __wbg_getUTCMonth_62fa72a7522ef806: function(arg0) {
460
732
  const ret = getObject(arg0).getUTCMonth();
461
733
  return ret;
462
734
  },
463
- __wbg_get_4848e350b40afc16: function(arg0, arg1) {
464
- const ret = getObject(arg0)[arg1 >>> 0];
465
- return addHeapObject(ret);
466
- },
467
- __wbg_get_ed0642c4b9d31ddf: function() { return handleError(function (arg0, arg1) {
735
+ __wbg_get_1affdbdd5573b16a: function() { return handleError(function (arg0, arg1) {
468
736
  const ret = Reflect.get(getObject(arg0), getObject(arg1));
469
737
  return addHeapObject(ret);
470
738
  }, arguments); },
471
- __wbg_get_unchecked_7d7babe32e9e6a54: function(arg0, arg1) {
739
+ __wbg_get_8360291721e2339f: function(arg0, arg1) {
472
740
  const ret = getObject(arg0)[arg1 >>> 0];
473
741
  return addHeapObject(ret);
474
742
  },
743
+ __wbg_get_unchecked_17f53dad852b9588: function(arg0, arg1) {
744
+ const ret = getObject(arg0)[arg1 >>> 0];
745
+ return addHeapObject(ret);
746
+ },
747
+ __wbg_get_with_ref_key_6412cf3094599694: function(arg0, arg1) {
748
+ const ret = getObject(arg0)[getObject(arg1)];
749
+ return addHeapObject(ret);
750
+ },
475
751
  __wbg_get_with_ref_key_f64427178466f623: function(arg0, arg1) {
476
752
  const ret = getObject(arg0)[getObject(arg1)];
477
753
  return addHeapObject(ret);
478
754
  },
479
- __wbg_instanceof_ArrayBuffer_ff7c1337a5e3b33a: function(arg0) {
755
+ __wbg_instanceof_ArrayBuffer_7c8433c6ed14ffe3: function(arg0) {
480
756
  let result;
481
757
  try {
482
758
  result = getObject(arg0) instanceof ArrayBuffer;
@@ -486,7 +762,17 @@ function __wbg_get_imports() {
486
762
  const ret = result;
487
763
  return ret;
488
764
  },
489
- __wbg_instanceof_Uint8Array_4b8da683deb25d72: function(arg0) {
765
+ __wbg_instanceof_Map_1b76fd4635be43eb: function(arg0) {
766
+ let result;
767
+ try {
768
+ result = getObject(arg0) instanceof Map;
769
+ } catch (_) {
770
+ result = false;
771
+ }
772
+ const ret = result;
773
+ return ret;
774
+ },
775
+ __wbg_instanceof_Uint8Array_152ba1f289edcf3f: function(arg0) {
490
776
  let result;
491
777
  try {
492
778
  result = getObject(arg0) instanceof Uint8Array;
@@ -496,86 +782,90 @@ function __wbg_get_imports() {
496
782
  const ret = result;
497
783
  return ret;
498
784
  },
499
- __wbg_isArray_db61795ad004c139: function(arg0) {
785
+ __wbg_isArray_c3109d14ffc06469: function(arg0) {
500
786
  const ret = Array.isArray(getObject(arg0));
501
787
  return ret;
502
788
  },
503
- __wbg_isSafeInteger_ea83862ba994770c: function(arg0) {
789
+ __wbg_isSafeInteger_4fc213d1989d6d2a: function(arg0) {
504
790
  const ret = Number.isSafeInteger(getObject(arg0));
505
791
  return ret;
506
792
  },
507
- __wbg_iterator_de403ef31815a3e6: function() {
793
+ __wbg_iterator_013bc09ec998c2a7: function() {
508
794
  const ret = Symbol.iterator;
509
795
  return addHeapObject(ret);
510
796
  },
511
- __wbg_length_0c32cb8543c8e4c8: function(arg0) {
797
+ __wbg_length_3d4ecd04bd8d22f1: function(arg0) {
512
798
  const ret = getObject(arg0).length;
513
799
  return ret;
514
800
  },
515
- __wbg_length_6e821edde497a532: function(arg0) {
801
+ __wbg_length_9f1775224cf1d815: function(arg0) {
516
802
  const ret = getObject(arg0).length;
517
803
  return ret;
518
804
  },
519
- __wbg_new_0_bfa2ef4bc447daa2: function() {
805
+ __wbg_new_0_4d657201ced14de3: function() {
520
806
  const ret = new Date();
521
807
  return addHeapObject(ret);
522
808
  },
523
- __wbg_new_0f6d2ddfe083319b: function(arg0) {
524
- const ret = new Date(getObject(arg0));
809
+ __wbg_new_0c7403db6e782f19: function(arg0) {
810
+ const ret = new Uint8Array(getObject(arg0));
525
811
  return addHeapObject(ret);
526
812
  },
527
813
  __wbg_new_227d7c05414eb861: function() {
528
814
  const ret = new Error();
529
815
  return addHeapObject(ret);
530
816
  },
531
- __wbg_new_4f9fafbb3909af72: function() {
532
- const ret = new Object();
533
- return addHeapObject(ret);
534
- },
535
- __wbg_new_99cabae501c0a8a0: function() {
817
+ __wbg_new_34d45cc8e36aaead: function() {
536
818
  const ret = new Map();
537
819
  return addHeapObject(ret);
538
820
  },
539
- __wbg_new_a560378ea1240b14: function(arg0) {
540
- const ret = new Uint8Array(getObject(arg0));
821
+ __wbg_new_5e360d2ff7b9e1c3: function(arg0, arg1) {
822
+ const ret = new Error(getStringFromWasm0(arg0, arg1));
541
823
  return addHeapObject(ret);
542
824
  },
543
- __wbg_new_f3c9df4f38f3f798: function() {
825
+ __wbg_new_682678e2f47e32bc: function() {
544
826
  const ret = new Array();
545
827
  return addHeapObject(ret);
546
828
  },
547
- __wbg_next_01132ed6134b8ef5: function(arg0) {
548
- const ret = getObject(arg0).next;
829
+ __wbg_new_7913666fe5070684: function(arg0) {
830
+ const ret = new Date(getObject(arg0));
549
831
  return addHeapObject(ret);
550
832
  },
551
- __wbg_next_b3713ec761a9dbfd: function() { return handleError(function (arg0) {
833
+ __wbg_new_aa8d0fa9762c29bd: function() {
834
+ const ret = new Object();
835
+ return addHeapObject(ret);
836
+ },
837
+ __wbg_next_0340c4ae324393c3: function() { return handleError(function (arg0) {
552
838
  const ret = getObject(arg0).next();
553
839
  return addHeapObject(ret);
554
840
  }, arguments); },
555
- __wbg_now_88621c9c9a4f3ffc: function() {
841
+ __wbg_next_7646edaa39458ef7: function(arg0) {
842
+ const ret = getObject(arg0).next;
843
+ return addHeapObject(ret);
844
+ },
845
+ __wbg_now_a9b7df1cbee90986: function() {
556
846
  const ret = Date.now();
557
847
  return ret;
558
848
  },
559
- __wbg_parse_545d11396395fbbd: function() { return handleError(function (arg0, arg1) {
560
- const ret = JSON.parse(getStringFromWasm0(arg0, arg1));
561
- return addHeapObject(ret);
562
- }, arguments); },
563
- __wbg_prototypesetcall_3e05eb9545565046: function(arg0, arg1, arg2) {
849
+ __wbg_prototypesetcall_a6b02eb00b0f4ce2: function(arg0, arg1, arg2) {
564
850
  Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), getObject(arg2));
565
851
  },
566
- __wbg_set_08463b1df38a7e29: function(arg0, arg1, arg2) {
567
- const ret = getObject(arg0).set(getObject(arg1), getObject(arg2));
568
- return addHeapObject(ret);
852
+ __wbg_set_022bee52d0b05b19: function() { return handleError(function (arg0, arg1, arg2) {
853
+ const ret = Reflect.set(getObject(arg0), getObject(arg1), getObject(arg2));
854
+ return ret;
855
+ }, arguments); },
856
+ __wbg_set_3bf1de9fab0cd644: function(arg0, arg1, arg2) {
857
+ getObject(arg0)[arg1 >>> 0] = takeObject(arg2);
569
858
  },
570
859
  __wbg_set_6be42768c690e380: function(arg0, arg1, arg2) {
571
860
  getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
572
861
  },
573
- __wbg_set_6c60b2e8ad0e9383: function(arg0, arg1, arg2) {
574
- getObject(arg0)[arg1 >>> 0] = takeObject(arg2);
575
- },
576
862
  __wbg_set_f071dbb3bd088e0e: function(arg0, arg1, arg2) {
577
863
  getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
578
864
  },
865
+ __wbg_set_fde2cec06c23692b: function(arg0, arg1, arg2) {
866
+ const ret = getObject(arg0).set(getObject(arg1), getObject(arg2));
867
+ return addHeapObject(ret);
868
+ },
579
869
  __wbg_stack_3b0d974bbf31e44f: function(arg0, arg1) {
580
870
  const ret = getObject(arg1).stack;
581
871
  const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
@@ -583,11 +873,7 @@ function __wbg_get_imports() {
583
873
  getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
584
874
  getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
585
875
  },
586
- __wbg_stringify_a2c39d991e1bf91d: function() { return handleError(function (arg0) {
587
- const ret = JSON.stringify(getObject(arg0));
588
- return addHeapObject(ret);
589
- }, arguments); },
590
- __wbg_value_7f6052747ccf940f: function(arg0) {
876
+ __wbg_value_ee3a06f4579184fa: function(arg0) {
591
877
  const ret = getObject(arg0).value;
592
878
  return addHeapObject(ret);
593
879
  },
@@ -625,12 +911,18 @@ function __wbg_get_imports() {
625
911
  };
626
912
  }
627
913
 
628
- const CompiledDocumentFinalization = (typeof FinalizationRegistry === 'undefined')
914
+ const DocumentFinalization = (typeof FinalizationRegistry === 'undefined')
915
+ ? { register: () => {}, unregister: () => {} }
916
+ : new FinalizationRegistry(ptr => wasm.__wbg_document_free(ptr >>> 0, 1));
917
+ const QuillFinalization = (typeof FinalizationRegistry === 'undefined')
629
918
  ? { register: () => {}, unregister: () => {} }
630
- : new FinalizationRegistry(ptr => wasm.__wbg_compileddocument_free(ptr >>> 0, 1));
919
+ : new FinalizationRegistry(ptr => wasm.__wbg_quill_free(ptr >>> 0, 1));
631
920
  const QuillmarkFinalization = (typeof FinalizationRegistry === 'undefined')
632
921
  ? { register: () => {}, unregister: () => {} }
633
922
  : new FinalizationRegistry(ptr => wasm.__wbg_quillmark_free(ptr >>> 0, 1));
923
+ const RenderSessionFinalization = (typeof FinalizationRegistry === 'undefined')
924
+ ? { register: () => {}, unregister: () => {} }
925
+ : new FinalizationRegistry(ptr => wasm.__wbg_rendersession_free(ptr >>> 0, 1));
634
926
 
635
927
  function addHeapObject(obj) {
636
928
  if (heap_next === heap.length) heap.push(heap.length + 1);
@@ -641,6 +933,12 @@ function addHeapObject(obj) {
641
933
  return idx;
642
934
  }
643
935
 
936
+ function _assertClass(instance, klass) {
937
+ if (!(instance instanceof klass)) {
938
+ throw new Error(`expected instance of ${klass.name}`);
939
+ }
940
+ }
941
+
644
942
  function debugString(val) {
645
943
  // primitive types
646
944
  const type = typeof val;
@@ -712,16 +1010,6 @@ function dropObject(idx) {
712
1010
  heap_next = idx;
713
1011
  }
714
1012
 
715
- function getArrayJsValueFromWasm0(ptr, len) {
716
- ptr = ptr >>> 0;
717
- const mem = getDataViewMemory0();
718
- const result = [];
719
- for (let i = ptr; i < ptr + 4 * len; i += 4) {
720
- result.push(takeObject(mem.getUint32(i, true)));
721
- }
722
- return result;
723
- }
724
-
725
1013
  function getArrayU8FromWasm0(ptr, len) {
726
1014
  ptr = ptr >>> 0;
727
1015
  return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
@@ -740,14 +1028,6 @@ function getStringFromWasm0(ptr, len) {
740
1028
  return decodeText(ptr, len);
741
1029
  }
742
1030
 
743
- let cachedUint32ArrayMemory0 = null;
744
- function getUint32ArrayMemory0() {
745
- if (cachedUint32ArrayMemory0 === null || cachedUint32ArrayMemory0.byteLength === 0) {
746
- cachedUint32ArrayMemory0 = new Uint32Array(wasm.memory.buffer);
747
- }
748
- return cachedUint32ArrayMemory0;
749
- }
750
-
751
1031
  let cachedUint8ArrayMemory0 = null;
752
1032
  function getUint8ArrayMemory0() {
753
1033
  if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
@@ -775,13 +1055,6 @@ function isLikeNone(x) {
775
1055
  return x === undefined || x === null;
776
1056
  }
777
1057
 
778
- function passArray32ToWasm0(arg, malloc) {
779
- const ptr = malloc(arg.length * 4, 4) >>> 0;
780
- getUint32ArrayMemory0().set(arg, ptr / 4);
781
- WASM_VECTOR_LEN = arg.length;
782
- return ptr;
783
- }
784
-
785
1058
  function passStringToWasm0(arg, malloc, realloc) {
786
1059
  if (realloc === undefined) {
787
1060
  const buf = cachedTextEncoder.encode(arg);
@@ -846,7 +1119,6 @@ if (!('encodeInto' in cachedTextEncoder)) {
846
1119
 
847
1120
  let WASM_VECTOR_LEN = 0;
848
1121
 
849
- import { readFileSync } from 'node:fs';
850
1122
  const wasmUrl = new URL('wasm_bg.wasm', import.meta.url);
851
1123
  const wasmBytes = readFileSync(wasmUrl);
852
1124
  const wasmModule = new WebAssembly.Module(wasmBytes);