@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.
- package/CHANGELOG.md +1612 -0
- package/README.md +91 -66
- package/core/wasm.d.ts +153 -183
- package/core/wasm.js +283 -391
- package/core/wasm_bg.wasm +0 -0
- package/core/wasm_bg.wasm.d.ts +6 -11
- package/package.json +2 -2
- package/{backends/pdfform → render}/wasm.d.ts +204 -265
- package/{backends/pdfform → render}/wasm.js +364 -450
- package/{backends/typst → render}/wasm_bg.wasm +0 -0
- package/{backends/typst → render}/wasm_bg.wasm.d.ts +8 -15
- package/runtime/runtime.d.ts +88 -179
- package/runtime/runtime.js +144 -585
- package/backends/pdfform/wasm_bg.wasm +0 -0
- package/backends/pdfform/wasm_bg.wasm.d.ts +0 -107
- package/backends/typst/wasm.d.ts +0 -1511
- package/backends/typst/wasm.js +0 -3008
package/core/wasm.js
CHANGED
|
@@ -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) ?
|
|
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.
|
|
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
|
|
124
|
-
* `
|
|
125
|
-
*
|
|
126
|
-
*
|
|
127
|
-
*
|
|
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
|
-
*
|
|
130
|
-
*
|
|
131
|
-
*
|
|
132
|
-
*
|
|
133
|
-
*
|
|
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
|
-
*
|
|
137
|
-
*
|
|
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
|
-
* @
|
|
141
|
+
* @param {PathStep[]} path
|
|
142
|
+
* @returns {Content | undefined}
|
|
141
143
|
*/
|
|
142
|
-
|
|
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.
|
|
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
|
|
195
|
-
*
|
|
196
|
-
*
|
|
197
|
-
*
|
|
198
|
-
*
|
|
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
|
-
*
|
|
203
|
-
*
|
|
204
|
-
*
|
|
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
|
-
* `
|
|
207
|
-
*
|
|
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
|
-
* @
|
|
218
|
-
* @returns {Content | undefined}
|
|
213
|
+
* @returns {unknown}
|
|
219
214
|
*/
|
|
220
|
-
|
|
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.
|
|
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
|
-
*
|
|
304
|
-
*
|
|
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 [`
|
|
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
|
-
*
|
|
507
|
-
*
|
|
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
|
|
483
|
+
static fromMarkdown(markdown) {
|
|
514
484
|
try {
|
|
515
485
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
516
|
-
const ptr0 = passStringToWasm0(
|
|
486
|
+
const ptr0 = passStringToWasm0(markdown, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
517
487
|
const len0 = WASM_VECTOR_LEN;
|
|
518
|
-
wasm.
|
|
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
|
-
*
|
|
532
|
-
*
|
|
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
|
|
508
|
+
static fromStored(json) {
|
|
536
509
|
try {
|
|
537
510
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
538
|
-
const ptr0 = passStringToWasm0(
|
|
511
|
+
const ptr0 = passStringToWasm0(json, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
539
512
|
const len0 = WASM_VECTOR_LEN;
|
|
540
|
-
wasm.
|
|
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
|
|
617
|
-
*
|
|
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) ?
|
|
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 [`
|
|
683
|
-
* `warnings` are cleared. Throws on an invalid DTO, leaving the
|
|
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
|
-
|
|
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.
|
|
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
|
|
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
|
-
|
|
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.
|
|
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
|
-
|
|
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.
|
|
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
|
|
932
|
-
*
|
|
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 `
|
|
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)
|
|
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.
|
|
1149
|
-
*
|
|
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
|
-
*
|
|
1278
|
-
* `
|
|
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
|
-
|
|
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.
|
|
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
|
-
*
|
|
1301
|
-
*
|
|
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
|
-
|
|
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.
|
|
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 `
|
|
1166
|
+
* it, and `fromStored` / `loadStored` clear it.
|
|
1338
1167
|
* @returns {Diagnostic[]}
|
|
1339
1168
|
*/
|
|
1340
1169
|
get warnings() {
|
|
@@ -1357,7 +1186,6 @@ if (Symbol.dispose) Document.prototype[Symbol.dispose] = Document.prototype.free
|
|
|
1357
1186
|
|
|
1358
1187
|
export class Quill {
|
|
1359
1188
|
static __wrap(ptr) {
|
|
1360
|
-
ptr = ptr >>> 0;
|
|
1361
1189
|
const obj = Object.create(Quill.prototype);
|
|
1362
1190
|
obj.__wbg_ptr = ptr;
|
|
1363
1191
|
QuillFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
@@ -1373,6 +1201,32 @@ export class Quill {
|
|
|
1373
1201
|
const ptr = this.__destroy_into_raw();
|
|
1374
1202
|
wasm.__wbg_quill_free(ptr, 0);
|
|
1375
1203
|
}
|
|
1204
|
+
/**
|
|
1205
|
+
* The resolved-value view of `doc`: the ABI under `reader.resolve()`. For
|
|
1206
|
+
* every declared field, the value the render projection would use and the
|
|
1207
|
+
* `FieldSource` rung it came from (`"authored" | "default" | "blank"`). The
|
|
1208
|
+
* card body is a `body` sibling on its card, never a row in `fields`, and
|
|
1209
|
+
* `null` when the kind enables no body. Value and provenance only;
|
|
1210
|
+
* completeness stays `validate`'s.
|
|
1211
|
+
* @param {Document} doc
|
|
1212
|
+
* @returns {Resolved}
|
|
1213
|
+
*/
|
|
1214
|
+
_resolve(doc) {
|
|
1215
|
+
try {
|
|
1216
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1217
|
+
_assertClass(doc, Document);
|
|
1218
|
+
wasm.quill__resolve(retptr, this.__wbg_ptr, doc.__wbg_ptr);
|
|
1219
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1220
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1221
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1222
|
+
if (r2) {
|
|
1223
|
+
throw takeObject(r1);
|
|
1224
|
+
}
|
|
1225
|
+
return takeObject(r0);
|
|
1226
|
+
} finally {
|
|
1227
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1228
|
+
}
|
|
1229
|
+
}
|
|
1376
1230
|
/**
|
|
1377
1231
|
* The *declared* backend identifier (e.g. `"typst"`): intent, not a
|
|
1378
1232
|
* resolved capability. Capability is read from the engine.
|
|
@@ -1417,7 +1271,7 @@ export class Quill {
|
|
|
1417
1271
|
* Land `doc`'s declared content fields at their canonical rest **in
|
|
1418
1272
|
* place**, returning the `conform::*` diagnostics for values that would not
|
|
1419
1273
|
* commit. The read-repair verb for a document that arrived through the
|
|
1420
|
-
* transport door (`fromMarkdown`, `
|
|
1274
|
+
* transport door (`fromMarkdown`, `fromStored`, a stored row).
|
|
1421
1275
|
*
|
|
1422
1276
|
* Idempotent: an equal value is not rewritten, so YAML comments and stored
|
|
1423
1277
|
* bytes survive. A `!must_fill` marker anywhere in a field's value skips
|
|
@@ -1466,9 +1320,9 @@ export class Quill {
|
|
|
1466
1320
|
}
|
|
1467
1321
|
}
|
|
1468
1322
|
/**
|
|
1469
|
-
* Identity snapshot of the `quill:` section of `Quill.yaml
|
|
1470
|
-
*
|
|
1471
|
-
*
|
|
1323
|
+
* Identity snapshot of the `quill:` section of `Quill.yaml`. Pure config:
|
|
1324
|
+
* output formats are a resolved-backend capability read from
|
|
1325
|
+
* `Quillmark.supportedFormats`, not part of this.
|
|
1472
1326
|
* @returns {QuillMetadata}
|
|
1473
1327
|
*/
|
|
1474
1328
|
get metadata() {
|
|
@@ -1517,31 +1371,6 @@ export class Quill {
|
|
|
1517
1371
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1518
1372
|
}
|
|
1519
1373
|
}
|
|
1520
|
-
/**
|
|
1521
|
-
* The resolved-value view of `doc`: for every declared field, the value the
|
|
1522
|
-
* render projection would use and the `FieldSource` rung it came from
|
|
1523
|
-
* (`"authored" | "default" | "blank"`). The card body is a `body` sibling on
|
|
1524
|
-
* its card, never a row in `fields`, and `null` when the kind enables no
|
|
1525
|
-
* body. Value and provenance only; completeness stays `validate`'s.
|
|
1526
|
-
* @param {Document} doc
|
|
1527
|
-
* @returns {Resolved}
|
|
1528
|
-
*/
|
|
1529
|
-
resolve(doc) {
|
|
1530
|
-
try {
|
|
1531
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1532
|
-
_assertClass(doc, Document);
|
|
1533
|
-
wasm.quill_resolve(retptr, this.__wbg_ptr, doc.__wbg_ptr);
|
|
1534
|
-
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1535
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1536
|
-
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1537
|
-
if (r2) {
|
|
1538
|
-
throw takeObject(r1);
|
|
1539
|
-
}
|
|
1540
|
-
return takeObject(r0);
|
|
1541
|
-
} finally {
|
|
1542
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1543
|
-
}
|
|
1544
|
-
}
|
|
1545
1374
|
/**
|
|
1546
1375
|
* Document schema for the quill: the user-fillable fields plus their `ui`
|
|
1547
1376
|
* hints. Key order in `fields`/`properties` is declaration order, the
|
|
@@ -1630,8 +1459,8 @@ export class Quill {
|
|
|
1630
1459
|
*
|
|
1631
1460
|
* This is how a quill crosses a WASM linear-memory boundary as data: a
|
|
1632
1461
|
* `Quill` built in one build cannot be passed to an engine in another, so
|
|
1633
|
-
* `@quillmark/wasm
|
|
1634
|
-
* `Quill.fromTree` on demand.
|
|
1462
|
+
* the `@quillmark/wasm` runtime layer re-feeds this tree to the backend
|
|
1463
|
+
* build's `Quill.fromTree` on demand.
|
|
1635
1464
|
* @returns {Map<string, Uint8Array>}
|
|
1636
1465
|
*/
|
|
1637
1466
|
toTree() {
|
|
@@ -1662,6 +1491,27 @@ export class Quill {
|
|
|
1662
1491
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1663
1492
|
}
|
|
1664
1493
|
}
|
|
1494
|
+
/**
|
|
1495
|
+
* The advisory diagnostics of the load that produced this quill: what is
|
|
1496
|
+
* wrong with it short of refusing it. A quill that loads clean answers
|
|
1497
|
+
* `[]`.
|
|
1498
|
+
* @returns {Diagnostic[]}
|
|
1499
|
+
*/
|
|
1500
|
+
get warnings() {
|
|
1501
|
+
try {
|
|
1502
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1503
|
+
wasm.quill_warnings(retptr, this.__wbg_ptr);
|
|
1504
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1505
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1506
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1507
|
+
if (r2) {
|
|
1508
|
+
throw takeObject(r1);
|
|
1509
|
+
}
|
|
1510
|
+
return takeObject(r0);
|
|
1511
|
+
} finally {
|
|
1512
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1513
|
+
}
|
|
1514
|
+
}
|
|
1665
1515
|
}
|
|
1666
1516
|
if (Symbol.dispose) Quill.prototype[Symbol.dispose] = Quill.prototype.free;
|
|
1667
1517
|
|
|
@@ -1696,6 +1546,44 @@ export function exportMarkdown(rt) {
|
|
|
1696
1546
|
}
|
|
1697
1547
|
}
|
|
1698
1548
|
|
|
1549
|
+
/**
|
|
1550
|
+
* Render a diagnostic as the CLI and Python's `str(diagnostic)` render it:
|
|
1551
|
+
* the severity tag and the message, the code parenthesised after them, then
|
|
1552
|
+
* location, path and hint each on an indented line of its own. The engine
|
|
1553
|
+
* owns the one printer, so a consumer surfacing diagnostics reads it here
|
|
1554
|
+
* rather than keeping a copy of the layout that drifts from the CLI's.
|
|
1555
|
+
*
|
|
1556
|
+
* Takes the `Diagnostic` shape every read hands back. Throws on a value that
|
|
1557
|
+
* is not one — a missing `severity` or `message`, or a `severity` outside the
|
|
1558
|
+
* two-value ladder.
|
|
1559
|
+
* @param {Diagnostic} diagnostic
|
|
1560
|
+
* @returns {string}
|
|
1561
|
+
*/
|
|
1562
|
+
export function formatDiagnostic(diagnostic) {
|
|
1563
|
+
let deferred2_0;
|
|
1564
|
+
let deferred2_1;
|
|
1565
|
+
try {
|
|
1566
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1567
|
+
wasm.formatDiagnostic(retptr, addHeapObject(diagnostic));
|
|
1568
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1569
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1570
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1571
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
1572
|
+
var ptr1 = r0;
|
|
1573
|
+
var len1 = r1;
|
|
1574
|
+
if (r3) {
|
|
1575
|
+
ptr1 = 0; len1 = 0;
|
|
1576
|
+
throw takeObject(r2);
|
|
1577
|
+
}
|
|
1578
|
+
deferred2_0 = ptr1;
|
|
1579
|
+
deferred2_1 = len1;
|
|
1580
|
+
return getStringFromWasm0(ptr1, len1);
|
|
1581
|
+
} finally {
|
|
1582
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1583
|
+
wasm.__wbindgen_export4(deferred2_0, deferred2_1, 1);
|
|
1584
|
+
}
|
|
1585
|
+
}
|
|
1586
|
+
|
|
1699
1587
|
/**
|
|
1700
1588
|
* Serialize structured [`DocPathSeg`] segments back to the canonical path
|
|
1701
1589
|
* string: the inverse of `parseDocPath`. Throws on a segment array the
|
|
@@ -1880,11 +1768,11 @@ export function start() {
|
|
|
1880
1768
|
function __wbg_get_imports() {
|
|
1881
1769
|
const import0 = {
|
|
1882
1770
|
__proto__: null,
|
|
1883
|
-
|
|
1771
|
+
__wbg_Error_67e7344beaa85059: function(arg0, arg1) {
|
|
1884
1772
|
const ret = Error(getStringFromWasm0(arg0, arg1));
|
|
1885
1773
|
return addHeapObject(ret);
|
|
1886
1774
|
},
|
|
1887
|
-
|
|
1775
|
+
__wbg_Number_c54e7112a3fa7e3e: function(arg0) {
|
|
1888
1776
|
const ret = Number(getObject(arg0));
|
|
1889
1777
|
return ret;
|
|
1890
1778
|
},
|
|
@@ -1895,68 +1783,68 @@ function __wbg_get_imports() {
|
|
|
1895
1783
|
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
1896
1784
|
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
1897
1785
|
},
|
|
1898
|
-
|
|
1786
|
+
__wbg___wbindgen_bigint_get_as_i64_b482365c149396c8: function(arg0, arg1) {
|
|
1899
1787
|
const v = getObject(arg1);
|
|
1900
1788
|
const ret = typeof(v) === 'bigint' ? v : undefined;
|
|
1901
1789
|
getDataViewMemory0().setBigInt64(arg0 + 8 * 1, isLikeNone(ret) ? BigInt(0) : ret, true);
|
|
1902
1790
|
getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
|
|
1903
1791
|
},
|
|
1904
|
-
|
|
1792
|
+
__wbg___wbindgen_boolean_get_7a12af2b3f899c5a: function(arg0) {
|
|
1905
1793
|
const v = getObject(arg0);
|
|
1906
1794
|
const ret = typeof(v) === 'boolean' ? v : undefined;
|
|
1907
1795
|
return isLikeNone(ret) ? 0xFFFFFF : ret ? 1 : 0;
|
|
1908
1796
|
},
|
|
1909
|
-
|
|
1797
|
+
__wbg___wbindgen_debug_string_0e68cf47c9cbd9b0: function(arg0, arg1) {
|
|
1910
1798
|
const ret = debugString(getObject(arg1));
|
|
1911
1799
|
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1912
1800
|
const len1 = WASM_VECTOR_LEN;
|
|
1913
1801
|
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
1914
1802
|
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
1915
1803
|
},
|
|
1916
|
-
|
|
1804
|
+
__wbg___wbindgen_in_50072d4d6e45c193: function(arg0, arg1) {
|
|
1917
1805
|
const ret = getObject(arg0) in getObject(arg1);
|
|
1918
1806
|
return ret;
|
|
1919
1807
|
},
|
|
1920
|
-
|
|
1808
|
+
__wbg___wbindgen_is_bigint_60fc0336cb14f5d7: function(arg0) {
|
|
1921
1809
|
const ret = typeof(getObject(arg0)) === 'bigint';
|
|
1922
1810
|
return ret;
|
|
1923
1811
|
},
|
|
1924
|
-
|
|
1812
|
+
__wbg___wbindgen_is_function_fcda5e3902d732fe: function(arg0) {
|
|
1925
1813
|
const ret = typeof(getObject(arg0)) === 'function';
|
|
1926
1814
|
return ret;
|
|
1927
1815
|
},
|
|
1928
|
-
|
|
1816
|
+
__wbg___wbindgen_is_null_5160b3e381865372: function(arg0) {
|
|
1929
1817
|
const ret = getObject(arg0) === null;
|
|
1930
1818
|
return ret;
|
|
1931
1819
|
},
|
|
1932
|
-
|
|
1820
|
+
__wbg___wbindgen_is_object_edb6b15aa3afe12e: function(arg0) {
|
|
1933
1821
|
const val = getObject(arg0);
|
|
1934
1822
|
const ret = typeof(val) === 'object' && val !== null;
|
|
1935
1823
|
return ret;
|
|
1936
1824
|
},
|
|
1937
|
-
|
|
1825
|
+
__wbg___wbindgen_is_string_c4f7cb494a2a21f1: function(arg0) {
|
|
1938
1826
|
const ret = typeof(getObject(arg0)) === 'string';
|
|
1939
1827
|
return ret;
|
|
1940
1828
|
},
|
|
1941
|
-
|
|
1829
|
+
__wbg___wbindgen_is_undefined_8c687d0b90d5b524: function(arg0) {
|
|
1942
1830
|
const ret = getObject(arg0) === undefined;
|
|
1943
1831
|
return ret;
|
|
1944
1832
|
},
|
|
1945
|
-
|
|
1833
|
+
__wbg___wbindgen_jsval_eq_9fdcd3c0a860dd3b: function(arg0, arg1) {
|
|
1946
1834
|
const ret = getObject(arg0) === getObject(arg1);
|
|
1947
1835
|
return ret;
|
|
1948
1836
|
},
|
|
1949
|
-
|
|
1837
|
+
__wbg___wbindgen_jsval_loose_eq_3c30021c243b64cd: function(arg0, arg1) {
|
|
1950
1838
|
const ret = getObject(arg0) == getObject(arg1);
|
|
1951
1839
|
return ret;
|
|
1952
1840
|
},
|
|
1953
|
-
|
|
1841
|
+
__wbg___wbindgen_number_get_1dc732b810cb937c: function(arg0, arg1) {
|
|
1954
1842
|
const obj = getObject(arg1);
|
|
1955
1843
|
const ret = typeof(obj) === 'number' ? obj : undefined;
|
|
1956
1844
|
getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
|
|
1957
1845
|
getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
|
|
1958
1846
|
},
|
|
1959
|
-
|
|
1847
|
+
__wbg___wbindgen_string_get_92ab86bb19cbc12f: function(arg0, arg1) {
|
|
1960
1848
|
const obj = getObject(arg1);
|
|
1961
1849
|
const ret = typeof(obj) === 'string' ? obj : undefined;
|
|
1962
1850
|
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
@@ -1964,26 +1852,26 @@ function __wbg_get_imports() {
|
|
|
1964
1852
|
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
1965
1853
|
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
1966
1854
|
},
|
|
1967
|
-
|
|
1855
|
+
__wbg___wbindgen_throw_5d9e815e6fdf150f: function(arg0, arg1) {
|
|
1968
1856
|
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
1969
1857
|
},
|
|
1970
|
-
|
|
1858
|
+
__wbg_call_269c5566fbede3eb: function() { return handleError(function (arg0, arg1) {
|
|
1971
1859
|
const ret = getObject(arg0).call(getObject(arg1));
|
|
1972
1860
|
return addHeapObject(ret);
|
|
1973
1861
|
}, arguments); },
|
|
1974
|
-
|
|
1862
|
+
__wbg_done_cffed884d87aa22e: function(arg0) {
|
|
1975
1863
|
const ret = getObject(arg0).done;
|
|
1976
1864
|
return ret;
|
|
1977
1865
|
},
|
|
1978
|
-
|
|
1866
|
+
__wbg_entries_20b9608d57d8ddd6: function(arg0) {
|
|
1979
1867
|
const ret = getObject(arg0).entries();
|
|
1980
1868
|
return addHeapObject(ret);
|
|
1981
1869
|
},
|
|
1982
|
-
|
|
1870
|
+
__wbg_entries_972a87586902cf87: function(arg0) {
|
|
1983
1871
|
const ret = Object.entries(getObject(arg0));
|
|
1984
1872
|
return addHeapObject(ret);
|
|
1985
1873
|
},
|
|
1986
|
-
|
|
1874
|
+
__wbg_error_757e9472f8410341: function(arg0, arg1) {
|
|
1987
1875
|
let deferred0_0;
|
|
1988
1876
|
let deferred0_1;
|
|
1989
1877
|
try {
|
|
@@ -1994,19 +1882,19 @@ function __wbg_get_imports() {
|
|
|
1994
1882
|
wasm.__wbindgen_export4(deferred0_0, deferred0_1, 1);
|
|
1995
1883
|
}
|
|
1996
1884
|
},
|
|
1997
|
-
|
|
1885
|
+
__wbg_from_a39669ce566077da: function(arg0) {
|
|
1998
1886
|
const ret = Array.from(getObject(arg0));
|
|
1999
1887
|
return addHeapObject(ret);
|
|
2000
1888
|
},
|
|
2001
|
-
|
|
1889
|
+
__wbg_get_6cf5a4d4d8ad3c5a: function() { return handleError(function (arg0, arg1) {
|
|
2002
1890
|
const ret = Reflect.get(getObject(arg0), getObject(arg1));
|
|
2003
1891
|
return addHeapObject(ret);
|
|
2004
1892
|
}, arguments); },
|
|
2005
|
-
|
|
1893
|
+
__wbg_get_b1f0ab13c737f856: function(arg0, arg1) {
|
|
2006
1894
|
const ret = getObject(arg0)[arg1 >>> 0];
|
|
2007
1895
|
return addHeapObject(ret);
|
|
2008
1896
|
},
|
|
2009
|
-
|
|
1897
|
+
__wbg_get_unchecked_363572bdd397d473: function(arg0, arg1) {
|
|
2010
1898
|
const ret = getObject(arg0)[arg1 >>> 0];
|
|
2011
1899
|
return addHeapObject(ret);
|
|
2012
1900
|
},
|
|
@@ -2014,7 +1902,7 @@ function __wbg_get_imports() {
|
|
|
2014
1902
|
const ret = getObject(arg0)[getObject(arg1)];
|
|
2015
1903
|
return addHeapObject(ret);
|
|
2016
1904
|
},
|
|
2017
|
-
|
|
1905
|
+
__wbg_instanceof_ArrayBuffer_d4ff01f8247925ae: function(arg0) {
|
|
2018
1906
|
let result;
|
|
2019
1907
|
try {
|
|
2020
1908
|
result = getObject(arg0) instanceof ArrayBuffer;
|
|
@@ -2024,7 +1912,7 @@ function __wbg_get_imports() {
|
|
|
2024
1912
|
const ret = result;
|
|
2025
1913
|
return ret;
|
|
2026
1914
|
},
|
|
2027
|
-
|
|
1915
|
+
__wbg_instanceof_Map_1ff6a2b54c899f0d: function(arg0) {
|
|
2028
1916
|
let result;
|
|
2029
1917
|
try {
|
|
2030
1918
|
result = getObject(arg0) instanceof Map;
|
|
@@ -2034,7 +1922,7 @@ function __wbg_get_imports() {
|
|
|
2034
1922
|
const ret = result;
|
|
2035
1923
|
return ret;
|
|
2036
1924
|
},
|
|
2037
|
-
|
|
1925
|
+
__wbg_instanceof_Object_87732cb922ac2e2c: function(arg0) {
|
|
2038
1926
|
let result;
|
|
2039
1927
|
try {
|
|
2040
1928
|
result = getObject(arg0) instanceof Object;
|
|
@@ -2044,7 +1932,7 @@ function __wbg_get_imports() {
|
|
|
2044
1932
|
const ret = result;
|
|
2045
1933
|
return ret;
|
|
2046
1934
|
},
|
|
2047
|
-
|
|
1935
|
+
__wbg_instanceof_Uint8Array_598adc0fef426aa8: function(arg0) {
|
|
2048
1936
|
let result;
|
|
2049
1937
|
try {
|
|
2050
1938
|
result = getObject(arg0) instanceof Uint8Array;
|
|
@@ -2054,31 +1942,31 @@ function __wbg_get_imports() {
|
|
|
2054
1942
|
const ret = result;
|
|
2055
1943
|
return ret;
|
|
2056
1944
|
},
|
|
2057
|
-
|
|
1945
|
+
__wbg_isArray_5674713bb7b79043: function(arg0) {
|
|
2058
1946
|
const ret = Array.isArray(getObject(arg0));
|
|
2059
1947
|
return ret;
|
|
2060
1948
|
},
|
|
2061
|
-
|
|
1949
|
+
__wbg_isSafeInteger_8f51c743827d1ec5: function(arg0) {
|
|
2062
1950
|
const ret = Number.isSafeInteger(getObject(arg0));
|
|
2063
1951
|
return ret;
|
|
2064
1952
|
},
|
|
2065
|
-
|
|
1953
|
+
__wbg_iterator_22ddeb808cf55a6f: function() {
|
|
2066
1954
|
const ret = Symbol.iterator;
|
|
2067
1955
|
return addHeapObject(ret);
|
|
2068
1956
|
},
|
|
2069
|
-
|
|
1957
|
+
__wbg_keys_6efc298980178da1: function(arg0) {
|
|
2070
1958
|
const ret = Object.keys(getObject(arg0));
|
|
2071
1959
|
return addHeapObject(ret);
|
|
2072
1960
|
},
|
|
2073
|
-
|
|
1961
|
+
__wbg_length_31bdaf014f5fbde2: function(arg0) {
|
|
2074
1962
|
const ret = getObject(arg0).length;
|
|
2075
1963
|
return ret;
|
|
2076
1964
|
},
|
|
2077
|
-
|
|
1965
|
+
__wbg_length_4e1adc0d42e23620: function(arg0) {
|
|
2078
1966
|
const ret = getObject(arg0).length;
|
|
2079
1967
|
return ret;
|
|
2080
1968
|
},
|
|
2081
|
-
|
|
1969
|
+
__wbg_new_1da3429bc3c4541c: function(arg0) {
|
|
2082
1970
|
const ret = new Uint8Array(getObject(arg0));
|
|
2083
1971
|
return addHeapObject(ret);
|
|
2084
1972
|
},
|
|
@@ -2086,48 +1974,48 @@ function __wbg_get_imports() {
|
|
|
2086
1974
|
const ret = new Error();
|
|
2087
1975
|
return addHeapObject(ret);
|
|
2088
1976
|
},
|
|
2089
|
-
|
|
1977
|
+
__wbg_new_8d36e20aa758e411: function() {
|
|
2090
1978
|
const ret = new Map();
|
|
2091
1979
|
return addHeapObject(ret);
|
|
2092
1980
|
},
|
|
2093
|
-
|
|
1981
|
+
__wbg_new_a32a1ab6c6655abe: function(arg0, arg1) {
|
|
2094
1982
|
const ret = new Error(getStringFromWasm0(arg0, arg1));
|
|
2095
1983
|
return addHeapObject(ret);
|
|
2096
1984
|
},
|
|
2097
|
-
|
|
2098
|
-
const ret = new
|
|
1985
|
+
__wbg_new_bebc3f4757acf305: function() {
|
|
1986
|
+
const ret = new Object();
|
|
2099
1987
|
return addHeapObject(ret);
|
|
2100
1988
|
},
|
|
2101
|
-
|
|
2102
|
-
const ret = new
|
|
1989
|
+
__wbg_new_ffa92086ea89f79c: function() {
|
|
1990
|
+
const ret = new Array();
|
|
2103
1991
|
return addHeapObject(ret);
|
|
2104
1992
|
},
|
|
2105
|
-
|
|
1993
|
+
__wbg_new_from_slice_4ee02165f9de919e: function(arg0, arg1) {
|
|
2106
1994
|
const ret = new Uint8Array(getArrayU8FromWasm0(arg0, arg1));
|
|
2107
1995
|
return addHeapObject(ret);
|
|
2108
1996
|
},
|
|
2109
|
-
|
|
2110
|
-
const ret = getObject(arg0).next();
|
|
2111
|
-
return addHeapObject(ret);
|
|
2112
|
-
}, arguments); },
|
|
2113
|
-
__wbg_next_7646edaa39458ef7: function(arg0) {
|
|
1997
|
+
__wbg_next_95053e306b1c3aed: function(arg0) {
|
|
2114
1998
|
const ret = getObject(arg0).next;
|
|
2115
1999
|
return addHeapObject(ret);
|
|
2116
2000
|
},
|
|
2117
|
-
|
|
2001
|
+
__wbg_next_f31ecb8646d2c605: function() { return handleError(function (arg0) {
|
|
2002
|
+
const ret = getObject(arg0).next();
|
|
2003
|
+
return addHeapObject(ret);
|
|
2004
|
+
}, arguments); },
|
|
2005
|
+
__wbg_prototypesetcall_ae9f5e7459250748: function(arg0, arg1, arg2) {
|
|
2118
2006
|
Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), getObject(arg2));
|
|
2119
2007
|
},
|
|
2120
|
-
|
|
2121
|
-
const ret = Reflect.set(getObject(arg0), getObject(arg1), getObject(arg2));
|
|
2122
|
-
return ret;
|
|
2123
|
-
}, arguments); },
|
|
2124
|
-
__wbg_set_3bf1de9fab0cd644: function(arg0, arg1, arg2) {
|
|
2008
|
+
__wbg_set_13d25b81ab403f5e: function(arg0, arg1, arg2) {
|
|
2125
2009
|
getObject(arg0)[arg1 >>> 0] = takeObject(arg2);
|
|
2126
2010
|
},
|
|
2127
2011
|
__wbg_set_6be42768c690e380: function(arg0, arg1, arg2) {
|
|
2128
2012
|
getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
|
|
2129
2013
|
},
|
|
2130
|
-
|
|
2014
|
+
__wbg_set_a377297433dfea63: function() { return handleError(function (arg0, arg1, arg2) {
|
|
2015
|
+
const ret = Reflect.set(getObject(arg0), getObject(arg1), getObject(arg2));
|
|
2016
|
+
return ret;
|
|
2017
|
+
}, arguments); },
|
|
2018
|
+
__wbg_set_bf6dde4923b9b059: function(arg0, arg1, arg2) {
|
|
2131
2019
|
const ret = getObject(arg0).set(getObject(arg1), getObject(arg2));
|
|
2132
2020
|
return addHeapObject(ret);
|
|
2133
2021
|
},
|
|
@@ -2138,34 +2026,34 @@ function __wbg_get_imports() {
|
|
|
2138
2026
|
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
2139
2027
|
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
2140
2028
|
},
|
|
2141
|
-
|
|
2029
|
+
__wbg_value_c227f843d21da141: function(arg0) {
|
|
2142
2030
|
const ret = getObject(arg0).value;
|
|
2143
2031
|
return addHeapObject(ret);
|
|
2144
2032
|
},
|
|
2145
|
-
|
|
2146
|
-
const ret = getObject(arg0)
|
|
2033
|
+
__wbg_values_220548effc36d1d3: function(arg0) {
|
|
2034
|
+
const ret = Object.values(getObject(arg0));
|
|
2147
2035
|
return addHeapObject(ret);
|
|
2148
2036
|
},
|
|
2149
|
-
|
|
2150
|
-
const ret =
|
|
2037
|
+
__wbg_values_85d5bcf6f1ca8248: function(arg0) {
|
|
2038
|
+
const ret = getObject(arg0).values();
|
|
2151
2039
|
return addHeapObject(ret);
|
|
2152
2040
|
},
|
|
2153
|
-
|
|
2041
|
+
__wbindgen_generic_0000000000000001: function(arg0) {
|
|
2154
2042
|
// Cast intrinsic for `F64 -> Externref`.
|
|
2155
2043
|
const ret = arg0;
|
|
2156
2044
|
return addHeapObject(ret);
|
|
2157
2045
|
},
|
|
2158
|
-
|
|
2046
|
+
__wbindgen_generic_0000000000000002: function(arg0) {
|
|
2159
2047
|
// Cast intrinsic for `I64 -> Externref`.
|
|
2160
2048
|
const ret = arg0;
|
|
2161
2049
|
return addHeapObject(ret);
|
|
2162
2050
|
},
|
|
2163
|
-
|
|
2051
|
+
__wbindgen_generic_0000000000000003: function(arg0, arg1) {
|
|
2164
2052
|
// Cast intrinsic for `Ref(String) -> Externref`.
|
|
2165
2053
|
const ret = getStringFromWasm0(arg0, arg1);
|
|
2166
2054
|
return addHeapObject(ret);
|
|
2167
2055
|
},
|
|
2168
|
-
|
|
2056
|
+
__wbindgen_generic_0000000000000004: function(arg0) {
|
|
2169
2057
|
// Cast intrinsic for `U64 -> Externref`.
|
|
2170
2058
|
const ret = BigInt.asUintN(64, arg0);
|
|
2171
2059
|
return addHeapObject(ret);
|
|
@@ -2186,10 +2074,10 @@ function __wbg_get_imports() {
|
|
|
2186
2074
|
|
|
2187
2075
|
const DocumentFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
2188
2076
|
? { register: () => {}, unregister: () => {} }
|
|
2189
|
-
: new FinalizationRegistry(ptr => wasm.__wbg_document_free(ptr
|
|
2077
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_document_free(ptr, 1));
|
|
2190
2078
|
const QuillFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
2191
2079
|
? { register: () => {}, unregister: () => {} }
|
|
2192
|
-
: new FinalizationRegistry(ptr => wasm.__wbg_quill_free(ptr
|
|
2080
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_quill_free(ptr, 1));
|
|
2193
2081
|
|
|
2194
2082
|
function addHeapObject(obj) {
|
|
2195
2083
|
if (heap_next === heap.length) heap.push(heap.length + 1);
|
|
@@ -2291,8 +2179,7 @@ function getDataViewMemory0() {
|
|
|
2291
2179
|
}
|
|
2292
2180
|
|
|
2293
2181
|
function getStringFromWasm0(ptr, len) {
|
|
2294
|
-
|
|
2295
|
-
return decodeText(ptr, len);
|
|
2182
|
+
return decodeText(ptr >>> 0, len);
|
|
2296
2183
|
}
|
|
2297
2184
|
|
|
2298
2185
|
let cachedUint8ArrayMemory0 = null;
|
|
@@ -2394,8 +2281,9 @@ if (!('encodeInto' in cachedTextEncoder)) {
|
|
|
2394
2281
|
|
|
2395
2282
|
let WASM_VECTOR_LEN = 0;
|
|
2396
2283
|
|
|
2397
|
-
let wasmModule, wasm;
|
|
2284
|
+
let wasmModule, wasmInstance, wasm;
|
|
2398
2285
|
function __wbg_finalize_init(instance, module) {
|
|
2286
|
+
wasmInstance = instance;
|
|
2399
2287
|
wasm = instance.exports;
|
|
2400
2288
|
wasmModule = module;
|
|
2401
2289
|
cachedDataViewMemory0 = null;
|
|
@@ -2406,11 +2294,15 @@ function __wbg_finalize_init(instance, module) {
|
|
|
2406
2294
|
|
|
2407
2295
|
async function __wbg_load(module, imports) {
|
|
2408
2296
|
if (typeof Response === 'function' && module instanceof Response) {
|
|
2297
|
+
if (!module.ok) {
|
|
2298
|
+
throw new Error(`failed to fetch Wasm: ${module.status} ${module.statusText} fetching '${module.url}'`);
|
|
2299
|
+
}
|
|
2300
|
+
|
|
2409
2301
|
if (typeof WebAssembly.instantiateStreaming === 'function') {
|
|
2410
2302
|
try {
|
|
2411
2303
|
return await WebAssembly.instantiateStreaming(module, imports);
|
|
2412
2304
|
} catch (e) {
|
|
2413
|
-
const validResponse =
|
|
2305
|
+
const validResponse = expectedResponseType(module.type);
|
|
2414
2306
|
|
|
2415
2307
|
if (validResponse && module.headers.get('Content-Type') !== 'application/wasm') {
|
|
2416
2308
|
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);
|