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