T
AttrValue
Attribute values are JSON-serializable so documents round-trip losslessly and
a CRDT adapter can map them onto its own primitives without special-casing.
export type AttrValue
= | string
| number
| boolean
| null
| readonly AttrValue[]
| { readonly [key: string]: AttrValue };
I
Mark
An inline formatting mark applied to a run of text (bold, italic, link, ...).
type is the registry key; attrs holds mark-specific data (e.g. link href).
| Property | Type | Default | Description |
|---|
typereadonly | string | — | — |
attrs?readonly | Attrs | — | — |
T
Marks
A normalized set of marks: at most one per type, sorted by type.
export type Marks = readonly Mark[];
I
InlineNode
A run of text sharing the same marks. The chosen inline representation
("marked runs") renders to per-block contenteditable as a span list and maps
isomorphically onto a character-sequence CRDT with formatting.
| Property | Type | Default | Description |
|---|
textreadonly | string | — | — |
marksreadonly | Marks | — | — |
T
Inline
A block's inline content: an ordered, normalized list of runs.
export type Inline = readonly InlineNode[];
I
Node
A document block. id is stable across split/merge/move.
| Property | Type | Default | Description |
|---|
idreadonly | string | — | — |
typereadonly | string | — | — |
attrsreadonly | Attrs | — | — |
contentreadonly | Content | — | — |
T
Content
A block's content. Three shapes, chosen by the block's schema:
- Inline for text blocks (paragraph, heading, list item),
- readonly Node[] for container blocks (reserved; no default block uses it),
- null for atom/void blocks (image, divider).
export type Content = Inline | readonly Node[] | null;
I
WritekitDocument
The writekit document: an ordered list of top-level blocks. Default blocks are
flat (lists use indent attributes, not nesting), so document helpers operate
on the top-level array.
interface WritekitDocument
| Property | Type | Default | Description |
|---|
typereadonly | 'doc' | — | — |
contentreadonly | readonly Node[] | — | — |