@quillmark/wasm 0.133.0 → 0.134.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 +344 -0
- package/README.md +19 -76
- package/THIRD_PARTY_LICENSES.md +443 -103
- package/core/wasm.d.ts +467 -390
- package/core/wasm.js +612 -226
- package/core/wasm_bg.wasm +0 -0
- package/core/wasm_bg.wasm.d.ts +25 -12
- package/package.json +1 -1
- package/render/wasm.d.ts +480 -406
- package/render/wasm.js +620 -252
- package/render/wasm_bg.wasm +0 -0
- package/render/wasm_bg.wasm.d.ts +25 -13
- package/runtime/runtime.d.ts +80 -120
- package/runtime/runtime.js +52 -136
- package/sbom.cdx.json +337 -542
package/render/wasm.js
CHANGED
|
@@ -100,9 +100,9 @@ export class Document {
|
|
|
100
100
|
/**
|
|
101
101
|
* Batched twin of [`commitField`](Document::commit_field): typed-commit
|
|
102
102
|
* several fields on the card `addr` targets atomically. `addr` is a **card
|
|
103
|
-
* address** (absent = main; a present `field` throws).
|
|
104
|
-
*
|
|
105
|
-
*
|
|
103
|
+
* address** (absent = main; a present `field` throws). Nothing is
|
|
104
|
+
* applied on error, and the thrown error carries one `diagnostics` entry per
|
|
105
|
+
* offending field, including
|
|
106
106
|
* `edit::unknown_field` for undeclared names. Throws on an out-of-range
|
|
107
107
|
* card. Returns [`commitField`](Document::commit_field)'s warnings for
|
|
108
108
|
* every field, in batch order.
|
|
@@ -127,6 +127,73 @@ export class Document {
|
|
|
127
127
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
128
128
|
}
|
|
129
129
|
}
|
|
130
|
+
/**
|
|
131
|
+
* The ABI under `writer.hashAt`: the body's hash, or a field's through its
|
|
132
|
+
* schema (a `richtext` field its content however it rests, a `text` field
|
|
133
|
+
* its literal text, any other type its stored value), the `baseHash` the
|
|
134
|
+
* writer's `reviseBody` / `reviseField` check. An undeclared name throws
|
|
135
|
+
* `edit::unknown_field`, an out-of-range card throws.
|
|
136
|
+
* @param {Quill} quill
|
|
137
|
+
* @param {Addr | string} addr
|
|
138
|
+
* @returns {string}
|
|
139
|
+
*/
|
|
140
|
+
_hashAt(quill, addr) {
|
|
141
|
+
let deferred2_0;
|
|
142
|
+
let deferred2_1;
|
|
143
|
+
try {
|
|
144
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
145
|
+
_assertClass(quill, Quill);
|
|
146
|
+
wasm.document__hashAt(retptr, this.__wbg_ptr, quill.__wbg_ptr, addHeapObject(addr));
|
|
147
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
148
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
149
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
150
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
151
|
+
var ptr1 = r0;
|
|
152
|
+
var len1 = r1;
|
|
153
|
+
if (r3) {
|
|
154
|
+
ptr1 = 0; len1 = 0;
|
|
155
|
+
throw takeObject(r2);
|
|
156
|
+
}
|
|
157
|
+
deferred2_0 = ptr1;
|
|
158
|
+
deferred2_1 = len1;
|
|
159
|
+
return getStringFromWasm0(ptr1, len1);
|
|
160
|
+
} finally {
|
|
161
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
162
|
+
wasm.__wbindgen_export4(deferred2_0, deferred2_1, 1);
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* The ABI under `writer.hash`: the hash of the document as `quill`
|
|
167
|
+
* conforms it, the `baseHash` `writer.reviseDocument` checks. Throws when
|
|
168
|
+
* the document declares a `$quill` this quill does not answer to.
|
|
169
|
+
* @param {Quill} quill
|
|
170
|
+
* @returns {string}
|
|
171
|
+
*/
|
|
172
|
+
_hash(quill) {
|
|
173
|
+
let deferred2_0;
|
|
174
|
+
let deferred2_1;
|
|
175
|
+
try {
|
|
176
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
177
|
+
_assertClass(quill, Quill);
|
|
178
|
+
wasm.document__hash(retptr, this.__wbg_ptr, quill.__wbg_ptr);
|
|
179
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
180
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
181
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
182
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
183
|
+
var ptr1 = r0;
|
|
184
|
+
var len1 = r1;
|
|
185
|
+
if (r3) {
|
|
186
|
+
ptr1 = 0; len1 = 0;
|
|
187
|
+
throw takeObject(r2);
|
|
188
|
+
}
|
|
189
|
+
deferred2_0 = ptr1;
|
|
190
|
+
deferred2_1 = len1;
|
|
191
|
+
return getStringFromWasm0(ptr1, len1);
|
|
192
|
+
} finally {
|
|
193
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
194
|
+
wasm.__wbindgen_export4(deferred2_0, deferred2_1, 1);
|
|
195
|
+
}
|
|
196
|
+
}
|
|
130
197
|
/**
|
|
131
198
|
* Interpreted **`Content`** read of a value nested inside the composite
|
|
132
199
|
* field at `addr`: the stable ABI under the runtime `reader.getContentAt`,
|
|
@@ -249,15 +316,16 @@ export class Document {
|
|
|
249
316
|
* does not answer to, before any mutation.
|
|
250
317
|
* @param {Quill} quill
|
|
251
318
|
* @param {string} markdown
|
|
319
|
+
* @param {any} opts
|
|
252
320
|
* @returns {DocumentRevised}
|
|
253
321
|
*/
|
|
254
|
-
_reviseDocument(quill, markdown) {
|
|
322
|
+
_reviseDocument(quill, markdown, opts) {
|
|
255
323
|
try {
|
|
256
324
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
257
325
|
_assertClass(quill, Quill);
|
|
258
326
|
const ptr0 = passStringToWasm0(markdown, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
259
327
|
const len0 = WASM_VECTOR_LEN;
|
|
260
|
-
wasm.document__reviseDocument(retptr, this.__wbg_ptr, quill.__wbg_ptr, ptr0, len0);
|
|
328
|
+
wasm.document__reviseDocument(retptr, this.__wbg_ptr, quill.__wbg_ptr, ptr0, len0, addHeapObject(opts));
|
|
261
329
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
262
330
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
263
331
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
@@ -284,15 +352,16 @@ export class Document {
|
|
|
284
352
|
* @param {Quill} quill
|
|
285
353
|
* @param {Addr | string} addr
|
|
286
354
|
* @param {string} text
|
|
355
|
+
* @param {any} opts
|
|
287
356
|
* @returns {Revised}
|
|
288
357
|
*/
|
|
289
|
-
_reviseField(quill, addr, text) {
|
|
358
|
+
_reviseField(quill, addr, text, opts) {
|
|
290
359
|
try {
|
|
291
360
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
292
361
|
_assertClass(quill, Quill);
|
|
293
362
|
const ptr0 = passStringToWasm0(text, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
294
363
|
const len0 = WASM_VECTOR_LEN;
|
|
295
|
-
wasm.document__reviseField(retptr, this.__wbg_ptr, quill.__wbg_ptr, addHeapObject(addr), ptr0, len0);
|
|
364
|
+
wasm.document__reviseField(retptr, this.__wbg_ptr, quill.__wbg_ptr, addHeapObject(addr), ptr0, len0, addHeapObject(opts));
|
|
296
365
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
297
366
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
298
367
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
@@ -305,32 +374,166 @@ export class Document {
|
|
|
305
374
|
}
|
|
306
375
|
}
|
|
307
376
|
/**
|
|
308
|
-
*
|
|
309
|
-
*
|
|
310
|
-
*
|
|
311
|
-
*
|
|
312
|
-
*
|
|
313
|
-
* `
|
|
377
|
+
* The ABI under `writer.reviseBody`: **revise** the richtext value at
|
|
378
|
+
* `addr` from a markdown string. Imports the markdown, diffs it against the current
|
|
379
|
+
* value, rebases surviving identity anchors, and returns the `Revised`
|
|
380
|
+
* receipt: the text `delta` an editor bridge maps its own positions through,
|
|
381
|
+
* and a `parse::dropped_construct` warning per construct the
|
|
382
|
+
* import dropped, its `path` the address written. An absent `addr.field`
|
|
383
|
+
* targets the body, an absent `addr.card` the main card; an absent field
|
|
384
|
+
* cold-imports from empty.
|
|
314
385
|
*
|
|
315
|
-
*
|
|
316
|
-
*
|
|
317
|
-
*
|
|
386
|
+
* `opts` names what the writer read (`BaseOptions`): a stale `baseHash`
|
|
387
|
+
* throws `edit::stale_base`, and a `baseMarkdown` the value has moved on
|
|
388
|
+
* from merges, throwing `edit::rebase_conflict` where both changed a line.
|
|
318
389
|
*
|
|
319
|
-
*
|
|
320
|
-
*
|
|
321
|
-
* building `markOps` need not predict it.
|
|
390
|
+
* Throws on an out-of-range card, a malformed field name, a present
|
|
391
|
+
* non-content field value, or an over-nested markdown input.
|
|
322
392
|
* @param {Addr | string} addr
|
|
323
|
-
* @param {
|
|
393
|
+
* @param {string} markdown
|
|
394
|
+
* @param {BaseOptions} [opts]
|
|
395
|
+
* @returns {Revised}
|
|
324
396
|
*/
|
|
325
|
-
|
|
397
|
+
_revise(addr, markdown, opts) {
|
|
326
398
|
try {
|
|
327
399
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
328
|
-
|
|
400
|
+
const ptr0 = passStringToWasm0(markdown, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
401
|
+
const len0 = WASM_VECTOR_LEN;
|
|
402
|
+
wasm.document__revise(retptr, this.__wbg_ptr, addHeapObject(addr), ptr0, len0, addHeapObject(opts));
|
|
329
403
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
330
404
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
331
|
-
|
|
332
|
-
|
|
405
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
406
|
+
if (r2) {
|
|
407
|
+
throw takeObject(r1);
|
|
408
|
+
}
|
|
409
|
+
return takeObject(r0);
|
|
410
|
+
} finally {
|
|
411
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
412
|
+
}
|
|
413
|
+
}
|
|
414
|
+
/**
|
|
415
|
+
* The context of the anchor `id`, or `undefined` where no body or
|
|
416
|
+
* content value holds one.
|
|
417
|
+
* @param {string} id
|
|
418
|
+
* @returns {AnchorContext | undefined}
|
|
419
|
+
*/
|
|
420
|
+
anchorContext(id) {
|
|
421
|
+
try {
|
|
422
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
423
|
+
const ptr0 = passStringToWasm0(id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
424
|
+
const len0 = WASM_VECTOR_LEN;
|
|
425
|
+
wasm.document_anchorContext(retptr, this.__wbg_ptr, ptr0, len0);
|
|
426
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
427
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
428
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
429
|
+
if (r2) {
|
|
430
|
+
throw takeObject(r1);
|
|
431
|
+
}
|
|
432
|
+
return takeObject(r0);
|
|
433
|
+
} finally {
|
|
434
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
435
|
+
}
|
|
436
|
+
}
|
|
437
|
+
/**
|
|
438
|
+
* Every anchor of every body and content value with its context, a table
|
|
439
|
+
* cell's or a note's included, in the order `toAnnotatedMarkdown` lists
|
|
440
|
+
* anchors: the selector a host stores beside a comment thread and hands
|
|
441
|
+
* back to `reattach`.
|
|
442
|
+
* @returns {AnchorContext[]}
|
|
443
|
+
*/
|
|
444
|
+
anchorContexts() {
|
|
445
|
+
try {
|
|
446
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
447
|
+
wasm.document_anchorContexts(retptr, this.__wbg_ptr);
|
|
448
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
449
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
450
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
451
|
+
if (r2) {
|
|
452
|
+
throw takeObject(r1);
|
|
453
|
+
}
|
|
454
|
+
return takeObject(r0);
|
|
455
|
+
} finally {
|
|
456
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
457
|
+
}
|
|
458
|
+
}
|
|
459
|
+
/**
|
|
460
|
+
* The annotated read of the body or richtext field at `addr` alone: the
|
|
461
|
+
* scoped twin of `toAnnotatedMarkdown`, what a revise at `addr` reads
|
|
462
|
+
* back and the `baseMarkdown` it merges against. Each anchor names `addr`'s
|
|
463
|
+
* path. An absent field reads as the empty content. Throws as `hashAt`.
|
|
464
|
+
* @param {Addr | string} addr
|
|
465
|
+
* @returns {AnnotatedMarkdown}
|
|
466
|
+
*/
|
|
467
|
+
annotatedAt(addr) {
|
|
468
|
+
try {
|
|
469
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
470
|
+
wasm.document_annotatedAt(retptr, this.__wbg_ptr, addHeapObject(addr));
|
|
471
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
472
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
473
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
474
|
+
if (r2) {
|
|
475
|
+
throw takeObject(r1);
|
|
476
|
+
}
|
|
477
|
+
return takeObject(r0);
|
|
478
|
+
} finally {
|
|
479
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
480
|
+
}
|
|
481
|
+
}
|
|
482
|
+
/**
|
|
483
|
+
* The markdown at `addr` with a `qm-*` tag for each anchor and island id
|
|
484
|
+
* its lines can hold: what `revise` reads back. Throws as `read`.
|
|
485
|
+
* @param {Addr | string} addr
|
|
486
|
+
* @returns {string}
|
|
487
|
+
*/
|
|
488
|
+
annotated(addr) {
|
|
489
|
+
let deferred2_0;
|
|
490
|
+
let deferred2_1;
|
|
491
|
+
try {
|
|
492
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
493
|
+
wasm.document_annotated(retptr, this.__wbg_ptr, addHeapObject(addr));
|
|
494
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
495
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
496
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
497
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
498
|
+
var ptr1 = r0;
|
|
499
|
+
var len1 = r1;
|
|
500
|
+
if (r3) {
|
|
501
|
+
ptr1 = 0; len1 = 0;
|
|
502
|
+
throw takeObject(r2);
|
|
333
503
|
}
|
|
504
|
+
deferred2_0 = ptr1;
|
|
505
|
+
deferred2_1 = len1;
|
|
506
|
+
return getStringFromWasm0(ptr1, len1);
|
|
507
|
+
} finally {
|
|
508
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
509
|
+
wasm.__wbindgen_export4(deferred2_0, deferred2_1, 1);
|
|
510
|
+
}
|
|
511
|
+
}
|
|
512
|
+
/**
|
|
513
|
+
* **Apply** `change` to the value at `addr`, all its steps or none, and
|
|
514
|
+
* answer the `Receipt`. `opts.base` is the hash the writer read
|
|
515
|
+
* (`hash(addr)`), and the change's offsets are into the value it names:
|
|
516
|
+
* one the value has moved on from rebases the change over the change
|
|
517
|
+
* since, throwing `edit::rebase_conflict` where they touch the same text or
|
|
518
|
+
* record and `edit::stale_base` where the document no longer holds the change
|
|
519
|
+
* since. A refused change throws `edit::content_apply` and writes
|
|
520
|
+
* nothing.
|
|
521
|
+
* @param {Addr | string} addr
|
|
522
|
+
* @param {Change} change
|
|
523
|
+
* @param {WriteOptions} [opts]
|
|
524
|
+
* @returns {Receipt}
|
|
525
|
+
*/
|
|
526
|
+
apply(addr, change, opts) {
|
|
527
|
+
try {
|
|
528
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
529
|
+
wasm.document_apply(retptr, this.__wbg_ptr, addHeapObject(addr), addHeapObject(change), addHeapObject(opts));
|
|
530
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
531
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
532
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
533
|
+
if (r2) {
|
|
534
|
+
throw takeObject(r1);
|
|
535
|
+
}
|
|
536
|
+
return takeObject(r0);
|
|
334
537
|
} finally {
|
|
335
538
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
336
539
|
}
|
|
@@ -442,11 +645,10 @@ export class Document {
|
|
|
442
645
|
}
|
|
443
646
|
/**
|
|
444
647
|
* The newest storage version this build writes via
|
|
445
|
-
* [`toStored`](Document::to_stored): a document
|
|
446
|
-
*
|
|
447
|
-
* carries
|
|
448
|
-
*
|
|
449
|
-
* release.
|
|
648
|
+
* [`toStored`](Document::to_stored): a document holding a composable
|
|
649
|
+
* card, each carrying its `$id`, carries it. A document of the main card
|
|
650
|
+
* alone carries the oldest tag that holds its content. The tag advances
|
|
651
|
+
* only when the wire format changes, not on every release.
|
|
450
652
|
* @returns {string}
|
|
451
653
|
*/
|
|
452
654
|
static currentStorageVersion() {
|
|
@@ -499,7 +701,7 @@ export class Document {
|
|
|
499
701
|
}
|
|
500
702
|
/**
|
|
501
703
|
* Reconstruct a `Document` from a versioned storage DTO string produced by
|
|
502
|
-
* [`toStored`](Document::to_stored)
|
|
704
|
+
* [`toStored`](Document::to_stored), with no `warnings`.
|
|
503
705
|
* Throws if `json` is not a valid storage DTO (malformed JSON, unknown
|
|
504
706
|
* `schema`, missing fields, or unparseable quill reference).
|
|
505
707
|
* @param {string} json
|
|
@@ -582,88 +784,111 @@ export class Document {
|
|
|
582
784
|
}
|
|
583
785
|
}
|
|
584
786
|
/**
|
|
585
|
-
*
|
|
586
|
-
* `
|
|
587
|
-
*
|
|
588
|
-
* `
|
|
589
|
-
*
|
|
590
|
-
*
|
|
591
|
-
*
|
|
787
|
+
* The hash of the body or richtext field at `addr`, the `baseHash` a
|
|
788
|
+
* revise at `addr` checks: the hash of its content, an absent field the
|
|
789
|
+
* empty content. An absent `addr.field` reads the body, an absent
|
|
790
|
+
* `addr.card` the main card. Richtext only; the
|
|
791
|
+
* typed `writer.hashAt` reads a field of any type through its schema.
|
|
792
|
+
* Throws on an out-of-range card, a malformed field name, or a present
|
|
793
|
+
* non-content field value.
|
|
794
|
+
* @param {Addr | string} addr
|
|
795
|
+
* @returns {string}
|
|
592
796
|
*/
|
|
593
|
-
|
|
797
|
+
hashAt(addr) {
|
|
798
|
+
let deferred2_0;
|
|
799
|
+
let deferred2_1;
|
|
594
800
|
try {
|
|
595
801
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
596
|
-
wasm.
|
|
802
|
+
wasm.document_hashAt(retptr, this.__wbg_ptr, addHeapObject(addr));
|
|
597
803
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
598
804
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
599
|
-
|
|
600
|
-
|
|
805
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
806
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
807
|
+
var ptr1 = r0;
|
|
808
|
+
var len1 = r1;
|
|
809
|
+
if (r3) {
|
|
810
|
+
ptr1 = 0; len1 = 0;
|
|
811
|
+
throw takeObject(r2);
|
|
601
812
|
}
|
|
813
|
+
deferred2_0 = ptr1;
|
|
814
|
+
deferred2_1 = len1;
|
|
815
|
+
return getStringFromWasm0(ptr1, len1);
|
|
602
816
|
} finally {
|
|
603
817
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
818
|
+
wasm.__wbindgen_export4(deferred2_0, deferred2_1, 1);
|
|
604
819
|
}
|
|
605
820
|
}
|
|
606
821
|
/**
|
|
607
|
-
*
|
|
608
|
-
*
|
|
609
|
-
*
|
|
610
|
-
*
|
|
611
|
-
*
|
|
612
|
-
* @
|
|
822
|
+
* With no `addr`, the hash of the document's stored form, the quill-free
|
|
823
|
+
* twin of `writer.hash()`: equal documents hash alike, whatever order a
|
|
824
|
+
* store kept their keys in. With one, the hash of the `Content` at
|
|
825
|
+
* `addr`, the `base` a write to it names. Throws as `read`.
|
|
826
|
+
* @param {Addr | string} [addr]
|
|
827
|
+
* @returns {string}
|
|
613
828
|
*/
|
|
614
|
-
|
|
829
|
+
hash(addr) {
|
|
830
|
+
let deferred2_0;
|
|
831
|
+
let deferred2_1;
|
|
615
832
|
try {
|
|
616
833
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
617
|
-
|
|
618
|
-
const len0 = WASM_VECTOR_LEN;
|
|
619
|
-
wasm.document_loadStored(retptr, this.__wbg_ptr, ptr0, len0);
|
|
834
|
+
wasm.document_hash(retptr, this.__wbg_ptr, addHeapObject(addr));
|
|
620
835
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
621
836
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
622
|
-
|
|
623
|
-
|
|
837
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
838
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
839
|
+
var ptr1 = r0;
|
|
840
|
+
var len1 = r1;
|
|
841
|
+
if (r3) {
|
|
842
|
+
ptr1 = 0; len1 = 0;
|
|
843
|
+
throw takeObject(r2);
|
|
624
844
|
}
|
|
845
|
+
deferred2_0 = ptr1;
|
|
846
|
+
deferred2_1 = len1;
|
|
847
|
+
return getStringFromWasm0(ptr1, len1);
|
|
625
848
|
} finally {
|
|
626
849
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
850
|
+
wasm.__wbindgen_export4(deferred2_0, deferred2_1, 1);
|
|
627
851
|
}
|
|
628
852
|
}
|
|
629
853
|
/**
|
|
630
|
-
*
|
|
631
|
-
*
|
|
854
|
+
* Insert a card: `at` absent appends, a number inserts at that index (in
|
|
855
|
+
* `0..=cards.length`). Accepts any `CardInput`, including a card read back
|
|
856
|
+
* out of a document. Throws if `card.kind` is not a valid kind name, if
|
|
857
|
+
* `at` is out of range, or `edit::too_many_cards` if the document holds
|
|
858
|
+
* 1,000 cards.
|
|
859
|
+
* @param {CardInput} card
|
|
860
|
+
* @param {number} [at]
|
|
632
861
|
*/
|
|
633
|
-
|
|
862
|
+
insertCard(card, at) {
|
|
634
863
|
try {
|
|
635
864
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
636
|
-
wasm.
|
|
865
|
+
wasm.document_insertCard(retptr, this.__wbg_ptr, addHeapObject(card), isLikeNone(at) ? Number.MAX_SAFE_INTEGER : (at) >>> 0);
|
|
637
866
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
638
867
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
throw takeObject(r1);
|
|
868
|
+
if (r1) {
|
|
869
|
+
throw takeObject(r0);
|
|
642
870
|
}
|
|
643
|
-
return takeObject(r0);
|
|
644
871
|
} finally {
|
|
645
872
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
646
873
|
}
|
|
647
874
|
}
|
|
648
875
|
/**
|
|
649
|
-
* The
|
|
650
|
-
*
|
|
651
|
-
* @returns {string}
|
|
876
|
+
* The document's main (entry) card. Allocates and serializes on each call.
|
|
877
|
+
* @returns {Card}
|
|
652
878
|
*/
|
|
653
|
-
|
|
654
|
-
let deferred1_0;
|
|
655
|
-
let deferred1_1;
|
|
879
|
+
get main() {
|
|
656
880
|
try {
|
|
657
881
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
658
|
-
wasm.
|
|
882
|
+
wasm.document_main(retptr, this.__wbg_ptr);
|
|
659
883
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
660
884
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
885
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
886
|
+
if (r2) {
|
|
887
|
+
throw takeObject(r1);
|
|
888
|
+
}
|
|
889
|
+
return takeObject(r0);
|
|
664
890
|
} finally {
|
|
665
891
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
666
|
-
wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
|
|
667
892
|
}
|
|
668
893
|
}
|
|
669
894
|
/**
|
|
@@ -711,32 +936,6 @@ export class Document {
|
|
|
711
936
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
712
937
|
}
|
|
713
938
|
}
|
|
714
|
-
/**
|
|
715
|
-
* **Overwrite** the content value at `addr` with exactly `rt`: value
|
|
716
|
-
* semantics, so the identity anchors of any previous value are gone. By
|
|
717
|
-
* anchor fate `overwrite` destroys, [`revise`](Document::revise) and
|
|
718
|
-
* [`reviseContent`](Document::revise_content) rebase, and
|
|
719
|
-
* [`applyChange`](Document::apply_change) preserves. An absent
|
|
720
|
-
* `addr.field` targets the body, an absent `addr.card` the main card.
|
|
721
|
-
*
|
|
722
|
-
* Throws on an out-of-range card, a malformed field name, or an `rt` that is
|
|
723
|
-
* not a canonical content object.
|
|
724
|
-
* @param {Addr | string} addr
|
|
725
|
-
* @param {Content} rt
|
|
726
|
-
*/
|
|
727
|
-
overwrite(addr, rt) {
|
|
728
|
-
try {
|
|
729
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
730
|
-
wasm.document_overwrite(retptr, this.__wbg_ptr, addHeapObject(addr), addHeapObject(rt));
|
|
731
|
-
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
732
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
733
|
-
if (r1) {
|
|
734
|
-
throw takeObject(r0);
|
|
735
|
-
}
|
|
736
|
-
} finally {
|
|
737
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
738
|
-
}
|
|
739
|
-
}
|
|
740
939
|
/**
|
|
741
940
|
* `addr`'s canonical `DocPath` string, the anchor `Diagnostic.path` carries:
|
|
742
941
|
* `pathFor()` is `main.body`, `pathFor("intro")` `main.intro`,
|
|
@@ -750,7 +949,7 @@ export class Document {
|
|
|
750
949
|
* **Total on the index axis**, unlike the `Addr` reads, which throw there:
|
|
751
950
|
* an out-of-range `{card: 7, field: "from"}` renders `cards[7].from`, which
|
|
752
951
|
* parses back and resolves to nothing rather than mis-targeting. Only a
|
|
753
|
-
* malformed address throws.
|
|
952
|
+
* malformed address throws, or a card id no card holds.
|
|
754
953
|
* @param {Addr | string} addr
|
|
755
954
|
* @returns {string}
|
|
756
955
|
*/
|
|
@@ -819,6 +1018,65 @@ export class Document {
|
|
|
819
1018
|
wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
|
|
820
1019
|
}
|
|
821
1020
|
}
|
|
1021
|
+
/**
|
|
1022
|
+
* The `Content` at `addr`: an absent `addr.field` reads the body, an
|
|
1023
|
+
* absent `addr.card` the main card, and an absent field the empty
|
|
1024
|
+
* content. Throws on an out-of-range card, a malformed field name, or a
|
|
1025
|
+
* present field value that is not content.
|
|
1026
|
+
* @param {Addr | string} addr
|
|
1027
|
+
* @returns {Content}
|
|
1028
|
+
*/
|
|
1029
|
+
read(addr) {
|
|
1030
|
+
try {
|
|
1031
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1032
|
+
wasm.document_read(retptr, this.__wbg_ptr, addHeapObject(addr));
|
|
1033
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1034
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1035
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1036
|
+
if (r2) {
|
|
1037
|
+
throw takeObject(r1);
|
|
1038
|
+
}
|
|
1039
|
+
return takeObject(r0);
|
|
1040
|
+
} finally {
|
|
1041
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1042
|
+
}
|
|
1043
|
+
}
|
|
1044
|
+
/**
|
|
1045
|
+
* Re-add anchors a write dropped, each at the `path` its selector names,
|
|
1046
|
+
* where its `quote` is found exactly once with its context agreeing: four
|
|
1047
|
+
* scalar values of quote or more, or a table's slot alone, eight of
|
|
1048
|
+
* context on each side or the whole context where the value's edge cut
|
|
1049
|
+
* it, and an empty quote a point where the two meet. Never a nearest match. Returns the `Reattached`
|
|
1050
|
+
* receipt.
|
|
1051
|
+
*
|
|
1052
|
+
* A path naming no body or content value orphans its selector, and
|
|
1053
|
+
* nothing remaps a card index. An id live anywhere in the document, a
|
|
1054
|
+
* table cell's included, is answered as reattached and not written. Each
|
|
1055
|
+
* id is answered once, by its first selector. `deltas` maps a path to the
|
|
1056
|
+
* `delta` of the revise that dropped its anchors, and a match there must
|
|
1057
|
+
* overlap text that revise inserted.
|
|
1058
|
+
*
|
|
1059
|
+
* Throws on a selector or delta that is not one, or a `path` that does
|
|
1060
|
+
* not parse.
|
|
1061
|
+
* @param {AnchorContext[]} selectors
|
|
1062
|
+
* @param {Record<string, Delta>} [deltas]
|
|
1063
|
+
* @returns {Reattached}
|
|
1064
|
+
*/
|
|
1065
|
+
reattach(selectors, deltas) {
|
|
1066
|
+
try {
|
|
1067
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1068
|
+
wasm.document_reattach(retptr, this.__wbg_ptr, addHeapObject(selectors), addHeapObject(deltas));
|
|
1069
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1070
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1071
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1072
|
+
if (r2) {
|
|
1073
|
+
throw takeObject(r1);
|
|
1074
|
+
}
|
|
1075
|
+
return takeObject(r0);
|
|
1076
|
+
} finally {
|
|
1077
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1078
|
+
}
|
|
1079
|
+
}
|
|
822
1080
|
/**
|
|
823
1081
|
* @param {number} index
|
|
824
1082
|
* @returns {Card | undefined}
|
|
@@ -906,28 +1164,19 @@ export class Document {
|
|
|
906
1164
|
}
|
|
907
1165
|
}
|
|
908
1166
|
/**
|
|
909
|
-
*
|
|
910
|
-
*
|
|
911
|
-
*
|
|
912
|
-
*
|
|
913
|
-
* anchors through the diff, and returns the
|
|
914
|
-
* `Revised` receipt, whose `delta` an editor bridge maps its own positions
|
|
915
|
-
* through and whose `warnings` is empty. `rt`'s own anchors and island ids
|
|
916
|
-
* land as they are. An absent `addr.field` targets the body, an absent
|
|
917
|
-
* `addr.card` the main card; an absent field diffs from empty. Richtext
|
|
918
|
-
* only: a `text` field takes `overwrite`.
|
|
919
|
-
*
|
|
920
|
-
* Throws on an out-of-range card, a malformed field name, a present
|
|
921
|
-
* non-content field value, or an `rt` that is not a canonical content
|
|
922
|
-
* object.
|
|
1167
|
+
* Write `content` over the value at `addr`, carrying each anchor it does
|
|
1168
|
+
* not name where a diff keeps its text and reporting the rest in
|
|
1169
|
+
* `droppedAnchors`. Throws as `apply`, and on a `content` that is not a
|
|
1170
|
+
* `Content`.
|
|
923
1171
|
* @param {Addr | string} addr
|
|
924
|
-
* @param {Content}
|
|
925
|
-
* @
|
|
1172
|
+
* @param {Content} content
|
|
1173
|
+
* @param {WriteOptions} [opts]
|
|
1174
|
+
* @returns {Receipt}
|
|
926
1175
|
*/
|
|
927
|
-
|
|
1176
|
+
replace(addr, content, opts) {
|
|
928
1177
|
try {
|
|
929
1178
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
930
|
-
wasm.
|
|
1179
|
+
wasm.document_replace(retptr, this.__wbg_ptr, addHeapObject(addr), addHeapObject(content), addHeapObject(opts));
|
|
931
1180
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
932
1181
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
933
1182
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
@@ -940,27 +1189,22 @@ export class Document {
|
|
|
940
1189
|
}
|
|
941
1190
|
}
|
|
942
1191
|
/**
|
|
943
|
-
*
|
|
944
|
-
*
|
|
945
|
-
*
|
|
946
|
-
*
|
|
947
|
-
*
|
|
948
|
-
* import dropped, its `path` the address written. An absent `addr.field`
|
|
949
|
-
* targets the body, an absent `addr.card` the main card; an absent field
|
|
950
|
-
* cold-imports from empty.
|
|
951
|
-
*
|
|
952
|
-
* Throws on an out-of-range card, a malformed field name, a present
|
|
953
|
-
* non-content field value, or an over-nested markdown input.
|
|
1192
|
+
* Rewrite the value at `addr` as `markdown`: the anchors and islands
|
|
1193
|
+
* whose `qm-*` tags it keeps (`annotated(addr)` spells them) stay put,
|
|
1194
|
+
* and the rest keeps what a word-aligned diff keeps. Answers the
|
|
1195
|
+
* `Receipt`, its `warnings` the import's. Throws as `apply`, and on an
|
|
1196
|
+
* over-nested markdown input.
|
|
954
1197
|
* @param {Addr | string} addr
|
|
955
1198
|
* @param {string} markdown
|
|
956
|
-
* @
|
|
1199
|
+
* @param {WriteOptions} [opts]
|
|
1200
|
+
* @returns {Receipt}
|
|
957
1201
|
*/
|
|
958
|
-
revise(addr, markdown) {
|
|
1202
|
+
revise(addr, markdown, opts) {
|
|
959
1203
|
try {
|
|
960
1204
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
961
1205
|
const ptr0 = passStringToWasm0(markdown, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
962
1206
|
const len0 = WASM_VECTOR_LEN;
|
|
963
|
-
wasm.document_revise(retptr, this.__wbg_ptr, addHeapObject(addr), ptr0, len0);
|
|
1207
|
+
wasm.document_revise(retptr, this.__wbg_ptr, addHeapObject(addr), ptr0, len0, addHeapObject(opts));
|
|
964
1208
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
965
1209
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
966
1210
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
@@ -1070,7 +1314,7 @@ export class Document {
|
|
|
1070
1314
|
* write is [`commitField`](Document::commit_field). A bare string is `Addr`
|
|
1071
1315
|
* shorthand for `{ field }`; `{ card: 2, field: "qty" }` targets a
|
|
1072
1316
|
* composable card. A body address throws:
|
|
1073
|
-
* write a body with `
|
|
1317
|
+
* write a body with `writer.reviseBody` / `replace`. Throws on an out-of-range card
|
|
1074
1318
|
* or a malformed name.
|
|
1075
1319
|
* @param {Addr | string} addr
|
|
1076
1320
|
* @param {any} value
|
|
@@ -1088,28 +1332,6 @@ export class Document {
|
|
|
1088
1332
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1089
1333
|
}
|
|
1090
1334
|
}
|
|
1091
|
-
/**
|
|
1092
|
-
* Store several fields verbatim and atomically on the card `addr` targets.
|
|
1093
|
-
* `addr` is a **card address** (`{ card }`, absent = main) and comes first
|
|
1094
|
-
* because `card` is itself a legal field name; a present `field` throws.
|
|
1095
|
-
* Nothing is applied on error, and the thrown error's `diagnostics` carry
|
|
1096
|
-
* one entry per offending field. Throws on an out-of-range card.
|
|
1097
|
-
* @param {CardAddr} addr
|
|
1098
|
-
* @param {Record<string, unknown>} fields
|
|
1099
|
-
*/
|
|
1100
|
-
storeFields(addr, fields) {
|
|
1101
|
-
try {
|
|
1102
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1103
|
-
wasm.document_storeFields(retptr, this.__wbg_ptr, addHeapObject(addr), addHeapObject(fields));
|
|
1104
|
-
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1105
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1106
|
-
if (r1) {
|
|
1107
|
-
throw takeObject(r0);
|
|
1108
|
-
}
|
|
1109
|
-
} finally {
|
|
1110
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1111
|
-
}
|
|
1112
|
-
}
|
|
1113
1335
|
/**
|
|
1114
1336
|
* Merge a card-kind's seed `overlay` into the **main** card's `$seed` map
|
|
1115
1337
|
* under `cardKind`, preserving sibling kinds; `$seed` is main-only, so this
|
|
@@ -1135,10 +1357,11 @@ export class Document {
|
|
|
1135
1357
|
}
|
|
1136
1358
|
/**
|
|
1137
1359
|
* `toMarkdown` with each prose anchor of every body and content field
|
|
1138
|
-
* spelled
|
|
1139
|
-
* listed with its field's path and line
|
|
1140
|
-
*
|
|
1141
|
-
*
|
|
1360
|
+
* spelled at its start where its line can hold the tag, every anchor,
|
|
1361
|
+
* a cell's too, listed with its field's path and line, and each island whose markdown
|
|
1362
|
+
* does not read back spelled as its token. `writer.reviseDocument` reads
|
|
1363
|
+
* both back: a kept tag pins its anchor, and a token keeps its island as
|
|
1364
|
+
* stored.
|
|
1142
1365
|
* @returns {AnnotatedMarkdown}
|
|
1143
1366
|
*/
|
|
1144
1367
|
toAnnotatedMarkdown() {
|
|
@@ -1206,7 +1429,8 @@ export class Document {
|
|
|
1206
1429
|
* The non-fatal diagnostics of the load that produced this document: parse
|
|
1207
1430
|
* warnings, plus `conform::*` warnings when it came through `quill.parse`.
|
|
1208
1431
|
* Session state, not document value: `equals` and the storage DTO exclude
|
|
1209
|
-
* it
|
|
1432
|
+
* it. `fromStored` sets it to the stored value's anchor id
|
|
1433
|
+
* collisions, and `writer.reviseDocument` clears it.
|
|
1210
1434
|
* @returns {Diagnostic[]}
|
|
1211
1435
|
*/
|
|
1212
1436
|
get warnings() {
|
|
@@ -1399,26 +1623,6 @@ export class LiveSession {
|
|
|
1399
1623
|
const ptr = this.__destroy_into_raw();
|
|
1400
1624
|
wasm.__wbg_livesession_free(ptr, 0);
|
|
1401
1625
|
}
|
|
1402
|
-
/**
|
|
1403
|
-
* The backend that produced this session (e.g. `"typst"`).
|
|
1404
|
-
* @returns {string}
|
|
1405
|
-
*/
|
|
1406
|
-
get backendId() {
|
|
1407
|
-
let deferred1_0;
|
|
1408
|
-
let deferred1_1;
|
|
1409
|
-
try {
|
|
1410
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1411
|
-
wasm.livesession_backendId(retptr, this.__wbg_ptr);
|
|
1412
|
-
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1413
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1414
|
-
deferred1_0 = r0;
|
|
1415
|
-
deferred1_1 = r1;
|
|
1416
|
-
return getStringFromWasm0(r0, r1);
|
|
1417
|
-
} finally {
|
|
1418
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1419
|
-
wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
|
|
1420
|
-
}
|
|
1421
|
-
}
|
|
1422
1626
|
/**
|
|
1423
1627
|
* Each address the current compile fills that a reader could want to
|
|
1424
1628
|
* click, and the `DocPath` of the region reaching it: the address itself,
|
|
@@ -1507,8 +1711,10 @@ export class LiveSession {
|
|
|
1507
1711
|
/**
|
|
1508
1712
|
* A content position → **caret rect**, the reverse of `positionAt`: the box
|
|
1509
1713
|
* to draw a caret at, in the same bottom-left PDF-point space as
|
|
1510
|
-
* `FieldRegion.rect`, its `span` collapsed to `[pos, pos]`. `
|
|
1511
|
-
*
|
|
1714
|
+
* `FieldRegion.rect`, its `span` collapsed to `[pos, pos]`. `pos` is a
|
|
1715
|
+
* UTF-16 offset into the field's `Content`. `undefined` when the field
|
|
1716
|
+
* places no tracked content, the offset falls inside a character, or it
|
|
1717
|
+
* maps to no drawn glyph.
|
|
1512
1718
|
* @param {string} field
|
|
1513
1719
|
* @param {number} pos
|
|
1514
1720
|
* @returns {FieldRegion | undefined}
|
|
@@ -1591,8 +1797,8 @@ export class LiveSession {
|
|
|
1591
1797
|
}
|
|
1592
1798
|
}
|
|
1593
1799
|
/**
|
|
1594
|
-
* A point → **content position**: the field *and* a
|
|
1595
|
-
* `Content`, for placing a caret or mapping a selection into the content
|
|
1800
|
+
* A point → **content position**: the field *and* a UTF-16 offset into
|
|
1801
|
+
* its `Content`, for placing a caret or mapping a selection into the content
|
|
1596
1802
|
* model, or `undefined` off all content ink. `x`/`y`/`tolPt` are PDF
|
|
1597
1803
|
* points, bottom-left origin, as in `fieldAt`. The offset is cluster-exact
|
|
1598
1804
|
* and degrades to the containing segment's start on origin-less ink.
|
|
@@ -1671,8 +1877,8 @@ export class LiveSession {
|
|
|
1671
1877
|
* and the session recovers on the next successful `update`. On success,
|
|
1672
1878
|
* repaint `dirtyPages ∩ visible`.
|
|
1673
1879
|
*
|
|
1674
|
-
* Distinct from [`
|
|
1675
|
-
*
|
|
1880
|
+
* Distinct from [`apply`](Document::apply), which edits a document's
|
|
1881
|
+
* content; this recompiles a document the caller already mutated.
|
|
1676
1882
|
* @param {Document} doc
|
|
1677
1883
|
* @returns {ChangeSet}
|
|
1678
1884
|
*/
|
|
@@ -2044,26 +2250,6 @@ export class Quill {
|
|
|
2044
2250
|
const ret = wasm.quill_seedDocument(this.__wbg_ptr);
|
|
2045
2251
|
return Document.__wrap(ret);
|
|
2046
2252
|
}
|
|
2047
|
-
/**
|
|
2048
|
-
* Seed a starter main `Card` (carries `$quill`) from the schema: the
|
|
2049
|
-
* `$kind: main` card of [`seedDocument`](Self::seed_document) alone.
|
|
2050
|
-
* @returns {Card}
|
|
2051
|
-
*/
|
|
2052
|
-
seedMain() {
|
|
2053
|
-
try {
|
|
2054
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
2055
|
-
wasm.quill_seedMain(retptr, this.__wbg_ptr);
|
|
2056
|
-
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
2057
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
2058
|
-
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
2059
|
-
if (r2) {
|
|
2060
|
-
throw takeObject(r1);
|
|
2061
|
-
}
|
|
2062
|
-
return takeObject(r0);
|
|
2063
|
-
} finally {
|
|
2064
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
2065
|
-
}
|
|
2066
|
-
}
|
|
2067
2253
|
/**
|
|
2068
2254
|
* `doc` as an authoring document: every field in the values form (each
|
|
2069
2255
|
* content leaf its codec's text), every body as Markdown, each card
|
|
@@ -2173,6 +2359,55 @@ export class Quill {
|
|
|
2173
2359
|
}
|
|
2174
2360
|
if (Symbol.dispose) Quill.prototype[Symbol.dispose] = Quill.prototype.free;
|
|
2175
2361
|
|
|
2362
|
+
/**
|
|
2363
|
+
* Deleting `[start, end)`: the splice, and where the range runs from a
|
|
2364
|
+
* block's start into a later block, the `setBlock` giving the block that
|
|
2365
|
+
* keeps the text the shape of the block the range ends in.
|
|
2366
|
+
* @param {Content} content
|
|
2367
|
+
* @param {number} start
|
|
2368
|
+
* @param {number} end
|
|
2369
|
+
* @returns {Change}
|
|
2370
|
+
*/
|
|
2371
|
+
export function deleteRange(content, start, end) {
|
|
2372
|
+
try {
|
|
2373
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
2374
|
+
wasm.deleteRange(retptr, addHeapObject(content), start, end);
|
|
2375
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
2376
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
2377
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
2378
|
+
if (r2) {
|
|
2379
|
+
throw takeObject(r1);
|
|
2380
|
+
}
|
|
2381
|
+
return takeObject(r0);
|
|
2382
|
+
} finally {
|
|
2383
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
2384
|
+
}
|
|
2385
|
+
}
|
|
2386
|
+
|
|
2387
|
+
/**
|
|
2388
|
+
* A change taking `before` to `after`, word-aligned, for a writer with no
|
|
2389
|
+
* steps of its own. Throws `edit::content_apply` where `after` is not a
|
|
2390
|
+
* valid value.
|
|
2391
|
+
* @param {Content} before
|
|
2392
|
+
* @param {Content} after
|
|
2393
|
+
* @returns {Change}
|
|
2394
|
+
*/
|
|
2395
|
+
export function diff(before, after) {
|
|
2396
|
+
try {
|
|
2397
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
2398
|
+
wasm.diff(retptr, addHeapObject(before), addHeapObject(after));
|
|
2399
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
2400
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
2401
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
2402
|
+
if (r2) {
|
|
2403
|
+
throw takeObject(r1);
|
|
2404
|
+
}
|
|
2405
|
+
return takeObject(r0);
|
|
2406
|
+
} finally {
|
|
2407
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
2408
|
+
}
|
|
2409
|
+
}
|
|
2410
|
+
|
|
2176
2411
|
/**
|
|
2177
2412
|
* Export canonical `Content` to its markdown projection. Throws if `rt` is not
|
|
2178
2413
|
* canonical content.
|
|
@@ -2275,10 +2510,10 @@ export function formatDocPath(segs) {
|
|
|
2275
2510
|
}
|
|
2276
2511
|
|
|
2277
2512
|
/**
|
|
2278
|
-
* Import a markdown string: the
|
|
2513
|
+
* Import a markdown string: the markdown codec's import, pure and document-free. Returns the
|
|
2279
2514
|
* canonical `content` and a `parse::dropped_construct` warning per construct
|
|
2280
|
-
* the import dropped, with no `path`. `
|
|
2281
|
-
* spells the cold
|
|
2515
|
+
* the import dropped, with no `path`. `replace(addr, importMarkdown(md).content)`
|
|
2516
|
+
* spells the cold write; prefer `revise` for edit semantics.
|
|
2282
2517
|
* Throws on an over-nested input.
|
|
2283
2518
|
* @param {string} markdown
|
|
2284
2519
|
* @returns {Imported}
|
|
@@ -2301,6 +2536,83 @@ export function importMarkdown(markdown) {
|
|
|
2301
2536
|
}
|
|
2302
2537
|
}
|
|
2303
2538
|
|
|
2539
|
+
/**
|
|
2540
|
+
* Tab over the blocks `first` to `last` (`first` alone when absent): the
|
|
2541
|
+
* change nesting their items under the item before them. Throws
|
|
2542
|
+
* `edit::content_apply` where `first` is in no item, the range leaves its
|
|
2543
|
+
* list, or its first item is the list's first.
|
|
2544
|
+
* @param {Content} content
|
|
2545
|
+
* @param {string} first
|
|
2546
|
+
* @param {string | null} [last]
|
|
2547
|
+
* @returns {Change}
|
|
2548
|
+
*/
|
|
2549
|
+
export function indent(content, first, last) {
|
|
2550
|
+
try {
|
|
2551
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
2552
|
+
const ptr0 = passStringToWasm0(first, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
2553
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2554
|
+
var ptr1 = isLikeNone(last) ? 0 : passStringToWasm0(last, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
2555
|
+
var len1 = WASM_VECTOR_LEN;
|
|
2556
|
+
wasm.indent(retptr, addHeapObject(content), ptr0, len0, ptr1, len1);
|
|
2557
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
2558
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
2559
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
2560
|
+
if (r2) {
|
|
2561
|
+
throw takeObject(r1);
|
|
2562
|
+
}
|
|
2563
|
+
return takeObject(r0);
|
|
2564
|
+
} finally {
|
|
2565
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
2566
|
+
}
|
|
2567
|
+
}
|
|
2568
|
+
|
|
2569
|
+
/**
|
|
2570
|
+
* Typing at `at`: the formatting the typed text carries, for a splice's
|
|
2571
|
+
* `marks`, in canonical order. Throws `edit::content_apply` where `at` is
|
|
2572
|
+
* past the text.
|
|
2573
|
+
* @param {Content} content
|
|
2574
|
+
* @param {number} at
|
|
2575
|
+
* @returns {ContentMarkKind[]}
|
|
2576
|
+
*/
|
|
2577
|
+
export function inheritedMarks(content, at) {
|
|
2578
|
+
try {
|
|
2579
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
2580
|
+
wasm.inheritedMarks(retptr, addHeapObject(content), at);
|
|
2581
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
2582
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
2583
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
2584
|
+
if (r2) {
|
|
2585
|
+
throw takeObject(r1);
|
|
2586
|
+
}
|
|
2587
|
+
return takeObject(r0);
|
|
2588
|
+
} finally {
|
|
2589
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
2590
|
+
}
|
|
2591
|
+
}
|
|
2592
|
+
|
|
2593
|
+
/**
|
|
2594
|
+
* The change that undoes `change` on `before`. Throws `edit::content_apply`
|
|
2595
|
+
* where `change` does not apply to `before`.
|
|
2596
|
+
* @param {Change} change
|
|
2597
|
+
* @param {Content} before
|
|
2598
|
+
* @returns {Change}
|
|
2599
|
+
*/
|
|
2600
|
+
export function invert(change, before) {
|
|
2601
|
+
try {
|
|
2602
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
2603
|
+
wasm.invert(retptr, addHeapObject(change), addHeapObject(before));
|
|
2604
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
2605
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
2606
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
2607
|
+
if (r2) {
|
|
2608
|
+
throw takeObject(r1);
|
|
2609
|
+
}
|
|
2610
|
+
return takeObject(r0);
|
|
2611
|
+
} finally {
|
|
2612
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
2613
|
+
}
|
|
2614
|
+
}
|
|
2615
|
+
|
|
2304
2616
|
/**
|
|
2305
2617
|
* Whether `content` satisfies the one-line constraint of `text` and
|
|
2306
2618
|
* `richtext`: one `Para` line, in no container, with no islands. Judged on
|
|
@@ -2350,26 +2662,19 @@ export function isPlain(content) {
|
|
|
2350
2662
|
}
|
|
2351
2663
|
|
|
2352
2664
|
/**
|
|
2353
|
-
*
|
|
2354
|
-
*
|
|
2355
|
-
*
|
|
2356
|
-
* The document-free read an editor diffs against to decide which `markOps` to
|
|
2357
|
-
* emit, rather than reproducing that rule in its own language.
|
|
2358
|
-
*
|
|
2359
|
-
* `bundle.markOps` are ignored. The answer is normalized, as the store's is:
|
|
2360
|
-
* marks a text move drops (out of range, zero-width formatting) are absent,
|
|
2361
|
-
* and same-kind runs a move left adjacent arrive already unioned, so a bundle
|
|
2362
|
-
* carrying no `markOps` names the marks the field will hold.
|
|
2363
|
-
* Throws on a non-content `content`, a malformed bundle, or an op that applies
|
|
2364
|
-
* out of bounds: `applyChange`'s errors on the same ops.
|
|
2665
|
+
* Backspace at the start of block `id`: the change joining it onto the block
|
|
2666
|
+
* before it, under that block's record. Throws `edit::content_apply` for the
|
|
2667
|
+
* first block or an id no block holds.
|
|
2365
2668
|
* @param {Content} content
|
|
2366
|
-
* @param {
|
|
2367
|
-
* @returns {
|
|
2669
|
+
* @param {string} id
|
|
2670
|
+
* @returns {Change}
|
|
2368
2671
|
*/
|
|
2369
|
-
export function
|
|
2672
|
+
export function joinBlocks(content, id) {
|
|
2370
2673
|
try {
|
|
2371
2674
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
2372
|
-
|
|
2675
|
+
const ptr0 = passStringToWasm0(id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
2676
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2677
|
+
wasm.joinBlocks(retptr, addHeapObject(content), ptr0, len0);
|
|
2373
2678
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
2374
2679
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
2375
2680
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
@@ -2383,39 +2688,35 @@ export function mapMarks(content, bundle) {
|
|
|
2383
2688
|
}
|
|
2384
2689
|
|
|
2385
2690
|
/**
|
|
2386
|
-
*
|
|
2387
|
-
*
|
|
2388
|
-
*
|
|
2389
|
-
*
|
|
2390
|
-
*
|
|
2391
|
-
*
|
|
2392
|
-
*
|
|
2393
|
-
*
|
|
2394
|
-
* @param {Delta} delta
|
|
2395
|
-
* @param {number} pos
|
|
2396
|
-
* @param {Assoc} assoc
|
|
2397
|
-
* @returns {number}
|
|
2691
|
+
* Where `pos` lands after `change`, and what around it the change deleted;
|
|
2692
|
+
* `assoc` (`"after"` by default) picks the side of text inserted at it.
|
|
2693
|
+
* Throws `edit::content_apply` where a splice deletes an island and names
|
|
2694
|
+
* none in `removed`, as the receipt's `applied` always does.
|
|
2695
|
+
* @param {Change} change
|
|
2696
|
+
* @param {Pos} pos
|
|
2697
|
+
* @param {"before" | "after"} [assoc]
|
|
2698
|
+
* @returns {MapResult}
|
|
2398
2699
|
*/
|
|
2399
|
-
export function mapPos(
|
|
2700
|
+
export function mapPos(change, pos, assoc) {
|
|
2400
2701
|
try {
|
|
2401
2702
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
2402
|
-
wasm.mapPos(retptr, addHeapObject(
|
|
2703
|
+
wasm.mapPos(retptr, addHeapObject(change), addHeapObject(pos), addHeapObject(assoc));
|
|
2403
2704
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
2404
2705
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
2405
2706
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
2406
2707
|
if (r2) {
|
|
2407
2708
|
throw takeObject(r1);
|
|
2408
2709
|
}
|
|
2409
|
-
return r0
|
|
2710
|
+
return takeObject(r0);
|
|
2410
2711
|
} finally {
|
|
2411
2712
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
2412
2713
|
}
|
|
2413
2714
|
}
|
|
2414
2715
|
|
|
2415
2716
|
/**
|
|
2416
|
-
* The canonical form of `rt`: the content `
|
|
2717
|
+
* The canonical form of `rt`: the content `replace` stores from it, read
|
|
2417
2718
|
* without a document. Normalizing rewrites structure, never the text, so the
|
|
2418
|
-
* answer's `text` is `rt.text`. Throws where `
|
|
2719
|
+
* answer's `text` is `rt.text`. Throws where `replace` would, with the same
|
|
2419
2720
|
* error under this verb's name.
|
|
2420
2721
|
* @param {Content} rt
|
|
2421
2722
|
* @returns {Content}
|
|
@@ -2436,6 +2737,36 @@ export function normalize(rt) {
|
|
|
2436
2737
|
}
|
|
2437
2738
|
}
|
|
2438
2739
|
|
|
2740
|
+
/**
|
|
2741
|
+
* Shift-Tab over the blocks `first` to `last` (`first` alone when absent):
|
|
2742
|
+
* the change lifting them out of the innermost item or quote holding
|
|
2743
|
+
* `first`. Throws `edit::content_apply` where `first` is in neither or the
|
|
2744
|
+
* range leaves it.
|
|
2745
|
+
* @param {Content} content
|
|
2746
|
+
* @param {string} first
|
|
2747
|
+
* @param {string | null} [last]
|
|
2748
|
+
* @returns {Change}
|
|
2749
|
+
*/
|
|
2750
|
+
export function outdent(content, first, last) {
|
|
2751
|
+
try {
|
|
2752
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
2753
|
+
const ptr0 = passStringToWasm0(first, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
2754
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2755
|
+
var ptr1 = isLikeNone(last) ? 0 : passStringToWasm0(last, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
2756
|
+
var len1 = WASM_VECTOR_LEN;
|
|
2757
|
+
wasm.outdent(retptr, addHeapObject(content), ptr0, len0, ptr1, len1);
|
|
2758
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
2759
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
2760
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
2761
|
+
if (r2) {
|
|
2762
|
+
throw takeObject(r1);
|
|
2763
|
+
}
|
|
2764
|
+
return takeObject(r0);
|
|
2765
|
+
} finally {
|
|
2766
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
2767
|
+
}
|
|
2768
|
+
}
|
|
2769
|
+
|
|
2439
2770
|
/**
|
|
2440
2771
|
* Parse a canonical document-model `Diagnostic.path` (`cards.<kind>[<i>].<field>`,
|
|
2441
2772
|
* `main.body`, `recipients[0].name`) into structured `DocPathSeg` segments, so
|
|
@@ -2463,21 +2794,20 @@ export function parseDocPath(path) {
|
|
|
2463
2794
|
}
|
|
2464
2795
|
|
|
2465
2796
|
/**
|
|
2466
|
-
*
|
|
2467
|
-
*
|
|
2468
|
-
* `
|
|
2469
|
-
*
|
|
2470
|
-
*
|
|
2471
|
-
* @param {
|
|
2472
|
-
* @
|
|
2473
|
-
* @returns {{ content: Content; delta: Delta; warnings: Diagnostic[] }}
|
|
2797
|
+
* Enter at `at`: the change splitting the block holding `at` there, the new
|
|
2798
|
+
* block `newId` and the text keeping its id. Throws `edit::content_apply`
|
|
2799
|
+
* where `at` is past the text.
|
|
2800
|
+
* @param {Content} content
|
|
2801
|
+
* @param {number} at
|
|
2802
|
+
* @param {string} newId
|
|
2803
|
+
* @returns {Change}
|
|
2474
2804
|
*/
|
|
2475
|
-
export function
|
|
2805
|
+
export function splitBlock(content, at, newId) {
|
|
2476
2806
|
try {
|
|
2477
2807
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
2478
|
-
const ptr0 = passStringToWasm0(
|
|
2808
|
+
const ptr0 = passStringToWasm0(newId, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
2479
2809
|
const len0 = WASM_VECTOR_LEN;
|
|
2480
|
-
wasm.
|
|
2810
|
+
wasm.splitBlock(retptr, addHeapObject(content), at, ptr0, len0);
|
|
2481
2811
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
2482
2812
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
2483
2813
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
@@ -2498,6 +2828,36 @@ export function rebase(base, markdown) {
|
|
|
2498
2828
|
export function start() {
|
|
2499
2829
|
wasm.start();
|
|
2500
2830
|
}
|
|
2831
|
+
|
|
2832
|
+
/**
|
|
2833
|
+
* The change wrapping the blocks `first` to `last` in a quote or a list,
|
|
2834
|
+
* around the children of their innermost shared item or quote that the range
|
|
2835
|
+
* touches; a list the range sits in is wrapped whole.
|
|
2836
|
+
* @param {Content} content
|
|
2837
|
+
* @param {string} first
|
|
2838
|
+
* @param {string} last
|
|
2839
|
+
* @param {WrapKind} kind
|
|
2840
|
+
* @returns {Change}
|
|
2841
|
+
*/
|
|
2842
|
+
export function wrap(content, first, last, kind) {
|
|
2843
|
+
try {
|
|
2844
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
2845
|
+
const ptr0 = passStringToWasm0(first, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
2846
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2847
|
+
const ptr1 = passStringToWasm0(last, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
2848
|
+
const len1 = WASM_VECTOR_LEN;
|
|
2849
|
+
wasm.wrap(retptr, addHeapObject(content), ptr0, len0, ptr1, len1, addHeapObject(kind));
|
|
2850
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
2851
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
2852
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
2853
|
+
if (r2) {
|
|
2854
|
+
throw takeObject(r1);
|
|
2855
|
+
}
|
|
2856
|
+
return takeObject(r0);
|
|
2857
|
+
} finally {
|
|
2858
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
2859
|
+
}
|
|
2860
|
+
}
|
|
2501
2861
|
function __wbg_get_imports() {
|
|
2502
2862
|
const import0 = {
|
|
2503
2863
|
__proto__: null,
|
|
@@ -2646,6 +3006,10 @@ function __wbg_get_imports() {
|
|
|
2646
3006
|
__wbg_getRandomValues_436a51d0629d84e1: function() { return handleError(function (arg0, arg1) {
|
|
2647
3007
|
globalThis.crypto.getRandomValues(getArrayU8FromWasm0(arg0, arg1));
|
|
2648
3008
|
}, arguments); },
|
|
3009
|
+
__wbg_get_31af05bd4842a84f: function() { return handleError(function (arg0, arg1) {
|
|
3010
|
+
const ret = Reflect.get(getObject(arg0), getObject(arg1));
|
|
3011
|
+
return addHeapObject(ret);
|
|
3012
|
+
}, arguments); },
|
|
2649
3013
|
__wbg_get_658f6698067d9515: function() { return handleError(function (arg0, arg1) {
|
|
2650
3014
|
const ret = Reflect.get(getObject(arg0), getObject(arg1));
|
|
2651
3015
|
return addHeapObject(ret);
|
|
@@ -2662,6 +3026,10 @@ function __wbg_get_imports() {
|
|
|
2662
3026
|
const ret = getObject(arg0)[getObject(arg1)];
|
|
2663
3027
|
return addHeapObject(ret);
|
|
2664
3028
|
},
|
|
3029
|
+
__wbg_has_5d6706e5209576c1: function() { return handleError(function (arg0, arg1) {
|
|
3030
|
+
const ret = Reflect.has(getObject(arg0), getObject(arg1));
|
|
3031
|
+
return ret;
|
|
3032
|
+
}, arguments); },
|
|
2665
3033
|
__wbg_instanceof_ArrayBuffer_a99f175873e5d9b8: function(arg0) {
|
|
2666
3034
|
let result;
|
|
2667
3035
|
try {
|