@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_bg.wasm
CHANGED
|
Binary file
|
package/render/wasm_bg.wasm.d.ts
CHANGED
|
@@ -5,15 +5,24 @@ export const __wbg_document_free: (a: number, b: number) => void;
|
|
|
5
5
|
export const __wbg_engine_free: (a: number, b: number) => void;
|
|
6
6
|
export const __wbg_livesession_free: (a: number, b: number) => void;
|
|
7
7
|
export const __wbg_quill_free: (a: number, b: number) => void;
|
|
8
|
+
export const deleteRange: (a: number, b: number, c: number, d: number) => void;
|
|
9
|
+
export const diff: (a: number, b: number, c: number) => void;
|
|
8
10
|
export const document__addCard: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number) => void;
|
|
9
11
|
export const document__commitField: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
10
12
|
export const document__commitFields: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
13
|
+
export const document__hash: (a: number, b: number, c: number) => void;
|
|
14
|
+
export const document__hashAt: (a: number, b: number, c: number, d: number) => void;
|
|
11
15
|
export const document__readerGet: (a: number, b: number, c: number, d: number) => void;
|
|
12
16
|
export const document__readerGetContent: (a: number, b: number, c: number, d: number) => void;
|
|
13
17
|
export const document__readerGetContentAt: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
14
|
-
export const
|
|
15
|
-
export const
|
|
16
|
-
export const
|
|
18
|
+
export const document__revise: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
19
|
+
export const document__reviseDocument: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
20
|
+
export const document__reviseField: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
|
|
21
|
+
export const document_anchorContext: (a: number, b: number, c: number, d: number) => void;
|
|
22
|
+
export const document_anchorContexts: (a: number, b: number) => void;
|
|
23
|
+
export const document_annotated: (a: number, b: number, c: number) => void;
|
|
24
|
+
export const document_annotatedAt: (a: number, b: number, c: number) => void;
|
|
25
|
+
export const document_apply: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
17
26
|
export const document_bodyMarkdown: (a: number, b: number, c: number) => void;
|
|
18
27
|
export const document_card: (a: number, b: number, c: number) => void;
|
|
19
28
|
export const document_cardCount: (a: number) => number;
|
|
@@ -26,28 +35,28 @@ export const document_fromMarkdown: (a: number, b: number, c: number) => void;
|
|
|
26
35
|
export const document_fromStored: (a: number, b: number, c: number) => void;
|
|
27
36
|
export const document_getExt: (a: number, b: number, c: number) => void;
|
|
28
37
|
export const document_getStored: (a: number, b: number, c: number) => void;
|
|
38
|
+
export const document_hash: (a: number, b: number, c: number) => void;
|
|
39
|
+
export const document_hashAt: (a: number, b: number, c: number) => void;
|
|
29
40
|
export const document_insertCard: (a: number, b: number, c: number, d: number) => void;
|
|
30
|
-
export const document_loadStored: (a: number, b: number, c: number, d: number) => void;
|
|
31
41
|
export const document_main: (a: number, b: number) => void;
|
|
32
|
-
export const document_markdownRules: (a: number) => void;
|
|
33
42
|
export const document_moveCard: (a: number, b: number, c: number, d: number) => void;
|
|
34
43
|
export const document_new: (a: number, b: number, c: number) => void;
|
|
35
|
-
export const document_overwrite: (a: number, b: number, c: number, d: number) => void;
|
|
36
44
|
export const document_pathFor: (a: number, b: number, c: number) => void;
|
|
37
45
|
export const document_quillRef: (a: number, b: number) => void;
|
|
38
46
|
export const document_quillRefHint: (a: number) => void;
|
|
47
|
+
export const document_read: (a: number, b: number, c: number) => void;
|
|
48
|
+
export const document_reattach: (a: number, b: number, c: number, d: number) => void;
|
|
39
49
|
export const document_removeCard: (a: number, b: number, c: number) => void;
|
|
40
50
|
export const document_removeExt: (a: number, b: number, c: number) => void;
|
|
41
51
|
export const document_removeField: (a: number, b: number, c: number) => void;
|
|
42
52
|
export const document_removeSeedOverlay: (a: number, b: number, c: number, d: number) => void;
|
|
43
|
-
export const
|
|
44
|
-
export const
|
|
53
|
+
export const document_replace: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
54
|
+
export const document_revise: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
45
55
|
export const document_seedOverlay: (a: number, b: number, c: number, d: number) => void;
|
|
46
56
|
export const document_setQuillRef: (a: number, b: number, c: number, d: number) => void;
|
|
47
57
|
export const document_storageVersionOf: (a: number, b: number, c: number) => void;
|
|
48
58
|
export const document_storeExt: (a: number, b: number, c: number, d: number) => void;
|
|
49
59
|
export const document_storeField: (a: number, b: number, c: number, d: number) => void;
|
|
50
|
-
export const document_storeFields: (a: number, b: number, c: number, d: number) => void;
|
|
51
60
|
export const document_storeSeedOverlay: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
52
61
|
export const document_toAnnotatedMarkdown: (a: number, b: number) => void;
|
|
53
62
|
export const document_toMarkdown: (a: number, b: number) => void;
|
|
@@ -62,9 +71,12 @@ export const exportMarkdown: (a: number, b: number) => void;
|
|
|
62
71
|
export const formatDiagnostic: (a: number, b: number) => void;
|
|
63
72
|
export const formatDocPath: (a: number, b: number) => void;
|
|
64
73
|
export const importMarkdown: (a: number, b: number, c: number) => void;
|
|
74
|
+
export const indent: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
75
|
+
export const inheritedMarks: (a: number, b: number, c: number) => void;
|
|
76
|
+
export const invert: (a: number, b: number, c: number) => void;
|
|
65
77
|
export const isInline: (a: number, b: number) => void;
|
|
66
78
|
export const isPlain: (a: number, b: number) => void;
|
|
67
|
-
export const
|
|
79
|
+
export const joinBlocks: (a: number, b: number, c: number, d: number) => void;
|
|
68
80
|
export const livesession_coverage: (a: number, b: number) => void;
|
|
69
81
|
export const livesession_fieldAt: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
70
82
|
export const livesession_fieldBoxes: (a: number, b: number, c: number, d: number) => void;
|
|
@@ -77,9 +89,9 @@ export const livesession_regions: (a: number, b: number) => void;
|
|
|
77
89
|
export const livesession_render: (a: number, b: number, c: number) => void;
|
|
78
90
|
export const livesession_update: (a: number, b: number, c: number) => void;
|
|
79
91
|
export const livesession_warnings: (a: number, b: number) => void;
|
|
80
|
-
export const mapMarks: (a: number, b: number, c: number) => void;
|
|
81
92
|
export const mapPos: (a: number, b: number, c: number, d: number) => void;
|
|
82
93
|
export const normalize: (a: number, b: number) => void;
|
|
94
|
+
export const outdent: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
83
95
|
export const parseDocPath: (a: number, b: number, c: number) => void;
|
|
84
96
|
export const quill__resolve: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
85
97
|
export const quill_authoringSchema: (a: number, b: number) => void;
|
|
@@ -95,14 +107,15 @@ export const quill_parse: (a: number, b: number, c: number, d: number) => void;
|
|
|
95
107
|
export const quill_schema: (a: number, b: number) => void;
|
|
96
108
|
export const quill_seedCard: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
97
109
|
export const quill_seedDocument: (a: number) => number;
|
|
98
|
-
export const quill_seedMain: (a: number, b: number) => void;
|
|
99
110
|
export const quill_toAuthoring: (a: number, b: number, c: number) => void;
|
|
100
111
|
export const quill_toBundle: (a: number, b: number) => void;
|
|
101
112
|
export const quill_toTree: (a: number) => number;
|
|
102
113
|
export const quill_validate: (a: number, b: number, c: number) => void;
|
|
103
114
|
export const quill_warnings: (a: number, b: number) => void;
|
|
104
|
-
export const
|
|
115
|
+
export const repair: (a: number, b: number) => void;
|
|
116
|
+
export const splitBlock: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
105
117
|
export const start: () => void;
|
|
118
|
+
export const wrap: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
|
|
106
119
|
export const __wbindgen_export: (a: number, b: number) => number;
|
|
107
120
|
export const __wbindgen_export2: (a: number, b: number, c: number, d: number) => number;
|
|
108
121
|
export const __wbindgen_export3: (a: number) => void;
|
package/runtime/runtime.d.ts
CHANGED
|
@@ -19,9 +19,17 @@ import type {
|
|
|
19
19
|
importMarkdown,
|
|
20
20
|
exportMarkdown,
|
|
21
21
|
normalize,
|
|
22
|
-
|
|
22
|
+
invert,
|
|
23
|
+
diff,
|
|
24
|
+
splitBlock,
|
|
25
|
+
joinBlocks,
|
|
26
|
+
deleteRange,
|
|
27
|
+
indent,
|
|
28
|
+
outdent,
|
|
29
|
+
wrap,
|
|
30
|
+
inheritedMarks,
|
|
23
31
|
mapPos,
|
|
24
|
-
|
|
32
|
+
repair,
|
|
25
33
|
isInline,
|
|
26
34
|
isPlain,
|
|
27
35
|
parseDocPath,
|
|
@@ -42,9 +50,17 @@ export interface CoreSurface {
|
|
|
42
50
|
importMarkdown: typeof importMarkdown;
|
|
43
51
|
exportMarkdown: typeof exportMarkdown;
|
|
44
52
|
normalize: typeof normalize;
|
|
45
|
-
|
|
53
|
+
invert: typeof invert;
|
|
54
|
+
diff: typeof diff;
|
|
55
|
+
splitBlock: typeof splitBlock;
|
|
56
|
+
joinBlocks: typeof joinBlocks;
|
|
57
|
+
deleteRange: typeof deleteRange;
|
|
58
|
+
indent: typeof indent;
|
|
59
|
+
outdent: typeof outdent;
|
|
60
|
+
wrap: typeof wrap;
|
|
61
|
+
inheritedMarks: typeof inheritedMarks;
|
|
46
62
|
mapPos: typeof mapPos;
|
|
47
|
-
|
|
63
|
+
repair: typeof repair;
|
|
48
64
|
isInline: typeof isInline;
|
|
49
65
|
isPlain: typeof isPlain;
|
|
50
66
|
parseDocPath: typeof parseDocPath;
|
|
@@ -120,42 +136,46 @@ export type {
|
|
|
120
136
|
AuthoringCard
|
|
121
137
|
} from '../core/wasm.js';
|
|
122
138
|
|
|
123
|
-
//
|
|
124
|
-
//
|
|
125
|
-
// `
|
|
126
|
-
//
|
|
127
|
-
//
|
|
128
|
-
// the op — is the version-proof spelling of the op, and naming the type is what
|
|
129
|
-
// makes that spelling type-check without a cast.
|
|
139
|
+
// The content model `Document`'s write primitive and readers speak
|
|
140
|
+
// (`apply(addr, change)`, `revise(addr, md)`, `replace(addr, content)`,
|
|
141
|
+
// `read(addr)`), offsets in UTF-16 code units. `ContentBlockKind` and `ContentMarkKind` are the shared halves of a
|
|
142
|
+
// read value and a step: destructure the kind off the envelope and spread it
|
|
143
|
+
// into the step.
|
|
130
144
|
export type {
|
|
131
145
|
Content,
|
|
132
|
-
|
|
133
|
-
|
|
146
|
+
ContentBlock,
|
|
147
|
+
ContentBlockKind,
|
|
134
148
|
ContentContainer,
|
|
135
149
|
ContentMark,
|
|
136
150
|
ContentMarkKind,
|
|
151
|
+
ContentAnchor,
|
|
137
152
|
ContentIsland,
|
|
138
153
|
TableProps,
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
154
|
+
Change,
|
|
155
|
+
Step,
|
|
156
|
+
Receipt,
|
|
157
|
+
DroppedAnchor,
|
|
158
|
+
WriteOptions,
|
|
143
159
|
CardInput,
|
|
144
160
|
PathStep,
|
|
145
161
|
Addr,
|
|
146
162
|
CardAddr,
|
|
147
163
|
Delta,
|
|
148
164
|
Revised,
|
|
165
|
+
BaseOptions,
|
|
149
166
|
DocumentRevised,
|
|
150
167
|
AnnotatedMarkdown,
|
|
151
168
|
DocumentAnchor,
|
|
169
|
+
AnchorContext,
|
|
170
|
+
Reattached,
|
|
152
171
|
Imported,
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
172
|
+
DocPathSeg,
|
|
173
|
+
Pos,
|
|
174
|
+
MapResult,
|
|
175
|
+
WrapKind,
|
|
176
|
+
RawContent,
|
|
177
|
+
Repair,
|
|
178
|
+
Repaired
|
|
159
179
|
} from '../core/wasm.js';
|
|
160
180
|
|
|
161
181
|
// The schema-bound whole-document read on `quill.reader(doc)`: the resolved
|
|
@@ -197,43 +217,11 @@ export interface QuillmarkError extends Error {
|
|
|
197
217
|
*/
|
|
198
218
|
export declare function isQuillmarkError(e: unknown): e is QuillmarkError;
|
|
199
219
|
|
|
200
|
-
import type { ContentContainer } from '../core/wasm.js';
|
|
201
|
-
|
|
202
220
|
// `ContentIsland.type`, `ContentMark.type`, `ContentLine.kind` and
|
|
203
221
|
// `ContentContainer.container` are closed sets, so a bare discriminant check
|
|
204
222
|
// narrows the payload on its own:
|
|
205
223
|
// `line.kind === 'heading'` reaches `line.attrs.level`, with no guard to call.
|
|
206
224
|
|
|
207
|
-
/**
|
|
208
|
-
* Stamp `instance` across one parent's blocks at one depth, in document order,
|
|
209
|
-
* returning containers ready to write.
|
|
210
|
-
*
|
|
211
|
-
* One entry per container RUN — a list, not a list item — and `null` for a
|
|
212
|
-
* block carrying no container at this depth. A bare paragraph between two lists
|
|
213
|
-
* is such a block, and separates them on its own. Every line of a run then
|
|
214
|
-
* carries that run's returned container, `ordinal` varying per item and
|
|
215
|
-
* `instance` held.
|
|
216
|
-
*
|
|
217
|
-
* The `instance` it stamps is canonical, so a document reads back the value it
|
|
218
|
-
* was written — a `0` as an absent key, which decodes to the same value.
|
|
219
|
-
* `ordinal` stays the caller's, and a write is renumbered to a gapless index
|
|
220
|
-
* within its run.
|
|
221
|
-
*
|
|
222
|
-
* Which fields decide a weld is coarser than equality for a list: CommonMark
|
|
223
|
-
* reads only a list's first number, so `1. a` beside `3. b` welds despite the
|
|
224
|
-
* differing `start`.
|
|
225
|
-
*
|
|
226
|
-
* ```js
|
|
227
|
-
* const [outer, , inner] = assignInstances([listA, null, listB]);
|
|
228
|
-
* // outer.instance === 0, inner.instance === 0 — the paragraph parts them
|
|
229
|
-
* const [a, b] = assignInstances([listA, listB]);
|
|
230
|
-
* // a.instance === 0, b.instance === 1 — adjacent, one shape
|
|
231
|
-
* ```
|
|
232
|
-
*/
|
|
233
|
-
export declare function assignInstances(
|
|
234
|
-
runs: (ContentContainer | null)[]
|
|
235
|
-
): (ContentContainer | null)[];
|
|
236
|
-
|
|
237
225
|
// The backend-neutral render contract, defined here rather than re-exported from
|
|
238
226
|
// one private backend because no single backend owns the canonical API's types.
|
|
239
227
|
// The render build must satisfy these shapes; `runtime.types.test-d.ts` keeps
|
|
@@ -291,7 +279,7 @@ export interface RenderOptions {
|
|
|
291
279
|
*/
|
|
292
280
|
export type HitGranularity = 'cluster' | 'segment';
|
|
293
281
|
|
|
294
|
-
/** A click resolved to a field and
|
|
282
|
+
/** A click resolved to a field and a UTF-16 offset into its Content. */
|
|
295
283
|
export interface ContentHit {
|
|
296
284
|
/**
|
|
297
285
|
* The field's canonical `DocPath` address (`parseDocPath`-routable): the same
|
|
@@ -344,7 +332,7 @@ export interface FieldRegion {
|
|
|
344
332
|
/** `[x0, y0, x1, y1]` in PDF points (1/72″), bottom-left origin. */
|
|
345
333
|
rect: [number, number, number, number];
|
|
346
334
|
/**
|
|
347
|
-
* The content slice this box covers:
|
|
335
|
+
* The content slice this box covers: UTF-16 `[start, end)` into the field's
|
|
348
336
|
* `Content` for content ink (one segment), absent for a scalar's or a
|
|
349
337
|
* date's ink, a claim or a widget. Consumers key segment highlights on it;
|
|
350
338
|
* {@link LiveSession.fieldBoxes} unions same-page segments for the
|
|
@@ -414,7 +402,7 @@ export interface BackendDescriptor {
|
|
|
414
402
|
formats: OutputFormat[];
|
|
415
403
|
}
|
|
416
404
|
|
|
417
|
-
/** Options for `new Engine(...)`, as a plain object. A key other than `backends` throws. */
|
|
405
|
+
/** Options for `new Engine(...)`, as a plain object. A key other than `backends` or `fonts` throws. */
|
|
418
406
|
export interface EngineOptions {
|
|
419
407
|
/**
|
|
420
408
|
* Extra or overriding backend descriptors, merged over the built-ins. Keys are
|
|
@@ -548,7 +536,6 @@ export declare class Engine {
|
|
|
548
536
|
export declare class LiveSession {
|
|
549
537
|
private constructor();
|
|
550
538
|
readonly pageCount: number;
|
|
551
|
-
readonly backendId: string;
|
|
552
539
|
readonly warnings: Diagnostic[];
|
|
553
540
|
/**
|
|
554
541
|
* Recompile the session against `doc`: the edit verb of a live preview.
|
|
@@ -617,7 +604,8 @@ export declare class LiveSession {
|
|
|
617
604
|
positionAt(page: number, x: number, y: number, tolPt?: number): ContentHit | undefined;
|
|
618
605
|
/**
|
|
619
606
|
* Content position → caret rect: reverse of {@link positionAt}. `field` is a
|
|
620
|
-
* canonical `DocPath` address (`parseDocPath`-routable), as {@link regions} keys
|
|
607
|
+
* canonical `DocPath` address (`parseDocPath`-routable), as {@link regions} keys;
|
|
608
|
+
* `pos` a UTF-16 offset into its `Content`, `undefined` inside a character.
|
|
621
609
|
*/
|
|
622
610
|
locate(field: string, pos: number): FieldRegion | undefined;
|
|
623
611
|
/** Page geometry in points (1/72″). */
|
|
@@ -673,7 +661,7 @@ declare module '../core/wasm.js' {
|
|
|
673
661
|
}
|
|
674
662
|
}
|
|
675
663
|
|
|
676
|
-
import type { Addr, Content, DocumentRevised, PathStep, Resolved, Revised } from '../core/wasm.js';
|
|
664
|
+
import type { Addr, BaseOptions, Content, DocumentRevised, PathStep, Resolved, Revised } from '../core/wasm.js';
|
|
677
665
|
|
|
678
666
|
/**
|
|
679
667
|
* A `Document` bound to its `Quill` for typed writes, from {@link Quill.writer}.
|
|
@@ -683,14 +671,28 @@ import type { Addr, Content, DocumentRevised, PathStep, Resolved, Revised } from
|
|
|
683
671
|
*
|
|
684
672
|
* Typed commit is the default whenever a quill is in hand: it resolves each
|
|
685
673
|
* field's schema type and strict-commits it, throwing `UnknownField` for an
|
|
686
|
-
* undeclared name rather than falling back. The raw `Document.storeField`
|
|
687
|
-
*
|
|
674
|
+
* undeclared name rather than falling back. The raw `Document.storeField`
|
|
675
|
+
* verb remains the deliberate quill-free primitive (standalone
|
|
688
676
|
* data, storage/migration infra, or not-yet-conforming in-progress input).
|
|
689
677
|
*/
|
|
690
678
|
export declare class DocumentWriter {
|
|
691
679
|
constructor(quill: Quill, doc: Document);
|
|
692
|
-
/**
|
|
693
|
-
|
|
680
|
+
/**
|
|
681
|
+
* The hash of the document as this quill conforms it: the `baseHash`
|
|
682
|
+
* {@link reviseDocument} checks. A document loaded without its quill
|
|
683
|
+
* hashes as its conformed self, so a conform between the read and the
|
|
684
|
+
* write does not stale the base. Throws when the document declares a
|
|
685
|
+
* `$quill` this quill does not answer to.
|
|
686
|
+
*/
|
|
687
|
+
hash(): string;
|
|
688
|
+
/**
|
|
689
|
+
* The hash of the body or field at `addr` through its schema: the
|
|
690
|
+
* `baseHash` {@link reviseBody} and {@link reviseField} check. A
|
|
691
|
+
* `richtext` field hashes its content however it rests, a `text` field its
|
|
692
|
+
* literal text, any other type its stored value, an absent field as
|
|
693
|
+
* `null`. Throws `UnknownField` for an undeclared name.
|
|
694
|
+
*/
|
|
695
|
+
hashAt(addr: Addr | string): string;
|
|
694
696
|
/**
|
|
695
697
|
* Typed-commit one main-card field (strict coerce, mismatch throws now).
|
|
696
698
|
* Throws `UnknownField` for a name the schema does not declare. Returns a
|
|
@@ -707,11 +709,13 @@ export declare class DocumentWriter {
|
|
|
707
709
|
setAll(fields: Record<string, unknown>): Diagnostic[];
|
|
708
710
|
/**
|
|
709
711
|
* Revise the main body from markdown; anchors rebase. Returns the
|
|
710
|
-
* `Revised` receipt, its warnings at `main.body
|
|
711
|
-
*
|
|
712
|
-
*
|
|
712
|
+
* `Revised` receipt, its warnings at `main.body` and `droppedAnchors`
|
|
713
|
+
* naming each anchor the diff dropped: a body carries no field schema to
|
|
714
|
+
* type against. `opts` names what the writer read: a stale
|
|
715
|
+
* `baseHash` (from {@link hashAt}) throws `edit::stale_base`, and a
|
|
716
|
+
* `baseMarkdown` merges.
|
|
713
717
|
*/
|
|
714
|
-
reviseBody(markdown: string): Revised;
|
|
718
|
+
reviseBody(markdown: string, opts?: BaseOptions): Revised;
|
|
715
719
|
/**
|
|
716
720
|
* Revise the content main-card field `name` from authored text: typed *and*
|
|
717
721
|
* anchor-preserving. Surviving anchors rebase, then the diffed result is
|
|
@@ -722,19 +726,28 @@ export declare class DocumentWriter {
|
|
|
722
726
|
* The codec comes from the declared type: `richtext` diffs markdown, while
|
|
723
727
|
* `text` diffs the literal text and never imports markdown, so a
|
|
724
728
|
* byte-identical revise of a value carrying escapes is a byte no-op.
|
|
729
|
+
*
|
|
730
|
+
* `opts` names what the writer read, as on {@link reviseBody}; a `text`
|
|
731
|
+
* field's `baseMarkdown` is the literal text it read.
|
|
725
732
|
*/
|
|
726
|
-
reviseField(name: string, text: string): Revised;
|
|
733
|
+
reviseField(name: string, text: string, opts?: BaseOptions): Revised;
|
|
727
734
|
/**
|
|
728
735
|
* Replace the bound document with `markdown`, then conform it. Composable
|
|
729
736
|
* cards align to the stored ones by `$kind` and text similarity, an aligned
|
|
730
737
|
* card's body and stored content fields revise, their anchors rebasing as
|
|
731
738
|
* {@link reviseBody}'s do, and every declared content field lands at rest.
|
|
732
|
-
* Returns the `DocumentRevised` receipt, its `
|
|
739
|
+
* Returns the `DocumentRevised` receipt, its `from` naming the stored card
|
|
740
|
+
* each composable card revises and its `warnings` ending with the
|
|
733
741
|
* `conform::*` ones, and clears `doc.warnings`. Throws when `markdown`
|
|
734
742
|
* declares a `$quill` this quill does not answer to, or does not parse,
|
|
735
743
|
* leaving the document unchanged.
|
|
744
|
+
*
|
|
745
|
+
* `opts` names what the writer read: `baseHash` is {@link hash}, and
|
|
746
|
+
* `baseMarkdown` the whole document's markdown (`toMarkdown` or
|
|
747
|
+
* `toAnnotatedMarkdown`), merged by line onto what changed since. A stale
|
|
748
|
+
* or conflicting write throws before any mutation.
|
|
736
749
|
*/
|
|
737
|
-
reviseDocument(markdown: string): DocumentRevised;
|
|
750
|
+
reviseDocument(markdown: string, opts?: BaseOptions): DocumentRevised;
|
|
738
751
|
/**
|
|
739
752
|
* Build a composable card of `kind`, typed-commit `fields` onto it, set its
|
|
740
753
|
* body from optional markdown, and place it. `at` omitted appends, a number
|
|
@@ -764,25 +777,20 @@ export declare class DocumentWriter {
|
|
|
764
777
|
*/
|
|
765
778
|
export declare class CardWriter {
|
|
766
779
|
constructor(quill: Quill, doc: Document, index: number);
|
|
767
|
-
/** The
|
|
768
|
-
|
|
769
|
-
/**
|
|
770
|
-
* The bound card's `$kind`. Throws `IndexOutOfRange` for a bad bound
|
|
771
|
-
* index.
|
|
772
|
-
*/
|
|
773
|
-
readonly kind: string;
|
|
780
|
+
/** The card twin of {@link DocumentWriter.hashAt}; no `field` reads the body. */
|
|
781
|
+
hashAt(field?: string): string;
|
|
774
782
|
set(name: string, value: unknown): Diagnostic[];
|
|
775
783
|
setAll(fields: Record<string, unknown>): Diagnostic[];
|
|
776
784
|
/**
|
|
777
785
|
* Revise this card's body from markdown (edit semantics), returning the
|
|
778
786
|
* `Revised` receipt, its warnings at the card's body.
|
|
779
787
|
*/
|
|
780
|
-
reviseBody(markdown: string): Revised;
|
|
788
|
+
reviseBody(markdown: string, opts?: BaseOptions): Revised;
|
|
781
789
|
/**
|
|
782
790
|
* The card twin of {@link DocumentWriter.reviseField}. Throws `UnknownField`
|
|
783
791
|
* for an undeclared name and `IndexOutOfRange` for a bad bound index.
|
|
784
792
|
*/
|
|
785
|
-
reviseField(name: string, text: string): Revised;
|
|
793
|
+
reviseField(name: string, text: string, opts?: BaseOptions): Revised;
|
|
786
794
|
}
|
|
787
795
|
|
|
788
796
|
/**
|
|
@@ -805,8 +813,6 @@ export declare class CardWriter {
|
|
|
805
813
|
*/
|
|
806
814
|
export declare class DocumentReader {
|
|
807
815
|
constructor(quill: Quill, doc: Document);
|
|
808
|
-
/** The bound document: the instance passed in. */
|
|
809
|
-
readonly document: Document;
|
|
810
816
|
/**
|
|
811
817
|
* Read the value at `addr`, interpreted by its declared type: a richtext field
|
|
812
818
|
* to markdown, every other type verbatim. A bare string is `Addr` shorthand for
|
|
@@ -857,42 +863,4 @@ export declare class DocumentReader {
|
|
|
857
863
|
* pairing it with a session passes the session's opening date.
|
|
858
864
|
*/
|
|
859
865
|
resolve(today?: string): Resolved;
|
|
860
|
-
/**
|
|
861
|
-
* A {@link CardReader} for the composable card at `index`. Index validity is
|
|
862
|
-
* checked lazily at read time, so an out-of-range index does not throw here.
|
|
863
|
-
* The cursor is ephemeral: a `removeCard`/`addCard` between binding and reading
|
|
864
|
-
* silently retargets it.
|
|
865
|
-
*/
|
|
866
|
-
card(index: number): CardReader;
|
|
867
|
-
}
|
|
868
|
-
|
|
869
|
-
/**
|
|
870
|
-
* A composable card bound to its `Quill` for interpreted reads, from
|
|
871
|
-
* {@link DocumentReader.card}. Same verbs as {@link DocumentReader}, reading the card
|
|
872
|
-
* at its bound index; each read throws `IndexOutOfRange` if that index is out of
|
|
873
|
-
* range.
|
|
874
|
-
*/
|
|
875
|
-
export declare class CardReader {
|
|
876
|
-
constructor(quill: Quill, doc: Document, index: number);
|
|
877
|
-
/** The bound card index. */
|
|
878
|
-
readonly index: number;
|
|
879
|
-
/**
|
|
880
|
-
* The bound card's `$kind`. Throws `IndexOutOfRange` if the bound index is
|
|
881
|
-
* out of range.
|
|
882
|
-
*/
|
|
883
|
-
readonly kind: string;
|
|
884
|
-
/**
|
|
885
|
-
* Read the field `name` on this card, interpreted by its declared type.
|
|
886
|
-
* `undefined` when absent; throws `UnknownField` for an undeclared name and
|
|
887
|
-
* `IndexOutOfRange` for a bad index.
|
|
888
|
-
*/
|
|
889
|
-
get(name: string): unknown;
|
|
890
|
-
/**
|
|
891
|
-
* The card twin of {@link DocumentReader.getContent}.
|
|
892
|
-
*/
|
|
893
|
-
getContent(name: string): Content | undefined;
|
|
894
|
-
/** The card twin of {@link DocumentReader.getContentAt}. */
|
|
895
|
-
getContentAt(name: string, path: PathStep[]): Content | undefined;
|
|
896
|
-
/** This card's body markdown: the card twin of {@link DocumentReader.bodyMarkdown}. */
|
|
897
|
-
bodyMarkdown(): string;
|
|
898
866
|
}
|