@relyio/sdk 0.12.0 → 0.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/CHANGELOG.md +84 -0
  2. package/dist/{chunk-3DRDHXLY.js → chunk-3NPPMGB6.js} +435 -23
  3. package/dist/{chunk-FRJEUAAF.js → chunk-6NGJXLOR.js} +22 -11
  4. package/dist/{chunk-DXCVO6M5.cjs → chunk-DEDIJKHY.cjs} +22 -11
  5. package/dist/{chunk-POEEDYFM.js → chunk-EW23SZPX.js} +7 -2
  6. package/dist/{chunk-3MSFWXQL.cjs → chunk-FOSM4LMM.cjs} +7 -2
  7. package/dist/{chunk-FI5VIF4M.cjs → chunk-Z6GLWSSD.cjs} +442 -22
  8. package/dist/client/index.cjs +3 -3
  9. package/dist/client/index.d.cts +4 -5
  10. package/dist/client/index.d.ts +4 -5
  11. package/dist/client/index.js +1 -1
  12. package/dist/{define-schema-mrEZbY1h.d.ts → define-schema-UHViXKiv.d.ts} +2 -219
  13. package/dist/{define-schema-DgctHlI2.d.cts → define-schema-sWJ8Zn7C.d.cts} +2 -219
  14. package/dist/{include-paths-CL4gHv6I.d.cts → include-paths-Bs5FhNw2.d.cts} +2191 -108
  15. package/dist/{include-paths-CrJNTsMl.d.ts → include-paths-Cb7iPCW2.d.ts} +2191 -108
  16. package/dist/index--_u1nPHv.d.cts +507 -0
  17. package/dist/index-8DozAWsA.d.ts +507 -0
  18. package/dist/{index-BrvEg6-A.d.cts → index-BT0L8xJj.d.cts} +41 -53
  19. package/dist/{index-Pw0onkJe.d.ts → index-CPjJ25R4.d.ts} +41 -53
  20. package/dist/index.cjs +119 -112
  21. package/dist/index.d.cts +39 -70
  22. package/dist/index.d.ts +39 -70
  23. package/dist/index.js +5 -29
  24. package/dist/markdown/index.cjs +13750 -0
  25. package/dist/markdown/index.d.cts +111 -0
  26. package/dist/markdown/index.d.ts +111 -0
  27. package/dist/markdown/index.js +13742 -0
  28. package/dist/rich-text/index.cjs +26 -6
  29. package/dist/rich-text/index.d.cts +3 -148
  30. package/dist/rich-text/index.d.ts +3 -148
  31. package/dist/rich-text/index.js +1 -1
  32. package/dist/rich-text.d-BWc-5gX1.d.cts +326 -0
  33. package/dist/rich-text.d-BWc-5gX1.d.ts +326 -0
  34. package/dist/schema/index.cjs +34 -34
  35. package/dist/schema/index.d.cts +9 -178
  36. package/dist/schema/index.d.ts +9 -178
  37. package/dist/schema/index.js +1 -1
  38. package/dist/types/index.d.cts +2 -3
  39. package/dist/types/index.d.ts +2 -3
  40. package/package.json +14 -3
  41. package/dist/index-B9RfZVF1.d.ts +0 -861
  42. package/dist/index-b-AkfTUv.d.cts +0 -861
  43. package/dist/rich-text.d-rKmpgdGd.d.cts +0 -200
  44. package/dist/rich-text.d-rKmpgdGd.d.ts +0 -200
