@quillmark/wasm 0.133.0 → 0.134.1
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 +355 -0
- package/README.md +19 -76
- package/THIRD_PARTY_LICENSES.md +443 -103
- package/core/wasm.d.ts +521 -390
- package/core/wasm.js +635 -226
- package/core/wasm_bg.wasm +0 -0
- package/core/wasm_bg.wasm.d.ts +26 -12
- package/package.json +1 -1
- package/render/wasm.d.ts +534 -406
- package/render/wasm.js +643 -252
- package/render/wasm_bg.wasm +0 -0
- package/render/wasm_bg.wasm.d.ts +26 -13
- package/runtime/runtime.d.ts +89 -121
- package/runtime/runtime.js +53 -136
- package/sbom.cdx.json +337 -542
package/render/wasm.d.ts
CHANGED
|
@@ -21,12 +21,14 @@ export type PayloadItem =
|
|
|
21
21
|
* `CardInput`, so a card read from one document pushes straight into another.
|
|
22
22
|
*
|
|
23
23
|
* `$` system entries are hoisted to named fields: `kind` (the `$kind`),
|
|
24
|
-
* `
|
|
25
|
-
* `seed` (the `$seed`
|
|
26
|
-
* `payloadItems` carries user fields
|
|
24
|
+
* `id` (the `$id`, composable cards only), `quill` (`$quill`
|
|
25
|
+
* `name@version`, main card only), `ext` (`$ext`), and `seed` (the `$seed`
|
|
26
|
+
* per-kind overlay map, main card only). `payloadItems` carries user fields
|
|
27
|
+
* and comments in order.
|
|
27
28
|
*/
|
|
28
29
|
export interface Card {
|
|
29
30
|
kind: string;
|
|
31
|
+
id?: string;
|
|
30
32
|
quill?: string;
|
|
31
33
|
ext?: Record<string, unknown>;
|
|
32
34
|
seed?: Record<string, unknown>;
|
|
@@ -41,10 +43,13 @@ export interface Card {
|
|
|
41
43
|
/**
|
|
42
44
|
* A card written *into* a document, accepted by `Document.insertCard`. Like
|
|
43
45
|
* `Card`, but `body` also takes a markdown `string`, and every field but `kind`
|
|
44
|
-
* is optional (defaulting to no payload items and an empty body).
|
|
46
|
+
* is optional (defaulting to no payload items and an empty body). A card
|
|
47
|
+
* without an `id` is minted one where it is placed; one whose `id` is not a
|
|
48
|
+
* card id, or is held by another card of the document, is refused.
|
|
45
49
|
*/
|
|
46
50
|
export interface CardInput {
|
|
47
51
|
kind: string;
|
|
52
|
+
id?: string;
|
|
48
53
|
quill?: string;
|
|
49
54
|
ext?: Record<string, unknown>;
|
|
50
55
|
seed?: Record<string, unknown>;
|
|
@@ -52,156 +57,20 @@ export interface CardInput {
|
|
|
52
57
|
body?: Content | string;
|
|
53
58
|
}
|
|
54
59
|
|
|
55
|
-
/**
|
|
56
|
-
* Canonical richtext content: the model behind a card body and richtext fields.
|
|
57
|
-
* One text sequence over a single coordinate space (Unicode scalar values):
|
|
58
|
-
* `text` plus line attributes, anchored `marks`, and embedded `islands`. Every
|
|
59
|
-
* edit is a splice; markdown is a projection, not the model.
|
|
60
|
-
*/
|
|
61
|
-
export interface Content {
|
|
62
|
-
text: string;
|
|
63
|
-
lines: ContentLine[];
|
|
64
|
-
marks: ContentMark[];
|
|
65
|
-
islands: ContentIsland[];
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
/** One `\n`-separated segment of `Content.text`, in order. `kind` is a closed
|
|
69
|
-
* set: `island` reads as `para`, and any other role outside it is refused
|
|
70
|
-
* wherever content is decoded. Every role spells its payload in `attrs`, so
|
|
71
|
-
* `kind === "heading"` narrows `attrs` to `{ level: number }` with no guard. */
|
|
72
|
-
export type ContentLine = {
|
|
73
|
-
containers: ContentContainer[];
|
|
74
|
-
/** A within-block hard line break rather than a new block. Omitted (false) in the common case. */
|
|
75
|
-
continues?: boolean;
|
|
76
|
-
} & ContentLineKind;
|
|
77
|
-
|
|
78
|
-
/** A line's block role, shared by `ContentLine` and the `setKind` op. */
|
|
79
|
-
export type ContentLineKind =
|
|
80
|
-
| { kind: "para" }
|
|
81
|
-
| { kind: "heading"; attrs: { level: number } }
|
|
82
|
-
| { kind: "code"; attrs?: { lang?: string } }
|
|
83
|
-
| { kind: "rule" };
|
|
84
|
-
|
|
85
|
-
/** An ancestor block a line nests inside, outermost first. Closed like
|
|
86
|
-
* `ContentLine.kind`.
|
|
87
|
-
*
|
|
88
|
-
* Two adjacent lines sit in the same container iff their whole path matches, so
|
|
89
|
-
* `instance` is what tells one container from an adjacent sibling of identical
|
|
90
|
-
* shape — two consecutive quotes, two consecutive lists — which contiguity
|
|
91
|
-
* alone reads as one.
|
|
92
|
-
*
|
|
93
|
-
* **A writer owes a distinct value per adjacent sibling run.** Runs of one shape
|
|
94
|
-
* sharing one arrive as one: a second list's items come back as continuation
|
|
95
|
-
* paragraphs of the first, markers gone. Nothing reports that — an omitted field
|
|
96
|
-
* and a `0` stamped on both are the same write — so a codec flattening a tree
|
|
97
|
-
* takes them from `assignInstances` in `@quillmark/wasm` rather than by hand.
|
|
98
|
-
* Any distinct pair works; a write is canonicalized to `0`/`1`.
|
|
99
|
-
*
|
|
100
|
-
* Absent is `0`, and a read omits it there, so a container with nothing adjacent
|
|
101
|
-
* to be told apart from carries no key. A read does spell one on pairs no writer
|
|
102
|
-
* had to: `1.` beside a list starting at `3` differs by `start`, so those runs
|
|
103
|
-
* arrive apart with nothing written, and the canonical form spends a
|
|
104
|
-
* discriminator anyway because Markdown reads only a list's first number. */
|
|
105
|
-
export type ContentContainer =
|
|
106
|
-
| {
|
|
107
|
-
container: "list_item";
|
|
108
|
-
/** `checked` is present on a task item: `true` ticked, `false` open. */
|
|
109
|
-
attrs: { ordered: boolean; start: number; ordinal: number; checked?: boolean };
|
|
110
|
-
instance?: number;
|
|
111
|
-
}
|
|
112
|
-
| { container: "quote"; instance?: number };
|
|
113
|
-
|
|
114
|
-
/** A mark over char range `[start, end)` into `Content.text`. `type` is a
|
|
115
|
-
* closed set, so `type === "link"` narrows `attrs` to `{ url: string }` with no
|
|
116
|
-
* guard. An `anchor`'s `id` is a caller-supplied opaque
|
|
117
|
-
* handle, unique per `Content` and invariant while the mark lives (positions
|
|
118
|
-
* rebase, the id never does); it has no markdown projection and survives only
|
|
119
|
-
* through the edit lane. */
|
|
120
|
-
export type ContentMark = { start: number; end: number } & ContentMarkKind;
|
|
121
|
-
|
|
122
|
-
/** A mark's type with its payload, shared by `ContentMark` and a `MarkOp`'s
|
|
123
|
-
* `add` / `remove`. */
|
|
124
|
-
export type ContentMarkKind =
|
|
125
|
-
| { type: "strong" | "emph" | "underline" | "strike" | "code" }
|
|
126
|
-
| { type: "link"; attrs: { url: string } }
|
|
127
|
-
| { type: "anchor"; attrs: { id: string } }
|
|
128
|
-
| { type: "font_family"; attrs: { name: string } };
|
|
129
|
-
|
|
130
|
-
/** A cell in a `TableProps`. `marks` rides the prose `ContentMark` shape, but
|
|
131
|
-
* each mark's `start`/`end` are USV offsets into this cell's `text`, not into
|
|
132
|
-
* `Content.text`. A `\n` in `text` is a line break. */
|
|
133
|
-
export interface TableCell {
|
|
134
|
-
text: string;
|
|
135
|
-
marks: ContentMark[];
|
|
136
|
-
/** The cell's horizontal alignment; absent is its column's. */
|
|
137
|
-
align?: "left" | "center" | "right";
|
|
138
|
-
/** The cell's vertical alignment; absent is the quill's. */
|
|
139
|
-
valign?: "top" | "middle" | "bottom";
|
|
140
|
-
/** The columns the cell spans, from 2; absent is one. Each cell it covers
|
|
141
|
-
* holds its slot as an empty placeholder. */
|
|
142
|
-
colspan?: number;
|
|
143
|
-
/** The rows the cell spans, from 2; absent is one. */
|
|
144
|
-
rowspan?: number;
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
/** `props` of a `type: "table"` island: a rectangular grid normalized to one
|
|
148
|
-
* column count that `header`, every row of `rows`, `aligns` and `widths` all
|
|
149
|
-
* share. A layout key at its default is absent; one holding a value outside
|
|
150
|
-
* its type stays as written and reads as absent. */
|
|
151
|
-
export interface TableProps {
|
|
152
|
-
header: TableCell[];
|
|
153
|
-
rows: TableCell[][];
|
|
154
|
-
/** Per-column alignment, one entry per column. */
|
|
155
|
-
aligns: ("none" | "left" | "center" | "right")[];
|
|
156
|
-
/** Per-column relative weights; `null` is an auto-fit column. Absent when
|
|
157
|
-
* every column is auto-fit. A weight is an integer from 1 to
|
|
158
|
-
* `Number.MAX_SAFE_INTEGER`. */
|
|
159
|
-
widths?: (number | null)[];
|
|
160
|
-
/** The table's placement; absent is the quill's. */
|
|
161
|
-
align?: "left" | "center" | "right";
|
|
162
|
-
/** How many rows from the top of `header` then `rows` are header rows;
|
|
163
|
-
* `0` draws `header` as the first body row, and absent is one. */
|
|
164
|
-
head?: number;
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
/** `props` of a `type: "image"` island. Stores and round-trips; no backend
|
|
168
|
-
* typesets one, and a render that holds one warns `backend::declined_construct`,
|
|
169
|
-
* because no backend resolves `url`. */
|
|
170
|
-
export interface ImageProps {
|
|
171
|
-
url: string;
|
|
172
|
-
alt: string;
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
/** `props` of a `type: "footnote"` island: the note, shaped as one `TableCell`
|
|
176
|
-
* with no `\n` at either edge. The island's slot is the reference, inline in
|
|
177
|
-
* its paragraph. */
|
|
178
|
-
export type FootnoteProps = TableCell;
|
|
179
|
-
|
|
180
|
-
/** `props` of a `type: "math"` island: the equation's TeX, as written between
|
|
181
|
-
* its dollars, on one line with no edge whitespace. `display` is present and
|
|
182
|
-
* `true` on a `$$…$$` equation. */
|
|
183
|
-
export interface MathProps {
|
|
184
|
-
tex: string;
|
|
185
|
-
display?: true;
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
/** A structured object occupying one island slot in `Content.text`. `type` is a
|
|
189
|
-
* closed set, so `type === "table"` narrows `props` to `TableProps`. */
|
|
190
|
-
export type ContentIsland = {
|
|
191
|
-
id: string;
|
|
192
|
-
} & (
|
|
193
|
-
| { type: "table"; props: TableProps }
|
|
194
|
-
| { type: "image"; props: ImageProps }
|
|
195
|
-
| { type: "footnote"; props: FootnoteProps }
|
|
196
|
-
| { type: "math"; props: MathProps }
|
|
197
|
-
);
|
|
198
|
-
|
|
199
60
|
/**
|
|
200
61
|
* A write address: one navigation concept for the whole `Document` surface. An
|
|
201
62
|
* absent `field` targets the card body; an absent `card` targets the main card.
|
|
202
|
-
*
|
|
203
|
-
*
|
|
204
|
-
*
|
|
63
|
+
* A composable card is named by its `$id` (`card.id`) or by its index: `{}` is
|
|
64
|
+
* the main-card body; `{ card: "c3xk7p" }` the body of the card holding that
|
|
65
|
+
* id, wherever it sits; `{ card: 2 }` the body of the card at index 2;
|
|
66
|
+
* `{ field: "intro" }` the main card's `intro` field; `{ card: "c3xk7p",
|
|
67
|
+
* field: "intro" }` a card field. An id no card holds throws
|
|
68
|
+
* `edit::unknown_card_id`.
|
|
69
|
+
*
|
|
70
|
+
* The content lane's writes (`apply`, `revise`, `replace`) take a
|
|
71
|
+
* card by `$id` only, and throw on an index: a card moved or inserted between
|
|
72
|
+
* a writer's read and its write shifts an index onto another card, and an
|
|
73
|
+
* equal body there would pass the `base` check.
|
|
205
74
|
*
|
|
206
75
|
* On the `Addr`-taking verbs a **bare string** is shorthand for `{ field: name }`
|
|
207
76
|
* (`doc.storeField("qty", 3)`); a bare number is *not* an addr.
|
|
@@ -216,23 +85,23 @@ export type ContentIsland = {
|
|
|
216
85
|
* inside takes the path as its own argument, `reader.getContentAt(addr, path)`.
|
|
217
86
|
*/
|
|
218
87
|
export interface Addr {
|
|
219
|
-
card?: number;
|
|
88
|
+
card?: string | number;
|
|
220
89
|
field?: string;
|
|
221
90
|
}
|
|
222
91
|
|
|
223
92
|
/**
|
|
224
|
-
* A card-only address, taken by the card-scoped verbs (`
|
|
225
|
-
*
|
|
226
|
-
*
|
|
93
|
+
* A card-only address, taken by the card-scoped verbs (`storeExt`, `getExt`, `commitFields`, …). An absent `card` targets the main
|
|
94
|
+
* card, a string the card holding that `$id`, a number the card at that
|
|
95
|
+
* index; a present `field` throws.
|
|
227
96
|
*/
|
|
228
97
|
export interface CardAddr {
|
|
229
|
-
card?: number;
|
|
98
|
+
card?: string | number;
|
|
230
99
|
}
|
|
231
100
|
|
|
232
101
|
/**
|
|
233
|
-
* A text-splice change set over the
|
|
234
|
-
*
|
|
235
|
-
*
|
|
102
|
+
* A text-splice change set over the revised value's text, counted in UTF-16
|
|
103
|
+
* code units (CodeMirror `ChangeSet` semantics), returned in a revise's
|
|
104
|
+
* `Revised` receipt and taken back by `reattach`.
|
|
236
105
|
*
|
|
237
106
|
* Applying one admits an `insert` string rather than storing it verbatim: `\r`
|
|
238
107
|
* and the Unicode bidi controls drop, and a line separator — VT, FF, NEL,
|
|
@@ -243,14 +112,34 @@ export interface Delta {
|
|
|
243
112
|
}
|
|
244
113
|
|
|
245
114
|
/**
|
|
246
|
-
* The receipt of a revise (`
|
|
247
|
-
* `writer.reviseField`): the text `delta`, and one `parse::dropped_construct`
|
|
115
|
+
* The receipt of a typed revise (`writer.reviseBody`, `writer.reviseField`): the text `delta`, one `parse::dropped_construct`
|
|
248
116
|
* warning per construct a markdown import dropped, anchored at the revised
|
|
249
|
-
* address
|
|
117
|
+
* address, and `droppedAnchors`, every anchor of the stored value, in its
|
|
118
|
+
* prose or a cell, whose id the revised value holds nowhere, each with the
|
|
119
|
+
* text of the line or cell it stood in. The revised
|
|
120
|
+
* address is the dropped anchors' path, so they carry none.
|
|
250
121
|
*/
|
|
251
122
|
export interface Revised {
|
|
252
123
|
delta: Delta;
|
|
253
124
|
warnings: Diagnostic[];
|
|
125
|
+
droppedAnchors: { id: string; line: string }[];
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* What a revise's writer read, the optional last argument of the writer's
|
|
130
|
+
* `reviseBody` / `reviseField` / `reviseDocument`.
|
|
131
|
+
* Name one or neither; a key present with no string throws. `baseHash` is the
|
|
132
|
+
* hash the writer read, paired with the lane it writes on: `writer.hashAt` /
|
|
133
|
+
* `writer.hash`. A write onto a value that hashes otherwise
|
|
134
|
+
* throws `edit::stale_base`. `baseMarkdown` is the markdown the writer read, annotated
|
|
135
|
+
* or not (a `text` field's literal text): when the value has changed since,
|
|
136
|
+
* the writer's edit and the change since merge by line, so both land, and
|
|
137
|
+
* runs of lines both changed throw `edit::rebase_conflict`. Each refusal's
|
|
138
|
+
* `args.current` is the hash now, and leaves the value unchanged.
|
|
139
|
+
*/
|
|
140
|
+
export interface BaseOptions {
|
|
141
|
+
baseHash?: string;
|
|
142
|
+
baseMarkdown?: string;
|
|
254
143
|
}
|
|
255
144
|
|
|
256
145
|
/**
|
|
@@ -259,20 +148,26 @@ export interface Revised {
|
|
|
259
148
|
* cell's anchors drop unnamed. `warnings` are the parse's, then each revised
|
|
260
149
|
* content field's `parse::dropped_construct`, then the writer's `conform::*`.
|
|
261
150
|
* A field that lands rather than revises, on an inserted card or over no stored
|
|
262
|
-
* content, reports no drop.
|
|
151
|
+
* content, reports no drop. `from` names, for each composable card of the
|
|
152
|
+
* revised document, the index of the stored card it revises, or `null` for an
|
|
153
|
+
* inserted card; a stored card no entry names was removed, and only cards of
|
|
154
|
+
* one `$kind` pair.
|
|
263
155
|
*/
|
|
264
156
|
export interface DocumentRevised {
|
|
265
157
|
droppedAnchors: DocumentAnchor[];
|
|
266
158
|
warnings: Diagnostic[];
|
|
159
|
+
from: (number | null)[];
|
|
267
160
|
}
|
|
268
161
|
|
|
269
162
|
/**
|
|
270
163
|
* The read `toAnnotatedMarkdown` returns: `toMarkdown`'s markdown with a
|
|
271
|
-
*
|
|
272
|
-
*
|
|
273
|
-
*
|
|
274
|
-
*
|
|
275
|
-
*
|
|
164
|
+
* `<qm-anchor ref="…"></qm-anchor>` at each prose anchor's start its line
|
|
165
|
+
* can hold, and a `<qm-island ref="…"></qm-island>` token for each island
|
|
166
|
+
* whose markdown does not read back, which every revise reads back; and every
|
|
167
|
+
* anchor of every body and content field, spelled or not, a table cell's or
|
|
168
|
+
* a note's listed unspelled. Each names the `path` of its body or field and
|
|
169
|
+
* the text of the `line` its start sits on, island slots removed, or of its
|
|
170
|
+
* cell.
|
|
276
171
|
*/
|
|
277
172
|
export interface AnnotatedMarkdown {
|
|
278
173
|
markdown: string;
|
|
@@ -282,9 +177,40 @@ export interface AnnotatedMarkdown {
|
|
|
282
177
|
export interface DocumentAnchor {
|
|
283
178
|
id: string;
|
|
284
179
|
path: string;
|
|
180
|
+
/** The `$id` of the card `path` names; absent on the main card. */
|
|
181
|
+
cardId?: string;
|
|
285
182
|
line: string;
|
|
286
183
|
}
|
|
287
184
|
|
|
185
|
+
/**
|
|
186
|
+
* An anchor's context at its address (`anchorContexts`, `anchorContext`,
|
|
187
|
+
* `reattach`): the text-quote selector a host stores beside a comment thread.
|
|
188
|
+
* `path` is the body or content value's `DocPath` string. `quote` is the
|
|
189
|
+
* anchored text as stored, an inline island its `U+FFFC` slot and a line break
|
|
190
|
+
* its `\n`, empty for a point; `prefix` and `suffix` are up to 32 scalar values
|
|
191
|
+
* of stored text on each side, cut at the value's edges or a cell's. `cardId` is the `$id`
|
|
192
|
+
* of the card `path` names, absent on the main card: `reattach` finds the card
|
|
193
|
+
* by it wherever the card now sits, and orphans the selector where no card of
|
|
194
|
+
* the path's kind holds it.
|
|
195
|
+
*/
|
|
196
|
+
export interface AnchorContext {
|
|
197
|
+
id: string;
|
|
198
|
+
path: string;
|
|
199
|
+
cardId?: string;
|
|
200
|
+
quote: string;
|
|
201
|
+
prefix: string;
|
|
202
|
+
suffix: string;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
/**
|
|
206
|
+
* The receipt of `reattach`: each selector given, in order, either reattached
|
|
207
|
+
* with its context as read after the write, or orphaned as given.
|
|
208
|
+
*/
|
|
209
|
+
export interface Reattached {
|
|
210
|
+
reattached: AnchorContext[];
|
|
211
|
+
orphaned: AnchorContext[];
|
|
212
|
+
}
|
|
213
|
+
|
|
288
214
|
/**
|
|
289
215
|
* A markdown import (`importMarkdown`): the canonical `content`, and one
|
|
290
216
|
* `parse::dropped_construct` warning per construct it dropped, with no `path`.
|
|
@@ -294,108 +220,249 @@ export interface Imported {
|
|
|
294
220
|
warnings: Diagnostic[];
|
|
295
221
|
}
|
|
296
222
|
|
|
297
|
-
|
|
298
|
-
|
|
223
|
+
|
|
224
|
+
|
|
299
225
|
|
|
300
226
|
/**
|
|
301
|
-
*
|
|
302
|
-
* `
|
|
303
|
-
*
|
|
304
|
-
*
|
|
305
|
-
*
|
|
306
|
-
*
|
|
307
|
-
*
|
|
227
|
+
* One rich-text value: a card body or a `richtext` field. Flat `text` where a
|
|
228
|
+
* `\n` opens a block, `U+2028` is a hard break and `U+FFFC` is an island's
|
|
229
|
+
* slot; one block record per `\n`-separated segment, each `\n` carrying the
|
|
230
|
+
* record of the block it opens and `blocks[0]` the first block's; containers
|
|
231
|
+
* the blocks' paths name; formatting marks; comment anchors; and islands, a
|
|
232
|
+
* table's cells and a footnote's note each a nested `Content` in its `slots`.
|
|
233
|
+
* Every part carries an id. Offsets are UTF-16 code units, JavaScript string
|
|
234
|
+
* indices, into the `text` of the value holding them.
|
|
308
235
|
*/
|
|
309
|
-
export
|
|
310
|
-
|
|
311
|
-
|
|
236
|
+
export interface Content {
|
|
237
|
+
text: string;
|
|
238
|
+
blocks: ContentBlock[];
|
|
239
|
+
containers?: ContentContainer[];
|
|
240
|
+
marks?: ContentMark[];
|
|
241
|
+
anchors?: ContentAnchor[];
|
|
242
|
+
islands?: ContentIsland[];
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
/** A block's record: its kind and attributes, and its container path,
|
|
246
|
+
* outermost first. A kind, mark type or island type spelled `x-` and more
|
|
247
|
+
* is one this build does not know, held as written: a block reads as a
|
|
248
|
+
* paragraph, a mark formats nothing, an island renders as nothing. */
|
|
249
|
+
export type ContentBlock = { id: string; path?: string[] } & ContentBlockKind;
|
|
250
|
+
|
|
251
|
+
export type ContentBlockKind =
|
|
252
|
+
| { kind: "para" }
|
|
253
|
+
| { kind: "heading"; attrs: { level: number } }
|
|
254
|
+
| { kind: "code"; attrs?: { lang?: string } }
|
|
255
|
+
| { kind: "rule" }
|
|
256
|
+
| { kind: `x-${string}`; attrs?: Record<string, unknown> };
|
|
257
|
+
|
|
258
|
+
/** A list, a list item or a quote. An item's number is computed, never stored. */
|
|
259
|
+
export type ContentContainer = { id: string } & (
|
|
260
|
+
| { kind: "list"; attrs: { ordered: boolean; start: number } }
|
|
261
|
+
| { kind: "item"; attrs?: { checked?: boolean } }
|
|
262
|
+
| { kind: "quote" }
|
|
263
|
+
);
|
|
264
|
+
|
|
265
|
+
/** Formatting over `[start, end)`. Same-kind marks union; `link` and
|
|
266
|
+
* `font_family` hold one value per character. */
|
|
267
|
+
export type ContentMark = { start: number; end: number } & ContentMarkKind;
|
|
268
|
+
|
|
269
|
+
export type ContentMarkKind =
|
|
270
|
+
| { type: "strong" | "emph" | "underline" | "strike" | "code" }
|
|
271
|
+
| { type: "link"; attrs: { url: string } }
|
|
272
|
+
| { type: "font_family"; attrs: { name: string } }
|
|
273
|
+
| { type: `x-${string}`; attrs?: Record<string, unknown> };
|
|
274
|
+
|
|
275
|
+
/** A comment handle over `[start, end)` with a host-minted id; a point when
|
|
276
|
+
* the two are equal. */
|
|
277
|
+
export interface ContentAnchor {
|
|
278
|
+
id: string;
|
|
279
|
+
start: number;
|
|
280
|
+
end: number;
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
/** `props` of a `table` island. `columns` are column ids; each row maps a
|
|
284
|
+
* column id to the slot holding its cell. `rows[0]` is the header row, and
|
|
285
|
+
* `head` counts header rows from the top, absent at 1. `aligns` and `widths`
|
|
286
|
+
* are keyed by column id, `cell_attrs` by slot id. */
|
|
287
|
+
export interface TableProps {
|
|
288
|
+
columns: string[];
|
|
289
|
+
rows: { id: string; cells: Record<string, string> }[];
|
|
290
|
+
head?: number;
|
|
291
|
+
aligns?: Record<string, "left" | "center" | "right">;
|
|
292
|
+
widths?: Record<string, number>;
|
|
293
|
+
align?: "left" | "center" | "right";
|
|
294
|
+
cell_attrs?: Record<string, {
|
|
295
|
+
align?: "left" | "center" | "right";
|
|
296
|
+
valign?: "top" | "middle" | "bottom";
|
|
297
|
+
colspan?: number;
|
|
298
|
+
rowspan?: number;
|
|
299
|
+
}>;
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
/** An island: the object one `U+FFFC` of `text` stands for. A `table`'s cells
|
|
303
|
+
* and a `footnote`'s `note` are its `slots`. */
|
|
304
|
+
export type ContentIsland = { id: string; slots?: Record<string, Content> } & (
|
|
305
|
+
| { type: "table"; props: TableProps }
|
|
306
|
+
| { type: "image"; props: { url: string; alt: string } }
|
|
307
|
+
| { type: "footnote"; props: Record<string, never> }
|
|
308
|
+
| { type: "math"; props: { tex: string; display?: true } }
|
|
309
|
+
| { type: `x-${string}`; props: Record<string, unknown> }
|
|
310
|
+
);
|
|
312
311
|
|
|
313
312
|
/**
|
|
314
|
-
*
|
|
315
|
-
*
|
|
316
|
-
* metadata. `setContinues` sets or clears a line's within-block hard-break flag
|
|
317
|
-
* (`ContentLine.continues`); `continues: true` lands as `false` on line 0, which
|
|
318
|
-
* nothing precedes, on a line whose containers differ from the line above, and
|
|
319
|
-
* on one following a heading, a rule or a block island's line, each a block of
|
|
320
|
-
* one line. `setKind` lands a kind the line's text contradicts — `rule` over
|
|
321
|
-
* prose, `code` over a slot — as `para`, which is what re-importing the line's
|
|
322
|
-
* own markdown yields, and reads an `island` the union does not offer as the
|
|
323
|
-
* `para` that spelling projects. Read the content back to see where an op
|
|
324
|
-
* settled.
|
|
313
|
+
* An edit: a list of steps, each reading the value the step before it left.
|
|
314
|
+
* `apply` runs them all or none.
|
|
325
315
|
*/
|
|
326
|
-
export
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
| ({ op: "setKind"; line: number } & ContentLineKind)
|
|
330
|
-
| { op: "setContainers"; line: number; containers: ContentContainer[] }
|
|
331
|
-
| { op: "setContinues"; line: number; continues: boolean };
|
|
316
|
+
export interface Change {
|
|
317
|
+
steps: Step[];
|
|
318
|
+
}
|
|
332
319
|
|
|
333
320
|
/**
|
|
334
|
-
*
|
|
335
|
-
* cells or an image's url. Both ops leave the field's text and marks alone, so
|
|
336
|
-
* an island edit keeps every identity anchor in the field.
|
|
337
|
-
*
|
|
338
|
-
* `set` addresses an existing island by `id`; an unknown `id` throws. `insert`
|
|
339
|
-
* places a new island's slot at `at` together with its entry, so a slot never
|
|
340
|
-
* exists without an island behind it; its `id` must be non-empty and unused.
|
|
341
|
-
* `at` is a position in the text the `delta` and this bundle's earlier island
|
|
342
|
-
* ops left, so slots after `a` and `b` of `abc` go in at 1 and 3. A stale frame
|
|
343
|
-
* misplaces slots and never throws. A `delta` insert string may not carry a
|
|
344
|
-
* slot, which would orphan: split such a splice into the slot-free `delta` plus
|
|
345
|
-
* one `insert` per slot.
|
|
321
|
+
* One step, an object of one key naming it.
|
|
346
322
|
*
|
|
347
|
-
*
|
|
348
|
-
*
|
|
349
|
-
*
|
|
323
|
+
* - `splice` replaces `delete`, which must be the text at `at`, with `insert`.
|
|
324
|
+
* `marks` is the formatting the inserted text carries, offsets into
|
|
325
|
+
* `insert`, a mark without `start`/`end` covering all of it; `blocks` the
|
|
326
|
+
* record of each block an inserted `\n` opens; `islands` the island of each
|
|
327
|
+
* inserted `U+FFFC`. `removed` is what the deleted text held, filled in on
|
|
328
|
+
* the receipt's `applied`.
|
|
329
|
+
* - `setBlock` changes a block's kind, attributes or path.
|
|
330
|
+
* - `container` adds a container or sets an existing one's attributes, or
|
|
331
|
+
* removes one no path names.
|
|
332
|
+
* - `mark` adds or removes formatting over a range.
|
|
333
|
+
* - `anchor` places, moves or removes a comment anchor.
|
|
334
|
+
* - `island` replaces an island's props, or inserts an island's slot at `at`.
|
|
335
|
+
* - `nested` applies a change inside one slot of an island.
|
|
350
336
|
*
|
|
351
|
-
*
|
|
352
|
-
*
|
|
353
|
-
*
|
|
354
|
-
*
|
|
355
|
-
*
|
|
356
|
-
*
|
|
357
|
-
* after island ops.
|
|
358
|
-
*
|
|
359
|
-
* A `table` has no inline placement: markdown writes it as a block, so an
|
|
360
|
-
* `insert` whose `at` is not an empty line throws, as does a `set` retyping an
|
|
361
|
-
* inline island into one. A table already sharing its line, as a `join` or an
|
|
362
|
-
* `overwrite` of merged edits leaves one, stays there and takes its `set`;
|
|
363
|
-
* markdown writes it on a line of its own.
|
|
337
|
+
* A `mark` step and an `anchor` placement take `quote`, the text their range
|
|
338
|
+
* covered when the writer read it, and an island insert takes `block`, the id
|
|
339
|
+
* of the block the writer read `at` in. A step whose `quote` or `block` the
|
|
340
|
+
* value no longer holds is refused as stale (`edit::content_apply`), as a
|
|
341
|
+
* splice is whose `delete` the value no longer holds. The receipt's `applied`
|
|
342
|
+
* fills both in.
|
|
364
343
|
*/
|
|
365
|
-
export type
|
|
366
|
-
|
|
|
367
|
-
|
|
344
|
+
export type Step =
|
|
345
|
+
| { splice: { at: number; delete?: string; insert: string;
|
|
346
|
+
marks?: ({ start?: number; end?: number } & ContentMarkKind)[];
|
|
347
|
+
blocks?: ContentBlock[]; islands?: ContentIsland[];
|
|
348
|
+
removed?: { blocks?: ContentBlock[]; marks?: ContentMark[]; islands?: ContentIsland[] } } }
|
|
349
|
+
| { setBlock: { id: string; kind?: ContentBlockKind["kind"]; attrs?: Record<string, unknown>; path?: string[] } }
|
|
350
|
+
| { container: ContentContainer | { id: string; remove: true } }
|
|
351
|
+
| { mark: { start: number; end: number; add: boolean; quote?: string } & ContentMarkKind }
|
|
352
|
+
| { anchor: (ContentAnchor & { quote?: string }) | { id: string; remove: true } }
|
|
353
|
+
| { island: { id: string; props: Record<string, unknown>; slots?: Record<string, Content> } | { at: number; island: ContentIsland; block?: string } }
|
|
354
|
+
| { nested: { island: string; slot: string; change: Change } };
|
|
368
355
|
|
|
369
356
|
/**
|
|
370
|
-
*
|
|
371
|
-
* `
|
|
372
|
-
*
|
|
373
|
-
*
|
|
374
|
-
*
|
|
375
|
-
*
|
|
376
|
-
*
|
|
377
|
-
*
|
|
378
|
-
*
|
|
379
|
-
*
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
357
|
+
* What a write did. `applied` is the change in its normalized form, which
|
|
358
|
+
* `invert(applied, before)` undoes; `hash` is the value's new hash, the next
|
|
359
|
+
* write's `base`. `droppedAnchors` names each anchor the value held and holds
|
|
360
|
+
* nowhere now, as it read before: every one a `revise` or `replace` lost, and
|
|
361
|
+
* for an `apply` every one but those its `anchor` steps removed.
|
|
362
|
+
* `movedAnchors` names each surviving one whose text the write rewrote.
|
|
363
|
+
* `warnings` holds a `parse::dropped_construct` per construct a revise's
|
|
364
|
+
* markdown dropped.
|
|
365
|
+
* `rebased` says the write's `base` was a value the field had moved on from,
|
|
366
|
+
* and the write was rebased over what changed since.
|
|
367
|
+
*/
|
|
368
|
+
export interface Receipt {
|
|
369
|
+
applied: Change;
|
|
370
|
+
hash: string;
|
|
371
|
+
droppedAnchors: DroppedAnchor[];
|
|
372
|
+
movedAnchors: { id: string; before: string; after: string }[];
|
|
373
|
+
warnings: Diagnostic[];
|
|
374
|
+
rebased: boolean;
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
/**
|
|
378
|
+
* A receipt's dropped anchor: its selector, which `reattach` takes as given,
|
|
379
|
+
* and the `island` and `slot` that held it, absent for an anchor in the
|
|
380
|
+
* value's own text.
|
|
381
|
+
*/
|
|
382
|
+
export interface DroppedAnchor extends AnchorContext {
|
|
383
|
+
island?: string;
|
|
384
|
+
slot?: string;
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
/** The hash a writer read. A value that has changed since rebases the write
|
|
388
|
+
* over the change, refusing it with `edit::rebase_conflict` where the two
|
|
389
|
+
* touch the same text or record, and with `edit::stale_base` where the document no
|
|
390
|
+
* longer holds the change since. Pass it: a write without one lands over
|
|
391
|
+
* whatever the value now holds. */
|
|
392
|
+
export interface WriteOptions {
|
|
393
|
+
base?: string;
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
/** A position in a value: an offset into its text, or one inside an
|
|
397
|
+
* island's slot. */
|
|
398
|
+
export type Pos = number | { island: string; slot: string; at: Pos };
|
|
399
|
+
|
|
400
|
+
/**
|
|
401
|
+
* Where `mapPos` carried a position, and what around it the change deleted:
|
|
402
|
+
* the character on its `assoc` side (`deleted`), the one before, the one
|
|
403
|
+
* after, or both in one deletion (`deletedAcross`).
|
|
389
404
|
*/
|
|
390
|
-
export interface
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
405
|
+
export interface MapResult {
|
|
406
|
+
pos: Pos;
|
|
407
|
+
deleted: boolean;
|
|
408
|
+
deletedBefore: boolean;
|
|
409
|
+
deletedAfter: boolean;
|
|
410
|
+
deletedAcross: boolean;
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
/** What `wrap` opens around the blocks it wraps: a quote, or a list with an
|
|
414
|
+
* item per wrapped child, each `checked` as given. */
|
|
415
|
+
export type WrapKind = { kind: "quote" } | { kind: "list"; ordered: boolean; checked?: boolean };
|
|
416
|
+
|
|
417
|
+
/**
|
|
418
|
+
* A value as a merge of concurrent edits left it, for `repair`: shaped as
|
|
419
|
+
* `Content`, its invariants unchecked. `islands` is an array paired with the
|
|
420
|
+
* slots in order, or an object keyed by island id with `slot_ids` naming the
|
|
421
|
+
* island each `U+FFFC` carries, `null` for none. An anchor placed as a range
|
|
422
|
+
* carries `range: true`, since one collapsed to zero width reads as a point
|
|
423
|
+
* otherwise. An offset inside a character moves to its start, and one past
|
|
424
|
+
* the text to its end.
|
|
425
|
+
*/
|
|
426
|
+
export interface RawContent {
|
|
427
|
+
text: string;
|
|
428
|
+
blocks: ContentBlock[];
|
|
429
|
+
containers?: ContentContainer[];
|
|
430
|
+
marks?: ContentMark[];
|
|
431
|
+
anchors?: (ContentAnchor & { range?: boolean })[];
|
|
432
|
+
islands?: (ContentIsland & { slots?: Record<string, RawContent> })[]
|
|
433
|
+
| Record<string, Omit<ContentIsland, "id"> & { slots?: Record<string, RawContent> }>;
|
|
434
|
+
slot_ids?: (string | null)[];
|
|
435
|
+
}
|
|
436
|
+
|
|
437
|
+
/**
|
|
438
|
+
* One mend `repair` made. `inserts` marks one whose write-back inserts text
|
|
439
|
+
* or a slot, which only a session's single writer writes back; any peer may
|
|
440
|
+
* write back a report holding none.
|
|
441
|
+
*/
|
|
442
|
+
export type Repair = { inserts?: true } & (
|
|
443
|
+
| { repair: "missing_container"; block: string; container: string }
|
|
444
|
+
| { repair: "two_parents"; container: string }
|
|
445
|
+
| { repair: "split_run"; container: string; fresh: string }
|
|
446
|
+
| { repair: "orphan_slot"; island: string | null }
|
|
447
|
+
| { repair: "orphan_island"; island: string }
|
|
448
|
+
| { repair: "shared_island"; island: string; fresh: string }
|
|
449
|
+
| { repair: "split_block"; island: string; block: string }
|
|
450
|
+
| { repair: "empty_cell"; island: string; slot: string }
|
|
451
|
+
| { repair: "collapsed_anchor"; id: string }
|
|
452
|
+
| { repair: "invalid"; reason: string }
|
|
453
|
+
| { repair: "in_slot"; island: string; slot: string; inner: Repair }
|
|
454
|
+
);
|
|
455
|
+
|
|
456
|
+
/** What `repair` read a merged value as: the valid `content`, and each
|
|
457
|
+
* mend, none for a value already valid. */
|
|
458
|
+
export interface Repaired {
|
|
459
|
+
content: Content;
|
|
460
|
+
repairs: Repair[];
|
|
395
461
|
}
|
|
396
462
|
|
|
397
463
|
|
|
398
464
|
|
|
465
|
+
|
|
399
466
|
/**
|
|
400
467
|
* One segment of a parsed `Diagnostic.path` (see `parseDocPath`). The head
|
|
401
468
|
* carries the document-model root: `main` (only before `body`), a `card`
|
|
@@ -656,8 +723,8 @@ export interface QuillMetadata {
|
|
|
656
723
|
|
|
657
724
|
|
|
658
725
|
/**
|
|
659
|
-
* A resolved point → content position: the field a click landed in and the
|
|
660
|
-
* offset into its `Content`. The `LiveSession.positionAt` result, inverse of
|
|
726
|
+
* A resolved point → content position: the field a click landed in and the
|
|
727
|
+
* UTF-16 offset into its `Content`. The `LiveSession.positionAt` result, inverse of
|
|
661
728
|
* `locate`.
|
|
662
729
|
*/
|
|
663
730
|
export interface ContentHit {
|
|
@@ -666,7 +733,7 @@ export interface ContentHit {
|
|
|
666
733
|
*/
|
|
667
734
|
field: string;
|
|
668
735
|
/**
|
|
669
|
-
*
|
|
736
|
+
* UTF-16 offset into the field's `Content`.
|
|
670
737
|
*/
|
|
671
738
|
pos: number;
|
|
672
739
|
/**
|
|
@@ -696,8 +763,8 @@ export interface FieldRegion {
|
|
|
696
763
|
*/
|
|
697
764
|
rect: [number, number, number, number];
|
|
698
765
|
/**
|
|
699
|
-
* The slice this box covers:
|
|
700
|
-
* for one content segment, `undefined` for a scalar's ink, a claim or a
|
|
766
|
+
* The slice this box covers: UTF-16 `[start, end)` into the field's
|
|
767
|
+
* `Content` for one content segment, `undefined` for a scalar's ink, a claim or a
|
|
701
768
|
* widget.
|
|
702
769
|
*/
|
|
703
770
|
span?: [number, number];
|
|
@@ -821,22 +888,40 @@ export class Document {
|
|
|
821
888
|
free(): void;
|
|
822
889
|
[Symbol.dispose](): void;
|
|
823
890
|
/**
|
|
824
|
-
*
|
|
825
|
-
*
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
*
|
|
830
|
-
*
|
|
831
|
-
*
|
|
832
|
-
*
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
*
|
|
837
|
-
*
|
|
891
|
+
* The context of the anchor `id`, or `undefined` where no body or
|
|
892
|
+
* content value holds one.
|
|
893
|
+
*/
|
|
894
|
+
anchorContext(id: string): AnchorContext | undefined;
|
|
895
|
+
/**
|
|
896
|
+
* Every anchor of every body and content value with its context, a table
|
|
897
|
+
* cell's or a note's included, in the order `toAnnotatedMarkdown` lists
|
|
898
|
+
* anchors: the selector a host stores beside a comment thread and hands
|
|
899
|
+
* back to `reattach`.
|
|
900
|
+
*/
|
|
901
|
+
anchorContexts(): AnchorContext[];
|
|
902
|
+
/**
|
|
903
|
+
* The annotated read of the body or richtext field at `addr` alone: the
|
|
904
|
+
* scoped twin of `toAnnotatedMarkdown`, what a revise at `addr` reads
|
|
905
|
+
* back and the `baseMarkdown` it merges against. Each anchor names `addr`'s
|
|
906
|
+
* path. An absent field reads as the empty content. Throws as `hashAt`.
|
|
907
|
+
*/
|
|
908
|
+
annotatedAt(addr: Addr | string): AnnotatedMarkdown;
|
|
909
|
+
/**
|
|
910
|
+
* The markdown at `addr` with a `qm-*` tag for each anchor and island id
|
|
911
|
+
* its lines can hold: what `revise` reads back. Throws as `read`.
|
|
838
912
|
*/
|
|
839
|
-
|
|
913
|
+
annotated(addr: Addr | string): string;
|
|
914
|
+
/**
|
|
915
|
+
* **Apply** `change` to the value at `addr`, all its steps or none, and
|
|
916
|
+
* answer the `Receipt`. `opts.base` is the hash the writer read
|
|
917
|
+
* (`hash(addr)`), and the change's offsets are into the value it names:
|
|
918
|
+
* one the value has moved on from rebases the change over the change
|
|
919
|
+
* since, throwing `edit::rebase_conflict` where they touch the same text or
|
|
920
|
+
* record and `edit::stale_base` where the document no longer holds the change
|
|
921
|
+
* since. A refused change throws `edit::content_apply` and writes
|
|
922
|
+
* nothing.
|
|
923
|
+
*/
|
|
924
|
+
apply(addr: Addr | string, change: Change, opts?: WriteOptions): Receipt;
|
|
840
925
|
/**
|
|
841
926
|
* The **body** markdown projection: an on-demand, lossy export (content-only
|
|
842
927
|
* marks do not survive markdown). A body's type is a format fact, not a
|
|
@@ -863,11 +948,10 @@ export class Document {
|
|
|
863
948
|
clone(): Document;
|
|
864
949
|
/**
|
|
865
950
|
* The newest storage version this build writes via
|
|
866
|
-
* [`toStored`](Document::to_stored): a document
|
|
867
|
-
*
|
|
868
|
-
* carries
|
|
869
|
-
*
|
|
870
|
-
* release.
|
|
951
|
+
* [`toStored`](Document::to_stored): a document holding a composable
|
|
952
|
+
* card, each carrying its `$id`, carries it. A document of the main card
|
|
953
|
+
* alone carries the oldest tag that holds its content. The tag advances
|
|
954
|
+
* only when the wire format changes, not on every release.
|
|
871
955
|
*/
|
|
872
956
|
static currentStorageVersion(): string;
|
|
873
957
|
/**
|
|
@@ -880,7 +964,7 @@ export class Document {
|
|
|
880
964
|
static fromMarkdown(markdown: string): Document;
|
|
881
965
|
/**
|
|
882
966
|
* Reconstruct a `Document` from a versioned storage DTO string produced by
|
|
883
|
-
* [`toStored`](Document::to_stored)
|
|
967
|
+
* [`toStored`](Document::to_stored), with no `warnings`.
|
|
884
968
|
* Throws if `json` is not a valid storage DTO (malformed JSON, unknown
|
|
885
969
|
* `schema`, missing fields, or unparseable quill reference).
|
|
886
970
|
*/
|
|
@@ -912,6 +996,23 @@ export class Document {
|
|
|
912
996
|
* unread, which is the contract and why it is `unknown`.
|
|
913
997
|
*/
|
|
914
998
|
getStored(addr: Addr | string): unknown;
|
|
999
|
+
/**
|
|
1000
|
+
* The hash of the body or richtext field at `addr`, the `baseHash` a
|
|
1001
|
+
* revise at `addr` checks: the hash of its content, an absent field the
|
|
1002
|
+
* empty content. An absent `addr.field` reads the body, an absent
|
|
1003
|
+
* `addr.card` the main card. Richtext only; the
|
|
1004
|
+
* typed `writer.hashAt` reads a field of any type through its schema.
|
|
1005
|
+
* Throws on an out-of-range card, a malformed field name, or a present
|
|
1006
|
+
* non-content field value.
|
|
1007
|
+
*/
|
|
1008
|
+
hashAt(addr: Addr | string): string;
|
|
1009
|
+
/**
|
|
1010
|
+
* With no `addr`, the hash of the document's stored form, the quill-free
|
|
1011
|
+
* twin of `writer.hash()`: equal documents hash alike, whatever order a
|
|
1012
|
+
* store kept their keys in. With one, the hash of the `Content` at
|
|
1013
|
+
* `addr`, the `base` a write to it names. Throws as `read`.
|
|
1014
|
+
*/
|
|
1015
|
+
hash(addr?: Addr | string): string;
|
|
915
1016
|
/**
|
|
916
1017
|
* Insert a card: `at` absent appends, a number inserts at that index (in
|
|
917
1018
|
* `0..=cards.length`). Accepts any `CardInput`, including a card read back
|
|
@@ -920,19 +1021,6 @@ export class Document {
|
|
|
920
1021
|
* 1,000 cards.
|
|
921
1022
|
*/
|
|
922
1023
|
insertCard(card: CardInput, at?: number): void;
|
|
923
|
-
/**
|
|
924
|
-
* Replace this document's contents **in place** from a versioned storage DTO
|
|
925
|
-
* string: the mutating twin of [`fromStored`](Document::from_stored).
|
|
926
|
-
* Parse-time `warnings` are cleared. Throws on an invalid DTO, leaving the
|
|
927
|
-
* document unchanged. A caller holding the document need not re-bind its
|
|
928
|
-
* variable.
|
|
929
|
-
*/
|
|
930
|
-
loadStored(json: string): void;
|
|
931
|
-
/**
|
|
932
|
-
* The Quillmark Markdown rules, re-exposed from core. Constant across
|
|
933
|
-
* calls; read once and cache.
|
|
934
|
-
*/
|
|
935
|
-
static markdownRules(): string;
|
|
936
1024
|
/**
|
|
937
1025
|
* Move the card at `from` to position `to`. `from == to` is a no-op.
|
|
938
1026
|
*/
|
|
@@ -945,18 +1033,6 @@ export class Document {
|
|
|
945
1033
|
* an invalid quill reference.
|
|
946
1034
|
*/
|
|
947
1035
|
constructor(quill_ref: string);
|
|
948
|
-
/**
|
|
949
|
-
* **Overwrite** the content value at `addr` with exactly `rt`: value
|
|
950
|
-
* semantics, so the identity anchors of any previous value are gone. By
|
|
951
|
-
* anchor fate `overwrite` destroys, [`revise`](Document::revise) and
|
|
952
|
-
* [`reviseContent`](Document::revise_content) rebase, and
|
|
953
|
-
* [`applyChange`](Document::apply_change) preserves. An absent
|
|
954
|
-
* `addr.field` targets the body, an absent `addr.card` the main card.
|
|
955
|
-
*
|
|
956
|
-
* Throws on an out-of-range card, a malformed field name, or an `rt` that is
|
|
957
|
-
* not a canonical content object.
|
|
958
|
-
*/
|
|
959
|
-
overwrite(addr: Addr | string, rt: Content): void;
|
|
960
1036
|
/**
|
|
961
1037
|
* `addr`'s canonical `DocPath` string, the anchor `Diagnostic.path` carries:
|
|
962
1038
|
* `pathFor()` is `main.body`, `pathFor("intro")` `main.intro`,
|
|
@@ -970,7 +1046,7 @@ export class Document {
|
|
|
970
1046
|
* **Total on the index axis**, unlike the `Addr` reads, which throw there:
|
|
971
1047
|
* an out-of-range `{card: 7, field: "from"}` renders `cards[7].from`, which
|
|
972
1048
|
* parses back and resolves to nothing rather than mis-targeting. Only a
|
|
973
|
-
* malformed address throws.
|
|
1049
|
+
* malformed address throws, or a card id no card holds.
|
|
974
1050
|
*/
|
|
975
1051
|
pathFor(addr: Addr | string): string;
|
|
976
1052
|
/**
|
|
@@ -979,6 +1055,32 @@ export class Document {
|
|
|
979
1055
|
* messages from this instead of re-stating the rule.
|
|
980
1056
|
*/
|
|
981
1057
|
static quillRefHint(): string;
|
|
1058
|
+
/**
|
|
1059
|
+
* The `Content` at `addr`: an absent `addr.field` reads the body, an
|
|
1060
|
+
* absent `addr.card` the main card, and an absent field the empty
|
|
1061
|
+
* content. Throws on an out-of-range card, a malformed field name, or a
|
|
1062
|
+
* present field value that is not content.
|
|
1063
|
+
*/
|
|
1064
|
+
read(addr: Addr | string): Content;
|
|
1065
|
+
/**
|
|
1066
|
+
* Re-add anchors a write dropped, each at the `path` its selector names,
|
|
1067
|
+
* where its `quote` is found exactly once with its context agreeing: four
|
|
1068
|
+
* scalar values of quote or more, or a table's slot alone, eight of
|
|
1069
|
+
* context on each side or the whole context where the value's edge cut
|
|
1070
|
+
* it, and an empty quote a point where the two meet. Never a nearest match. Returns the `Reattached`
|
|
1071
|
+
* receipt.
|
|
1072
|
+
*
|
|
1073
|
+
* A path naming no body or content value orphans its selector, and
|
|
1074
|
+
* nothing remaps a card index. An id live anywhere in the document, a
|
|
1075
|
+
* table cell's included, is answered as reattached and not written. Each
|
|
1076
|
+
* id is answered once, by its first selector. `deltas` maps a path to the
|
|
1077
|
+
* `delta` of the revise that dropped its anchors, and a match there must
|
|
1078
|
+
* overlap text that revise inserted.
|
|
1079
|
+
*
|
|
1080
|
+
* Throws on a selector or delta that is not one, or a `path` that does
|
|
1081
|
+
* not parse.
|
|
1082
|
+
*/
|
|
1083
|
+
reattach(selectors: AnchorContext[], deltas?: Record<string, Delta>): Reattached;
|
|
982
1084
|
removeCard(index: number): Card | undefined;
|
|
983
1085
|
/**
|
|
984
1086
|
* Remove the `$ext` map on the card `addr` targets entirely, returning the
|
|
@@ -998,36 +1100,20 @@ export class Document {
|
|
|
998
1100
|
*/
|
|
999
1101
|
removeSeedOverlay(card_kind: string): any;
|
|
1000
1102
|
/**
|
|
1001
|
-
*
|
|
1002
|
-
*
|
|
1003
|
-
*
|
|
1004
|
-
*
|
|
1005
|
-
* anchors through the diff, and returns the
|
|
1006
|
-
* `Revised` receipt, whose `delta` an editor bridge maps its own positions
|
|
1007
|
-
* through and whose `warnings` is empty. `rt`'s own anchors and island ids
|
|
1008
|
-
* land as they are. An absent `addr.field` targets the body, an absent
|
|
1009
|
-
* `addr.card` the main card; an absent field diffs from empty. Richtext
|
|
1010
|
-
* only: a `text` field takes `overwrite`.
|
|
1011
|
-
*
|
|
1012
|
-
* Throws on an out-of-range card, a malformed field name, a present
|
|
1013
|
-
* non-content field value, or an `rt` that is not a canonical content
|
|
1014
|
-
* object.
|
|
1103
|
+
* Write `content` over the value at `addr`, carrying each anchor it does
|
|
1104
|
+
* not name where a diff keeps its text and reporting the rest in
|
|
1105
|
+
* `droppedAnchors`. Throws as `apply`, and on a `content` that is not a
|
|
1106
|
+
* `Content`.
|
|
1015
1107
|
*/
|
|
1016
|
-
|
|
1108
|
+
replace(addr: Addr | string, content: Content, opts?: WriteOptions): Receipt;
|
|
1017
1109
|
/**
|
|
1018
|
-
*
|
|
1019
|
-
*
|
|
1020
|
-
*
|
|
1021
|
-
*
|
|
1022
|
-
*
|
|
1023
|
-
* import dropped, its `path` the address written. An absent `addr.field`
|
|
1024
|
-
* targets the body, an absent `addr.card` the main card; an absent field
|
|
1025
|
-
* cold-imports from empty.
|
|
1026
|
-
*
|
|
1027
|
-
* Throws on an out-of-range card, a malformed field name, a present
|
|
1028
|
-
* non-content field value, or an over-nested markdown input.
|
|
1110
|
+
* Rewrite the value at `addr` as `markdown`: the anchors and islands
|
|
1111
|
+
* whose `qm-*` tags it keeps (`annotated(addr)` spells them) stay put,
|
|
1112
|
+
* and the rest keeps what a word-aligned diff keeps. Answers the
|
|
1113
|
+
* `Receipt`, its `warnings` the import's. Throws as `apply`, and on an
|
|
1114
|
+
* over-nested markdown input.
|
|
1029
1115
|
*/
|
|
1030
|
-
revise(addr: Addr | string, markdown: string):
|
|
1116
|
+
revise(addr: Addr | string, markdown: string, opts?: WriteOptions): Receipt;
|
|
1031
1117
|
/**
|
|
1032
1118
|
* The main card's `$seed[kind]` overlay object, or `undefined`. Feeds
|
|
1033
1119
|
* `quill.seedCard(kind, overlay)` without serializing the whole main card,
|
|
@@ -1060,18 +1146,10 @@ export class Document {
|
|
|
1060
1146
|
* write is [`commitField`](Document::commit_field). A bare string is `Addr`
|
|
1061
1147
|
* shorthand for `{ field }`; `{ card: 2, field: "qty" }` targets a
|
|
1062
1148
|
* composable card. A body address throws:
|
|
1063
|
-
* write a body with `
|
|
1149
|
+
* write a body with `writer.reviseBody` / `replace`. Throws on an out-of-range card
|
|
1064
1150
|
* or a malformed name.
|
|
1065
1151
|
*/
|
|
1066
1152
|
storeField(addr: Addr | string, value: any): void;
|
|
1067
|
-
/**
|
|
1068
|
-
* Store several fields verbatim and atomically on the card `addr` targets.
|
|
1069
|
-
* `addr` is a **card address** (`{ card }`, absent = main) and comes first
|
|
1070
|
-
* because `card` is itself a legal field name; a present `field` throws.
|
|
1071
|
-
* Nothing is applied on error, and the thrown error's `diagnostics` carry
|
|
1072
|
-
* one entry per offending field. Throws on an out-of-range card.
|
|
1073
|
-
*/
|
|
1074
|
-
storeFields(addr: CardAddr, fields: Record<string, unknown>): void;
|
|
1075
1153
|
/**
|
|
1076
1154
|
* Merge a card-kind's seed `overlay` into the **main** card's `$seed` map
|
|
1077
1155
|
* under `cardKind`, preserving sibling kinds; `$seed` is main-only, so this
|
|
@@ -1081,10 +1159,11 @@ export class Document {
|
|
|
1081
1159
|
storeSeedOverlay(card_kind: string, overlay: any): void;
|
|
1082
1160
|
/**
|
|
1083
1161
|
* `toMarkdown` with each prose anchor of every body and content field
|
|
1084
|
-
* spelled
|
|
1085
|
-
* listed with its field's path and line
|
|
1086
|
-
*
|
|
1087
|
-
*
|
|
1162
|
+
* spelled at its start where its line can hold the tag, every anchor,
|
|
1163
|
+
* a cell's too, listed with its field's path and line, and each island whose markdown
|
|
1164
|
+
* does not read back spelled as its token. `writer.reviseDocument` reads
|
|
1165
|
+
* both back: a kept tag pins its anchor, and a token keeps its island as
|
|
1166
|
+
* stored.
|
|
1088
1167
|
*/
|
|
1089
1168
|
toAnnotatedMarkdown(): AnnotatedMarkdown;
|
|
1090
1169
|
/**
|
|
@@ -1115,7 +1194,8 @@ export class Document {
|
|
|
1115
1194
|
* The non-fatal diagnostics of the load that produced this document: parse
|
|
1116
1195
|
* warnings, plus `conform::*` warnings when it came through `quill.parse`.
|
|
1117
1196
|
* Session state, not document value: `equals` and the storage DTO exclude
|
|
1118
|
-
* it
|
|
1197
|
+
* it. `fromStored` sets it to the stored value's anchor id
|
|
1198
|
+
* collisions, and `writer.reviseDocument` clears it.
|
|
1119
1199
|
*/
|
|
1120
1200
|
readonly warnings: Diagnostic[];
|
|
1121
1201
|
}
|
|
@@ -1209,8 +1289,10 @@ export class LiveSession {
|
|
|
1209
1289
|
/**
|
|
1210
1290
|
* A content position → **caret rect**, the reverse of `positionAt`: the box
|
|
1211
1291
|
* to draw a caret at, in the same bottom-left PDF-point space as
|
|
1212
|
-
* `FieldRegion.rect`, its `span` collapsed to `[pos, pos]`. `
|
|
1213
|
-
*
|
|
1292
|
+
* `FieldRegion.rect`, its `span` collapsed to `[pos, pos]`. `pos` is a
|
|
1293
|
+
* UTF-16 offset into the field's `Content`. `undefined` when the field
|
|
1294
|
+
* places no tracked content, the offset falls inside a character, or it
|
|
1295
|
+
* maps to no drawn glyph.
|
|
1214
1296
|
*/
|
|
1215
1297
|
locate(field: string, pos: number): FieldRegion | undefined;
|
|
1216
1298
|
/**
|
|
@@ -1236,8 +1318,8 @@ export class LiveSession {
|
|
|
1236
1318
|
*/
|
|
1237
1319
|
paint(ctx: CanvasRenderingContext2D | OffscreenCanvasRenderingContext2D, page: number, scale: number): void;
|
|
1238
1320
|
/**
|
|
1239
|
-
* A point → **content position**: the field *and* a
|
|
1240
|
-
* `Content`, for placing a caret or mapping a selection into the content
|
|
1321
|
+
* A point → **content position**: the field *and* a UTF-16 offset into
|
|
1322
|
+
* its `Content`, for placing a caret or mapping a selection into the content
|
|
1241
1323
|
* model, or `undefined` off all content ink. `x`/`y`/`tolPt` are PDF
|
|
1242
1324
|
* points, bottom-left origin, as in `fieldAt`. The offset is cluster-exact
|
|
1243
1325
|
* and degrades to the containing segment's start on origin-less ink.
|
|
@@ -1264,14 +1346,10 @@ export class LiveSession {
|
|
|
1264
1346
|
* and the session recovers on the next successful `update`. On success,
|
|
1265
1347
|
* repaint `dirtyPages ∩ visible`.
|
|
1266
1348
|
*
|
|
1267
|
-
* Distinct from [`
|
|
1268
|
-
*
|
|
1349
|
+
* Distinct from [`apply`](Document::apply), which edits a document's
|
|
1350
|
+
* content; this recompiles a document the caller already mutated.
|
|
1269
1351
|
*/
|
|
1270
1352
|
update(doc: Document): ChangeSet;
|
|
1271
|
-
/**
|
|
1272
|
-
* The backend that produced this session (e.g. `"typst"`).
|
|
1273
|
-
*/
|
|
1274
|
-
readonly backendId: string;
|
|
1275
1353
|
readonly pageCount: number;
|
|
1276
1354
|
/**
|
|
1277
1355
|
* Non-fatal diagnostics of the session's **current compile**, refreshed by
|
|
@@ -1366,11 +1444,6 @@ export class Quill {
|
|
|
1366
1444
|
* field's blank).
|
|
1367
1445
|
*/
|
|
1368
1446
|
seedDocument(): Document;
|
|
1369
|
-
/**
|
|
1370
|
-
* Seed a starter main `Card` (carries `$quill`) from the schema: the
|
|
1371
|
-
* `$kind: main` card of [`seedDocument`](Self::seed_document) alone.
|
|
1372
|
-
*/
|
|
1373
|
-
seedMain(): Card;
|
|
1374
1447
|
/**
|
|
1375
1448
|
* `doc` as an authoring document: every field in the values form (each
|
|
1376
1449
|
* content leaf its codec's text), every body as Markdown, each card
|
|
@@ -1432,6 +1505,20 @@ export class Quill {
|
|
|
1432
1505
|
readonly warnings: Diagnostic[];
|
|
1433
1506
|
}
|
|
1434
1507
|
|
|
1508
|
+
/**
|
|
1509
|
+
* Deleting `[start, end)`: the splice, and where the range runs from a
|
|
1510
|
+
* block's start into a later block, the `setBlock` giving the block that
|
|
1511
|
+
* keeps the text the shape of the block the range ends in.
|
|
1512
|
+
*/
|
|
1513
|
+
export function deleteRange(content: Content, start: number, end: number): Change;
|
|
1514
|
+
|
|
1515
|
+
/**
|
|
1516
|
+
* A change taking `before` to `after`, word-aligned, for a writer with no
|
|
1517
|
+
* steps of its own. Throws `edit::content_apply` where `after` is not a
|
|
1518
|
+
* valid value.
|
|
1519
|
+
*/
|
|
1520
|
+
export function diff(before: Content, after: Content): Change;
|
|
1521
|
+
|
|
1435
1522
|
/**
|
|
1436
1523
|
* Export canonical `Content` to its markdown projection. Throws if `rt` is not
|
|
1437
1524
|
* canonical content.
|
|
@@ -1459,14 +1546,35 @@ export function formatDiagnostic(diagnostic: Diagnostic): string;
|
|
|
1459
1546
|
export function formatDocPath(segs: DocPathSeg[]): string;
|
|
1460
1547
|
|
|
1461
1548
|
/**
|
|
1462
|
-
* Import a markdown string: the
|
|
1549
|
+
* Import a markdown string: the markdown codec's import, pure and document-free. Returns the
|
|
1463
1550
|
* canonical `content` and a `parse::dropped_construct` warning per construct
|
|
1464
|
-
* the import dropped, with no `path`. `
|
|
1465
|
-
* spells the cold
|
|
1551
|
+
* the import dropped, with no `path`. `replace(addr, importMarkdown(md).content)`
|
|
1552
|
+
* spells the cold write; prefer `revise` for edit semantics.
|
|
1466
1553
|
* Throws on an over-nested input.
|
|
1467
1554
|
*/
|
|
1468
1555
|
export function importMarkdown(markdown: string): Imported;
|
|
1469
1556
|
|
|
1557
|
+
/**
|
|
1558
|
+
* Tab over the blocks `first` to `last` (`first` alone when absent): the
|
|
1559
|
+
* change nesting their items under the item before them. Throws
|
|
1560
|
+
* `edit::content_apply` where `first` is in no item, the range leaves its
|
|
1561
|
+
* list, or its first item is the list's first.
|
|
1562
|
+
*/
|
|
1563
|
+
export function indent(content: Content, first: string, last?: string | null): Change;
|
|
1564
|
+
|
|
1565
|
+
/**
|
|
1566
|
+
* Typing at `at`: the formatting the typed text carries, for a splice's
|
|
1567
|
+
* `marks`, in canonical order. Throws `edit::content_apply` where `at` is
|
|
1568
|
+
* past the text.
|
|
1569
|
+
*/
|
|
1570
|
+
export function inheritedMarks(content: Content, at: number): ContentMarkKind[];
|
|
1571
|
+
|
|
1572
|
+
/**
|
|
1573
|
+
* The change that undoes `change` on `before`. Throws `edit::content_apply`
|
|
1574
|
+
* where `change` does not apply to `before`.
|
|
1575
|
+
*/
|
|
1576
|
+
export function invert(change: Change, before: Content): Change;
|
|
1577
|
+
|
|
1470
1578
|
/**
|
|
1471
1579
|
* Whether `content` satisfies the one-line constraint of `text` and
|
|
1472
1580
|
* `richtext`: one `Para` line, in no container, with no islands. Judged on
|
|
@@ -1484,41 +1592,36 @@ export function isInline(content: Content): boolean;
|
|
|
1484
1592
|
export function isPlain(content: Content): boolean;
|
|
1485
1593
|
|
|
1486
1594
|
/**
|
|
1487
|
-
*
|
|
1488
|
-
*
|
|
1489
|
-
*
|
|
1490
|
-
* The document-free read an editor diffs against to decide which `markOps` to
|
|
1491
|
-
* emit, rather than reproducing that rule in its own language.
|
|
1492
|
-
*
|
|
1493
|
-
* `bundle.markOps` are ignored. The answer is normalized, as the store's is:
|
|
1494
|
-
* marks a text move drops (out of range, zero-width formatting) are absent,
|
|
1495
|
-
* and same-kind runs a move left adjacent arrive already unioned, so a bundle
|
|
1496
|
-
* carrying no `markOps` names the marks the field will hold.
|
|
1497
|
-
* Throws on a non-content `content`, a malformed bundle, or an op that applies
|
|
1498
|
-
* out of bounds: `applyChange`'s errors on the same ops.
|
|
1595
|
+
* Backspace at the start of block `id`: the change joining it onto the block
|
|
1596
|
+
* before it, under that block's record. Throws `edit::content_apply` for the
|
|
1597
|
+
* first block or an id no block holds.
|
|
1499
1598
|
*/
|
|
1500
|
-
export function
|
|
1599
|
+
export function joinBlocks(content: Content, id: string): Change;
|
|
1501
1600
|
|
|
1502
1601
|
/**
|
|
1503
|
-
*
|
|
1504
|
-
*
|
|
1505
|
-
*
|
|
1506
|
-
*
|
|
1507
|
-
*
|
|
1508
|
-
* This maps a position the *caller* holds. For the marks already in a field,
|
|
1509
|
-
* `mapMarks` applies the store's own assoc rule across every channel of a
|
|
1510
|
-
* `ChangeBundle`.
|
|
1602
|
+
* Where `pos` lands after `change`, and what around it the change deleted;
|
|
1603
|
+
* `assoc` (`"after"` by default) picks the side of text inserted at it.
|
|
1604
|
+
* Throws `edit::content_apply` where a splice deletes an island and names
|
|
1605
|
+
* none in `removed`, as the receipt's `applied` always does.
|
|
1511
1606
|
*/
|
|
1512
|
-
export function mapPos(
|
|
1607
|
+
export function mapPos(change: Change, pos: Pos, assoc?: "before" | "after"): MapResult;
|
|
1513
1608
|
|
|
1514
1609
|
/**
|
|
1515
|
-
* The canonical form of `rt`: the content `
|
|
1610
|
+
* The canonical form of `rt`: the content `replace` stores from it, read
|
|
1516
1611
|
* without a document. Normalizing rewrites structure, never the text, so the
|
|
1517
|
-
* answer's `text` is `rt.text`. Throws where `
|
|
1612
|
+
* answer's `text` is `rt.text`. Throws where `replace` would, with the same
|
|
1518
1613
|
* error under this verb's name.
|
|
1519
1614
|
*/
|
|
1520
1615
|
export function normalize(rt: Content): Content;
|
|
1521
1616
|
|
|
1617
|
+
/**
|
|
1618
|
+
* Shift-Tab over the blocks `first` to `last` (`first` alone when absent):
|
|
1619
|
+
* the change lifting them out of the innermost item or quote holding
|
|
1620
|
+
* `first`. Throws `edit::content_apply` where `first` is in neither or the
|
|
1621
|
+
* range leaves it.
|
|
1622
|
+
*/
|
|
1623
|
+
export function outdent(content: Content, first: string, last?: string | null): Change;
|
|
1624
|
+
|
|
1522
1625
|
/**
|
|
1523
1626
|
* Parse a canonical document-model `Diagnostic.path` (`cards.<kind>[<i>].<field>`,
|
|
1524
1627
|
* `main.body`, `recipients[0].name`) into structured `DocPathSeg` segments, so
|
|
@@ -1528,13 +1631,18 @@ export function normalize(rt: Content): Content;
|
|
|
1528
1631
|
export function parseDocPath(path: string): DocPathSeg[];
|
|
1529
1632
|
|
|
1530
1633
|
/**
|
|
1531
|
-
*
|
|
1532
|
-
*
|
|
1533
|
-
*
|
|
1534
|
-
* `parse::dropped_construct` warnings, with no `path`. Throws on an
|
|
1535
|
-
* over-nested markdown input or a non-content `base`.
|
|
1634
|
+
* The valid value every peer holding the merged state `raw` reads, and what
|
|
1635
|
+
* was mended to reach it: total and deterministic, every id it mints derived
|
|
1636
|
+
* from the ids involved. Throws only on a `raw` not shaped as content.
|
|
1536
1637
|
*/
|
|
1537
|
-
export function
|
|
1638
|
+
export function repair(raw: RawContent): Repaired;
|
|
1639
|
+
|
|
1640
|
+
/**
|
|
1641
|
+
* Enter at `at`: the change splitting the block holding `at` there, the new
|
|
1642
|
+
* block `newId` and the text keeping its id. Throws `edit::content_apply`
|
|
1643
|
+
* where `at` is past the text.
|
|
1644
|
+
*/
|
|
1645
|
+
export function splitBlock(content: Content, at: number, newId: string): Change;
|
|
1538
1646
|
|
|
1539
1647
|
/**
|
|
1540
1648
|
* Runs at instantiation, so a Rust panic reaches the console as a stack trace
|
|
@@ -1543,6 +1651,13 @@ export function rebase(base: Content, markdown: string): { content: Content; del
|
|
|
1543
1651
|
*/
|
|
1544
1652
|
export function start(): void;
|
|
1545
1653
|
|
|
1654
|
+
/**
|
|
1655
|
+
* The change wrapping the blocks `first` to `last` in a quote or a list,
|
|
1656
|
+
* around the children of their innermost shared item or quote that the range
|
|
1657
|
+
* touches; a list the range sits in is wrapped whole.
|
|
1658
|
+
*/
|
|
1659
|
+
export function wrap(content: Content, first: string, last: string, kind: WrapKind): Change;
|
|
1660
|
+
|
|
1546
1661
|
export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
|
|
1547
1662
|
|
|
1548
1663
|
export interface InitOutput {
|
|
@@ -1551,15 +1666,24 @@ export interface InitOutput {
|
|
|
1551
1666
|
readonly __wbg_engine_free: (a: number, b: number) => void;
|
|
1552
1667
|
readonly __wbg_livesession_free: (a: number, b: number) => void;
|
|
1553
1668
|
readonly __wbg_quill_free: (a: number, b: number) => void;
|
|
1669
|
+
readonly deleteRange: (a: number, b: number, c: number, d: number) => void;
|
|
1670
|
+
readonly diff: (a: number, b: number, c: number) => void;
|
|
1554
1671
|
readonly document__addCard: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number) => void;
|
|
1555
1672
|
readonly document__commitField: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
1556
1673
|
readonly document__commitFields: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
1674
|
+
readonly document__hash: (a: number, b: number, c: number) => void;
|
|
1675
|
+
readonly document__hashAt: (a: number, b: number, c: number, d: number) => void;
|
|
1557
1676
|
readonly document__readerGet: (a: number, b: number, c: number, d: number) => void;
|
|
1558
1677
|
readonly document__readerGetContent: (a: number, b: number, c: number, d: number) => void;
|
|
1559
1678
|
readonly document__readerGetContentAt: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
1560
|
-
readonly
|
|
1561
|
-
readonly
|
|
1562
|
-
readonly
|
|
1679
|
+
readonly document__revise: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
1680
|
+
readonly document__reviseDocument: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
1681
|
+
readonly document__reviseField: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
|
|
1682
|
+
readonly document_anchorContext: (a: number, b: number, c: number, d: number) => void;
|
|
1683
|
+
readonly document_anchorContexts: (a: number, b: number) => void;
|
|
1684
|
+
readonly document_annotated: (a: number, b: number, c: number) => void;
|
|
1685
|
+
readonly document_annotatedAt: (a: number, b: number, c: number) => void;
|
|
1686
|
+
readonly document_apply: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
1563
1687
|
readonly document_bodyMarkdown: (a: number, b: number, c: number) => void;
|
|
1564
1688
|
readonly document_card: (a: number, b: number, c: number) => void;
|
|
1565
1689
|
readonly document_cardCount: (a: number) => number;
|
|
@@ -1572,28 +1696,28 @@ export interface InitOutput {
|
|
|
1572
1696
|
readonly document_fromStored: (a: number, b: number, c: number) => void;
|
|
1573
1697
|
readonly document_getExt: (a: number, b: number, c: number) => void;
|
|
1574
1698
|
readonly document_getStored: (a: number, b: number, c: number) => void;
|
|
1699
|
+
readonly document_hash: (a: number, b: number, c: number) => void;
|
|
1700
|
+
readonly document_hashAt: (a: number, b: number, c: number) => void;
|
|
1575
1701
|
readonly document_insertCard: (a: number, b: number, c: number, d: number) => void;
|
|
1576
|
-
readonly document_loadStored: (a: number, b: number, c: number, d: number) => void;
|
|
1577
1702
|
readonly document_main: (a: number, b: number) => void;
|
|
1578
|
-
readonly document_markdownRules: (a: number) => void;
|
|
1579
1703
|
readonly document_moveCard: (a: number, b: number, c: number, d: number) => void;
|
|
1580
1704
|
readonly document_new: (a: number, b: number, c: number) => void;
|
|
1581
|
-
readonly document_overwrite: (a: number, b: number, c: number, d: number) => void;
|
|
1582
1705
|
readonly document_pathFor: (a: number, b: number, c: number) => void;
|
|
1583
1706
|
readonly document_quillRef: (a: number, b: number) => void;
|
|
1584
1707
|
readonly document_quillRefHint: (a: number) => void;
|
|
1708
|
+
readonly document_read: (a: number, b: number, c: number) => void;
|
|
1709
|
+
readonly document_reattach: (a: number, b: number, c: number, d: number) => void;
|
|
1585
1710
|
readonly document_removeCard: (a: number, b: number, c: number) => void;
|
|
1586
1711
|
readonly document_removeExt: (a: number, b: number, c: number) => void;
|
|
1587
1712
|
readonly document_removeField: (a: number, b: number, c: number) => void;
|
|
1588
1713
|
readonly document_removeSeedOverlay: (a: number, b: number, c: number, d: number) => void;
|
|
1589
|
-
readonly
|
|
1590
|
-
readonly
|
|
1714
|
+
readonly document_replace: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
1715
|
+
readonly document_revise: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
1591
1716
|
readonly document_seedOverlay: (a: number, b: number, c: number, d: number) => void;
|
|
1592
1717
|
readonly document_setQuillRef: (a: number, b: number, c: number, d: number) => void;
|
|
1593
1718
|
readonly document_storageVersionOf: (a: number, b: number, c: number) => void;
|
|
1594
1719
|
readonly document_storeExt: (a: number, b: number, c: number, d: number) => void;
|
|
1595
1720
|
readonly document_storeField: (a: number, b: number, c: number, d: number) => void;
|
|
1596
|
-
readonly document_storeFields: (a: number, b: number, c: number, d: number) => void;
|
|
1597
1721
|
readonly document_storeSeedOverlay: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
1598
1722
|
readonly document_toAnnotatedMarkdown: (a: number, b: number) => void;
|
|
1599
1723
|
readonly document_toMarkdown: (a: number, b: number) => void;
|
|
@@ -1608,9 +1732,12 @@ export interface InitOutput {
|
|
|
1608
1732
|
readonly formatDiagnostic: (a: number, b: number) => void;
|
|
1609
1733
|
readonly formatDocPath: (a: number, b: number) => void;
|
|
1610
1734
|
readonly importMarkdown: (a: number, b: number, c: number) => void;
|
|
1735
|
+
readonly indent: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
1736
|
+
readonly inheritedMarks: (a: number, b: number, c: number) => void;
|
|
1737
|
+
readonly invert: (a: number, b: number, c: number) => void;
|
|
1611
1738
|
readonly isInline: (a: number, b: number) => void;
|
|
1612
1739
|
readonly isPlain: (a: number, b: number) => void;
|
|
1613
|
-
readonly
|
|
1740
|
+
readonly joinBlocks: (a: number, b: number, c: number, d: number) => void;
|
|
1614
1741
|
readonly livesession_coverage: (a: number, b: number) => void;
|
|
1615
1742
|
readonly livesession_fieldAt: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
1616
1743
|
readonly livesession_fieldBoxes: (a: number, b: number, c: number, d: number) => void;
|
|
@@ -1623,9 +1750,9 @@ export interface InitOutput {
|
|
|
1623
1750
|
readonly livesession_render: (a: number, b: number, c: number) => void;
|
|
1624
1751
|
readonly livesession_update: (a: number, b: number, c: number) => void;
|
|
1625
1752
|
readonly livesession_warnings: (a: number, b: number) => void;
|
|
1626
|
-
readonly mapMarks: (a: number, b: number, c: number) => void;
|
|
1627
1753
|
readonly mapPos: (a: number, b: number, c: number, d: number) => void;
|
|
1628
1754
|
readonly normalize: (a: number, b: number) => void;
|
|
1755
|
+
readonly outdent: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
1629
1756
|
readonly parseDocPath: (a: number, b: number, c: number) => void;
|
|
1630
1757
|
readonly quill__resolve: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
1631
1758
|
readonly quill_authoringSchema: (a: number, b: number) => void;
|
|
@@ -1641,14 +1768,15 @@ export interface InitOutput {
|
|
|
1641
1768
|
readonly quill_schema: (a: number, b: number) => void;
|
|
1642
1769
|
readonly quill_seedCard: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
1643
1770
|
readonly quill_seedDocument: (a: number) => number;
|
|
1644
|
-
readonly quill_seedMain: (a: number, b: number) => void;
|
|
1645
1771
|
readonly quill_toAuthoring: (a: number, b: number, c: number) => void;
|
|
1646
1772
|
readonly quill_toBundle: (a: number, b: number) => void;
|
|
1647
1773
|
readonly quill_toTree: (a: number) => number;
|
|
1648
1774
|
readonly quill_validate: (a: number, b: number, c: number) => void;
|
|
1649
1775
|
readonly quill_warnings: (a: number, b: number) => void;
|
|
1650
|
-
readonly
|
|
1776
|
+
readonly repair: (a: number, b: number) => void;
|
|
1777
|
+
readonly splitBlock: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
1651
1778
|
readonly start: () => void;
|
|
1779
|
+
readonly wrap: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
|
|
1652
1780
|
readonly __wbindgen_export: (a: number, b: number) => number;
|
|
1653
1781
|
readonly __wbindgen_export2: (a: number, b: number, c: number, d: number) => number;
|
|
1654
1782
|
readonly __wbindgen_export3: (a: number) => void;
|