@quillmark/wasm 0.90.0 → 0.92.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +71 -28
- package/README.md +8 -8
- package/backends/typst/wasm.d.ts +86 -47
- package/backends/typst/wasm_bg.js +222 -46
- package/backends/typst/wasm_bg.wasm +0 -0
- package/backends/typst/wasm_bg.wasm.d.ts +13 -24
- package/core/wasm.d.ts +62 -23
- package/core/wasm_bg.js +209 -44
- package/core/wasm_bg.wasm +0 -0
- package/core/wasm_bg.wasm.d.ts +12 -10
- package/package.json +1 -1
|
@@ -21,8 +21,9 @@ export class Document {
|
|
|
21
21
|
}
|
|
22
22
|
/**
|
|
23
23
|
* Authoring-ergonomics header introducing a blueprint to an LLM/MCP
|
|
24
|
-
* consumer for the given `quillName`.
|
|
25
|
-
*
|
|
24
|
+
* consumer for the given `quillName`. Re-exposes core's canonical text for
|
|
25
|
+
* JS consumers; any surface that draws from the same core source stays
|
|
26
|
+
* uniform.
|
|
26
27
|
* @param {string} quill_name
|
|
27
28
|
* @returns {string}
|
|
28
29
|
*/
|
|
@@ -56,8 +57,19 @@ export class Document {
|
|
|
56
57
|
* @returns {Card[]}
|
|
57
58
|
*/
|
|
58
59
|
get cards() {
|
|
59
|
-
|
|
60
|
-
|
|
60
|
+
try {
|
|
61
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
62
|
+
wasm.document_cards(retptr, this.__wbg_ptr);
|
|
63
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
64
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
65
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
66
|
+
if (r2) {
|
|
67
|
+
throw takeObject(r1);
|
|
68
|
+
}
|
|
69
|
+
return takeObject(r0);
|
|
70
|
+
} finally {
|
|
71
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
72
|
+
}
|
|
61
73
|
}
|
|
62
74
|
/**
|
|
63
75
|
* @returns {Document}
|
|
@@ -100,8 +112,8 @@ export class Document {
|
|
|
100
112
|
return ret !== 0;
|
|
101
113
|
}
|
|
102
114
|
/**
|
|
103
|
-
* Render a Diagnostic as the canonical pretty-printed text
|
|
104
|
-
*
|
|
115
|
+
* Render a Diagnostic as the canonical pretty-printed text (core's
|
|
116
|
+
* `Diagnostic::fmt_pretty`). Single source of truth so a Diagnostic looks
|
|
105
117
|
* identical no matter which consumer surfaces it.
|
|
106
118
|
* @param {Diagnostic} diag
|
|
107
119
|
* @returns {string}
|
|
@@ -123,10 +135,11 @@ export class Document {
|
|
|
123
135
|
}
|
|
124
136
|
}
|
|
125
137
|
/**
|
|
126
|
-
* Authoring-format rules for the card-yaml markdown surface
|
|
127
|
-
* text
|
|
128
|
-
*
|
|
129
|
-
* startup and cache; the value never changes
|
|
138
|
+
* Authoring-format rules for the card-yaml markdown surface. The canonical
|
|
139
|
+
* text is core's (`quillmark_core::document::FORMAT_RULES`), re-exposed
|
|
140
|
+
* here for JS consumers so it matches any other surface that draws from the
|
|
141
|
+
* same source. Read once at startup and cache; the value never changes
|
|
142
|
+
* between calls.
|
|
130
143
|
* @returns {string}
|
|
131
144
|
*/
|
|
132
145
|
static formatRules() {
|
|
@@ -219,8 +232,19 @@ export class Document {
|
|
|
219
232
|
* @returns {Card}
|
|
220
233
|
*/
|
|
221
234
|
get main() {
|
|
222
|
-
|
|
223
|
-
|
|
235
|
+
try {
|
|
236
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
237
|
+
wasm.document_main(retptr, this.__wbg_ptr);
|
|
238
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
239
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
240
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
241
|
+
if (r2) {
|
|
242
|
+
throw takeObject(r1);
|
|
243
|
+
}
|
|
244
|
+
return takeObject(r0);
|
|
245
|
+
} finally {
|
|
246
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
247
|
+
}
|
|
224
248
|
}
|
|
225
249
|
/**
|
|
226
250
|
* Build a fresh `Card` from a kind and a flat field map — the ergonomic
|
|
@@ -310,11 +334,11 @@ export class Document {
|
|
|
310
334
|
}
|
|
311
335
|
}
|
|
312
336
|
/**
|
|
313
|
-
* The canonical `$quill` reference grammar as author-facing text.
|
|
314
|
-
* source of truth
|
|
315
|
-
*
|
|
316
|
-
*
|
|
317
|
-
*
|
|
337
|
+
* The canonical `$quill` reference grammar as author-facing text. Core is
|
|
338
|
+
* the single source of truth: drive schema `describe` and validation
|
|
339
|
+
* messages from this instead of re-stating the rule — it matches the
|
|
340
|
+
* `hint` on `parse::invalid_quill_reference`. Cache it; the value never
|
|
341
|
+
* changes.
|
|
318
342
|
* @returns {string}
|
|
319
343
|
*/
|
|
320
344
|
static quillRefHint() {
|
|
@@ -338,8 +362,19 @@ export class Document {
|
|
|
338
362
|
* @returns {Card | undefined}
|
|
339
363
|
*/
|
|
340
364
|
removeCard(index) {
|
|
341
|
-
|
|
342
|
-
|
|
365
|
+
try {
|
|
366
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
367
|
+
wasm.document_removeCard(retptr, this.__wbg_ptr, index);
|
|
368
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
369
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
370
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
371
|
+
if (r2) {
|
|
372
|
+
throw takeObject(r1);
|
|
373
|
+
}
|
|
374
|
+
return takeObject(r0);
|
|
375
|
+
} finally {
|
|
376
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
377
|
+
}
|
|
343
378
|
}
|
|
344
379
|
/**
|
|
345
380
|
* Remove the `$ext` map from the composable card at `index` *entirely*,
|
|
@@ -420,8 +455,19 @@ export class Document {
|
|
|
420
455
|
* @returns {Record<string, unknown> | undefined}
|
|
421
456
|
*/
|
|
422
457
|
removeExt() {
|
|
423
|
-
|
|
424
|
-
|
|
458
|
+
try {
|
|
459
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
460
|
+
wasm.document_removeExt(retptr, this.__wbg_ptr);
|
|
461
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
462
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
463
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
464
|
+
if (r2) {
|
|
465
|
+
throw takeObject(r1);
|
|
466
|
+
}
|
|
467
|
+
return takeObject(r0);
|
|
468
|
+
} finally {
|
|
469
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
470
|
+
}
|
|
425
471
|
}
|
|
426
472
|
/**
|
|
427
473
|
* Remove `namespace` from the main card's `$ext` map, returning the value
|
|
@@ -432,10 +478,21 @@ export class Document {
|
|
|
432
478
|
* @returns {any}
|
|
433
479
|
*/
|
|
434
480
|
removeExtNamespace(namespace) {
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
481
|
+
try {
|
|
482
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
483
|
+
const ptr0 = passStringToWasm0(namespace, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
484
|
+
const len0 = WASM_VECTOR_LEN;
|
|
485
|
+
wasm.document_removeExtNamespace(retptr, this.__wbg_ptr, ptr0, len0);
|
|
486
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
487
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
488
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
489
|
+
if (r2) {
|
|
490
|
+
throw takeObject(r1);
|
|
491
|
+
}
|
|
492
|
+
return takeObject(r0);
|
|
493
|
+
} finally {
|
|
494
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
495
|
+
}
|
|
439
496
|
}
|
|
440
497
|
/**
|
|
441
498
|
* Remove a payload field on the main card, returning the removed value or
|
|
@@ -460,6 +517,30 @@ export class Document {
|
|
|
460
517
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
461
518
|
}
|
|
462
519
|
}
|
|
520
|
+
/**
|
|
521
|
+
* Remove `cardKind` from the main card's `$seed` map, returning its
|
|
522
|
+
* overlay or `undefined`; drops `$seed` entirely once empty. Sibling
|
|
523
|
+
* kinds survive.
|
|
524
|
+
* @param {string} card_kind
|
|
525
|
+
* @returns {any}
|
|
526
|
+
*/
|
|
527
|
+
removeSeedNamespace(card_kind) {
|
|
528
|
+
try {
|
|
529
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
530
|
+
const ptr0 = passStringToWasm0(card_kind, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
531
|
+
const len0 = WASM_VECTOR_LEN;
|
|
532
|
+
wasm.document_removeSeedNamespace(retptr, this.__wbg_ptr, ptr0, len0);
|
|
533
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
534
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
535
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
536
|
+
if (r2) {
|
|
537
|
+
throw takeObject(r1);
|
|
538
|
+
}
|
|
539
|
+
return takeObject(r0);
|
|
540
|
+
} finally {
|
|
541
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
542
|
+
}
|
|
543
|
+
}
|
|
463
544
|
/**
|
|
464
545
|
* @param {string} body
|
|
465
546
|
*/
|
|
@@ -603,7 +684,7 @@ export class Document {
|
|
|
603
684
|
}
|
|
604
685
|
}
|
|
605
686
|
/**
|
|
606
|
-
* Update a payload field on the main card. Clears any existing `!
|
|
687
|
+
* Update a payload field on the main card. Clears any existing `!must_fill` marker.
|
|
607
688
|
*
|
|
608
689
|
* Throws if `name` does not match `[a-z_][a-z0-9_]*`.
|
|
609
690
|
* @param {string} name
|
|
@@ -625,7 +706,7 @@ export class Document {
|
|
|
625
706
|
}
|
|
626
707
|
}
|
|
627
708
|
/**
|
|
628
|
-
* Update a payload field on the main card and mark it as `!
|
|
709
|
+
* Update a payload field on the main card and mark it as `!must_fill`.
|
|
629
710
|
* Throws on invalid name (see [`setField`](Document::set_field)).
|
|
630
711
|
* @param {string} name
|
|
631
712
|
* @param {any} value
|
|
@@ -664,6 +745,29 @@ export class Document {
|
|
|
664
745
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
665
746
|
}
|
|
666
747
|
}
|
|
748
|
+
/**
|
|
749
|
+
* Merge a card-kind's seed `overlay` into the main card's `$seed` map
|
|
750
|
+
* under `cardKind`, preserving sibling kinds. Sets the starting values
|
|
751
|
+
* new cards of that kind spawn with. Throws if `overlay` cannot be
|
|
752
|
+
* serialized or nests too deep.
|
|
753
|
+
* @param {string} card_kind
|
|
754
|
+
* @param {any} overlay
|
|
755
|
+
*/
|
|
756
|
+
setSeedNamespace(card_kind, overlay) {
|
|
757
|
+
try {
|
|
758
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
759
|
+
const ptr0 = passStringToWasm0(card_kind, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
760
|
+
const len0 = WASM_VECTOR_LEN;
|
|
761
|
+
wasm.document_setSeedNamespace(retptr, this.__wbg_ptr, ptr0, len0, addHeapObject(overlay));
|
|
762
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
763
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
764
|
+
if (r1) {
|
|
765
|
+
throw takeObject(r0);
|
|
766
|
+
}
|
|
767
|
+
} finally {
|
|
768
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
769
|
+
}
|
|
770
|
+
}
|
|
667
771
|
/**
|
|
668
772
|
* Serialize this document to a versioned storage DTO string.
|
|
669
773
|
*
|
|
@@ -773,8 +877,19 @@ export class Document {
|
|
|
773
877
|
* @returns {Diagnostic[]}
|
|
774
878
|
*/
|
|
775
879
|
get warnings() {
|
|
776
|
-
|
|
777
|
-
|
|
880
|
+
try {
|
|
881
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
882
|
+
wasm.document_warnings(retptr, this.__wbg_ptr);
|
|
883
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
884
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
885
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
886
|
+
if (r2) {
|
|
887
|
+
throw takeObject(r1);
|
|
888
|
+
}
|
|
889
|
+
return takeObject(r0);
|
|
890
|
+
} finally {
|
|
891
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
892
|
+
}
|
|
778
893
|
}
|
|
779
894
|
}
|
|
780
895
|
if (Symbol.dispose) Document.prototype[Symbol.dispose] = Document.prototype.free;
|
|
@@ -872,8 +987,19 @@ export class Quill {
|
|
|
872
987
|
* @returns {QuillMetadata}
|
|
873
988
|
*/
|
|
874
989
|
get metadata() {
|
|
875
|
-
|
|
876
|
-
|
|
990
|
+
try {
|
|
991
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
992
|
+
wasm.quill_metadata(retptr, this.__wbg_ptr);
|
|
993
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
994
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
995
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
996
|
+
if (r2) {
|
|
997
|
+
throw takeObject(r1);
|
|
998
|
+
}
|
|
999
|
+
return takeObject(r0);
|
|
1000
|
+
} finally {
|
|
1001
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1002
|
+
}
|
|
877
1003
|
}
|
|
878
1004
|
/**
|
|
879
1005
|
* Document schema for the quill: the user-fillable fields plus their
|
|
@@ -883,23 +1009,51 @@ export class Quill {
|
|
|
883
1009
|
* @returns {QuillSchema}
|
|
884
1010
|
*/
|
|
885
1011
|
get schema() {
|
|
886
|
-
|
|
887
|
-
|
|
1012
|
+
try {
|
|
1013
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1014
|
+
wasm.quill_schema(retptr, this.__wbg_ptr);
|
|
1015
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1016
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1017
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1018
|
+
if (r2) {
|
|
1019
|
+
throw takeObject(r1);
|
|
1020
|
+
}
|
|
1021
|
+
return takeObject(r0);
|
|
1022
|
+
} finally {
|
|
1023
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1024
|
+
}
|
|
888
1025
|
}
|
|
889
1026
|
/**
|
|
890
1027
|
* Seed a starter composable `Card` of the given kind (carries `$kind`),
|
|
891
|
-
*
|
|
892
|
-
* absent. Returns `undefined` if `cardKind`
|
|
893
|
-
* quill's schema, else a `Card` that feeds
|
|
894
|
-
* `Document.pushCard` / `insertCard`.
|
|
1028
|
+
* layering an optional per-kind seed `overlay` over the schema-example
|
|
1029
|
+
* base (`overlay › example › absent`). Returns `undefined` if `cardKind`
|
|
1030
|
+
* is not declared in this quill's schema, else a `Card` that feeds
|
|
1031
|
+
* straight into `Document.pushCard` / `insertCard`.
|
|
1032
|
+
*
|
|
1033
|
+
* Pass `document.main.seed?.[cardKind]` as `overlay` so a card added to a
|
|
1034
|
+
* template-derived document inherits its curated starting values; omit it
|
|
1035
|
+
* (or pass `undefined` / `null`) for the bare schema seed. `overlay` is a
|
|
1036
|
+
* plain object — this reads the document, it does not mutate it.
|
|
895
1037
|
* @param {string} card_kind
|
|
1038
|
+
* @param {Record<string, unknown> | undefined} overlay
|
|
896
1039
|
* @returns {Card | undefined}
|
|
897
1040
|
*/
|
|
898
|
-
seedCard(card_kind) {
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
1041
|
+
seedCard(card_kind, overlay) {
|
|
1042
|
+
try {
|
|
1043
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1044
|
+
const ptr0 = passStringToWasm0(card_kind, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1045
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1046
|
+
wasm.quill_seedCard(retptr, this.__wbg_ptr, ptr0, len0, addHeapObject(overlay));
|
|
1047
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1048
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1049
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1050
|
+
if (r2) {
|
|
1051
|
+
throw takeObject(r1);
|
|
1052
|
+
}
|
|
1053
|
+
return takeObject(r0);
|
|
1054
|
+
} finally {
|
|
1055
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1056
|
+
}
|
|
903
1057
|
}
|
|
904
1058
|
/**
|
|
905
1059
|
* Seed a starter `Document` from the schema — the main card plus one
|
|
@@ -922,8 +1076,19 @@ export class Quill {
|
|
|
922
1076
|
* @returns {Card}
|
|
923
1077
|
*/
|
|
924
1078
|
seedMain() {
|
|
925
|
-
|
|
926
|
-
|
|
1079
|
+
try {
|
|
1080
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1081
|
+
wasm.quill_seedMain(retptr, this.__wbg_ptr);
|
|
1082
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1083
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1084
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1085
|
+
if (r2) {
|
|
1086
|
+
throw takeObject(r1);
|
|
1087
|
+
}
|
|
1088
|
+
return takeObject(r0);
|
|
1089
|
+
} finally {
|
|
1090
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1091
|
+
}
|
|
927
1092
|
}
|
|
928
1093
|
/**
|
|
929
1094
|
* Flatten this quill back into its canonical file tree — the inverse of
|
|
@@ -1219,8 +1384,19 @@ export class RenderSession {
|
|
|
1219
1384
|
* @returns {Diagnostic[]}
|
|
1220
1385
|
*/
|
|
1221
1386
|
get warnings() {
|
|
1222
|
-
|
|
1223
|
-
|
|
1387
|
+
try {
|
|
1388
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1389
|
+
wasm.rendersession_warnings(retptr, this.__wbg_ptr);
|
|
1390
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1391
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1392
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1393
|
+
if (r2) {
|
|
1394
|
+
throw takeObject(r1);
|
|
1395
|
+
}
|
|
1396
|
+
return takeObject(r0);
|
|
1397
|
+
} finally {
|
|
1398
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1399
|
+
}
|
|
1224
1400
|
}
|
|
1225
1401
|
}
|
|
1226
1402
|
if (Symbol.dispose) RenderSession.prototype[Symbol.dispose] = RenderSession.prototype.free;
|
|
Binary file
|
|
@@ -7,7 +7,7 @@ export const __wbg_quillmark_free: (a: number, b: number) => void;
|
|
|
7
7
|
export const __wbg_rendersession_free: (a: number, b: number) => void;
|
|
8
8
|
export const document_blueprintInstruction: (a: number, b: number, c: number) => void;
|
|
9
9
|
export const document_cardCount: (a: number) => number;
|
|
10
|
-
export const document_cards: (a: number) =>
|
|
10
|
+
export const document_cards: (a: number, b: number) => void;
|
|
11
11
|
export const document_clone: (a: number) => number;
|
|
12
12
|
export const document_currentSchemaVersion: (a: number) => void;
|
|
13
13
|
export const document_equals: (a: number, b: number) => number;
|
|
@@ -16,19 +16,20 @@ export const document_formatRules: (a: number) => void;
|
|
|
16
16
|
export const document_fromJson: (a: number, b: number, c: number) => void;
|
|
17
17
|
export const document_fromMarkdown: (a: number, b: number, c: number) => void;
|
|
18
18
|
export const document_insertCard: (a: number, b: number, c: number, d: number) => void;
|
|
19
|
-
export const document_main: (a: number) =>
|
|
19
|
+
export const document_main: (a: number, b: number) => void;
|
|
20
20
|
export const document_makeCard: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
21
21
|
export const document_moveCard: (a: number, b: number, c: number, d: number) => void;
|
|
22
22
|
export const document_pushCard: (a: number, b: number, c: number) => void;
|
|
23
23
|
export const document_quillRef: (a: number, b: number) => void;
|
|
24
24
|
export const document_quillRefHint: (a: number) => void;
|
|
25
|
-
export const document_removeCard: (a: number, b: number) =>
|
|
25
|
+
export const document_removeCard: (a: number, b: number, c: number) => void;
|
|
26
26
|
export const document_removeCardExt: (a: number, b: number, c: number) => void;
|
|
27
27
|
export const document_removeCardExtNamespace: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
28
28
|
export const document_removeCardField: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
29
|
-
export const document_removeExt: (a: number) =>
|
|
30
|
-
export const document_removeExtNamespace: (a: number, b: number, c: number) =>
|
|
29
|
+
export const document_removeExt: (a: number, b: number) => void;
|
|
30
|
+
export const document_removeExtNamespace: (a: number, b: number, c: number, d: number) => void;
|
|
31
31
|
export const document_removeField: (a: number, b: number, c: number, d: number) => void;
|
|
32
|
+
export const document_removeSeedNamespace: (a: number, b: number, c: number, d: number) => void;
|
|
32
33
|
export const document_replaceBody: (a: number, b: number, c: number) => void;
|
|
33
34
|
export const document_schemaVersionOf: (a: number, b: number, c: number) => void;
|
|
34
35
|
export const document_setCardExt: (a: number, b: number, c: number, d: number) => void;
|
|
@@ -39,21 +40,22 @@ export const document_setExtNamespace: (a: number, b: number, c: number, d: numb
|
|
|
39
40
|
export const document_setField: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
40
41
|
export const document_setFill: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
41
42
|
export const document_setQuillRef: (a: number, b: number, c: number, d: number) => void;
|
|
43
|
+
export const document_setSeedNamespace: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
42
44
|
export const document_toJson: (a: number, b: number) => void;
|
|
43
45
|
export const document_toMarkdown: (a: number, b: number) => void;
|
|
44
46
|
export const document_tryFromJson: (a: number, b: number) => number;
|
|
45
47
|
export const document_updateCardBody: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
46
48
|
export const document_updateCardField: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
47
|
-
export const document_warnings: (a: number) =>
|
|
49
|
+
export const document_warnings: (a: number, b: number) => void;
|
|
48
50
|
export const init: () => void;
|
|
49
51
|
export const quill_backendId: (a: number, b: number) => void;
|
|
50
52
|
export const quill_blueprint: (a: number, b: number) => void;
|
|
51
53
|
export const quill_fromTree: (a: number, b: number) => void;
|
|
52
|
-
export const quill_metadata: (a: number) =>
|
|
53
|
-
export const quill_schema: (a: number) =>
|
|
54
|
-
export const quill_seedCard: (a: number, b: number, c: number) =>
|
|
54
|
+
export const quill_metadata: (a: number, b: number) => void;
|
|
55
|
+
export const quill_schema: (a: number, b: number) => void;
|
|
56
|
+
export const quill_seedCard: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
55
57
|
export const quill_seedDocument: (a: number) => number;
|
|
56
|
-
export const quill_seedMain: (a: number) =>
|
|
58
|
+
export const quill_seedMain: (a: number, b: number) => void;
|
|
57
59
|
export const quill_toTree: (a: number) => number;
|
|
58
60
|
export const quill_validate: (a: number, b: number, c: number) => void;
|
|
59
61
|
export const quillmark_new: () => number;
|
|
@@ -67,20 +69,7 @@ export const rendersession_pageSize: (a: number, b: number, c: number) => void;
|
|
|
67
69
|
export const rendersession_paint: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
68
70
|
export const rendersession_render: (a: number, b: number, c: number) => void;
|
|
69
71
|
export const rendersession_supportsCanvas: (a: number) => number;
|
|
70
|
-
export const rendersession_warnings: (a: number) =>
|
|
71
|
-
export const lut_inverse_interp16: (a: number, b: number, c: number) => number;
|
|
72
|
-
export const qcms_profile_precache_output_transform: (a: number) => void;
|
|
73
|
-
export const qcms_white_point_sRGB: (a: number) => void;
|
|
74
|
-
export const qcms_transform_data_rgb_out_lut: (a: number, b: number, c: number, d: number) => void;
|
|
75
|
-
export const qcms_transform_data_rgba_out_lut: (a: number, b: number, c: number, d: number) => void;
|
|
76
|
-
export const qcms_transform_data_bgra_out_lut: (a: number, b: number, c: number, d: number) => void;
|
|
77
|
-
export const qcms_transform_data_rgb_out_lut_precache: (a: number, b: number, c: number, d: number) => void;
|
|
78
|
-
export const qcms_transform_data_rgba_out_lut_precache: (a: number, b: number, c: number, d: number) => void;
|
|
79
|
-
export const qcms_transform_data_bgra_out_lut_precache: (a: number, b: number, c: number, d: number) => void;
|
|
80
|
-
export const lut_interp_linear16: (a: number, b: number, c: number) => number;
|
|
81
|
-
export const qcms_enable_iccv4: () => void;
|
|
82
|
-
export const qcms_profile_is_bogus: (a: number) => number;
|
|
83
|
-
export const qcms_transform_release: (a: number) => void;
|
|
72
|
+
export const rendersession_warnings: (a: number, b: number) => void;
|
|
84
73
|
export const __wbindgen_export: (a: number, b: number) => number;
|
|
85
74
|
export const __wbindgen_export2: (a: number, b: number, c: number, d: number) => number;
|
|
86
75
|
export const __wbindgen_export3: (a: number) => void;
|
package/core/wasm.d.ts
CHANGED
|
@@ -1,9 +1,26 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
|
|
4
|
+
/**
|
|
5
|
+
* A path to a value nested inside a field `value`: `string` keys and
|
|
6
|
+
* `number` array indices, e.g. `["addr", "street"]` or `["recipients", 0, "name"]`.
|
|
7
|
+
*/
|
|
8
|
+
export type PathStep = string | number;
|
|
9
|
+
|
|
4
10
|
/** A field or comment entry in a `Card.payloadItems` list. */
|
|
5
11
|
export type PayloadItem =
|
|
6
|
-
| {
|
|
12
|
+
| {
|
|
13
|
+
type: "field";
|
|
14
|
+
key: string;
|
|
15
|
+
value: unknown;
|
|
16
|
+
fill?: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Paths to `!must_fill` markers nested *inside* `value` (the `value`
|
|
19
|
+
* projection itself is fill-free). Absent when the field has no nested
|
|
20
|
+
* placeholders. Preserved across `pushCard` / `makeCard`.
|
|
21
|
+
*/
|
|
22
|
+
nestedFills?: PathStep[][];
|
|
23
|
+
}
|
|
7
24
|
| { type: "comment"; text: string; inline?: boolean };
|
|
8
25
|
|
|
9
26
|
/**
|
|
@@ -14,14 +31,16 @@ export type PayloadItem =
|
|
|
14
31
|
*
|
|
15
32
|
* `$` system entries are hoisted to named fields: `kind` (the `$kind`, empty
|
|
16
33
|
* string when none), optional `quill` (the `$quill` `name@version`, main card
|
|
17
|
-
* only), optional `id` (`$id`),
|
|
18
|
-
*
|
|
34
|
+
* only), optional `id` (`$id`), optional `ext` (`$ext`), and optional `seed`
|
|
35
|
+
* (the `$seed` per-kind overlay map, main card only). `payloadItems` carries
|
|
36
|
+
* user fields and comments in order.
|
|
19
37
|
*/
|
|
20
38
|
export interface Card {
|
|
21
39
|
kind: string;
|
|
22
40
|
quill?: string;
|
|
23
41
|
id?: string;
|
|
24
42
|
ext?: Record<string, unknown>;
|
|
43
|
+
seed?: Record<string, unknown>;
|
|
25
44
|
payloadItems: PayloadItem[];
|
|
26
45
|
body: string;
|
|
27
46
|
}
|
|
@@ -134,8 +153,9 @@ export class Document {
|
|
|
134
153
|
[Symbol.dispose](): void;
|
|
135
154
|
/**
|
|
136
155
|
* Authoring-ergonomics header introducing a blueprint to an LLM/MCP
|
|
137
|
-
* consumer for the given `quillName`.
|
|
138
|
-
*
|
|
156
|
+
* consumer for the given `quillName`. Re-exposes core's canonical text for
|
|
157
|
+
* JS consumers; any surface that draws from the same core source stays
|
|
158
|
+
* uniform.
|
|
139
159
|
*/
|
|
140
160
|
static blueprintInstruction(quill_name: string): string;
|
|
141
161
|
clone(): Document;
|
|
@@ -151,16 +171,17 @@ export class Document {
|
|
|
151
171
|
*/
|
|
152
172
|
equals(other: Document): boolean;
|
|
153
173
|
/**
|
|
154
|
-
* Render a Diagnostic as the canonical pretty-printed text
|
|
155
|
-
*
|
|
174
|
+
* Render a Diagnostic as the canonical pretty-printed text (core's
|
|
175
|
+
* `Diagnostic::fmt_pretty`). Single source of truth so a Diagnostic looks
|
|
156
176
|
* identical no matter which consumer surfaces it.
|
|
157
177
|
*/
|
|
158
178
|
static formatDiagnostic(diag: Diagnostic): string;
|
|
159
179
|
/**
|
|
160
|
-
* Authoring-format rules for the card-yaml markdown surface
|
|
161
|
-
* text
|
|
162
|
-
*
|
|
163
|
-
* startup and cache; the value never changes
|
|
180
|
+
* Authoring-format rules for the card-yaml markdown surface. The canonical
|
|
181
|
+
* text is core's (`quillmark_core::document::FORMAT_RULES`), re-exposed
|
|
182
|
+
* here for JS consumers so it matches any other surface that draws from the
|
|
183
|
+
* same source. Read once at startup and cache; the value never changes
|
|
184
|
+
* between calls.
|
|
164
185
|
*/
|
|
165
186
|
static formatRules(): string;
|
|
166
187
|
/**
|
|
@@ -201,11 +222,11 @@ export class Document {
|
|
|
201
222
|
*/
|
|
202
223
|
pushCard(card: Card): void;
|
|
203
224
|
/**
|
|
204
|
-
* The canonical `$quill` reference grammar as author-facing text.
|
|
205
|
-
* source of truth
|
|
206
|
-
*
|
|
207
|
-
*
|
|
208
|
-
*
|
|
225
|
+
* The canonical `$quill` reference grammar as author-facing text. Core is
|
|
226
|
+
* the single source of truth: drive schema `describe` and validation
|
|
227
|
+
* messages from this instead of re-stating the rule — it matches the
|
|
228
|
+
* `hint` on `parse::invalid_quill_reference`. Cache it; the value never
|
|
229
|
+
* changes.
|
|
209
230
|
*/
|
|
210
231
|
static quillRefHint(): string;
|
|
211
232
|
removeCard(index: number): Card | undefined;
|
|
@@ -245,6 +266,12 @@ export class Document {
|
|
|
245
266
|
* `undefined`. Throws if `name` does not match `[a-z_][a-z0-9_]*`.
|
|
246
267
|
*/
|
|
247
268
|
removeField(name: string): any;
|
|
269
|
+
/**
|
|
270
|
+
* Remove `cardKind` from the main card's `$seed` map, returning its
|
|
271
|
+
* overlay or `undefined`; drops `$seed` entirely once empty. Sibling
|
|
272
|
+
* kinds survive.
|
|
273
|
+
*/
|
|
274
|
+
removeSeedNamespace(card_kind: string): any;
|
|
248
275
|
replaceBody(body: string): void;
|
|
249
276
|
/**
|
|
250
277
|
* Read the `schema` version tag from a raw storage DTO string without a
|
|
@@ -286,13 +313,13 @@ export class Document {
|
|
|
286
313
|
*/
|
|
287
314
|
setExtNamespace(namespace: string, value: any): void;
|
|
288
315
|
/**
|
|
289
|
-
* Update a payload field on the main card. Clears any existing `!
|
|
316
|
+
* Update a payload field on the main card. Clears any existing `!must_fill` marker.
|
|
290
317
|
*
|
|
291
318
|
* Throws if `name` does not match `[a-z_][a-z0-9_]*`.
|
|
292
319
|
*/
|
|
293
320
|
setField(name: string, value: any): void;
|
|
294
321
|
/**
|
|
295
|
-
* Update a payload field on the main card and mark it as `!
|
|
322
|
+
* Update a payload field on the main card and mark it as `!must_fill`.
|
|
296
323
|
* Throws on invalid name (see [`setField`](Document::set_field)).
|
|
297
324
|
*/
|
|
298
325
|
setFill(name: string, value: any): void;
|
|
@@ -300,6 +327,13 @@ export class Document {
|
|
|
300
327
|
* Replace the QUILL reference string. Throws if `ref_str` is invalid.
|
|
301
328
|
*/
|
|
302
329
|
setQuillRef(ref_str: string): void;
|
|
330
|
+
/**
|
|
331
|
+
* Merge a card-kind's seed `overlay` into the main card's `$seed` map
|
|
332
|
+
* under `cardKind`, preserving sibling kinds. Sets the starting values
|
|
333
|
+
* new cards of that kind spawn with. Throws if `overlay` cannot be
|
|
334
|
+
* serialized or nests too deep.
|
|
335
|
+
*/
|
|
336
|
+
setSeedNamespace(card_kind: string, overlay: any): void;
|
|
303
337
|
/**
|
|
304
338
|
* Serialize this document to a versioned storage DTO string.
|
|
305
339
|
*
|
|
@@ -363,12 +397,17 @@ export class Quill {
|
|
|
363
397
|
static fromTree(tree: Map<string, Uint8Array>): Quill;
|
|
364
398
|
/**
|
|
365
399
|
* Seed a starter composable `Card` of the given kind (carries `$kind`),
|
|
366
|
-
*
|
|
367
|
-
* absent. Returns `undefined` if `cardKind`
|
|
368
|
-
* quill's schema, else a `Card` that feeds
|
|
369
|
-
* `Document.pushCard` / `insertCard`.
|
|
400
|
+
* layering an optional per-kind seed `overlay` over the schema-example
|
|
401
|
+
* base (`overlay › example › absent`). Returns `undefined` if `cardKind`
|
|
402
|
+
* is not declared in this quill's schema, else a `Card` that feeds
|
|
403
|
+
* straight into `Document.pushCard` / `insertCard`.
|
|
404
|
+
*
|
|
405
|
+
* Pass `document.main.seed?.[cardKind]` as `overlay` so a card added to a
|
|
406
|
+
* template-derived document inherits its curated starting values; omit it
|
|
407
|
+
* (or pass `undefined` / `null`) for the bare schema seed. `overlay` is a
|
|
408
|
+
* plain object — this reads the document, it does not mutate it.
|
|
370
409
|
*/
|
|
371
|
-
seedCard(card_kind: string): Card | undefined;
|
|
410
|
+
seedCard(card_kind: string, overlay: Record<string, unknown> | undefined): Card | undefined;
|
|
372
411
|
/**
|
|
373
412
|
* Seed a starter `Document` from the schema — the main card plus one
|
|
374
413
|
* instance of each composable card kind, each committing its fields'
|