@quillmark/wasm 0.112.0 → 0.114.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,11 +1,7 @@
1
1
  /* @ts-self-types="./wasm.d.ts" */
2
2
 
3
- /**
4
- * Typed in-memory Quillmark document.
5
- */
6
3
  export class Document {
7
4
  static __wrap(ptr) {
8
- ptr = ptr >>> 0;
9
5
  const obj = Object.create(Document.prototype);
10
6
  obj.__wbg_ptr = ptr;
11
7
  DocumentFinalization.register(obj, obj.__wbg_ptr, obj);
@@ -44,7 +40,7 @@ export class Document {
44
40
  const len0 = WASM_VECTOR_LEN;
45
41
  var ptr1 = isLikeNone(body) ? 0 : passStringToWasm0(body, wasm.__wbindgen_export, wasm.__wbindgen_export2);
46
42
  var len1 = WASM_VECTOR_LEN;
47
- wasm.document__addCard(retptr, this.__wbg_ptr, quill.__wbg_ptr, ptr0, len0, isLikeNone(fields) ? 0 : addHeapObject(fields), ptr1, len1, isLikeNone(at) ? 0x100000001 : (at) >>> 0);
43
+ wasm.document__addCard(retptr, this.__wbg_ptr, quill.__wbg_ptr, ptr0, len0, isLikeNone(fields) ? 0 : addHeapObject(fields), ptr1, len1, isLikeNone(at) ? Number.MAX_SAFE_INTEGER : (at) >>> 0);
48
44
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
49
45
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
50
46
  if (r1) {
@@ -58,10 +54,7 @@ export class Document {
58
54
  * Typed field write at `addr`, resolving the field's schema `type` from
59
55
  * `quill`: the stable ABI under the runtime `writer.set`. One verb for every
60
56
  * field type; the schema carries the `inline` constraint, so no type token
61
- * is passed. A richtext-typed field stores canonical content, so identity
62
- * marks (anchors, island ids) and content-only marks survive compiles and
63
- * the storage DTO. Values use the encoding the seam already speaks: content
64
- * object or markdown string for richtext, scalar/array/object otherwise.
57
+ * is passed.
65
58
  *
66
59
  * A bare string is `Addr` shorthand for `{ field }`. A body address throws,
67
60
  * having no field schema. A declared field is strict-committed, so a
@@ -120,30 +113,39 @@ export class Document {
120
113
  }
121
114
  }
122
115
  /**
123
- * Interpreted read at `addr`, resolving the field's declared `type` from
124
- * `quill`: the stable ABI under the runtime `reader.get`. The schema-plane
125
- * twin of [`getStored`](Self::get_stored) a `richtext` field returns its
126
- * markdown projection, every other declared type its canonical value
127
- * verbatim.
116
+ * Interpreted **`Content`** read of a value nested inside the composite
117
+ * field at `addr`: the stable ABI under the runtime `reader.getContentAt`,
118
+ * and [`reader.getContent`](Self::reader_get_content) with the path spelled
119
+ * out. `path` is a `PathStep[]` from the field to the leaf — `[0]` an
120
+ * element of an `array<richtext>`, `["motto"]` an `object`'s content
121
+ * property, `[1, "notes"]` a leaf under both, `["controlled_by"]` a
122
+ * variant's cell.
128
123
  *
129
- * A bare string is `Addr` shorthand for `{ field }`; `{ card, field }`
130
- * targets a composable card. An **absent** field returns `undefined`, and an
131
- * absent `addr.field` reads the body markdown. An undeclared name throws
132
- * `edit::unknown_field` (the authority `bodyMarkdown` lacks), a `richtext`
133
- * value that does not decode throws `edit::field_decode`, and an
134
- * out-of-range `addr.card` throws.
124
+ * The codec is the leaf's declared type's, so the caller stops deciding
125
+ * what an element's stored bytes mean. Total over the storage form, as the
126
+ * whole-field read is. What it answers is a legal write input: the anchors
127
+ * and island ids the values form cannot carry ride back through
128
+ * `writer.set` of the whole field.
135
129
  *
136
- * The `quill` handle is passed per call because a `Document` carries only a
137
- * `$quill` reference, not the resolved schema.
130
+ * `undefined` when the field is absent **and when `path` names nothing in
131
+ * the stored value**: a repeater's row index goes stale between derive and
132
+ * read, and absence there is a read, not a fault. Throws
133
+ * `edit::unknown_field` for an undeclared name at any depth,
134
+ * `edit::field_not_content` when `path` resolves to no content leaf,
135
+ * `edit::field_decode` for a value that decodes under neither encoding
136
+ * (anchored at the addressed path), and `edit::index_out_of_range` for a
137
+ * bad `addr.card`. A body address throws: a body has no nested content
138
+ * address.
138
139
  * @param {Quill} quill
139
140
  * @param {Addr | string} addr
140
- * @returns {unknown}
141
+ * @param {PathStep[]} path
142
+ * @returns {Content | undefined}
141
143
  */
142
- _readerGet(quill, addr) {
144
+ _readerGetContentAt(quill, addr, path) {
143
145
  try {
144
146
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
145
147
  _assertClass(quill, Quill);
146
- wasm.document__readerGet(retptr, this.__wbg_ptr, quill.__wbg_ptr, addHeapObject(addr));
148
+ wasm.document__readerGetContentAt(retptr, this.__wbg_ptr, quill.__wbg_ptr, addHeapObject(addr), addHeapObject(path));
147
149
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
148
150
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
149
151
  var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
@@ -191,37 +193,30 @@ export class Document {
191
193
  }
192
194
  }
193
195
  /**
194
- * Interpreted **`Content`** read of a value nested inside the composite
195
- * field at `addr`: the stable ABI under the runtime `reader.getContentAt`,
196
- * and [`reader.getContent`](Self::reader_get_content) with the path spelled
197
- * out. `path` is a `PathStep[]` from the field to the leaf — `[0]` an
198
- * element of an `array<richtext>`, `["motto"]` an `object`'s content
199
- * property, `[1, "notes"]` a leaf under both, `["controlled_by"]` a
200
- * variant's cell.
196
+ * Interpreted read at `addr`, resolving the field's declared `type` from
197
+ * `quill`: the stable ABI under the runtime `reader.get`. The schema-plane
198
+ * twin of [`getStored`](Self::get_stored) a `richtext` field returns its
199
+ * markdown projection, every other declared type its canonical value
200
+ * verbatim.
201
201
  *
202
- * The codec is the leaf's declared type's, so the caller stops deciding
203
- * what an element's stored bytes mean. Total over the storage form, as the
204
- * whole-field read is.
202
+ * A bare string is `Addr` shorthand for `{ field }`; `{ card, field }`
203
+ * targets a composable card. An **absent** field returns `undefined`, and an
204
+ * absent `addr.field` reads the body markdown. An undeclared name throws
205
+ * `edit::unknown_field` (the authority `bodyMarkdown` lacks), a `richtext`
206
+ * value that does not decode throws `edit::field_decode`, and an
207
+ * out-of-range `addr.card` throws.
205
208
  *
206
- * `undefined` when the field is absent **and when `path` names nothing in
207
- * the stored value**: a repeater's row index goes stale between derive and
208
- * read, and absence there is a read, not a fault. Throws
209
- * `edit::unknown_field` for an undeclared name at any depth,
210
- * `edit::field_not_content` when `path` resolves to no content leaf,
211
- * `edit::field_decode` for a value that decodes under neither encoding
212
- * (anchored at the addressed path), and `edit::index_out_of_range` for a
213
- * bad `addr.card`. A body address throws: a body has no nested content
214
- * address.
209
+ * The `quill` handle is passed per call because a `Document` carries only a
210
+ * `$quill` reference, not the resolved schema.
215
211
  * @param {Quill} quill
216
212
  * @param {Addr | string} addr
217
- * @param {PathStep[]} path
218
- * @returns {Content | undefined}
213
+ * @returns {unknown}
219
214
  */
220
- _readerGetContentAt(quill, addr, path) {
215
+ _readerGet(quill, addr) {
221
216
  try {
222
217
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
223
218
  _assertClass(quill, Quill);
224
- wasm.document__readerGetContentAt(retptr, this.__wbg_ptr, quill.__wbg_ptr, addHeapObject(addr), addHeapObject(path));
219
+ wasm.document__readerGet(retptr, this.__wbg_ptr, quill.__wbg_ptr, addHeapObject(addr));
225
220
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
226
221
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
227
222
  var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
@@ -300,8 +295,8 @@ export class Document {
300
295
  }
301
296
  }
302
297
  /**
303
- * Authoring-ergonomics header introducing a blueprint to an LLM/MCP consumer
304
- * for the given `quillName`, re-exposed from core.
298
+ * A blueprint's fill obligation for the given `quillName`, re-exposed from
299
+ * core. Carries no tool name: pair it with your own next-step directive.
305
300
  * @param {string} quill_name
306
301
  * @returns {string}
307
302
  */
@@ -349,28 +344,6 @@ export class Document {
349
344
  wasm.__wbindgen_add_to_stack_pointer(16);
350
345
  }
351
346
  }
352
- /**
353
- * A single composable card by index, so reading one need not materialize
354
- * every card via [`cards`](Self::cards). An out-of-range `index` throws
355
- * `edit::index_out_of_range`.
356
- * @param {number} index
357
- * @returns {Card}
358
- */
359
- card(index) {
360
- try {
361
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
362
- wasm.document_card(retptr, this.__wbg_ptr, index);
363
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
364
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
365
- var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
366
- if (r2) {
367
- throw takeObject(r1);
368
- }
369
- return takeObject(r0);
370
- } finally {
371
- wasm.__wbindgen_add_to_stack_pointer(16);
372
- }
373
- }
374
347
  /**
375
348
  * Number of composable cards, excluding the main card.
376
349
  * @returns {number}
@@ -403,6 +376,28 @@ export class Document {
403
376
  wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
404
377
  }
405
378
  }
379
+ /**
380
+ * A single composable card by index, so reading one need not materialize
381
+ * every card via [`cards`](Self::cards). An out-of-range `index` throws
382
+ * `edit::index_out_of_range`.
383
+ * @param {number} index
384
+ * @returns {Card}
385
+ */
386
+ card(index) {
387
+ try {
388
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
389
+ wasm.document_card(retptr, this.__wbg_ptr, index);
390
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
391
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
392
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
393
+ if (r2) {
394
+ throw takeObject(r1);
395
+ }
396
+ return takeObject(r0);
397
+ } finally {
398
+ wasm.__wbindgen_add_to_stack_pointer(16);
399
+ }
400
+ }
406
401
  /**
407
402
  * @returns {Card[]}
408
403
  */
@@ -429,7 +424,7 @@ export class Document {
429
424
  return Document.__wrap(ret);
430
425
  }
431
426
  /**
432
- * Storage version this build writes via [`toJson`](Document::to_json). The
427
+ * Storage version this build writes via [`toStored`](Document::to_stored). The
433
428
  * tag advances only when the wire format changes, not on every release.
434
429
  * @returns {string}
435
430
  */
@@ -459,28 +454,6 @@ export class Document {
459
454
  const ret = wasm.document_equals(this.__wbg_ptr, other.__wbg_ptr);
460
455
  return ret !== 0;
461
456
  }
462
- /**
463
- * Render a Diagnostic as the canonical pretty-printed text, so it looks
464
- * identical whichever consumer surfaces it.
465
- * @param {Diagnostic} diag
466
- * @returns {string}
467
- */
468
- static formatDiagnostic(diag) {
469
- let deferred1_0;
470
- let deferred1_1;
471
- try {
472
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
473
- wasm.document_formatDiagnostic(retptr, addHeapObject(diag));
474
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
475
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
476
- deferred1_0 = r0;
477
- deferred1_1 = r1;
478
- return getStringFromWasm0(r0, r1);
479
- } finally {
480
- wasm.__wbindgen_add_to_stack_pointer(16);
481
- wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
482
- }
483
- }
484
457
  /**
485
458
  * Authoring-format rules for the card-yaml markdown surface, re-exposed from
486
459
  * core. Constant across calls; read once and cache.
@@ -503,19 +476,16 @@ export class Document {
503
476
  }
504
477
  }
505
478
  /**
506
- * Reconstruct a `Document` from a versioned storage DTO string produced by
507
- * [`toJson`](Document::to_json). The result carries no parse-time warnings.
508
- * Throws if `json` is not a valid storage DTO (malformed JSON, unknown
509
- * `schema`, missing fields, or unparseable quill reference).
510
- * @param {string} json
479
+ * Parse markdown into a typed Document. Throws on parse errors.
480
+ * @param {string} markdown
511
481
  * @returns {Document}
512
482
  */
513
- static fromJson(json) {
483
+ static fromMarkdown(markdown) {
514
484
  try {
515
485
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
516
- const ptr0 = passStringToWasm0(json, wasm.__wbindgen_export, wasm.__wbindgen_export2);
486
+ const ptr0 = passStringToWasm0(markdown, wasm.__wbindgen_export, wasm.__wbindgen_export2);
517
487
  const len0 = WASM_VECTOR_LEN;
518
- wasm.document_fromJson(retptr, ptr0, len0);
488
+ wasm.document_fromMarkdown(retptr, ptr0, len0);
519
489
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
520
490
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
521
491
  var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
@@ -528,16 +498,19 @@ export class Document {
528
498
  }
529
499
  }
530
500
  /**
531
- * Parse markdown into a typed Document. Throws on parse errors.
532
- * @param {string} markdown
501
+ * Reconstruct a `Document` from a versioned storage DTO string produced by
502
+ * [`toStored`](Document::to_stored). The result carries no parse-time warnings.
503
+ * Throws if `json` is not a valid storage DTO (malformed JSON, unknown
504
+ * `schema`, missing fields, or unparseable quill reference).
505
+ * @param {string} json
533
506
  * @returns {Document}
534
507
  */
535
- static fromMarkdown(markdown) {
508
+ static fromStored(json) {
536
509
  try {
537
510
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
538
- const ptr0 = passStringToWasm0(markdown, wasm.__wbindgen_export, wasm.__wbindgen_export2);
511
+ const ptr0 = passStringToWasm0(json, wasm.__wbindgen_export, wasm.__wbindgen_export2);
539
512
  const len0 = WASM_VECTOR_LEN;
540
- wasm.document_fromMarkdown(retptr, ptr0, len0);
513
+ wasm.document_fromStored(retptr, ptr0, len0);
541
514
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
542
515
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
543
516
  var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
@@ -572,31 +545,6 @@ export class Document {
572
545
  wasm.__wbindgen_add_to_stack_pointer(16);
573
546
  }
574
547
  }
575
- /**
576
- * The value stored under `$ext[ns]` at `addr` (a card address, absent `card`
577
- * = main), or `undefined`. Throws on a present `field` or an out-of-range
578
- * card.
579
- * @param {CardAddr} addr
580
- * @param {string} ns
581
- * @returns {unknown}
582
- */
583
- getExtNamespace(addr, ns) {
584
- try {
585
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
586
- const ptr0 = passStringToWasm0(ns, wasm.__wbindgen_export, wasm.__wbindgen_export2);
587
- const len0 = WASM_VECTOR_LEN;
588
- wasm.document_getExtNamespace(retptr, this.__wbg_ptr, addHeapObject(addr), ptr0, len0);
589
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
590
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
591
- var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
592
- if (r2) {
593
- throw takeObject(r1);
594
- }
595
- return takeObject(r0);
596
- } finally {
597
- wasm.__wbindgen_add_to_stack_pointer(16);
598
- }
599
- }
600
548
  /**
601
549
  * Read the **verbatim stored value** at `addr`: a field's raw payload value,
602
550
  * or the body content when `addr.field` is absent. A bare string is `Addr`
@@ -613,9 +561,8 @@ export class Document {
613
561
  * conformed, and this read reports what is there. For the `Content` either
614
562
  * way use `reader.getContent`.
615
563
  *
616
- * The body arm is typed `Content` and answers in the seam form, spelling
617
- * every `ContentContainer.instance`. A field arm echoes the stored bytes,
618
- * which omit a zero: verbatim is the contract, and is why it is `unknown`.
564
+ * The body arm is typed `Content`; a field arm echoes the stored bytes
565
+ * unread, which is the contract and why it is `unknown`.
619
566
  * @param {Addr | string} addr
620
567
  * @returns {unknown}
621
568
  */
@@ -645,7 +592,7 @@ export class Document {
645
592
  insertCard(card, at) {
646
593
  try {
647
594
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
648
- wasm.document_insertCard(retptr, this.__wbg_ptr, addHeapObject(card), isLikeNone(at) ? 0x100000001 : (at) >>> 0);
595
+ wasm.document_insertCard(retptr, this.__wbg_ptr, addHeapObject(card), isLikeNone(at) ? Number.MAX_SAFE_INTEGER : (at) >>> 0);
649
596
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
650
597
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
651
598
  if (r1) {
@@ -679,21 +626,18 @@ export class Document {
679
626
  }
680
627
  /**
681
628
  * Replace this document's contents **in place** from a versioned storage DTO
682
- * string: the mutating twin of [`fromJson`](Document::from_json). Parse-time
683
- * `warnings` are cleared. Throws on an invalid DTO, leaving the document
684
- * unchanged.
685
- *
686
- * The cross-WASM-memory `Document` bridge: mutate a document on a
687
- * backend-memory clone, then write the state back into the caller's
688
- * canonical document, without the caller re-binding its variable.
629
+ * string: the mutating twin of [`fromStored`](Document::from_stored).
630
+ * Parse-time `warnings` are cleared. Throws on an invalid DTO, leaving the
631
+ * document unchanged. A caller holding the document need not re-bind its
632
+ * variable.
689
633
  * @param {string} json
690
634
  */
691
- loadJson(json) {
635
+ loadStored(json) {
692
636
  try {
693
637
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
694
638
  const ptr0 = passStringToWasm0(json, wasm.__wbindgen_export, wasm.__wbindgen_export2);
695
639
  const len0 = WASM_VECTOR_LEN;
696
- wasm.document_loadJson(retptr, this.__wbg_ptr, ptr0, len0);
640
+ wasm.document_loadStored(retptr, this.__wbg_ptr, ptr0, len0);
697
641
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
698
642
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
699
643
  if (r1) {
@@ -722,39 +666,6 @@ export class Document {
722
666
  wasm.__wbindgen_add_to_stack_pointer(16);
723
667
  }
724
668
  }
725
- /**
726
- * Build a fresh `Card` from a kind and a flat field map: the ergonomic
727
- * constructor for `insertCard`, which also takes any `Card` object
728
- * directly. Each `fields` entry becomes a card field in insertion order;
729
- * `body` defaults to `""`.
730
- *
731
- * Checks only what a detached card can decide alone: field-name grammar and
732
- * value depth. Kind validity is positional, so `insertCard` is its gate and
733
- * any kind string is accepted here.
734
- * @param {string} kind
735
- * @param {Record<string, unknown>} [fields]
736
- * @param {string} [body]
737
- * @returns {Card}
738
- */
739
- static makeCard(kind, fields, body) {
740
- try {
741
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
742
- const ptr0 = passStringToWasm0(kind, wasm.__wbindgen_export, wasm.__wbindgen_export2);
743
- const len0 = WASM_VECTOR_LEN;
744
- var ptr1 = isLikeNone(body) ? 0 : passStringToWasm0(body, wasm.__wbindgen_export, wasm.__wbindgen_export2);
745
- var len1 = WASM_VECTOR_LEN;
746
- wasm.document_makeCard(retptr, ptr0, len0, isLikeNone(fields) ? 0 : addHeapObject(fields), ptr1, len1);
747
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
748
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
749
- var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
750
- if (r2) {
751
- throw takeObject(r1);
752
- }
753
- return takeObject(r0);
754
- } finally {
755
- wasm.__wbindgen_add_to_stack_pointer(16);
756
- }
757
- }
758
669
  /**
759
670
  * Move the card at `from` to position `to`. `from == to` is a no-op.
760
671
  * @param {number} from
@@ -793,7 +704,7 @@ export class Document {
793
704
  if (r2) {
794
705
  throw takeObject(r1);
795
706
  }
796
- this.__wbg_ptr = r0 >>> 0;
707
+ this.__wbg_ptr = r0;
797
708
  DocumentFinalization.register(this, this.__wbg_ptr, this);
798
709
  return this;
799
710
  } finally {
@@ -867,14 +778,17 @@ export class Document {
867
778
  }
868
779
  }
869
780
  /**
781
+ * The canonical `$quill` reference grammar as author-facing text: the same
782
+ * text the `parse::invalid_quill_reference` hint carries. Drive validation
783
+ * messages from this instead of re-stating the rule.
870
784
  * @returns {string}
871
785
  */
872
- get quillRef() {
786
+ static quillRefHint() {
873
787
  let deferred1_0;
874
788
  let deferred1_1;
875
789
  try {
876
790
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
877
- wasm.document_quillRef(retptr, this.__wbg_ptr);
791
+ wasm.document_quillRefHint(retptr);
878
792
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
879
793
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
880
794
  deferred1_0 = r0;
@@ -886,17 +800,14 @@ export class Document {
886
800
  }
887
801
  }
888
802
  /**
889
- * The canonical `$quill` reference grammar as author-facing text: the same
890
- * text the `parse::invalid_quill_reference` hint carries. Drive validation
891
- * messages from this instead of re-stating the rule.
892
803
  * @returns {string}
893
804
  */
894
- static quillRefHint() {
805
+ get quillRef() {
895
806
  let deferred1_0;
896
807
  let deferred1_1;
897
808
  try {
898
809
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
899
- wasm.document_quillRefHint(retptr);
810
+ wasm.document_quillRef(retptr, this.__wbg_ptr);
900
811
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
901
812
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
902
813
  deferred1_0 = r0;
@@ -928,8 +839,8 @@ export class Document {
928
839
  }
929
840
  /**
930
841
  * Remove the `$ext` map on the card `addr` targets entirely, returning the
931
- * previous map or `undefined`. Discards every namespace at once; prefer
932
- * `removeExtNamespace`. Throws on a present `field` or an out-of-range card.
842
+ * previous map or `undefined`. Discards every namespace at once. Throws on
843
+ * a present `field` or an out-of-range card.
933
844
  * @param {CardAddr} [addr]
934
845
  * @returns {Record<string, unknown> | undefined}
935
846
  */
@@ -948,32 +859,6 @@ export class Document {
948
859
  wasm.__wbindgen_add_to_stack_pointer(16);
949
860
  }
950
861
  }
951
- /**
952
- * Remove `$ext[ns]` on the card `addr` targets, returning its value or
953
- * `undefined`; drops `$ext` once empty. `addr` is a card address (absent =
954
- * main). Preserves sibling namespaces. Throws on a present `field` or an
955
- * out-of-range card.
956
- * @param {CardAddr} addr
957
- * @param {string} ns
958
- * @returns {any}
959
- */
960
- removeExtNamespace(addr, ns) {
961
- try {
962
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
963
- const ptr0 = passStringToWasm0(ns, wasm.__wbindgen_export, wasm.__wbindgen_export2);
964
- const len0 = WASM_VECTOR_LEN;
965
- wasm.document_removeExtNamespace(retptr, this.__wbg_ptr, addHeapObject(addr), ptr0, len0);
966
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
967
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
968
- var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
969
- if (r2) {
970
- throw takeObject(r1);
971
- }
972
- return takeObject(r0);
973
- } finally {
974
- wasm.__wbindgen_add_to_stack_pointer(16);
975
- }
976
- }
977
862
  /**
978
863
  * Remove a field at `addr`, returning the removed value or `undefined`. A
979
864
  * bare string is `Addr` shorthand for `{ field }`. A body address throws, as
@@ -1074,28 +959,6 @@ export class Document {
1074
959
  wasm.__wbindgen_add_to_stack_pointer(16);
1075
960
  }
1076
961
  }
1077
- /**
1078
- * Replace the kind of the card at `index`. Payload and body are untouched;
1079
- * schema-aware migration is the caller's responsibility.
1080
- * Throws if `index` is out of range or `newKind` is invalid.
1081
- * @param {number} index
1082
- * @param {string} new_kind
1083
- */
1084
- setCardKind(index, new_kind) {
1085
- try {
1086
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1087
- const ptr0 = passStringToWasm0(new_kind, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1088
- const len0 = WASM_VECTOR_LEN;
1089
- wasm.document_setCardKind(retptr, this.__wbg_ptr, index, ptr0, len0);
1090
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1091
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1092
- if (r1) {
1093
- throw takeObject(r0);
1094
- }
1095
- } finally {
1096
- wasm.__wbindgen_add_to_stack_pointer(16);
1097
- }
1098
- }
1099
962
  /**
1100
963
  * Replace the QUILL reference string. Throws if `ref_str` is invalid.
1101
964
  * @param {string} ref_str
@@ -1118,7 +981,7 @@ export class Document {
1118
981
  /**
1119
982
  * Read the storage version tag from a raw storage DTO string without a full
1120
983
  * parse, or `undefined`. Unknown future versions come back as-is, which
1121
- * distinguishes "build too old" from "payload corrupt" when `fromJson`
984
+ * distinguishes "build too old" from "payload corrupt" when `fromStored`
1122
985
  * throws. This is the storage version, not a field schema, though the JSON
1123
986
  * key is spelled `"schema"`: that is the DTO's serde tag.
1124
987
  * @param {string} json
@@ -1134,7 +997,7 @@ export class Document {
1134
997
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1135
998
  let v2;
1136
999
  if (r0 !== 0) {
1137
- v2 = getStringFromWasm0(r0, r1).slice();
1000
+ v2 = getStringFromWasm0(r0, r1);
1138
1001
  wasm.__wbindgen_export4(r0, r1 * 1, 1);
1139
1002
  }
1140
1003
  return v2;
@@ -1145,8 +1008,10 @@ export class Document {
1145
1008
  /**
1146
1009
  * Replace the opaque `$ext` map on the card `addr` targets (absent `card` =
1147
1010
  * main). `value` must be a plain object. `$ext` carries out-of-band consumer
1148
- * state and never reaches the rendered output. Throws on a present `field`
1149
- * or an out-of-range card.
1011
+ * state and never reaches the rendered output. The whole map is the write,
1012
+ * so a consumer holding one namespace merges the rest:
1013
+ * `{...doc.getExt(addr), [ns]: v}`. Throws on a present `field` or an
1014
+ * out-of-range card.
1150
1015
  * @param {CardAddr} addr
1151
1016
  * @param {any} value
1152
1017
  */
@@ -1163,29 +1028,6 @@ export class Document {
1163
1028
  wasm.__wbindgen_add_to_stack_pointer(16);
1164
1029
  }
1165
1030
  }
1166
- /**
1167
- * Merge `value` into `$ext[ns]` on the card `addr` targets, preserving
1168
- * sibling namespaces: the recommended `$ext` write. Throws on a present
1169
- * `field` or an out-of-range card.
1170
- * @param {CardAddr} addr
1171
- * @param {string} ns
1172
- * @param {any} value
1173
- */
1174
- storeExtNamespace(addr, ns, value) {
1175
- try {
1176
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1177
- const ptr0 = passStringToWasm0(ns, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1178
- const len0 = WASM_VECTOR_LEN;
1179
- wasm.document_storeExtNamespace(retptr, this.__wbg_ptr, addHeapObject(addr), ptr0, len0, addHeapObject(value));
1180
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1181
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1182
- if (r1) {
1183
- throw takeObject(r0);
1184
- }
1185
- } finally {
1186
- wasm.__wbindgen_add_to_stack_pointer(16);
1187
- }
1188
- }
1189
1031
  /**
1190
1032
  * Store a field verbatim at `addr`, deferring coercion to render; the typed
1191
1033
  * write is [`commitField`](Document::commit_field). A bare string is `Addr`
@@ -1274,18 +1116,16 @@ export class Document {
1274
1116
  }
1275
1117
  }
1276
1118
  /**
1277
- * Serialize this document to a versioned storage DTO string. Prefer it over
1278
- * `toMarkdown` for persistence: the wire format is frozen per `schema`
1279
- * version and the output is byte-deterministic within one, so equal
1280
- * documents hash equal. Parse-time `warnings` are excluded.
1119
+ * Emit canonical Quillmark Markdown. Round-trip safe: re-parsing the
1120
+ * result produces a `Document` equal to `self` by value and by type.
1281
1121
  * @returns {string}
1282
1122
  */
1283
- toJson() {
1123
+ toMarkdown() {
1284
1124
  let deferred1_0;
1285
1125
  let deferred1_1;
1286
1126
  try {
1287
1127
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1288
- wasm.document_toJson(retptr, this.__wbg_ptr);
1128
+ wasm.document_toMarkdown(retptr, this.__wbg_ptr);
1289
1129
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1290
1130
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1291
1131
  deferred1_0 = r0;
@@ -1297,16 +1137,18 @@ export class Document {
1297
1137
  }
1298
1138
  }
1299
1139
  /**
1300
- * Emit canonical Quillmark Markdown. Round-trip safe: re-parsing the
1301
- * result produces a `Document` equal to `self` by value and by type.
1140
+ * Serialize this document to a versioned storage DTO string. Prefer it over
1141
+ * `toMarkdown` for persistence: the wire format is frozen per `schema`
1142
+ * version and the output is byte-deterministic within one, so equal
1143
+ * documents hash equal. Parse-time `warnings` are excluded.
1302
1144
  * @returns {string}
1303
1145
  */
1304
- toMarkdown() {
1146
+ toStored() {
1305
1147
  let deferred1_0;
1306
1148
  let deferred1_1;
1307
1149
  try {
1308
1150
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1309
- wasm.document_toMarkdown(retptr, this.__wbg_ptr);
1151
+ wasm.document_toStored(retptr, this.__wbg_ptr);
1310
1152
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1311
1153
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1312
1154
  deferred1_0 = r0;
@@ -1317,24 +1159,11 @@ export class Document {
1317
1159
  wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
1318
1160
  }
1319
1161
  }
1320
- /**
1321
- * Like [`fromJson`](Document::from_json) but returns `undefined` instead of
1322
- * throwing when `json` is not a valid storage DTO, to discriminate format
1323
- * without exceptions as control flow.
1324
- * @param {string} json
1325
- * @returns {Document | undefined}
1326
- */
1327
- static tryFromJson(json) {
1328
- const ptr0 = passStringToWasm0(json, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1329
- const len0 = WASM_VECTOR_LEN;
1330
- const ret = wasm.document_tryFromJson(ptr0, len0);
1331
- return ret === 0 ? undefined : Document.__wrap(ret);
1332
- }
1333
1162
  /**
1334
1163
  * The non-fatal diagnostics of the load that produced this document: parse
1335
1164
  * warnings, plus `conform::*` warnings when it came through `quill.parse`.
1336
1165
  * Session state, not document value: `equals` and the storage DTO exclude
1337
- * it, and `fromJson` / `loadJson` clear it.
1166
+ * it, and `fromStored` / `loadStored` clear it.
1338
1167
  * @returns {Diagnostic[]}
1339
1168
  */
1340
1169
  get warnings() {
@@ -1356,18 +1185,17 @@ export class Document {
1356
1185
  if (Symbol.dispose) Document.prototype[Symbol.dispose] = Document.prototype.free;
1357
1186
 
1358
1187
  /**
1359
- * Live render session: every read serves the current compile. `apply(doc)`
1188
+ * Live render session: every read serves the current compile. `update(doc)`
1360
1189
  * recompiles a whole document in place, transactionally — on throw the reads
1361
1190
  * keep serving the last-good compile. Geometry is per-compile, so re-read it
1362
- * after each committed `apply`.
1191
+ * after each committed `update`.
1363
1192
  *
1364
1193
  * A zero-page document yields a valid session (`pageCount === 0`) whose
1365
- * `paint(ctx, 0)` and `pageSize(0)` throw; branch on `pageCount === 0` rather
1366
- * than catching.
1194
+ * `paint(ctx, 0)` and `pageSize(0)` throw as any out-of-range page does; branch
1195
+ * on `pageCount === 0` rather than catching.
1367
1196
  */
1368
1197
  export class LiveSession {
1369
1198
  static __wrap(ptr) {
1370
- ptr = ptr >>> 0;
1371
1199
  const obj = Object.create(LiveSession.prototype);
1372
1200
  obj.__wbg_ptr = ptr;
1373
1201
  LiveSessionFinalization.register(obj, obj.__wbg_ptr, obj);
@@ -1425,12 +1253,12 @@ export class LiveSession {
1425
1253
  fieldAt(page, x, y, tol_pt) {
1426
1254
  try {
1427
1255
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1428
- wasm.livesession_fieldAt(retptr, this.__wbg_ptr, page, x, y, isLikeNone(tol_pt) ? 0x100000001 : Math.fround(tol_pt));
1256
+ wasm.livesession_fieldAt(retptr, this.__wbg_ptr, page, x, y, isLikeNone(tol_pt) ? Number.MAX_SAFE_INTEGER : Math.fround(tol_pt));
1429
1257
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1430
1258
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1431
1259
  let v1;
1432
1260
  if (r0 !== 0) {
1433
- v1 = getStringFromWasm0(r0, r1).slice();
1261
+ v1 = getStringFromWasm0(r0, r1);
1434
1262
  wasm.__wbindgen_export4(r0, r1 * 1, 1);
1435
1263
  }
1436
1264
  return v1;
@@ -1474,10 +1302,21 @@ export class LiveSession {
1474
1302
  * @returns {FieldRegion | undefined}
1475
1303
  */
1476
1304
  locate(field, pos) {
1477
- const ptr0 = passStringToWasm0(field, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1478
- const len0 = WASM_VECTOR_LEN;
1479
- const ret = wasm.livesession_locate(this.__wbg_ptr, ptr0, len0, pos);
1480
- return takeObject(ret);
1305
+ try {
1306
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1307
+ const ptr0 = passStringToWasm0(field, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1308
+ const len0 = WASM_VECTOR_LEN;
1309
+ wasm.livesession_locate(retptr, this.__wbg_ptr, ptr0, len0, pos);
1310
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1311
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1312
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1313
+ if (r2) {
1314
+ throw takeObject(r1);
1315
+ }
1316
+ return takeObject(r0);
1317
+ } finally {
1318
+ wasm.__wbindgen_add_to_stack_pointer(16);
1319
+ }
1481
1320
  }
1482
1321
  /**
1483
1322
  * @returns {number}
@@ -1487,8 +1326,8 @@ export class LiveSession {
1487
1326
  return ret >>> 0;
1488
1327
  }
1489
1328
  /**
1490
- * Page dimensions in points (1 pt = 1/72 inch).
1491
- * Throws if the backend has no canvas painter or `page` is out of range.
1329
+ * Page dimensions in points (1 pt = 1/72 inch). Throws if `page` is out of
1330
+ * range, which a zero-page compile makes true of every index.
1492
1331
  * @param {number} page
1493
1332
  * @returns {PageSize}
1494
1333
  */
@@ -1519,8 +1358,9 @@ export class LiveSession {
1519
1358
  * its own `<canvas>`: no compositing, sub-rect, or transform reaches through
1520
1359
  * this call.
1521
1360
  *
1522
- * Throws if the backend has no canvas painter, `page` is out of range, `ctx`
1523
- * is the wrong type, or either scale is non-finite or `<= 0`.
1361
+ * Throws if `page` is out of range, `ctx` is the wrong type, either scale is
1362
+ * non-finite or `<= 0`, or the page cannot be rasterized at the resulting
1363
+ * scale (`backend::invalid_raster_scale`).
1524
1364
  * @param {CanvasRenderingContext2D | OffscreenCanvasRenderingContext2D} ctx
1525
1365
  * @param {number} page
1526
1366
  * @param {PaintOptions | undefined} opts
@@ -1558,8 +1398,19 @@ export class LiveSession {
1558
1398
  * @returns {ContentHit | undefined}
1559
1399
  */
1560
1400
  positionAt(page, x, y, tol_pt) {
1561
- const ret = wasm.livesession_positionAt(this.__wbg_ptr, page, x, y, isLikeNone(tol_pt) ? 0x100000001 : Math.fround(tol_pt));
1562
- return takeObject(ret);
1401
+ try {
1402
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1403
+ wasm.livesession_positionAt(retptr, this.__wbg_ptr, page, x, y, isLikeNone(tol_pt) ? Number.MAX_SAFE_INTEGER : Math.fround(tol_pt));
1404
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1405
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1406
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1407
+ if (r2) {
1408
+ throw takeObject(r1);
1409
+ }
1410
+ return takeObject(r0);
1411
+ } finally {
1412
+ wasm.__wbindgen_add_to_stack_pointer(16);
1413
+ }
1563
1414
  }
1564
1415
  /**
1565
1416
  * Schema-field geometry for this compiled session: each content field's
@@ -1604,14 +1455,6 @@ export class LiveSession {
1604
1455
  wasm.__wbindgen_add_to_stack_pointer(16);
1605
1456
  }
1606
1457
  }
1607
- /**
1608
- * `true` iff `paint` and `pageSize` will succeed for this session.
1609
- * @returns {boolean}
1610
- */
1611
- get supportsCanvas() {
1612
- const ret = wasm.livesession_supportsCanvas(this.__wbg_ptr);
1613
- return ret !== 0;
1614
- }
1615
1458
  /**
1616
1459
  * Recompile the session against `doc`: the edit verb of a live preview. The
1617
1460
  * document compiles through the same pipeline as `open`, then swaps in
@@ -1642,7 +1485,7 @@ export class LiveSession {
1642
1485
  }
1643
1486
  /**
1644
1487
  * Non-fatal diagnostics of the session's **current compile**, refreshed by
1645
- * each committed `apply`; a failed apply keeps the last-good compile's.
1488
+ * each committed `update`; a failed `update` keeps the last-good compile's.
1646
1489
  * Also appended to `RenderResult.warnings` on each `render()`.
1647
1490
  * @returns {Diagnostic[]}
1648
1491
  */
@@ -1666,7 +1509,6 @@ if (Symbol.dispose) LiveSession.prototype[Symbol.dispose] = LiveSession.prototyp
1666
1509
 
1667
1510
  export class Quill {
1668
1511
  static __wrap(ptr) {
1669
- ptr = ptr >>> 0;
1670
1512
  const obj = Object.create(Quill.prototype);
1671
1513
  obj.__wbg_ptr = ptr;
1672
1514
  QuillFinalization.register(obj, obj.__wbg_ptr, obj);
@@ -1682,6 +1524,32 @@ export class Quill {
1682
1524
  const ptr = this.__destroy_into_raw();
1683
1525
  wasm.__wbg_quill_free(ptr, 0);
1684
1526
  }
1527
+ /**
1528
+ * The resolved-value view of `doc`: the ABI under `reader.resolve()`. For
1529
+ * every declared field, the value the render projection would use and the
1530
+ * `FieldSource` rung it came from (`"authored" | "default" | "blank"`). The
1531
+ * card body is a `body` sibling on its card, never a row in `fields`, and
1532
+ * `null` when the kind enables no body. Value and provenance only;
1533
+ * completeness stays `validate`'s.
1534
+ * @param {Document} doc
1535
+ * @returns {Resolved}
1536
+ */
1537
+ _resolve(doc) {
1538
+ try {
1539
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1540
+ _assertClass(doc, Document);
1541
+ wasm.quill__resolve(retptr, this.__wbg_ptr, doc.__wbg_ptr);
1542
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1543
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1544
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1545
+ if (r2) {
1546
+ throw takeObject(r1);
1547
+ }
1548
+ return takeObject(r0);
1549
+ } finally {
1550
+ wasm.__wbindgen_add_to_stack_pointer(16);
1551
+ }
1552
+ }
1685
1553
  /**
1686
1554
  * The *declared* backend identifier (e.g. `"typst"`): intent, not a
1687
1555
  * resolved capability. Capability is read from the engine.
@@ -1726,7 +1594,7 @@ export class Quill {
1726
1594
  * Land `doc`'s declared content fields at their canonical rest **in
1727
1595
  * place**, returning the `conform::*` diagnostics for values that would not
1728
1596
  * commit. The read-repair verb for a document that arrived through the
1729
- * transport door (`fromMarkdown`, `fromJson`, a stored row).
1597
+ * transport door (`fromMarkdown`, `fromStored`, a stored row).
1730
1598
  *
1731
1599
  * Idempotent: an equal value is not rewritten, so YAML comments and stored
1732
1600
  * bytes survive. A `!must_fill` marker anywhere in a field's value skips
@@ -1775,9 +1643,9 @@ export class Quill {
1775
1643
  }
1776
1644
  }
1777
1645
  /**
1778
- * Identity snapshot of the `quill:` section of `Quill.yaml` plus any extra
1779
- * `quill:` keys. Pure config: output formats are a resolved-backend
1780
- * capability read from `Quillmark.supportedFormats`, not part of this.
1646
+ * Identity snapshot of the `quill:` section of `Quill.yaml`. Pure config:
1647
+ * output formats are a resolved-backend capability read from
1648
+ * `Quillmark.supportedFormats`, not part of this.
1781
1649
  * @returns {QuillMetadata}
1782
1650
  */
1783
1651
  get metadata() {
@@ -1826,31 +1694,6 @@ export class Quill {
1826
1694
  wasm.__wbindgen_add_to_stack_pointer(16);
1827
1695
  }
1828
1696
  }
1829
- /**
1830
- * The resolved-value view of `doc`: for every declared field, the value the
1831
- * render projection would use and the `FieldSource` rung it came from
1832
- * (`"authored" | "default" | "blank"`). The card body is a `body` sibling on
1833
- * its card, never a row in `fields`, and `null` when the kind enables no
1834
- * body. Value and provenance only; completeness stays `validate`'s.
1835
- * @param {Document} doc
1836
- * @returns {Resolved}
1837
- */
1838
- resolve(doc) {
1839
- try {
1840
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1841
- _assertClass(doc, Document);
1842
- wasm.quill_resolve(retptr, this.__wbg_ptr, doc.__wbg_ptr);
1843
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1844
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1845
- var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1846
- if (r2) {
1847
- throw takeObject(r1);
1848
- }
1849
- return takeObject(r0);
1850
- } finally {
1851
- wasm.__wbindgen_add_to_stack_pointer(16);
1852
- }
1853
- }
1854
1697
  /**
1855
1698
  * Document schema for the quill: the user-fillable fields plus their `ui`
1856
1699
  * hints. Key order in `fields`/`properties` is declaration order, the
@@ -1939,8 +1782,8 @@ export class Quill {
1939
1782
  *
1940
1783
  * This is how a quill crosses a WASM linear-memory boundary as data: a
1941
1784
  * `Quill` built in one build cannot be passed to an engine in another, so
1942
- * `@quillmark/wasm/runtime` re-feeds this tree to the backend build's
1943
- * `Quill.fromTree` on demand.
1785
+ * the `@quillmark/wasm` runtime layer re-feeds this tree to the backend
1786
+ * build's `Quill.fromTree` on demand.
1944
1787
  * @returns {Map<string, Uint8Array>}
1945
1788
  */
1946
1789
  toTree() {
@@ -1971,6 +1814,27 @@ export class Quill {
1971
1814
  wasm.__wbindgen_add_to_stack_pointer(16);
1972
1815
  }
1973
1816
  }
1817
+ /**
1818
+ * The advisory diagnostics of the load that produced this quill: what is
1819
+ * wrong with it short of refusing it. A quill that loads clean answers
1820
+ * `[]`.
1821
+ * @returns {Diagnostic[]}
1822
+ */
1823
+ get warnings() {
1824
+ try {
1825
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1826
+ wasm.quill_warnings(retptr, this.__wbg_ptr);
1827
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1828
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1829
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1830
+ if (r2) {
1831
+ throw takeObject(r1);
1832
+ }
1833
+ return takeObject(r0);
1834
+ } finally {
1835
+ wasm.__wbindgen_add_to_stack_pointer(16);
1836
+ }
1837
+ }
1974
1838
  }
1975
1839
  if (Symbol.dispose) Quill.prototype[Symbol.dispose] = Quill.prototype.free;
1976
1840
 
@@ -1991,7 +1855,7 @@ export class Quillmark {
1991
1855
  }
1992
1856
  constructor() {
1993
1857
  const ret = wasm.quillmark_new();
1994
- this.__wbg_ptr = ret >>> 0;
1858
+ this.__wbg_ptr = ret;
1995
1859
  QuillmarkFinalization.register(this, this.__wbg_ptr, this);
1996
1860
  return this;
1997
1861
  }
@@ -2067,18 +1931,6 @@ export class Quillmark {
2067
1931
  wasm.__wbindgen_add_to_stack_pointer(16);
2068
1932
  }
2069
1933
  }
2070
- /**
2071
- * Whether `quill`'s backend can paint sessions to a canvas; `false` when the
2072
- * backend is unsupported. A cheap probe before mounting a preview UI. The
2073
- * authoritative answer is the session's `supportsCanvas` getter.
2074
- * @param {Quill} quill
2075
- * @returns {boolean}
2076
- */
2077
- supportsCanvas(quill) {
2078
- _assertClass(quill, Quill);
2079
- const ret = wasm.quillmark_supportsCanvas(this.__wbg_ptr, quill.__wbg_ptr);
2080
- return ret !== 0;
2081
- }
2082
1934
  }
2083
1935
  if (Symbol.dispose) Quillmark.prototype[Symbol.dispose] = Quillmark.prototype.free;
2084
1936
 
@@ -2113,6 +1965,44 @@ export function exportMarkdown(rt) {
2113
1965
  }
2114
1966
  }
2115
1967
 
1968
+ /**
1969
+ * Render a diagnostic as the CLI and Python's `str(diagnostic)` render it:
1970
+ * the severity tag and the message, the code parenthesised after them, then
1971
+ * location, path and hint each on an indented line of its own. The engine
1972
+ * owns the one printer, so a consumer surfacing diagnostics reads it here
1973
+ * rather than keeping a copy of the layout that drifts from the CLI's.
1974
+ *
1975
+ * Takes the `Diagnostic` shape every read hands back. Throws on a value that
1976
+ * is not one — a missing `severity` or `message`, or a `severity` outside the
1977
+ * two-value ladder.
1978
+ * @param {Diagnostic} diagnostic
1979
+ * @returns {string}
1980
+ */
1981
+ export function formatDiagnostic(diagnostic) {
1982
+ let deferred2_0;
1983
+ let deferred2_1;
1984
+ try {
1985
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1986
+ wasm.formatDiagnostic(retptr, addHeapObject(diagnostic));
1987
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1988
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1989
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1990
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
1991
+ var ptr1 = r0;
1992
+ var len1 = r1;
1993
+ if (r3) {
1994
+ ptr1 = 0; len1 = 0;
1995
+ throw takeObject(r2);
1996
+ }
1997
+ deferred2_0 = ptr1;
1998
+ deferred2_1 = len1;
1999
+ return getStringFromWasm0(ptr1, len1);
2000
+ } finally {
2001
+ wasm.__wbindgen_add_to_stack_pointer(16);
2002
+ wasm.__wbindgen_export4(deferred2_0, deferred2_1, 1);
2003
+ }
2004
+ }
2005
+
2116
2006
  /**
2117
2007
  * Serialize structured [`DocPathSeg`] segments back to the canonical path
2118
2008
  * string: the inverse of `parseDocPath`. Throws on a segment array the
@@ -2297,11 +2187,11 @@ export function start() {
2297
2187
  function __wbg_get_imports() {
2298
2188
  const import0 = {
2299
2189
  __proto__: null,
2300
- __wbg_Error_960c155d3d49e4c2: function(arg0, arg1) {
2190
+ __wbg_Error_67e7344beaa85059: function(arg0, arg1) {
2301
2191
  const ret = Error(getStringFromWasm0(arg0, arg1));
2302
2192
  return addHeapObject(ret);
2303
2193
  },
2304
- __wbg_Number_32bf70a599af1d4b: function(arg0) {
2194
+ __wbg_Number_c54e7112a3fa7e3e: function(arg0) {
2305
2195
  const ret = Number(getObject(arg0));
2306
2196
  return ret;
2307
2197
  },
@@ -2312,68 +2202,68 @@ function __wbg_get_imports() {
2312
2202
  getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
2313
2203
  getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
2314
2204
  },
2315
- __wbg___wbindgen_bigint_get_as_i64_3d3aba5d616c6a51: function(arg0, arg1) {
2205
+ __wbg___wbindgen_bigint_get_as_i64_b482365c149396c8: function(arg0, arg1) {
2316
2206
  const v = getObject(arg1);
2317
2207
  const ret = typeof(v) === 'bigint' ? v : undefined;
2318
2208
  getDataViewMemory0().setBigInt64(arg0 + 8 * 1, isLikeNone(ret) ? BigInt(0) : ret, true);
2319
2209
  getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
2320
2210
  },
2321
- __wbg___wbindgen_boolean_get_6ea149f0a8dcc5ff: function(arg0) {
2211
+ __wbg___wbindgen_boolean_get_7a12af2b3f899c5a: function(arg0) {
2322
2212
  const v = getObject(arg0);
2323
2213
  const ret = typeof(v) === 'boolean' ? v : undefined;
2324
2214
  return isLikeNone(ret) ? 0xFFFFFF : ret ? 1 : 0;
2325
2215
  },
2326
- __wbg___wbindgen_debug_string_ab4b34d23d6778bd: function(arg0, arg1) {
2216
+ __wbg___wbindgen_debug_string_0e68cf47c9cbd9b0: function(arg0, arg1) {
2327
2217
  const ret = debugString(getObject(arg1));
2328
2218
  const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
2329
2219
  const len1 = WASM_VECTOR_LEN;
2330
2220
  getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
2331
2221
  getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
2332
2222
  },
2333
- __wbg___wbindgen_in_a5d8b22e52b24dd1: function(arg0, arg1) {
2223
+ __wbg___wbindgen_in_50072d4d6e45c193: function(arg0, arg1) {
2334
2224
  const ret = getObject(arg0) in getObject(arg1);
2335
2225
  return ret;
2336
2226
  },
2337
- __wbg___wbindgen_is_bigint_ec25c7f91b4d9e93: function(arg0) {
2227
+ __wbg___wbindgen_is_bigint_60fc0336cb14f5d7: function(arg0) {
2338
2228
  const ret = typeof(getObject(arg0)) === 'bigint';
2339
2229
  return ret;
2340
2230
  },
2341
- __wbg___wbindgen_is_function_3baa9db1a987f47d: function(arg0) {
2231
+ __wbg___wbindgen_is_function_fcda5e3902d732fe: function(arg0) {
2342
2232
  const ret = typeof(getObject(arg0)) === 'function';
2343
2233
  return ret;
2344
2234
  },
2345
- __wbg___wbindgen_is_null_52ff4ec04186736f: function(arg0) {
2235
+ __wbg___wbindgen_is_null_5160b3e381865372: function(arg0) {
2346
2236
  const ret = getObject(arg0) === null;
2347
2237
  return ret;
2348
2238
  },
2349
- __wbg___wbindgen_is_object_63322ec0cd6ea4ef: function(arg0) {
2239
+ __wbg___wbindgen_is_object_edb6b15aa3afe12e: function(arg0) {
2350
2240
  const val = getObject(arg0);
2351
2241
  const ret = typeof(val) === 'object' && val !== null;
2352
2242
  return ret;
2353
2243
  },
2354
- __wbg___wbindgen_is_string_6df3bf7ef1164ed3: function(arg0) {
2244
+ __wbg___wbindgen_is_string_c4f7cb494a2a21f1: function(arg0) {
2355
2245
  const ret = typeof(getObject(arg0)) === 'string';
2356
2246
  return ret;
2357
2247
  },
2358
- __wbg___wbindgen_is_undefined_29a43b4d42920abd: function(arg0) {
2248
+ __wbg___wbindgen_is_undefined_8c687d0b90d5b524: function(arg0) {
2359
2249
  const ret = getObject(arg0) === undefined;
2360
2250
  return ret;
2361
2251
  },
2362
- __wbg___wbindgen_jsval_eq_d3465d8a07697228: function(arg0, arg1) {
2252
+ __wbg___wbindgen_jsval_eq_9fdcd3c0a860dd3b: function(arg0, arg1) {
2363
2253
  const ret = getObject(arg0) === getObject(arg1);
2364
2254
  return ret;
2365
2255
  },
2366
- __wbg___wbindgen_jsval_loose_eq_cac3565e89b4134c: function(arg0, arg1) {
2256
+ __wbg___wbindgen_jsval_loose_eq_3c30021c243b64cd: function(arg0, arg1) {
2367
2257
  const ret = getObject(arg0) == getObject(arg1);
2368
2258
  return ret;
2369
2259
  },
2370
- __wbg___wbindgen_number_get_c7f42aed0525c451: function(arg0, arg1) {
2260
+ __wbg___wbindgen_number_get_1dc732b810cb937c: function(arg0, arg1) {
2371
2261
  const obj = getObject(arg1);
2372
2262
  const ret = typeof(obj) === 'number' ? obj : undefined;
2373
2263
  getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
2374
2264
  getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
2375
2265
  },
2376
- __wbg___wbindgen_string_get_7ed5322991caaec5: function(arg0, arg1) {
2266
+ __wbg___wbindgen_string_get_92ab86bb19cbc12f: function(arg0, arg1) {
2377
2267
  const obj = getObject(arg1);
2378
2268
  const ret = typeof(obj) === 'string' ? obj : undefined;
2379
2269
  var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
@@ -2381,34 +2271,34 @@ function __wbg_get_imports() {
2381
2271
  getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
2382
2272
  getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
2383
2273
  },
2384
- __wbg___wbindgen_throw_6b64449b9b9ed33c: function(arg0, arg1) {
2274
+ __wbg___wbindgen_throw_5d9e815e6fdf150f: function(arg0, arg1) {
2385
2275
  throw new Error(getStringFromWasm0(arg0, arg1));
2386
2276
  },
2387
- __wbg_call_14b169f759b26747: function() { return handleError(function (arg0, arg1) {
2277
+ __wbg_call_269c5566fbede3eb: function() { return handleError(function (arg0, arg1) {
2388
2278
  const ret = getObject(arg0).call(getObject(arg1));
2389
2279
  return addHeapObject(ret);
2390
2280
  }, arguments); },
2391
- __wbg_canvas_2c0c6d263d4c52ad: function(arg0) {
2281
+ __wbg_canvas_128715f4edb228ef: function(arg0) {
2392
2282
  const ret = getObject(arg0).canvas;
2393
- return isLikeNone(ret) ? 0 : addHeapObject(ret);
2283
+ return addHeapObject(ret);
2394
2284
  },
2395
- __wbg_canvas_374da9f3c5b3dd0e: function(arg0) {
2285
+ __wbg_canvas_9c3188d85ded70f9: function(arg0) {
2396
2286
  const ret = getObject(arg0).canvas;
2397
- return addHeapObject(ret);
2287
+ return isLikeNone(ret) ? 0 : addHeapObject(ret);
2398
2288
  },
2399
- __wbg_done_9158f7cc8751ba32: function(arg0) {
2289
+ __wbg_done_cffed884d87aa22e: function(arg0) {
2400
2290
  const ret = getObject(arg0).done;
2401
2291
  return ret;
2402
2292
  },
2403
- __wbg_entries_2bf997cf82353e47: function(arg0) {
2293
+ __wbg_entries_20b9608d57d8ddd6: function(arg0) {
2404
2294
  const ret = getObject(arg0).entries();
2405
2295
  return addHeapObject(ret);
2406
2296
  },
2407
- __wbg_entries_e0b73aa8571ddb56: function(arg0) {
2297
+ __wbg_entries_972a87586902cf87: function(arg0) {
2408
2298
  const ret = Object.entries(getObject(arg0));
2409
2299
  return addHeapObject(ret);
2410
2300
  },
2411
- __wbg_error_a6fa202b58aa1cd3: function(arg0, arg1) {
2301
+ __wbg_error_757e9472f8410341: function(arg0, arg1) {
2412
2302
  let deferred0_0;
2413
2303
  let deferred0_1;
2414
2304
  try {
@@ -2419,19 +2309,35 @@ function __wbg_get_imports() {
2419
2309
  wasm.__wbindgen_export4(deferred0_0, deferred0_1, 1);
2420
2310
  }
2421
2311
  },
2422
- __wbg_from_0dbf29f09e7fb200: function(arg0) {
2312
+ __wbg_from_a39669ce566077da: function(arg0) {
2423
2313
  const ret = Array.from(getObject(arg0));
2424
2314
  return addHeapObject(ret);
2425
2315
  },
2426
- __wbg_get_1affdbdd5573b16a: function() { return handleError(function (arg0, arg1) {
2316
+ __wbg_getTime_65922ba0b59d55a7: function(arg0) {
2317
+ const ret = getObject(arg0).getTime();
2318
+ return ret;
2319
+ },
2320
+ __wbg_getUTCDate_b061d7dd93ea65ec: function(arg0) {
2321
+ const ret = getObject(arg0).getUTCDate();
2322
+ return ret;
2323
+ },
2324
+ __wbg_getUTCFullYear_4f3d4172a60a56ec: function(arg0) {
2325
+ const ret = getObject(arg0).getUTCFullYear();
2326
+ return ret;
2327
+ },
2328
+ __wbg_getUTCMonth_0c3985a29f63aeb1: function(arg0) {
2329
+ const ret = getObject(arg0).getUTCMonth();
2330
+ return ret;
2331
+ },
2332
+ __wbg_get_6cf5a4d4d8ad3c5a: function() { return handleError(function (arg0, arg1) {
2427
2333
  const ret = Reflect.get(getObject(arg0), getObject(arg1));
2428
2334
  return addHeapObject(ret);
2429
2335
  }, arguments); },
2430
- __wbg_get_8360291721e2339f: function(arg0, arg1) {
2336
+ __wbg_get_b1f0ab13c737f856: function(arg0, arg1) {
2431
2337
  const ret = getObject(arg0)[arg1 >>> 0];
2432
2338
  return addHeapObject(ret);
2433
2339
  },
2434
- __wbg_get_unchecked_17f53dad852b9588: function(arg0, arg1) {
2340
+ __wbg_get_unchecked_363572bdd397d473: function(arg0, arg1) {
2435
2341
  const ret = getObject(arg0)[arg1 >>> 0];
2436
2342
  return addHeapObject(ret);
2437
2343
  },
@@ -2439,7 +2345,7 @@ function __wbg_get_imports() {
2439
2345
  const ret = getObject(arg0)[getObject(arg1)];
2440
2346
  return addHeapObject(ret);
2441
2347
  },
2442
- __wbg_instanceof_ArrayBuffer_7c8433c6ed14ffe3: function(arg0) {
2348
+ __wbg_instanceof_ArrayBuffer_d4ff01f8247925ae: function(arg0) {
2443
2349
  let result;
2444
2350
  try {
2445
2351
  result = getObject(arg0) instanceof ArrayBuffer;
@@ -2449,7 +2355,7 @@ function __wbg_get_imports() {
2449
2355
  const ret = result;
2450
2356
  return ret;
2451
2357
  },
2452
- __wbg_instanceof_CanvasRenderingContext2d_24a3fe06e62b98d7: function(arg0) {
2358
+ __wbg_instanceof_CanvasRenderingContext2d_bde5245b14027f3f: function(arg0) {
2453
2359
  let result;
2454
2360
  try {
2455
2361
  result = getObject(arg0) instanceof CanvasRenderingContext2D;
@@ -2459,7 +2365,7 @@ function __wbg_get_imports() {
2459
2365
  const ret = result;
2460
2366
  return ret;
2461
2367
  },
2462
- __wbg_instanceof_Map_1b76fd4635be43eb: function(arg0) {
2368
+ __wbg_instanceof_Map_1ff6a2b54c899f0d: function(arg0) {
2463
2369
  let result;
2464
2370
  try {
2465
2371
  result = getObject(arg0) instanceof Map;
@@ -2469,7 +2375,7 @@ function __wbg_get_imports() {
2469
2375
  const ret = result;
2470
2376
  return ret;
2471
2377
  },
2472
- __wbg_instanceof_Object_7c99480a1cdfb911: function(arg0) {
2378
+ __wbg_instanceof_Object_87732cb922ac2e2c: function(arg0) {
2473
2379
  let result;
2474
2380
  try {
2475
2381
  result = getObject(arg0) instanceof Object;
@@ -2479,7 +2385,7 @@ function __wbg_get_imports() {
2479
2385
  const ret = result;
2480
2386
  return ret;
2481
2387
  },
2482
- __wbg_instanceof_OffscreenCanvasRenderingContext2d_285a274020b4f230: function(arg0) {
2388
+ __wbg_instanceof_OffscreenCanvasRenderingContext2d_4b64493c5055d621: function(arg0) {
2483
2389
  let result;
2484
2390
  try {
2485
2391
  result = getObject(arg0) instanceof OffscreenCanvasRenderingContext2D;
@@ -2489,7 +2395,7 @@ function __wbg_get_imports() {
2489
2395
  const ret = result;
2490
2396
  return ret;
2491
2397
  },
2492
- __wbg_instanceof_Uint8Array_152ba1f289edcf3f: function(arg0) {
2398
+ __wbg_instanceof_Uint8Array_598adc0fef426aa8: function(arg0) {
2493
2399
  let result;
2494
2400
  try {
2495
2401
  result = getObject(arg0) instanceof Uint8Array;
@@ -2499,31 +2405,39 @@ function __wbg_get_imports() {
2499
2405
  const ret = result;
2500
2406
  return ret;
2501
2407
  },
2502
- __wbg_isArray_c3109d14ffc06469: function(arg0) {
2408
+ __wbg_isArray_5674713bb7b79043: function(arg0) {
2503
2409
  const ret = Array.isArray(getObject(arg0));
2504
2410
  return ret;
2505
2411
  },
2506
- __wbg_isSafeInteger_4fc213d1989d6d2a: function(arg0) {
2412
+ __wbg_isSafeInteger_8f51c743827d1ec5: function(arg0) {
2507
2413
  const ret = Number.isSafeInteger(getObject(arg0));
2508
2414
  return ret;
2509
2415
  },
2510
- __wbg_iterator_013bc09ec998c2a7: function() {
2416
+ __wbg_iterator_22ddeb808cf55a6f: function() {
2511
2417
  const ret = Symbol.iterator;
2512
2418
  return addHeapObject(ret);
2513
2419
  },
2514
- __wbg_keys_2fd1bfdda7e278ca: function(arg0) {
2420
+ __wbg_keys_6efc298980178da1: function(arg0) {
2515
2421
  const ret = Object.keys(getObject(arg0));
2516
2422
  return addHeapObject(ret);
2517
2423
  },
2518
- __wbg_length_3d4ecd04bd8d22f1: function(arg0) {
2424
+ __wbg_length_31bdaf014f5fbde2: function(arg0) {
2519
2425
  const ret = getObject(arg0).length;
2520
2426
  return ret;
2521
2427
  },
2522
- __wbg_length_9f1775224cf1d815: function(arg0) {
2428
+ __wbg_length_4e1adc0d42e23620: function(arg0) {
2523
2429
  const ret = getObject(arg0).length;
2524
2430
  return ret;
2525
2431
  },
2526
- __wbg_new_0c7403db6e782f19: function(arg0) {
2432
+ __wbg_new_0_35540e542ba689d2: function() {
2433
+ const ret = new Date();
2434
+ return addHeapObject(ret);
2435
+ },
2436
+ __wbg_new_180f1022bb6ee517: function(arg0) {
2437
+ const ret = new Date(getObject(arg0));
2438
+ return addHeapObject(ret);
2439
+ },
2440
+ __wbg_new_1da3429bc3c4541c: function(arg0) {
2527
2441
  const ret = new Uint8Array(getObject(arg0));
2528
2442
  return addHeapObject(ret);
2529
2443
  },
@@ -2531,75 +2445,71 @@ function __wbg_get_imports() {
2531
2445
  const ret = new Error();
2532
2446
  return addHeapObject(ret);
2533
2447
  },
2534
- __wbg_new_34d45cc8e36aaead: function() {
2448
+ __wbg_new_8d36e20aa758e411: function() {
2535
2449
  const ret = new Map();
2536
2450
  return addHeapObject(ret);
2537
2451
  },
2538
- __wbg_new_5e360d2ff7b9e1c3: function(arg0, arg1) {
2452
+ __wbg_new_a32a1ab6c6655abe: function(arg0, arg1) {
2539
2453
  const ret = new Error(getStringFromWasm0(arg0, arg1));
2540
2454
  return addHeapObject(ret);
2541
2455
  },
2542
- __wbg_new_682678e2f47e32bc: function() {
2543
- const ret = new Array();
2456
+ __wbg_new_bebc3f4757acf305: function() {
2457
+ const ret = new Object();
2544
2458
  return addHeapObject(ret);
2545
2459
  },
2546
- __wbg_new_aa8d0fa9762c29bd: function() {
2547
- const ret = new Object();
2460
+ __wbg_new_ffa92086ea89f79c: function() {
2461
+ const ret = new Array();
2548
2462
  return addHeapObject(ret);
2549
2463
  },
2550
- __wbg_new_from_slice_b5ea43e23f6008c0: function(arg0, arg1) {
2464
+ __wbg_new_from_slice_4ee02165f9de919e: function(arg0, arg1) {
2551
2465
  const ret = new Uint8Array(getArrayU8FromWasm0(arg0, arg1));
2552
2466
  return addHeapObject(ret);
2553
2467
  },
2554
- __wbg_new_with_u8_clamped_array_and_sh_fe957411824b5158: function() { return handleError(function (arg0, arg1, arg2, arg3) {
2468
+ __wbg_new_with_u8_clamped_array_and_sh_15a008af56aca047: function() { return handleError(function (arg0, arg1, arg2, arg3) {
2555
2469
  const ret = new ImageData(getClampedArrayU8FromWasm0(arg0, arg1), arg2 >>> 0, arg3 >>> 0);
2556
2470
  return addHeapObject(ret);
2557
2471
  }, arguments); },
2558
- __wbg_next_0340c4ae324393c3: function() { return handleError(function (arg0) {
2559
- const ret = getObject(arg0).next();
2560
- return addHeapObject(ret);
2561
- }, arguments); },
2562
- __wbg_next_7646edaa39458ef7: function(arg0) {
2472
+ __wbg_next_95053e306b1c3aed: function(arg0) {
2563
2473
  const ret = getObject(arg0).next;
2564
2474
  return addHeapObject(ret);
2565
2475
  },
2566
- __wbg_now_a9b7df1cbee90986: function() {
2567
- const ret = Date.now();
2568
- return ret;
2569
- },
2570
- __wbg_prototypesetcall_a6b02eb00b0f4ce2: function(arg0, arg1, arg2) {
2476
+ __wbg_next_f31ecb8646d2c605: function() { return handleError(function (arg0) {
2477
+ const ret = getObject(arg0).next();
2478
+ return addHeapObject(ret);
2479
+ }, arguments); },
2480
+ __wbg_prototypesetcall_ae9f5e7459250748: function(arg0, arg1, arg2) {
2571
2481
  Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), getObject(arg2));
2572
2482
  },
2573
- __wbg_putImageData_c810e62ea70e761d: function() { return handleError(function (arg0, arg1, arg2, arg3) {
2483
+ __wbg_putImageData_080efc8615f29b4e: function() { return handleError(function (arg0, arg1, arg2, arg3) {
2574
2484
  getObject(arg0).putImageData(getObject(arg1), arg2, arg3);
2575
2485
  }, arguments); },
2576
- __wbg_putImageData_cb4de9afd58963be: function() { return handleError(function (arg0, arg1, arg2, arg3) {
2486
+ __wbg_putImageData_581de52c9f40fc59: function() { return handleError(function (arg0, arg1, arg2, arg3) {
2577
2487
  getObject(arg0).putImageData(getObject(arg1), arg2, arg3);
2578
2488
  }, arguments); },
2579
- __wbg_set_022bee52d0b05b19: function() { return handleError(function (arg0, arg1, arg2) {
2580
- const ret = Reflect.set(getObject(arg0), getObject(arg1), getObject(arg2));
2581
- return ret;
2582
- }, arguments); },
2583
- __wbg_set_3bf1de9fab0cd644: function(arg0, arg1, arg2) {
2489
+ __wbg_set_13d25b81ab403f5e: function(arg0, arg1, arg2) {
2584
2490
  getObject(arg0)[arg1 >>> 0] = takeObject(arg2);
2585
2491
  },
2586
2492
  __wbg_set_6be42768c690e380: function(arg0, arg1, arg2) {
2587
2493
  getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
2588
2494
  },
2589
- __wbg_set_fde2cec06c23692b: function(arg0, arg1, arg2) {
2495
+ __wbg_set_a377297433dfea63: function() { return handleError(function (arg0, arg1, arg2) {
2496
+ const ret = Reflect.set(getObject(arg0), getObject(arg1), getObject(arg2));
2497
+ return ret;
2498
+ }, arguments); },
2499
+ __wbg_set_bf6dde4923b9b059: function(arg0, arg1, arg2) {
2590
2500
  const ret = getObject(arg0).set(getObject(arg1), getObject(arg2));
2591
2501
  return addHeapObject(ret);
2592
2502
  },
2593
- __wbg_set_height_24d07d982f176ac6: function(arg0, arg1) {
2503
+ __wbg_set_height_1202ad0eab43cbe0: function(arg0, arg1) {
2594
2504
  getObject(arg0).height = arg1 >>> 0;
2595
2505
  },
2596
- __wbg_set_height_be9b2b920bd68401: function(arg0, arg1) {
2506
+ __wbg_set_height_698fb3b255bc1348: function(arg0, arg1) {
2597
2507
  getObject(arg0).height = arg1 >>> 0;
2598
2508
  },
2599
- __wbg_set_width_5cda41d4d06a14dd: function(arg0, arg1) {
2509
+ __wbg_set_width_4c3a2252e0dea033: function(arg0, arg1) {
2600
2510
  getObject(arg0).width = arg1 >>> 0;
2601
2511
  },
2602
- __wbg_set_width_adc925bca9c5351a: function(arg0, arg1) {
2512
+ __wbg_set_width_f52a20e39808b138: function(arg0, arg1) {
2603
2513
  getObject(arg0).width = arg1 >>> 0;
2604
2514
  },
2605
2515
  __wbg_stack_3b0d974bbf31e44f: function(arg0, arg1) {
@@ -2609,39 +2519,39 @@ function __wbg_get_imports() {
2609
2519
  getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
2610
2520
  getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
2611
2521
  },
2612
- __wbg_value_ee3a06f4579184fa: function(arg0) {
2522
+ __wbg_value_c227f843d21da141: function(arg0) {
2613
2523
  const ret = getObject(arg0).value;
2614
2524
  return addHeapObject(ret);
2615
2525
  },
2616
- __wbg_values_1e6d547ce555ce44: function(arg0) {
2617
- const ret = getObject(arg0).values();
2526
+ __wbg_values_220548effc36d1d3: function(arg0) {
2527
+ const ret = Object.values(getObject(arg0));
2618
2528
  return addHeapObject(ret);
2619
2529
  },
2620
- __wbg_values_301a77363cf6c773: function(arg0) {
2621
- const ret = Object.values(getObject(arg0));
2530
+ __wbg_values_85d5bcf6f1ca8248: function(arg0) {
2531
+ const ret = getObject(arg0).values();
2622
2532
  return addHeapObject(ret);
2623
2533
  },
2624
- __wbindgen_cast_0000000000000001: function(arg0) {
2534
+ __wbindgen_generic_0000000000000001: function(arg0) {
2625
2535
  // Cast intrinsic for `F64 -> Externref`.
2626
2536
  const ret = arg0;
2627
2537
  return addHeapObject(ret);
2628
2538
  },
2629
- __wbindgen_cast_0000000000000002: function(arg0) {
2539
+ __wbindgen_generic_0000000000000002: function(arg0) {
2630
2540
  // Cast intrinsic for `I64 -> Externref`.
2631
2541
  const ret = arg0;
2632
2542
  return addHeapObject(ret);
2633
2543
  },
2634
- __wbindgen_cast_0000000000000003: function(arg0, arg1) {
2544
+ __wbindgen_generic_0000000000000003: function(arg0, arg1) {
2635
2545
  // Cast intrinsic for `Ref(Slice(U8)) -> NamedExternref("Uint8Array")`.
2636
2546
  const ret = getArrayU8FromWasm0(arg0, arg1);
2637
2547
  return addHeapObject(ret);
2638
2548
  },
2639
- __wbindgen_cast_0000000000000004: function(arg0, arg1) {
2549
+ __wbindgen_generic_0000000000000004: function(arg0, arg1) {
2640
2550
  // Cast intrinsic for `Ref(String) -> Externref`.
2641
2551
  const ret = getStringFromWasm0(arg0, arg1);
2642
2552
  return addHeapObject(ret);
2643
2553
  },
2644
- __wbindgen_cast_0000000000000005: function(arg0) {
2554
+ __wbindgen_generic_0000000000000005: function(arg0) {
2645
2555
  // Cast intrinsic for `U64 -> Externref`.
2646
2556
  const ret = BigInt.asUintN(64, arg0);
2647
2557
  return addHeapObject(ret);
@@ -2662,16 +2572,16 @@ function __wbg_get_imports() {
2662
2572
 
2663
2573
  const DocumentFinalization = (typeof FinalizationRegistry === 'undefined')
2664
2574
  ? { register: () => {}, unregister: () => {} }
2665
- : new FinalizationRegistry(ptr => wasm.__wbg_document_free(ptr >>> 0, 1));
2575
+ : new FinalizationRegistry(ptr => wasm.__wbg_document_free(ptr, 1));
2666
2576
  const LiveSessionFinalization = (typeof FinalizationRegistry === 'undefined')
2667
2577
  ? { register: () => {}, unregister: () => {} }
2668
- : new FinalizationRegistry(ptr => wasm.__wbg_livesession_free(ptr >>> 0, 1));
2578
+ : new FinalizationRegistry(ptr => wasm.__wbg_livesession_free(ptr, 1));
2669
2579
  const QuillFinalization = (typeof FinalizationRegistry === 'undefined')
2670
2580
  ? { register: () => {}, unregister: () => {} }
2671
- : new FinalizationRegistry(ptr => wasm.__wbg_quill_free(ptr >>> 0, 1));
2581
+ : new FinalizationRegistry(ptr => wasm.__wbg_quill_free(ptr, 1));
2672
2582
  const QuillmarkFinalization = (typeof FinalizationRegistry === 'undefined')
2673
2583
  ? { register: () => {}, unregister: () => {} }
2674
- : new FinalizationRegistry(ptr => wasm.__wbg_quillmark_free(ptr >>> 0, 1));
2584
+ : new FinalizationRegistry(ptr => wasm.__wbg_quillmark_free(ptr, 1));
2675
2585
 
2676
2586
  function addHeapObject(obj) {
2677
2587
  if (heap_next === heap.length) heap.push(heap.length + 1);
@@ -2778,8 +2688,7 @@ function getDataViewMemory0() {
2778
2688
  }
2779
2689
 
2780
2690
  function getStringFromWasm0(ptr, len) {
2781
- ptr = ptr >>> 0;
2782
- return decodeText(ptr, len);
2691
+ return decodeText(ptr >>> 0, len);
2783
2692
  }
2784
2693
 
2785
2694
  let cachedUint8ArrayMemory0 = null;
@@ -2889,8 +2798,9 @@ if (!('encodeInto' in cachedTextEncoder)) {
2889
2798
 
2890
2799
  let WASM_VECTOR_LEN = 0;
2891
2800
 
2892
- let wasmModule, wasm;
2801
+ let wasmModule, wasmInstance, wasm;
2893
2802
  function __wbg_finalize_init(instance, module) {
2803
+ wasmInstance = instance;
2894
2804
  wasm = instance.exports;
2895
2805
  wasmModule = module;
2896
2806
  cachedDataViewMemory0 = null;
@@ -2902,11 +2812,15 @@ function __wbg_finalize_init(instance, module) {
2902
2812
 
2903
2813
  async function __wbg_load(module, imports) {
2904
2814
  if (typeof Response === 'function' && module instanceof Response) {
2815
+ if (!module.ok) {
2816
+ throw new Error(`failed to fetch Wasm: ${module.status} ${module.statusText} fetching '${module.url}'`);
2817
+ }
2818
+
2905
2819
  if (typeof WebAssembly.instantiateStreaming === 'function') {
2906
2820
  try {
2907
2821
  return await WebAssembly.instantiateStreaming(module, imports);
2908
2822
  } catch (e) {
2909
- const validResponse = module.ok && expectedResponseType(module.type);
2823
+ const validResponse = expectedResponseType(module.type);
2910
2824
 
2911
2825
  if (validResponse && module.headers.get('Content-Type') !== 'application/wasm') {
2912
2826
  console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n", e);