@@ -1,200 +0,0 @@
1
- /**
2
- * Rich text's stored and served value: a tree we define (ADR 0013, REL-1803).
3
- *
4
- * A `richText` field holds one {@link RichTextValue} per locale — a documented, **versioned** JSON
5
- * tree shaped like the editor's document: a quote and a list item hold blocks, lists nest, a text
6
- * run names its marks. Every node carries `_type`; every node but a text run carries `_key`, unique
7
- * within the field. It is not Portable Text (flat: a quote of two paragraphs becomes two quotes,
8
- * nested lists become levels) and not TipTap's JSON (TipTap's node names and attributes would be
9
- * our public API, and a TipTap upgrade a breaking change for customers). The vocabulary is written
10
- * down for readers in `devtools/docs/guide/schema/field-types/rich-text-format.md`; this module is
11
- * its one definition in code.
12
- *
13
- * **The version grows by addition.** {@link RICH_TEXT_VERSION} changes only when a node, a mark or
14
- * an attribute is renamed, removed or reshaped. A new node type, a new mark, a new `list` style or a
15
- * new optional attribute is not a version change — the docs set's built-ins (REL-1805: tables, task
16
- * lists, code groups with tabs, highlight, sub- and superscript) arrived inside version 1, and P3b's
17
- * entry links and declared blocks will, so a reader must treat a `_type` it does not know as content
18
- * it cannot draw rather than as an error.
19
- *
20
- * **A field narrows the docs set** (REL-1805): its config's `structure`, `marks` and `multiline` are
21
- * read by {@link richTextNarrowingOf}, held to on every write by {@link richTextNarrowingProblems}
22
- * (the validation document's `x-richTextNarrowing` keyword), enforced in the editor by
23
- * `@relyio/studio-core`'s `RichTextPolicy`, and applied by schema adaptation through
24
- * {@link narrowRichText} when a field is narrowed over content it no longer allows.
25
- *
26
- * Who uses it: the projection writes and reads a live document by it (`@relyio/entry-projection`'s
27
- * `./blocks`), the validation document holds a written value to it ({@link richTextProblems}), the
28
- * write core keys a written value ({@link keyRichText}), the index embeds its text
29
- * ({@link richTextPlainText}), and `@relyio/sdk` types a read by it (the types only, build-inlined
30
- * through the package root).
31
- *
32
- * Dependency-free like `./declaration` (`__tests__/dependency-free.test.ts`): no import at all.
33
- */
34
- /** The format's version. The stored value carries it, so a reader knows which vocabulary it holds. */
35
- declare const RICH_TEXT_VERSION = 1;
36
- /** The root's `_type`: what a value of a `richText` field is. */
37
- declare const RICH_TEXT_TYPE = "richText";
38
- /** A rich-text field's value: the root of the tree. The root is the field, so it has no `_key`. */
39
- interface RichTextValue {
40
- readonly _type: typeof RICH_TEXT_TYPE;
41
- readonly version: typeof RICH_TEXT_VERSION;
42
- readonly children: readonly RichTextBlock[];
43
- }
44
- /** What every node but a text run carries: its identity within the field (design decision 10). */
45
- interface RichTextKeyed {
46
- readonly _key: string;
47
- }
48
- /** A paragraph: inline content. */
49
- interface RichTextParagraph extends RichTextKeyed {
50
- readonly _type: 'paragraph';
51
- readonly children: readonly RichTextInline[];
52
- }
53
- /** The heading levels, as numbers. */
54
- declare const RICH_TEXT_HEADING_LEVELS: readonly [1, 2, 3, 4, 5, 6];
55
- /** A heading of `level` 1 to 6: inline content. */
56
- interface RichTextHeading extends RichTextKeyed {
57
- readonly _type: 'heading';
58
- readonly level: (typeof RICH_TEXT_HEADING_LEVELS)[number];
59
- readonly children: readonly RichTextInline[];
60
- }
61
- /** A quote: one block or more — a quote of two paragraphs is one quote. */
62
- interface RichTextQuote extends RichTextKeyed {
63
- readonly _type: 'quote';
64
- readonly children: readonly RichTextBlock[];
65
- }
66
- /**
67
- * The list styles. Version 1 held `bullet` and `numbered`; REL-1805 added `task`, whose items each
68
- * carry `checked`, without a version change.
69
- */
70
- declare const RICH_TEXT_LIST_STYLES: readonly ['bullet', 'numbered', 'task'];
71
- type RichTextListStyle = (typeof RICH_TEXT_LIST_STYLES)[number];
72
- /**
73
- * A list: one item or more. `start` is a numbered list's first number, present only when it is not
74
- * `1`. Lists nest: an item holds blocks, and a list is a block.
75
- */
76
- interface RichTextList extends RichTextKeyed {
77
- readonly _type: 'list';
78
- readonly style: RichTextListStyle;
79
- readonly start?: number;
80
- readonly children: readonly RichTextListItem[];
81
- }
82
- /**
83
- * A list's item: blocks, the first of them a paragraph (the editor's model, `paragraph block*`).
84
- * `checked` is a task list's item's, and present on every one of them: whether its task is done.
85
- * An item of a bullet or a numbered list carries none.
86
- */
87
- interface RichTextListItem extends RichTextKeyed {
88
- readonly _type: 'listItem';
89
- readonly checked?: boolean;
90
- readonly children: readonly RichTextBlock[];
91
- }
92
- /** The lines of a file a code block is, 1-based and inclusive: the docs' code citations. */
93
- interface RichTextCodeLines {
94
- readonly start: number;
95
- readonly end: number;
96
- }
97
- /**
98
- * A block of code: its text exactly, newlines included, with no marks, and the `language` it is
99
- * written in when one is named. Standing in a code group it is one of the group's tabs, and `label`
100
- * is the tab's name; `filename` is the file it shows and `lines` which of that file's lines. All
101
- * three are optional, alone or in a group (REL-1805).
102
- */
103
- interface RichTextCodeBlock extends RichTextKeyed {
104
- readonly _type: 'codeBlock';
105
- readonly language?: string;
106
- readonly label?: string;
107
- readonly filename?: string;
108
- readonly lines?: RichTextCodeLines;
109
- readonly text: string;
110
- }
111
- /**
112
- * Code with tabs: one code block or more, each a tab — the same snippet for another language,
113
- * package manager or client (REL-1805). Each tab's text is its own, so two people typing in two tabs
114
- * keep both. A `code` field holds this node as its value (REL-1806).
115
- */
116
- interface RichTextCodeGroup extends RichTextKeyed {
117
- readonly _type: 'codeGroup';
118
- readonly children: readonly RichTextCodeBlock[];
119
- }
120
- /** How a table cell's text is aligned. Absent is the reader's default. */
121
- declare const RICH_TEXT_CELL_ALIGNMENTS: readonly ['left', 'center', 'right'];
122
- type RichTextCellAlignment = (typeof RICH_TEXT_CELL_ALIGNMENTS)[number];
123
- /**
124
- * A table: one row or more, every row holding the same number of cells (REL-1805). `headerRow` is
125
- * present, `true`, when the first row is the table's header. Cells hold formatted text, and nothing
126
- * merges cells. A `table` field holds this node as its value (REL-1806).
127
- */
128
- interface RichTextTable extends RichTextKeyed {
129
- readonly _type: 'table';
130
- readonly headerRow?: true;
131
- readonly children: readonly RichTextTableRow[];
132
- }
133
- /** A table's row: one cell or more. */
134
- interface RichTextTableRow extends RichTextKeyed {
135
- readonly _type: 'tableRow';
136
- readonly children: readonly RichTextTableCell[];
137
- }
138
- /** A table's cell: one paragraph or more of formatted text, and its alignment when one is set. */
139
- interface RichTextTableCell extends RichTextKeyed {
140
- readonly _type: 'tableCell';
141
- readonly align?: RichTextCellAlignment;
142
- readonly children: readonly RichTextParagraph[];
143
- }
144
- /** A horizontal rule between blocks. */
145
- interface RichTextDivider extends RichTextKeyed {
146
- readonly _type: 'divider';
147
- }
148
- /** A block: what a field, a quote and a list item hold. */
149
- type RichTextBlock = RichTextParagraph | RichTextHeading | RichTextQuote | RichTextList | RichTextCodeBlock | RichTextCodeGroup | RichTextTable | RichTextDivider;
150
- /**
151
- * A run of text: its characters and the marks on all of them. `marks` is absent when there are
152
- * none, and in {@link RICH_TEXT_MARK_TYPES}' order when there are, each type at most once. A text
153
- * run has no `_key`: it is not addressable apart from the block that holds it, and the live document
154
- * gives it no identity to keep.
155
- */
156
- interface RichTextSpan {
157
- readonly _type: 'text';
158
- readonly text: string;
159
- readonly marks?: readonly RichTextMark[];
160
- }
161
- /** A line break inside a paragraph or a heading. */
162
- interface RichTextLineBreak extends RichTextKeyed {
163
- readonly _type: 'lineBreak';
164
- }
165
- /** Inline content: what a paragraph and a heading hold. */
166
- type RichTextInline = RichTextSpan | RichTextLineBreak;
167
- /**
168
- * The marks, in the order a run holds them: the link first, so a renderer that nests marks in this
169
- * order wraps the formatting in the anchor. REL-1805 added highlight, subscript and superscript
170
- * after the first six, and P3b adds the entry link, without a version change.
171
- */
172
- declare const RICH_TEXT_MARK_TYPES: readonly ['link', 'bold', 'italic', 'underline', 'strike', 'code', 'highlight', 'subscript', 'superscript'];
173
- type RichTextMarkType = (typeof RICH_TEXT_MARK_TYPES)[number];
174
- /**
175
- * A link to a URL. `href` is all a reader is given: whether it opens a new tab and which `rel` it
176
- * carries are the site's rendering decisions, not content (the editor's defaults for them are not
177
- * stored), and a link's title was dropped before the tree existed (REL-1942).
178
- */
179
- interface RichTextLinkMark {
180
- readonly _type: 'link';
181
- readonly href: string;
182
- }
183
- /**
184
- * A mark: formatting by name, or a link. `code` holds no other mark beside it, and `subscript` and
185
- * `superscript` are never on one run together.
186
- */
187
- type RichTextMark = RichTextLinkMark | {
188
- readonly _type: Exclude<RichTextMarkType, 'link'>;
189
- };
190
- /** Any node of the tree below the root. */
191
- type RichTextNode = RichTextBlock | RichTextListItem | RichTextTableRow | RichTextTableCell | RichTextInline;
192
- /**
193
- * The built-in blocks a field's `structure` names (REL-1805): every block but the paragraph, which
194
- * every field holds. A list is named by its style, since a field may want bullets and no tasks; a
195
- * code group's tabs come with the group, whether or not `codeBlock` is named.
196
- */
197
- declare const RICH_TEXT_STRUCTURES: readonly ['heading', 'quote', 'bulletList', 'numberedList', 'taskList', 'codeBlock', 'codeGroup', 'table', 'divider'];
198
- type RichTextStructure = (typeof RICH_TEXT_STRUCTURES)[number];
199
-
200
- export type { RichTextBlock as R, RichTextCellAlignment as a, RichTextCodeBlock as b, RichTextCodeGroup as c, RichTextCodeLines as d, RichTextDivider as e, RichTextHeading as f, RichTextInline as g, RichTextLineBreak as h, RichTextLinkMark as i, RichTextList as j, RichTextListItem as k, RichTextListStyle as l, RichTextMark as m, RichTextMarkType as n, RichTextNode as o, RichTextParagraph as p, RichTextQuote as q, RichTextSpan as r, RichTextStructure as s, RichTextTable as t, RichTextTableCell as u, RichTextTableRow as v, RichTextValue as w };
@@ -1,200 +0,0 @@
1
- /**
2
- * Rich text's stored and served value: a tree we define (ADR 0013, REL-1803).
3
- *
4
- * A `richText` field holds one {@link RichTextValue} per locale — a documented, **versioned** JSON
5
- * tree shaped like the editor's document: a quote and a list item hold blocks, lists nest, a text
6
- * run names its marks. Every node carries `_type`; every node but a text run carries `_key`, unique
7
- * within the field. It is not Portable Text (flat: a quote of two paragraphs becomes two quotes,
8
- * nested lists become levels) and not TipTap's JSON (TipTap's node names and attributes would be
9
- * our public API, and a TipTap upgrade a breaking change for customers). The vocabulary is written
10
- * down for readers in `devtools/docs/guide/schema/field-types/rich-text-format.md`; this module is
11
- * its one definition in code.
12
- *
13
- * **The version grows by addition.** {@link RICH_TEXT_VERSION} changes only when a node, a mark or
14
- * an attribute is renamed, removed or reshaped. A new node type, a new mark, a new `list` style or a
15
- * new optional attribute is not a version change — the docs set's built-ins (REL-1805: tables, task
16
- * lists, code groups with tabs, highlight, sub- and superscript) arrived inside version 1, and P3b's
17
- * entry links and declared blocks will, so a reader must treat a `_type` it does not know as content
18
- * it cannot draw rather than as an error.
19
- *
20
- * **A field narrows the docs set** (REL-1805): its config's `structure`, `marks` and `multiline` are
21
- * read by {@link richTextNarrowingOf}, held to on every write by {@link richTextNarrowingProblems}
22
- * (the validation document's `x-richTextNarrowing` keyword), enforced in the editor by
23
- * `@relyio/studio-core`'s `RichTextPolicy`, and applied by schema adaptation through
24
- * {@link narrowRichText} when a field is narrowed over content it no longer allows.
25
- *
26
- * Who uses it: the projection writes and reads a live document by it (`@relyio/entry-projection`'s
27
- * `./blocks`), the validation document holds a written value to it ({@link richTextProblems}), the
28
- * write core keys a written value ({@link keyRichText}), the index embeds its text
29
- * ({@link richTextPlainText}), and `@relyio/sdk` types a read by it (the types only, build-inlined
30
- * through the package root).
31
- *
32
- * Dependency-free like `./declaration` (`__tests__/dependency-free.test.ts`): no import at all.
33
- */
34
- /** The format's version. The stored value carries it, so a reader knows which vocabulary it holds. */
35
- declare const RICH_TEXT_VERSION = 1;
36
- /** The root's `_type`: what a value of a `richText` field is. */
37
- declare const RICH_TEXT_TYPE = "richText";
38
- /** A rich-text field's value: the root of the tree. The root is the field, so it has no `_key`. */
39
- interface RichTextValue {
40
- readonly _type: typeof RICH_TEXT_TYPE;
41
- readonly version: typeof RICH_TEXT_VERSION;
42
- readonly children: readonly RichTextBlock[];
43
- }
44
- /** What every node but a text run carries: its identity within the field (design decision 10). */
45
- interface RichTextKeyed {
46
- readonly _key: string;
47
- }
48
- /** A paragraph: inline content. */
49
- interface RichTextParagraph extends RichTextKeyed {
50
- readonly _type: 'paragraph';
51
- readonly children: readonly RichTextInline[];
52
- }
53
- /** The heading levels, as numbers. */
54
- declare const RICH_TEXT_HEADING_LEVELS: readonly [1, 2, 3, 4, 5, 6];
55
- /** A heading of `level` 1 to 6: inline content. */
56
- interface RichTextHeading extends RichTextKeyed {
57
- readonly _type: 'heading';
58
- readonly level: (typeof RICH_TEXT_HEADING_LEVELS)[number];
59
- readonly children: readonly RichTextInline[];
60
- }
61
- /** A quote: one block or more — a quote of two paragraphs is one quote. */
62
- interface RichTextQuote extends RichTextKeyed {
63
- readonly _type: 'quote';
64
- readonly children: readonly RichTextBlock[];
65
- }
66
- /**
67
- * The list styles. Version 1 held `bullet` and `numbered`; REL-1805 added `task`, whose items each
68
- * carry `checked`, without a version change.
69
- */
70
- declare const RICH_TEXT_LIST_STYLES: readonly ['bullet', 'numbered', 'task'];
71
- type RichTextListStyle = (typeof RICH_TEXT_LIST_STYLES)[number];
72
- /**
73
- * A list: one item or more. `start` is a numbered list's first number, present only when it is not
74
- * `1`. Lists nest: an item holds blocks, and a list is a block.
75
- */
76
- interface RichTextList extends RichTextKeyed {
77
- readonly _type: 'list';
78
- readonly style: RichTextListStyle;
79
- readonly start?: number;
80
- readonly children: readonly RichTextListItem[];
81
- }
82
- /**
83
- * A list's item: blocks, the first of them a paragraph (the editor's model, `paragraph block*`).
84
- * `checked` is a task list's item's, and present on every one of them: whether its task is done.
85
- * An item of a bullet or a numbered list carries none.
86
- */
87
- interface RichTextListItem extends RichTextKeyed {
88
- readonly _type: 'listItem';
89
- readonly checked?: boolean;
90
- readonly children: readonly RichTextBlock[];
91
- }
92
- /** The lines of a file a code block is, 1-based and inclusive: the docs' code citations. */
93
- interface RichTextCodeLines {
94
- readonly start: number;
95
- readonly end: number;
96
- }
97
- /**
98
- * A block of code: its text exactly, newlines included, with no marks, and the `language` it is
99
- * written in when one is named. Standing in a code group it is one of the group's tabs, and `label`
100
- * is the tab's name; `filename` is the file it shows and `lines` which of that file's lines. All
101
- * three are optional, alone or in a group (REL-1805).
102
- */
103
- interface RichTextCodeBlock extends RichTextKeyed {
104
- readonly _type: 'codeBlock';
105
- readonly language?: string;
106
- readonly label?: string;
107
- readonly filename?: string;
108
- readonly lines?: RichTextCodeLines;
109
- readonly text: string;
110
- }
111
- /**
112
- * Code with tabs: one code block or more, each a tab — the same snippet for another language,
113
- * package manager or client (REL-1805). Each tab's text is its own, so two people typing in two tabs
114
- * keep both. A `code` field holds this node as its value (REL-1806).
115
- */
116
- interface RichTextCodeGroup extends RichTextKeyed {
117
- readonly _type: 'codeGroup';
118
- readonly children: readonly RichTextCodeBlock[];
119
- }
120
- /** How a table cell's text is aligned. Absent is the reader's default. */
121
- declare const RICH_TEXT_CELL_ALIGNMENTS: readonly ['left', 'center', 'right'];
122
- type RichTextCellAlignment = (typeof RICH_TEXT_CELL_ALIGNMENTS)[number];
123
- /**
124
- * A table: one row or more, every row holding the same number of cells (REL-1805). `headerRow` is
125
- * present, `true`, when the first row is the table's header. Cells hold formatted text, and nothing
126
- * merges cells. A `table` field holds this node as its value (REL-1806).
127
- */
128
- interface RichTextTable extends RichTextKeyed {
129
- readonly _type: 'table';
130
- readonly headerRow?: true;
131
- readonly children: readonly RichTextTableRow[];
132
- }
133
- /** A table's row: one cell or more. */
134
- interface RichTextTableRow extends RichTextKeyed {
135
- readonly _type: 'tableRow';
136
- readonly children: readonly RichTextTableCell[];
137
- }
138
- /** A table's cell: one paragraph or more of formatted text, and its alignment when one is set. */
139
- interface RichTextTableCell extends RichTextKeyed {
140
- readonly _type: 'tableCell';
141
- readonly align?: RichTextCellAlignment;
142
- readonly children: readonly RichTextParagraph[];
143
- }
144
- /** A horizontal rule between blocks. */
145
- interface RichTextDivider extends RichTextKeyed {
146
- readonly _type: 'divider';
147
- }
148
- /** A block: what a field, a quote and a list item hold. */
149
- type RichTextBlock = RichTextParagraph | RichTextHeading | RichTextQuote | RichTextList | RichTextCodeBlock | RichTextCodeGroup | RichTextTable | RichTextDivider;
150
- /**
151
- * A run of text: its characters and the marks on all of them. `marks` is absent when there are
152
- * none, and in {@link RICH_TEXT_MARK_TYPES}' order when there are, each type at most once. A text
153
- * run has no `_key`: it is not addressable apart from the block that holds it, and the live document
154
- * gives it no identity to keep.
155
- */
156
- interface RichTextSpan {
157
- readonly _type: 'text';
158
- readonly text: string;
159
- readonly marks?: readonly RichTextMark[];
160
- }
161
- /** A line break inside a paragraph or a heading. */
162
- interface RichTextLineBreak extends RichTextKeyed {
163
- readonly _type: 'lineBreak';
164
- }
165
- /** Inline content: what a paragraph and a heading hold. */
166
- type RichTextInline = RichTextSpan | RichTextLineBreak;
167
- /**
168
- * The marks, in the order a run holds them: the link first, so a renderer that nests marks in this
169
- * order wraps the formatting in the anchor. REL-1805 added highlight, subscript and superscript
170
- * after the first six, and P3b adds the entry link, without a version change.
171
- */
172
- declare const RICH_TEXT_MARK_TYPES: readonly ['link', 'bold', 'italic', 'underline', 'strike', 'code', 'highlight', 'subscript', 'superscript'];
173
- type RichTextMarkType = (typeof RICH_TEXT_MARK_TYPES)[number];
174
- /**
175
- * A link to a URL. `href` is all a reader is given: whether it opens a new tab and which `rel` it
176
- * carries are the site's rendering decisions, not content (the editor's defaults for them are not
177
- * stored), and a link's title was dropped before the tree existed (REL-1942).
178
- */
179
- interface RichTextLinkMark {
180
- readonly _type: 'link';
181
- readonly href: string;
182
- }
183
- /**
184
- * A mark: formatting by name, or a link. `code` holds no other mark beside it, and `subscript` and
185
- * `superscript` are never on one run together.
186
- */
187
- type RichTextMark = RichTextLinkMark | {
188
- readonly _type: Exclude<RichTextMarkType, 'link'>;
189
- };
190
- /** Any node of the tree below the root. */
191
- type RichTextNode = RichTextBlock | RichTextListItem | RichTextTableRow | RichTextTableCell | RichTextInline;
192
- /**
193
- * The built-in blocks a field's `structure` names (REL-1805): every block but the paragraph, which
194
- * every field holds. A list is named by its style, since a field may want bullets and no tasks; a
195
- * code group's tabs come with the group, whether or not `codeBlock` is named.
196
- */
197
- declare const RICH_TEXT_STRUCTURES: readonly ['heading', 'quote', 'bulletList', 'numberedList', 'taskList', 'codeBlock', 'codeGroup', 'table', 'divider'];
198
- type RichTextStructure = (typeof RICH_TEXT_STRUCTURES)[number];
199
-
200
- export type { RichTextBlock as R, RichTextCellAlignment as a, RichTextCodeBlock as b, RichTextCodeGroup as c, RichTextCodeLines as d, RichTextDivider as e, RichTextHeading as f, RichTextInline as g, RichTextLineBreak as h, RichTextLinkMark as i, RichTextList as j, RichTextListItem as k, RichTextListStyle as l, RichTextMark as m, RichTextMarkType as n, RichTextNode as o, RichTextParagraph as p, RichTextQuote as q, RichTextSpan as r, RichTextStructure as s, RichTextTable as t, RichTextTableCell as u, RichTextTableRow as v, RichTextValue as w };