Skip to Content

@stesura/core/types

Shared TypeScript types: node and doc attrs, stores, comments, proofreading and user preferences. Everything here is type-only except followNumberingWith and TABLE_REGIONS. Runtime lists for some of the unions live in @stesura/core/constants: UnderlineType and UNDERLINE_TYPES for Underlines, BORDER_STYLES for BorderStyle, CAPS_VALUES for Caps and CASE_CHANGES for CaseChange.

Types

AccessibilityFinding

NameTypeDefault
idstring

Stable across checks and edits elsewhere: a hash of the rule, the node’s id (its textblock’s, for a link) and the excerpt. What Ignore stores.

ruleAccessibilityRule
posnumber

Position of the offending node — the panel selects it on click.

endnumber

End of the offending content: the node’s end for a block or atom, the run’s end for a link. Carried because a link run can span several text nodes and only the checker knows where it stops.

typeNamestring

Node type at pos when the finding was made. Findings are snapshots, so check pos still holds this type before acting on one later.

excerptstring

Short context for the panel row (link text, heading text, …).

ActiveHandle

NameTypeDefault
posnumber
typeResizeType
colnumber
tablePosnumber
isOuterEdgeboolean
isLeftOuterEdgeboolean
adjacentColnumber
side"left" | "right"
tableAlignTableAlign

AiCommentSuggestion

One pending change an AI agent made to comments, kept in the thread’s metadata.aiSuggestions until the user accepts (the marker goes) or rejects it:

  • thread: the agent created the thread. Reject deletes it and removes its anchors.
  • reply: the agent replied (commentId). Reject deletes the reply.
  • resolve: the agent resolved the thread. Reject reopens it.
NameTypeDefault
kind"thread" | "reply" | "resolve"
authorIdstring

The agent’s author id: “accept all” filters on it.

toolCallIdstring

The tool call that made it: the chat chip resolves its own call’s suggestions.

requestedByIdstring

The user the agent worked for, when the comments backend knows them.

commentIdstring

The reply, for reply.

AppendTransactionProps

NameTypeDefault
transactionsreadonly Transaction[]
oldStateEditorState
newStateEditorState

BlockBorders

NameTypeDefault
topMutable<Omit<IBorderOptions, "style"> & { style: BorderStyle; }>
bottomMutable<Omit<IBorderOptions, "style"> & { style: BorderStyle; }>
leftMutable<Omit<IBorderOptions, "style"> & { style: BorderStyle; }>
betweenMutable<Omit<IBorderOptions, "style"> & { style: BorderStyle; }>

BlockStyleAttrs

The block’s reference INTO the stylesheet. Named apart from doc.styleSheet (the definitions map): a shared name made every step.attr === "styleSheet" check ambiguous and needed a reserved-name exemption for the doc node.

NameTypeDefault
styleIdstring | null

BlockStylingAttrs

NameTypeDefault
bgColorstring | null | undefined
bgColorThemestring | null | undefined
bordersBorders | null | undefined

BorderOptions

NameTypeDefault
sizenumber
colorstring
spacenumber
colorThemestring | null

Theme sidecar of color (docs/executed/document-theme-plan.md).

styleBorderStyle

Borders

NameTypeDefault
topMutable<Omit<IBorderOptions, "style"> & { style: BorderStyle; }>
bottomMutable<Omit<IBorderOptions, "style"> & { style: BorderStyle; }>
leftMutable<Omit<IBorderOptions, "style"> & { style: BorderStyle; }>
betweenMutable<Omit<IBorderOptions, "style"> & { style: BorderStyle; }>
insideHorizontalMutable<Omit<IBorderOptions, "style"> & { style: BorderStyle; }>
insideVerticalMutable<Omit<IBorderOptions, "style"> & { style: BorderStyle; }>

CellAttrs

NameTypeDefault
colspannumber
rowspannumber
colwidthnumber[] | null
verticalAlignAlignmentDirection
isHeaderboolean

Serialize this cell as th scope="col". DERIVED from the table’s headerRowCount by tableHeaderCellsPlugin — never set it directly; the plugin will overwrite it on the next transaction (A11Y-21).

bgColorstring | null
bgColorThemestring | null
bordersCellBorders | null
paddingCellPadding | null

Space between the cell’s edges and its content, in px; null is Word’s default (0 above and below, 7.2px a side).

CellBorders

NameTypeDefault
topMutable<Omit<IBorderOptions, "style"> & { style: BorderStyle; }> | null
bottomMutable<Omit<IBorderOptions, "style"> & { style: BorderStyle; }> | null
leftMutable<Omit<IBorderOptions, "style"> & { style: BorderStyle; }> | null

CellFormat

What a table style gives one cell, the table’s own fill and edges folded in where they rank (a region over the table’s own fill and edges, those over the style’s base). The cell’s own attrs win over all of it (cellStyle).

NameTypeDefault
regionsreadonly ("firstRow" | "lastRow" | "wholeTable" | "band1Vert" | "band2Vert" | "band1Horz" | "band2Horz" | "firstCol" | "lastCol" | "nwCell" | "neCell" | "swCell" | "seCell")[]
bgColorstring

Undefined when nothing paints the cell; “transparent” for an explicit none.

bgColorThemestring | null
bordersCellBorders

The sides the style and the table draw, each edge shared with the cell across it.

textTableTextStyle

CodeBlockAttrs

NameTypeDefault
codeLanguagestring | null

Syntax-highlighting language. Named apart from the proofingLanguage global attribute because runtime behaviour is gated on attr presence.

theme"dark" | "light"
showLineNumbersboolean

CommentAuthor

NameTypeDefault
idstring
namestring
avatarstring
requestedBy{ id: string; name?: string; }

Set when an AI agent wrote the comment: the signed-in user it worked for. Kept after the user accepts it, so the card can say whose agent wrote it and an audit knows who asked.

CommentCloseAttrs

NameTypeDefault
threadIdstring | null
anchorIdstring | null
originEditorIdstring | null

Editor id stamped on clipboard copies (transformCopied) so paste can strip anchors from another document. Always null in the doc — paste clears it.

CommentOpenAttrs

NameTypeDefault
threadIdstring | null
anchorIdstring | null
originEditorIdstring | null

Editor id stamped on clipboard copies (transformCopied) so paste can strip anchors from another document. Always null in the doc — paste clears it.

CommentReaction

NameTypeDefault
emojistring
createdAtDate
users{ id: string; }[]

ConfigPluginConfig

NameTypeDefault
batchStepsboolean

Whether a bulk command (Ctrl+A formatting, an attribute change over many blocks) lands in edit mode as one batch step instead of chunks of ordinary steps: much faster on long documents and one step in collab, but a step class ProseMirror plugins don’t know. A host plugin that tests step classes must read steps through standardStepsOf; set false to keep bulk commands on ordinary steps. Default true.

resolveUsersResolveUsersCallback

Resolves user ids to names and avatars (comment authors, mentions).

currentUserCurrentUser
onToastToastCallback

Shows a toast. Must render into an ARIA live region (role="status", or role="alert" for errors): some actions, like a refused nested table or a rejected upload, report their outcome ONLY here. When omitted, the mount warns once and messages go to console.warn.

Render toast.description, or switch on toast.key for your own copy.

onDiagnosticDiagnosticCallback

Receives every EditorDiagnostic the mount raises: pagination failures, doc-integrity repairs, dropped transactions, node-view crashes and cross-references losing (or regaining) their target. One place to wire telemetry or host reactions; the specific channels (addPaginationFailureHandler, addDocIntegrityHandler) still fire.

Diagnostics raised inside a sub-editor reach the root mount’s callback. A throwing callback is caught and logged.

allowedFileHostsstring[]

Hosts (host[:port]) whose PDFs the file node may PREVIEW with @stesura/pdf-viewer-react. Undefined means no previews at all — every PDF is a card (SEC-70) — because the viewer’s browser fetches the file, so the integrator must name hosts trusted to serve only PDFs.

Non-http(s) schemes, loopback, private/link-local ranges and .local/.internal hosts are always refused, so a hostile document cannot make the viewer’s browser fetch their intranet.

Pagination and the PDF export use the same decision, so a print mount MUST get the same list as the editor.

printMountboolean

Marks the PDF export’s print mount. Read via isPrintMount , so screen-only chrome (handles, floating menus, table outlines) can skip rendering instead of being hidden by CSS.

Config-time, not a store: a flag flipping mid-export would paginate one way and capture another.

experimental{ columnSections?: boolean; skipReactSelectionSave?: boolean; stableContexts?: boolean; }

Features whose browser support or spec may still change.

columnSections: lays out sections with columns in columns (Chromium 145+, column-wrap) and shows the column UI (page setup, span columns, column break). Off by default: the attrs, commands’ data and DOCX round-trip are kept, and the section renders in one column. A print mount MUST get the same value as the editor, or the export paginates differently.

skipReactSelectionSave (on unless false): the editor root reports contentEditable as "inherit" to scripts, so react-dom skips its root-to-caret text walk before every commit (~20% of a keystroke on a 350-page doc). The attribute, isContentEditable and editing are unaffected. Not yet checked by hand with an IME (dead keys, composition) or spellcheck underlines; turn it off first if either misbehaves. Mount-time.

stableContexts (on unless false): react-prosemirror keeps its state and doc contexts stable across synchronous dispatches, so a keystroke no longer makes React scan every memoised node view (~30% of a keystroke on a 350-page doc). Main editor only; sub-editors are small. Mount-time.

layout"page" | "flow"

"page" (default) renders sections as pages. "flow" renders the doc as one full-width block flow sized by its container: no page chrome, and sections, page breaks and column breaks are hidden and can’t be created locally (they stay in the doc). Read via isFlowLayout .

Mount-time only: switching on a live editor is not supported. Never a doc property, so a flow and a page mount can collaborate on one doc.

placeholdersPlaceholderConfig

Placeholders (fill-in prompts): the content a new one gets, and the marks text typed, pasted or filled over one takes. Config-time. A sub-editor answers for the mount that owns it.

ConfigPluginState

NameTypeDefault
editorIdstring
configConfigPluginConfig
toastText(message: ToastMessage) => string

See ConfigPluginProps["toastText"].

parentEditorIdstring

The owning editor; set only on sub-editors (footnote, header…). Store lookups fall through to it.

CounterStackItem

NameTypeDefault
levelnumber
indexnumber
parentTypestring
startnumber

The number index 0 renders as, sticky across the level’s increments. Absent: the rendered list’s level start. A list and its forks share one stack (listBases), so an item numbers from the list that opened it.

liststring

The list of the block that last counted at this level: deeper levels reset to its starts.

fillerboolean

A level opened without being counted (1. → 1.1.1 opens level 2).

countFromnumber

Word’s quirk: a filler a fork’s first block skips over displays its reset value but counts on from the fork’s start override.

CreateNodeFromContentOptions

NameTypeDefault
sliceboolean
parseOptionsParseOptions
errorOnInvalidContentboolean

CreateProofreadCache

Factory passed to proofreadPlugin; creates one cache adapter per editor field.

Parameters:
NameTypeDefault
fieldstring
Returns:
ProofreadCacheAdapter

CreateProofreadDictionary

Factory passed to proofreadPlugin to create a dictionary adapter. Called once per plugin instance (sub-editors get their own).

Parameters:
This function does not accept any parameters.
Returns:
ProofreadDictionaryAdapter

CrossReferenceAttrs

NameTypeDefault
idstring | null

The reference’s own id, minted like a block’s: its key in the references store.

targetIdstring | null
refToCrossRefType
separatorstring | null
textCaseCrossRefTextCase | null

Applied to the text the reference shows; null leaves it as computed.

bookmarkTextstring | null

A text reference’s content: the bookmark’s text, which may be part of its block (an import), so it isn’t rebuilt from the target.

pageLabelstring | null

A page reference’s cached page (Word’s cached PAGEREF result), shown where nothing lays out pages.

missingLabelstring | null

The label a derived reference showed when its target went missing, so a reload still shows it. Null while the target exists.

CurrentUser

NameTypeDefault
idstring
namestring
avatarstring
colorstring

DiagnosticCallback

Parameters:
NameTypeDefault
diagnosticEditorDiagnostic
Returns:
void

DisplayUnits

NameTypeDefault
baseUnit"cm" | "inches"
indentationUnitDisplayUnit
spacingUnitDisplayUnit

DocAttrs

NameTypeDefault
docBgColorstring

Canvas color behind the pages. Named apart from blockStyling’s bgColor attr.

docBgColorThemestring | null
themeDocumentTheme

The colour theme every *Theme sidecar resolves against (Word’s theme1.xml colour scheme).

listConfigsRecord<string, ILevelsOptions[]>
listBasesRecord<string, ListBase>

Lists numbered on another list’s counters, keyed by their listConfigs key.

listOverridesListOverrides

Per list instance, what it overrides over its level config (Word’s w:lvlOverride).

styleSheetStyleSheet
endnotesOptionsEndnoteOptions
languagestring

Default proofing language (BCP 47): the bottom of paragraph.proofingLanguage ?? style.language ?? doc.language, and the only level that always answers.

dirTextDirection

Default text direction: the bottom of paragraph.dir ?? section.dir ?? doc.dir, so a host can mount RTL-by-default without stamping every node.

pageBordersSurroundHeaderboolean

Whether text-measured page borders enclose the header / footer. Document level, like Word’s w:bordersDoNotSurroundHeader/Footer settings.

pageBordersSurroundFooterboolean
variablesTemplateVariable[]

Variables a template declares for its field nodes. Empty for ordinary documents; only template tooling reads it.

bibliographyBibliographyDocAttr

The sources the document cites from, and how it formats them.

docPropertiesDocPropertiesAttr

Title, author, custom properties…: kept for the DOCX round trip (DOCPROPERTY fields).

formatLintIgnorestring[]

Format-cleanup suggestion ids the user dismissed (@stesura/format-lint), kept with the document so collaborators and later sessions agree.

contractCheckReviewRecord<string, "ignored" | "flagged">

Contract-check review state (@stesura/contract-check): finding id to ignored or flagged; open findings are absent. Shared by collaborators, last write wins.

dismissedFindingsRecord<string, string[]>

Findings dismissed per checker (e.g. accessibility): checker name to finding ids. Kept with the document so collaborators and later sessions agree; not written to DOCX.

captionsCaptionsDocAttr

Caption settings (custom labels), shared by collaborators; not written to DOCX (Word ignores w:captions).

DocIntegrityIssueKind

export type DocIntegrityIssueKind = /** * Load: adjacent sections sharing an id, the shape ProseMirror's replace * fitter leaves when it splits a section around a drop, were merged back. */ | "section-split-repaired" /** Load or pagination pre-flight: duplicate or missing section ids were regenerated. */ | "duplicate-section-id" /** Edit: the header/footer guard rejected a transaction that broke the section structure. */ | "section-structure-edit-rejected";

Reporting channel for document-structure repairs and refusals. Every one means some path produced (or tried to produce) a broken doc, so hosts send them to telemetry with doc attached: it is the doc as found, enough to reproduce.

DocIntegrityReport

One repair or refusal, as addDocIntegrityHandler handlers receive it.

NameTypeDefault
kindDocIntegrityIssueKind
editorIdstring | null
detailstring

What was found and done, as a plain string.

docNode

The doc before the repair (or the rejected edit).

stepsunknown[]

A rejected edit’s steps, as JSON.

DocumentTheme

A document’s colour theme. Fonts and effects are not modelled (docs/executed/document-theme-plan.md).

NameTypeDefault
namestring

The a:clrScheme name, which Word’s Design › Colors gallery shows.

colorsRecord<ThemeColorSlot, string>

#RRGGBB per slot.

mapping{ background1: ThemeMappedSlot; text1: ThemeMappedSlot; background2: ThemeMappedSlot; text2: ThemeMappedSlot; }

settings.xml w:clrSchemeMapping: which slot the text/background names read.

Dragging

NameTypeDefault
startXnumber
startYnumber
startWidthnumber
startHeightnumber
typeResizeType
adjacentStartWidthnumber
startTimenumber

EditorDiagnostic

Everything the editor reports to the host’s onDiagnostic, discriminated by type. editorId is the mount the diagnostic was raised in (a sub-editor’s own id when it came from one).

NameTypeDefault
type"pagination-failure" | "doc-integrity" | "dispatch-error" | "node-view-crash" | "reference-missing" | "reference-restored"
editorIdstring

EditorStoreDefaults

NameTypeDefault
showPaginationboolean
modeEditorMode

EditorStores

NameTypeDefault
modeWritableAtom<EditorMode>
tocWritableAtom<TOCstate | undefined>
tocActiveIdWritableAtom<string | null>

Anchor id of the TOC item the viewport has scrolled to (highlight state). Kept out of toc so scroll tracking never churns the items array.

tocBreaksWritableAtom<Map<string, TOCbreakEntry[]> | undefined>

TOC nodeId → page breaks cutting through it. Written by the pagination engine after each recompute; the TOC nodeview renders row spacers from it.

bibliographyWritableAtom<BibliographyState | undefined>

The citation registry, written by @stesura/bibliography’s plugin.

nodePageNumbersWritableAtom<Map<string, string> | undefined>

Block nodeId → DISPLAYED page label (“iv”, “12”), honouring each section’s pageNumbering, so it matches the footers. Written by pagination after each recompute; undefined until then, or when it’s off. Read by the TOC.

nodePagesWritableAtom<Map<string, number> | undefined>

Block nodeId → 0-based DOCUMENT page index its first line is laid on, continuous across sections. Written with nodePageNumbers; undefined until then, or when pagination is off. Read by the positioned object cycle.

pageCountsWritableAtom<Map<string, number> | undefined>

sectionId → page count, iterated in DOCUMENT order, so a prefix sum is a section’s page offset and the full sum the document total (totalPages, the stats dialog). Written by pagination after each recompute; undefined until then, or when it’s off.

pageNumberingWritableAtom<Map<string, PageNumberingAttrs> | undefined>

sectionId → pageNumbering, for sections that set one. Published by pagination next to pageCounts, so headers/footers resolve page numbers without subscribing to the document.

caretColumnWritableAtom<number | null>

0-based physical column (counted from the left) of the caret in a column section; null anywhere else. Written by pagination after each view update (it reads the layout), read by the ruler to draw that column’s edges.

firstLayoutReadyWritableAtom<boolean | null>

Whether the first pagination pass has produced a layout. null: nobody claims it (unpaginated, or pagination not loaded) and the canvas renders immediately. false: first pass outstanding — the canvas holds, so the unpaginated draft never flashes. true: every section has a layout, or the hold timed out.

contentWidthWritableAtom<number | undefined>

Measured width (px) of the content box in a layout: "flow" mount, written by editor-react’s ResizeObserver; undefined until the first measurement and in page layout. Read through getContentWidth.

resolvedStyleSheetWritableAtom<StyleSheet | undefined>
styleSheetOverridesWritableAtom<StyleSheet | undefined>

The RAW doc.attrs.styleSheet, published by the stylesheet plugin. Sub-editor docs store no style definitions, so they read them here via the registry’s parent fall-through — same as listConfigs .

listConfigsWritableAtom<Record<string, ILevelsOptions[]> | undefined>

List configs (defaults + doc.attrs.listConfigs), published by the numbering plugin. Definitions are doc-global while counters are per story, so sub-editors read them here via the registry’s parent fall-through.

listBasesWritableAtom<Record<string, ListBase> | undefined>

The root doc’s listBases, published beside listConfigs .

listOverridesWritableAtom<ListOverrides | undefined>

The root doc’s listOverrides, published beside listConfigs .

rootDocWritableAtom<Node | undefined>

The root editor’s current doc, published by the numbering plugin’s view. Lets sub-editors answer cross-region questions, e.g. counting a listRef’s instances before deciding whether a config edit must fork (CORE-31).

blockHandleWritableAtom<BlockHandleState>

EffectiveNumbering

A paragraph’s numbering after the style cascade is applied. listRef is always a real key of listConfigs — never INHERIT_LIST_REF.

NameTypeDefault
listRefstring
levelnumber
instanceIdstring | undefined
tabStopnumber | null
fromStyleboolean

True when the list came from the paragraph’s style rather than its attrs.

EndnoteAttrs

NameTypeDefault
idstring | null

This occurrence’s own id (DS-9); repeated anchors of one note share endnoteRef.

endnoteRefstring | null

EndnoteBodyAttrs

NameTypeDefault
endnoteRefstring | null
indexnumber

EndnoteItem

NameTypeDefault
indexnumber
occurrencesnumber
sectionIdstring | null
isFirstOccurrenceboolean
endnoteRefstring

EndnoteOptions

NameTypeDefault
showAt"endOfDocument" | "endOfSection"
formatLevelFormatName
continuousboolean
startAtnumber

ExportLayoutManifest

A paginated document’s layout: its page count and, per page, the id of the first block that starts on it (null when the page opens with the rest of a block from the page before). The editor sends its own with an export, and the server compares it with the export page’s to catch a PDF that paginates differently from what the user saw.

NameTypeDefault
pagesnumber
starts(string | null)[]

ExportLosses

What an export left out or could not match: images that never loaded, embedded files that were dropped, characters no bundled font covers (they print in a system font), and pages that start on a different block than in the editor that requested the export.

NameTypeDefault
imagesnumber
filesnumber
glyphsnumber
layoutnumber

FileAttrs

An embedded file. Only a PDF can be PREVIEWED (page by page, via @stesura/pdf-viewer-react; paginated, it sits between two pages). Any other kind, or a PDF the mount cannot or must not preview, renders as a card that flows like a small block. The kind is derived from mimeType (fileKind).

NameTypeDefault
srcstring | null

Absolute URL of the file.

heightnumber

Preview height in CSS px, UNPAGINATED only (the resize handle writes it). Under pagination the box is the section’s page height and this is ignored.

namestring | null

Original filename, as uploaded. Null on documents that predate it.

mimeTypestring | null

Content type sniffed at upload (never the browser’s file.type). Null on documents that predate it, which could only ever hold PDFs.

sizenumber | null

Byte size at upload, for the card.

rotationFileRotation

Whole-file rotation, degrees clockwise. ADDED to each page’s own rotation (effectiveRotation) by both preview and export.

displayPreviewboolean

Whether a PDF renders as a PREVIEW (its pages) or as a card. Default true: mounting the viewer package is the migration trigger, and what you see is what you export — a card prints as a card with its link.

FloatDistance

Gap (px) kept between the object and the text wrapping around it.

NameTypeDefault
topnumber
bottomnumber
leftnumber

FloatingAttrs

The floating global attribute family.

NameTypeDefault
wrapFloatWrap
anchorPositionFloatPosition
wrapDistanceFloatDistance | null

null: the wrap mode’s default gap.

zIndexnumber | null

Stacking order among positioned objects (Word’s relativeHeight); null when unset.

FloatingBoxAttrs

NameTypeDefault
idstring | null

Unique id (the uniqueId plugin fills it: inline nodes declare it themselves).

originFloatingBoxOrigin
widthnumber

px, border box.

autoWidthboolean

Word sized it to its content (a frame without w:w): width stands in at the column width and the DOCX export leaves it out. Setting the width clears it.

heightnumber | null

px; null grows with the content.

heightRuleFloatingBoxHeightRule
borderFloatingBoxBorder | null
fillstring | null

Background color; null for none.

paddingFloatingBoxPadding
verticalAlignFloatingBoxVerticalAlign
labelstring | null

Accessible name; null falls back to the UI’s “Text box”.

wrapFloatWrap
anchorPositionFloatPosition
wrapDistanceFloatDistance | null

null: the wrap mode’s default gap.

zIndexnumber | null

Stacking order among positioned objects (Word’s relativeHeight); null when unset.

FloatingBoxBorder

A box’s outline; width in px.

NameTypeDefault
widthnumber
colorstring
styleFloatingBoxBorderStyle

FloatingBoxBorderStyle

export type FloatingBoxBorderStyle = "solid" | "dashed" | "dotted";

FloatingBoxHeightRule

export type FloatingBoxHeightRule = "atLeast" | "exact";

How a fixed height applies: a minimum the content can grow past, or clipped to it.

FloatingBoxOrigin

export type FloatingBoxOrigin = "textbox" | "frame";

Where a text box came from; read only by the DOCX exporter (a wps text box or w:framePr).

FloatingBoxOwnAttrs

The text box’s own attrs; placement comes from the floating family.

NameTypeDefault
idstring | null

Unique id (the uniqueId plugin fills it: inline nodes declare it themselves).

originFloatingBoxOrigin
widthnumber

px, border box.

autoWidthboolean

Word sized it to its content (a frame without w:w): width stands in at the column width and the DOCX export leaves it out. Setting the width clears it.

heightnumber | null

px; null grows with the content.

heightRuleFloatingBoxHeightRule
borderFloatingBoxBorder | null
fillstring | null

Background color; null for none.

paddingFloatingBoxPadding
verticalAlignFloatingBoxVerticalAlign
labelstring | null

Accessible name; null falls back to the UI’s “Text box”.

FloatingBoxPadding

Space (px) between a box’s border and its content.

NameTypeDefault
topnumber
bottomnumber
leftnumber

FloatPosition

Where the object sits, per axis: an alignment within the frame, or, when align is null, an offset (px) from the frame’s start edge.

NameTypeDefault
h{ relativeTo: FloatHorizontalRelativeTo; align: FloatHorizontalAlign | null; offset: number; }
v{ relativeTo: FloatVerticalRelativeTo; align: FloatVerticalAlign | null; offset: number; }

FootnoteAttrs

NameTypeDefault
idstring | null

This occurrence’s own id (DS-9); repeated anchors of one note share footnoteRef.

footnoteRefstring | null

FootnoteBodyAttrs

NameTypeDefault
footnoteRefstring | null
indexnumber

FootnoteItem

NameTypeDefault
indexnumber
occurrencesnumber
sectionIdstring | null
isFirstOccurrenceboolean
footnoteRefstring

FormatPainterPluginState

NameTypeDefault
enabledboolean
onceboolean
marksMark[]
attrsAttrs
nodeTypestring

FullEditorStores

NameTypeDefault
modeWritableAtom<EditorMode>
tocWritableAtom<TOCstate | undefined>
tocActiveIdWritableAtom<string | null>

Anchor id of the TOC item the viewport has scrolled to (highlight state). Kept out of toc so scroll tracking never churns the items array.

tocBreaksWritableAtom<Map<string, TOCbreakEntry[]> | undefined>

TOC nodeId → page breaks cutting through it. Written by the pagination engine after each recompute; the TOC nodeview renders row spacers from it.

bibliographyWritableAtom<BibliographyState | undefined>

The citation registry, written by @stesura/bibliography’s plugin.

nodePageNumbersWritableAtom<Map<string, string> | undefined>

Block nodeId → DISPLAYED page label (“iv”, “12”), honouring each section’s pageNumbering, so it matches the footers. Written by pagination after each recompute; undefined until then, or when it’s off. Read by the TOC.

nodePagesWritableAtom<Map<string, number> | undefined>

Block nodeId → 0-based DOCUMENT page index its first line is laid on, continuous across sections. Written with nodePageNumbers; undefined until then, or when pagination is off. Read by the positioned object cycle.

pageCountsWritableAtom<Map<string, number> | undefined>

sectionId → page count, iterated in DOCUMENT order, so a prefix sum is a section’s page offset and the full sum the document total (totalPages, the stats dialog). Written by pagination after each recompute; undefined until then, or when it’s off.

pageNumberingWritableAtom<Map<string, PageNumberingAttrs> | undefined>

sectionId → pageNumbering, for sections that set one. Published by pagination next to pageCounts, so headers/footers resolve page numbers without subscribing to the document.

caretColumnWritableAtom<number | null>

0-based physical column (counted from the left) of the caret in a column section; null anywhere else. Written by pagination after each view update (it reads the layout), read by the ruler to draw that column’s edges.

firstLayoutReadyWritableAtom<boolean | null>

Whether the first pagination pass has produced a layout. null: nobody claims it (unpaginated, or pagination not loaded) and the canvas renders immediately. false: first pass outstanding — the canvas holds, so the unpaginated draft never flashes. true: every section has a layout, or the hold timed out.

contentWidthWritableAtom<number | undefined>

Measured width (px) of the content box in a layout: "flow" mount, written by editor-react’s ResizeObserver; undefined until the first measurement and in page layout. Read through getContentWidth.

resolvedStyleSheetWritableAtom<StyleSheet | undefined>
styleSheetOverridesWritableAtom<StyleSheet | undefined>

The RAW doc.attrs.styleSheet, published by the stylesheet plugin. Sub-editor docs store no style definitions, so they read them here via the registry’s parent fall-through — same as listConfigs .

listConfigsWritableAtom<Record<string, ILevelsOptions[]> | undefined>

List configs (defaults + doc.attrs.listConfigs), published by the numbering plugin. Definitions are doc-global while counters are per story, so sub-editors read them here via the registry’s parent fall-through.

listBasesWritableAtom<Record<string, ListBase> | undefined>

The root doc’s listBases, published beside listConfigs .

listOverridesWritableAtom<ListOverrides | undefined>

The root doc’s listOverrides, published beside listConfigs .

rootDocWritableAtom<Node | undefined>

The root editor’s current doc, published by the numbering plugin’s view. Lets sub-editors answer cross-region questions, e.g. counting a listRef’s instances before deciding whether a config edit must fork (CORE-31).

blockHandleWritableAtom<BlockHandleState>

GetTextStylesResult

What the toolbar reads: the value attrs as stored, plus one RESOLVED boolean per negatable mark — mark presence, the paragraph style and off folded into the single “is it on here” answer. Not the mark’s attr shape, which carries the negations as a list.

NameTypeDefault
colorstring | number | boolean | null
capsstring | number | boolean | null
colorThemestring | number | boolean | null
fontSizestring | number | boolean | null
fontFamilystring | number | boolean | null
letterSpacingstring | number | boolean | null
bgColorstring | number | boolean | null
bgColorThemestring | number | boolean | null
strongboolean
emboolean
underlineboolean
strikethroughboolean
superscriptboolean
subscriptboolean

GlobalAttribute

A global attribute definition bound to the node type names that carry it.

NameTypeDefault
attrsRecord<string, { default: any; }>

Attrs merged into the node spec’s own attrs.

toDOM(node: Node) => { [key: string]: any; style?: string; class?: string; }

Extra DOM attributes merged into the node’s own toDOM output. class values are combined, style strings concatenated, the rest spread.

getAttrs(dom: HTMLElement) => Attrs

Attr values recovered from the DOM, merged into every parseDOM rule of the node.

nodesstring[]

GlobalAttributeDefinition

A global attribute definition: the attrs it injects into node specs and how they serialize to/from the DOM. Definitions are independent of WHICH nodes carry them — binding is resolved centrally from the default bindings plus the globalAttributes.nodes delta passed to stesuraSchema.

NameTypeDefault
attrsRecord<string, { default: any; }>

Attrs merged into the node spec’s own attrs.

toDOM(node: Node) => { [key: string]: any; style?: string; class?: string; }

Extra DOM attributes merged into the node’s own toDOM output. class values are combined, style strings concatenated, the rest spread.

getAttrs(dom: HTMLElement) => Attrs

Attr values recovered from the DOM, merged into every parseDOM rule of the node.

HighlightAttrs

NameTypeDefault
colorstring

HighlightPluginState

NameTypeDefault
persistedColorstring | null

IBorderOptions

NameTypeDefault
styleOoxmlBorderStyle
colorstring
colorThemestring | null

Theme sidecar of color (docs/executed/document-theme-plan.md).

sizenumber
spacenumber

IBordersOptions

NameTypeDefault
topIBorderOptions
bottomIBorderOptions
leftIBorderOptions
betweenIBorderOptions

ILevelsOptions

NameTypeDefault
levelnumber
formatLevelFormatName
textstring
alignmentAlignmentTypeValue
startnumber
suffixLevelSuffixValue
isLegalNumberingStyleboolean
indentIndentAttrs

Per-level indentation in px — Word’s w:lvl/w:pPr/w:ind. The LOWEST tier of the indent cascade (see resolveNumberedIndent); a paragraph’s own indent always beats it.

Only start, by and special are meaningful; end is kept so a round trip cannot drop a value an imported file set.

tabStopnumber

Minimum counter-cell width in px, measured from where the number STARTS (Word measures from the margin; the DOCX layer translates). Only meaningful when followed by a tab. Local extension — strip before docx.js export.

genderNumberGender

Grammatical gender for the word-based formats (cardinalText, ordinalText, ordinal) — “Parte Prima” vs “Capitolo Primo”. Defaults to masculine; ignored by digit formats and single-gender languages.

Local extension with no w:lvl equivalent: stripped before docx.js export and lost on a DOCX round trip.

casing"lowercase" | "uppercase" | "capitalize" | "firstLetter"

Casing for the word-based formats — “FORTY-TWO” vs “forty-two”. Undefined is the converters’ native output (every word capitalised).

Local extension, like gender: stripped before docx.js export and lost on a DOCX round trip.

ClauseLabel

A numbered block’s clause label (getClauseLabels). own is the counter’s text; tokens are its levels’ numbers alone (“Part 1 / Section A / 1.1(a)” → 1, A, 1, 1, a); label is the display form (“5.2(a)”).

NameTypeDefault
ownstring
tokensreadonly string[]
labelstring

ImageAltState

Alt text is THREE-state: meaningful (alt set), decorative (decorative: true), or undeclared (neither). A single string would let an unlabelled image pass every check as if deliberately decorative.

NameTypeDefault
altstring | null
decorativeboolean

ImageAnchoredAttrs

NameTypeDefault
altstring | null
decorativeboolean
cropImageCrop | null
transformImageTransform | null
borderImageBorder | null
opacitynumber | null

Visible opacity, 0–100 (a:alphaModFix).

adjustImageAdjust | null
grayscaletrue | null
shapeImageShape | null
shadowImageShadow | null
docxPictureDocxPicturePassthrough | null
idstring | null

Unique id (assigned by the uniqueId plugin — inline nodes are opted in explicitly).

srcstring | null
widthnumber | null
heightnumber | null
aspectRationumber | null
wrapFloatWrap
anchorPositionFloatPosition
wrapDistanceFloatDistance | null

null: the wrap mode’s default gap.

zIndexnumber | null

Stacking order among positioned objects (Word’s relativeHeight); null when unset.

ImageAnchoredOwnAttrs

The picture’s own attrs; placement comes from the floating family.

NameTypeDefault
altstring | null
decorativeboolean
cropImageCrop | null
transformImageTransform | null
borderImageBorder | null
opacitynumber | null

Visible opacity, 0–100 (a:alphaModFix).

adjustImageAdjust | null
grayscaletrue | null
shapeImageShape | null
shadowImageShadow | null
docxPictureDocxPicturePassthrough | null
idstring | null

Unique id (assigned by the uniqueId plugin — inline nodes are opted in explicitly).

srcstring | null
widthnumber | null
heightnumber | null
aspectRationumber | null

ImageAttrs

NameTypeDefault
altstring | null
decorativeboolean
cropImageCrop | null
transformImageTransform | null
borderImageBorder | null
opacitynumber | null

Visible opacity, 0–100 (a:alphaModFix).

adjustImageAdjust | null
grayscaletrue | null
shapeImageShape | null
shadowImageShadow | null
docxPictureDocxPicturePassthrough | null
srcstring | null
widthnumber | null
heightnumber | null
aspectRationumber | null
maxWidthnumber | null
alignImageAlign
wrapImageWrap

ImageBorderCompound

Word’s a:ln/@cmpd values for a picture’s line, other than single (sng).

NameTypeDefault
toString() => string
charAt(pos: number) => string
charCodeAt(index: number) => number
concat(...strings: string[]) => string
indexOf(searchString: string, position?: number | undefined) => number
lastIndexOf(searchString: string, position?: number | undefined) => number
localeCompare{ (that: string): number; (that: string, locales?: string | string[] | undefined, options?: CollatorOptions | undefined): number; (that: string, locales?: LocalesArgument, options?: CollatorOptions | undefined): number; }
match{ (regexp: string | RegExp): RegExpMatchArray | null; (matcher: { [Symbol.match](string: string): RegExpMatchArray | null; }): RegExpMatchArray | null; }
replace{ (searchValue: string | RegExp, replaceValue: string): string; (searchValue: string | RegExp, replacer: (substring: string, ...args: any[]) => string): string; (searchValue: { ...; }, replaceValue: string): string; (searchValue: { ...; }, replacer: (substring: string, ...args: any[]) => string): string; }
slice(start?: number | undefined, end?: number | undefined) => string
split{ (separator: string | RegExp, limit?: number | undefined): string[]; (splitter: { [Symbol.split](string: string, limit?: number | undefined): string[]; }, limit?: number | undefined): string[]; }
substring(start: number, end?: number | undefined) => string
toLowerCase() => string
toLocaleLowerCase{ (locales?: string | string[] | undefined): string; (locales?: LocalesArgument): string; }
toUpperCase() => string
toLocaleUpperCase{ (locales?: string | string[] | undefined): string; (locales?: LocalesArgument): string; }
trim() => string
lengthnumber
substr(from: number, length?: number | undefined) => string
valueOf() => string
codePointAt(pos: number) => number | undefined
includes(searchString: string, position?: number | undefined) => boolean
endsWith(searchString: string, endPosition?: number | undefined) => boolean
normalize{ (form: "NFC" | "NFD" | "NFKC" | "NFKD"): string; (form?: string | undefined): string; }
repeat(count: number) => string
startsWith(searchString: string, position?: number | undefined) => boolean
anchor(name: string) => string
big() => string
bold() => string
fixed() => string
fontcolor(color: string) => string
fontsize{ (size: number): string; (size: string): string; }
italics() => string
small() => string
strike() => string
sub() => string
sup() => string
padStart(maxLength: number, fillString?: string | undefined) => string
padEnd(maxLength: number, fillString?: string | undefined) => string
trimEnd() => string
trimStart() => string
trimLeft() => string
trimRight() => string
matchAll(regexp: RegExp) => RegExpStringIterator<RegExpExecArray>
replaceAll{ (searchValue: string | RegExp, replaceValue: string): string; (searchValue: string | RegExp, replacer: (substring: string, ...args: any[]) => string): string; }
at(index: number) => string | undefined
__@iterator@6565() => StringIterator<string>

ImageCrop

The part of the source bitmap a picture shows, as the percent of its width (left/right) or height (top/bottom) trimmed from each edge — Word’s a:srcRect. The displayed box (width/height) is the visible part.

NameTypeDefault
topnumber
bottomnumber
leftnumber

ImageGeometryAttrs

What both image nodes carry beyond their layout.

NameTypeDefault
cropImageCrop | null
transformImageTransform | null

ImagePluginAction

NameTypeDefault
type"add" | "remove"
idunknown

ImagePluginState

NameTypeDefault
find(start?: number | undefined, end?: number | undefined, predicate?: ((spec: any) => boolean) | undefined) => Decoration[]

Find all decorations in this set which touch the given range (including decorations that start or end directly at the boundaries) and match the given predicate on their spec. When start and end are omitted, all decorations in the set are considered. When predicate isn’t given, all decorations are assumed to match.

findInnerany
map(mapping: Mapping, doc: Node, options?: { onRemove?: (decorationSpec: any) => void; } | undefined) => DecorationSet

Map the set of decorations in response to a change in the document.

add(doc: Node, decorations: Decoration[]) => DecorationSet

Add the given array of decorations to the ones in the set, producing a new set. Consumes the decorations array. Needs access to the current document to create the appropriate tree structure.

addInnerany
remove(decorations: Decoration[]) => DecorationSet

Create a new set that contains the decorations in this set, minus the ones in the given array.

removeInnerany
forChild(offset: number, node: Node) => DecorationSet | DecorationGroup

Extract a DecorationSource containing decorations for the given child node at the given offset.

forEachSet(f: (set: DecorationSet) => void) => void

Call the given function for each decoration set in the group.

ImageRejection

Why an image was refused (ImageUploadPolicy.onImageRejected).

NameTypeDefault
reason"too-large" | "inline-disallowed" | "unsupported-type" | "type-not-allowed"

ImageTransform

How the picture is turned inside its box — Word’s a:xfrm: degrees clockwise, and mirroring (applied before the rotation).

NameTypeDefault
rotationnumber
flipHboolean
flipVboolean

ImageUploadPolicy

How an editor handles image files when no upload strategy is installed (see setImageUploadStrategy). Declared per editor via the imageUploadPolicy plugin; absent means inline fallbacks are allowed.

NameTypeDefault
allowInlineImagesboolean

When false and no upload strategy is installed, dropped/pasted images are refused instead of being embedded as base64 data URIs — docs that sync or persist server-side must not carry inline blobs.

onInlineImageRejected() => void

Notified when an image is refused because inline fallbacks are disabled.

allowedImageTypesSniffedImageType[]

The image types users may insert (drop, paste, upload, a watermark), sniffed from the bytes or read off a data: src; absent, all of them. DOCX import keeps what the file holds, and so does a move or copy of a picture already in the document. A remote URL’s type is unknown to the client: check those on the server (or in the upload strategy).

onImageRejected(rejection: ImageRejection) => void

Notified whenever an inserted image is refused, with why.

IndentAttrs

Indentation attrs. Every field is optional and nullable, like SpacingAttrs: a save legitimately emits a partial (only the field the user touched), and null is the explicit “inherit from the style” unset.

NameTypeDefault
startnumber | null
endnumber | null
specialIndentationSpecials | null
bynumber | null

InsertImagePlaceholder

NameTypeDefault
type"add"
posnumber
idunknown

InvisibleCharactersState

NameTypeDefault
showboolean
pilcrowsDecorationSet

One widget at the content end of every atom-final block, kept whether or not markers are shown: it is also the caret’s text anchor after an atom, without which Chrome sizes the caret by the line box (PIL-1c). The pilcrow glyph is gated in CSS.

JSONContent

Loosely describes a JSON representation of a Prosemirror document or node

NameTypeDefault
typestring
attrsRecord<string, any>
contentJSONContent[]
marks{ [key: string]: any; type: string; attrs?: Record<string, any>; }[]
textstring

LanguageExtractor

Reads a code block’s highlighting language.

Parameters:
NameTypeDefault
nodeNode
Returns:
string | undefined

LevelFormat

NameTypeDefault
formatLevelFormatName | undefined
textstring
tabStopnumber

Level-config tabStop in px (see ILevelsOptions.tabStop).

genderNumberGender

Level-config gender (see ILevelsOptions.gender).

casing"lowercase" | "uppercase" | "capitalize" | "firstLetter"

Level-config casing (see ILevelsOptions.casing).

LineNumbersAttrs

Section-level line numbering, modelled on OOXML’s w:lnNumType. null on the section means no line numbering. The pagination engine owns the counter and publishes each line’s number; nothing here is interpreted by CSS.

See DEFAULT_LINE_NUMBERS_ATTRS for the values toggleLineNumbers turns on, and LINE_NUMBERS_BOUNDS for the ranges setLineNumbers clamps to.

NameTypeDefault
countBynumber

Show only every Nth line’s number (Word’s “Count by”). Every line is still counted.

distancenumber

Gap in px between the gutter and the section’s text edge (OOXML stores twips).

restart"continuous" | "newPage" | "newSection"

Where the counter resets: never, on every page, or at the section’s first line.

startnumber

The first line’s number, 1-based (Word’s floor is 1).

LinkAttrs

NameTypeDefault
urlstring

ListConfig

NameTypeDefault
referencestring
levelsILevelsOptions[]

ListFormatOption

NameTypeDefault
labelstring
valueLevelFormatName | undefined
cssstring
transform(i: number) => string
pickableboolean

Whether the format appears in the level-format picker. Most entries exist only so IMPORTED files render faithfully (⑴, - 5 -, Devanagari digits).

Margins

NameTypeDefault
topnumber
bottomnumber
leftnumber

MarkRange

NameTypeDefault
markMark
fromnumber
tonumber

NodeCommentEntry

One thread attached to a whole node via the nodeComments global attribute (an array — a node can carry several). The node’s id is the anchor.

NameTypeDefault
threadIdstring

NodeFormatting

NameTypeDefault
indentIndentAttrs
spacingSpacingAttrs
lineHeightstring | number

Unitless multiplier (1.5 lines) or an exact “Xpt” height.

textAlignstring

NodeWithPos

NameTypeDefault
nodeNode
posnumber

NoteItemBase

Shape shared by both note kinds; only the ref field name differs per kind (kept distinct so a footnote item can never be fed to endnote code).

NameTypeDefault
indexnumber
occurrencesnumber
sectionIdstring | null
isFirstOccurrenceboolean

NotesState

State of the merged notes plugin: one slice per note kind, each in anchor (= numbering) order. Kinds not present in the schema stay empty.

NameTypeDefault
footnotesFootnoteItem[]
endnotesEndnoteItem[]

NumberingAttrs

NameTypeDefault
listRefstring | null

The list this paragraph numbers against. INHERIT_LIST_REF means “take the list from the resolved style”; null is the off-sentinel (see NumberingAttrValue).

levelnumber

level / instanceId are USER data:

  • on a directly-numbered paragraph they are the canonical storage and the numbering plugin keeps them stamped;
  • on a style-numbered paragraph (INHERIT_LIST_REF) they are OVERRIDES and stay absent unless the user explicitly set one (level change at an unbound level, restart). The style cascade fills the gaps — stamping derived values here froze the binding (CORE-37).

What follows the number and whether it’s a bullet are the level’s (and the list’s listOverrides): the numbering store derives them.

instanceIdstring
tabStopnumber | null

Per-instance override of the level config’s tabStop (px, see ILevelsOptions.tabStop).

NumberingOffSentinel

Written on a paragraph whose resolved style IS numbered but which the user toggled off. Distinct from the null attr, which means “inherit — the style decides”. Healed back to null by the numbering plugin once the style stops being numbered.

NameTypeDefault
listRefnull

NumberingPluginState

NameTypeDefault
numberingConfigsMap<string, ListConfig>
selectedConfigIdstring | null
selectedinstanceIdstring | null
applyNumberingboolean
currentLevelnumber

PageFormats

NameTypeDefault
widthnumber
heightnumber
labelstring
valuestring
defaultboolean

PageMargins

NameTypeDefault
topnumber
bottomnumber
leftnumber
labelstring
valuestring
defaultboolean

PageNumberAttrs

NameTypeDefault
pageTypePageNumberType

PageNumberingAttrs

A section’s page numbering, modelled on w:pgNumType: the number its first page prints — null continues from the previous section, Word’s default — and the format every page of the section prints in.

NameTypeDefault
startnumber | null
formatPageNumberFormat

PaginationAttrs

NameTypeDefault
widowOrphanboolean | null
pageBreakBeforeboolean | null
keepWithNextboolean | null
keepLinesboolean | null

Word’s keepLines: the paragraph is never split across pages. One taller than a page starts on a fresh page and splits there. Ignored in tables.

PaginationPluginState

NameTypeDefault
showPaginationboolean
oversizedDecorationsDecorationSet

Node decorations marking engine-detected oversized nodes with data-oversized-id. The actual clamp (max-height + overflow: hidden) comes from a store-driven stylesheet, NOT from decoration styles — see the pagination plugin’s oversizedClamps module.

oversizedSignaturestring

Signature of the clamp set the decorations were built from, compared by the poke helper to skip redundant dispatches.

ParagraphStyle

NameTypeDefault
bordersBlockBorders
backgroundColorstring | null

Block fill. null resets (cleared here, not inherited), as with numbering/outlineLevel; absent inherits.

backgroundColorThemestring | null
numberingStyleNumbering | null

Style-linked numbering. Inherits through basedOn as a whole object (no field merge). null resets to unnumbered; absent inherits.

textAlignstring
indentIndentAttrs
spacingSpacingAttrs
lineHeightstring | number

Unitless multiplier (1.5 lines) or an exact “Xpt” height.

lineHeightAtLeastLineHeightAtLeast | null

Word’s “At least” height lineHeight was derived from (see the paragraph attr).

tabStopsTabStop[] | null

Tab stops, as a whole list: a paragraph’s own tabStops replaces the style’s rather than adding to it. Inherits through basedOn; null resets to the default stops.

outlineLevelnumber | null

Heading level (1–9; Word’s w:outlineLvl is 0-based). A style with an outline level IS a heading. Inherits through basedOn; null resets to body text, absent inherits.

paginationPaginationAttrs | null

Pagination props (Word: keepNext / keepLines / widowControl / pageBreakBefore), in the node attr’s PaginationAttrs shape so both levels resolve the same way. One object because Word edits them together in its Paragraph dialog — the right granularity for OT and track changes.

Whole-object override through basedOn: absent inherits, null resets. Unset fields fall back to widowOrphan true and the rest false (see getStylePaginationProps). Not rendered as CSS.

Parser

Highlights a code block into decorations, or returns a promise (optionally with interim decorations) that resolves once a still-loading highlighter is ready.

Parameters:
NameTypeDefault
optionsParserOptions
Returns:
Promise<void> | Decoration[] | PendingDecorations

ParserOptions

NameTypeDefault
contentstring

Text content of the code block.

posnumber

Start position of the code block.

languagestring
sizenumber

The node’s nodeSize.

nodeNode

PdfPreviewAssets

URLs the host app serves pdf.js’s out-of-bundle resources from. pdf.js loads its worker as a separate script and fetches cMaps, standard fonts, the WASM modules and ICC profiles lazily BY URL; none of that can be inlined into a library bundle and a library cannot know the app’s public path, so the integrator passes them (pdf-viewer-assets --out public/pdfjs copies them).

NameTypeDefault
workerSrcstring

pdf.js worker script. The one asset without which nothing renders.

cMapUrlstring

Directory of the CMap files, for CJK documents. Trailing slash.

standardFontDataUrlstring

Directory of the standard 14 font files. Trailing slash.

wasmUrlstring

Directory of the WASM modules (OpenJPEG, qcms colour management). Trailing slash.

iccUrlstring

Directory of the predefined ICC profiles (e.g. CMYK). Trailing slash.

PdfPreviewConfig

Everything isPdfPreview needs — the one decision the node view, pagination and the PDF export must agree on. Both facts are STATIC for a mount and known before first layout: ready is whether the mount’s uiExtensions include the viewer, and the allowlist is config.

NameTypeDefault
readyboolean
allowedFileHostsstring[]

The config plugin’s allowedFileHosts. Undefined → every PDF is a card.

PdfPreviewLimits

Ceilings a preview refuses to render past (SEC-70).

NameTypeDefault
maxPagesnumber

Pages rendered before the preview stops and says how many are left.

maxBytesnumber

Content-Length above which the preview shows a “too large” notice instead of rendering.

PdfPreviewProps

What the preview component is given for one file node.

NameTypeDefault
srcstring

Already normalized and policy-checked by the node view.

rotationFileRotation

The node’s whole-file rotation, ADDED to each page’s own.

namestring | null

Display name, for the preview region’s accessible name.

heightnumber

Box height in CSS px: the page height paginated, the height attr otherwise.

PendingLinkPluginState

NameTypeDefault
isPendingboolean
pendingSelectionSelection | null
existingUrlstring

Problem

NameTypeDefault
fromnumber
tonumber
msgstring
shortmsgstring
typestring
replacements{ value: string; }[]

Suggested corrections in LanguageTool’s object shape (PR-2). Capped at five.

ProofingLanguageAttrs

The block’s proofing language (BCP 47), top of the paragraph ?? style ?? doc chain. null defers to the level below. Named apart from a code block’s codeLanguage: gates key on attr presence, so one language would give a code block a spell checker.

NameTypeDefault
proofingLanguagestring | null

ProofreadCacheAdapter

Storage abstraction for the proofread cache (memory, redis, localforage…).

Sync contract

get / entries / set / delete are synchronous. Decoration rendering runs inside doc.descendants on every transaction and cannot block on IO. Async-backed adapters (redis, idb) are expected to maintain an in-memory mirror and schedule persistence in the background.

External changes

Adapters whose data can change from outside the plugin (collaborator edits on a y.Map, redis pubsub, another tab via BroadcastChannel) should implement subscribe. The plugin calls it on mount and triggers a decoration refresh when notified.

Pass the changed node ids to the callback when the adapter knows them. The plugin then re-queues only those nodes, and a sub-editor skips the rebuild entirely when none of them is in its document — without the ids, every remote write walks every mounted editor. Omitting them stays correct, just broader.

Cross-instance fan-out

One page creates several instances for the same field: the main editor’s plugin plus one subscriber plugin per sub-editor (headers, footers, notes), all through the same factory. Sub-editors only ever repaint from these notifications, so set and delete MUST notify subscribers registered through every instance backed by the same store, with the changed ids — not just the instance that wrote. Adapters don’t need to filter out the writer’s own notifications, but the notification MUST be delivered synchronously from inside set/delete: the main plugin suppresses its own writes with a flag held only for the duration of the call, so a deferred notification (microtask, network echo) makes it treat every one of its own writes as external — a wasted re-check pass per write.

Readiness

An adapter that fills its mirror from an async source (a hydration GET, an idb read) should expose that as ready. The plugin’s FIRST pass waits for it (bounded — a dead endpoint must not stall proofreading), so a document whose results are already in the shared store is not re-sent to the api on every load (PR-47). Resolve it on failure too; reject never. Adapters with no async source omit it.

NameTypeDefault
get(id: string) => ProofreadCacheItem | undefined
set(id: string, value: ProofreadCacheItem) => void
delete(id: string) => void
entries() => Iterable<[string, ProofreadCacheItem]>
subscribe(cb: (changedIds?: readonly string[] | undefined) => void) => () => void
destroy() => void
readyPromise<void>

ProofreadCacheItem

NameTypeDefault
hashstring
languagestring | null
problemsProblem[]

Problem positions are relative to the node’s content (doc token accounting: atoms = 1, inline node boundaries = 1 each).

deletedAtnumber

Epoch ms when the node was seen deleted; the entry is kept briefly so an undo needs no new api call. A number, not a Date: entries round-trip through JSON, and a Date would come back as a string that never expires.

vnumber

Cache format version. Entries whose version doesn’t match the current format are treated as misses.

ProofreadDictionaryAdapter

Storage abstraction for the user’s proofread dictionary (“add to dictionary”).

The dictionary is identity-scoped (a user and the groups they belong to), never document-scoped: it is applied as a render-time filter over cached problems, so cached results stay dictionary-blind and shareable across collaborators.

Sync contract

Same as ProofreadCacheAdapter: has runs inside decoration builds and cannot block on IO. Async-backed adapters keep an in-memory mirror and persist in the background.

Language

language is always a primary subtag ("en", never "en-US") or null. An entry stored with language: null applies to every language (names, brand terms); has must honour that.

External changes

subscribe should fire on any change to the effective dictionary — including writes from this same page through another adapter instance (sub-editors create their own), other tabs, or the server. The plugin only rebuilds decorations from cache on notification, so over-notifying is cheap and safe.

NameTypeDefault
has(word: string, language?: string | null | undefined) => boolean

Whether word is in the dictionary for language (primary subtag) or globally.

add(word: string, language?: string | null | undefined) => void
remove(word: string, language?: string | null | undefined) => void
subscribe(cb: () => void) => () => void
destroy() => void

Range

NameTypeDefault
fromnumber
tonumber

RemoveImagePlaceholder

NameTypeDefault
type"remove"
idunknown

ResolvedIndentAttrs

IndentAttrs with every value resolved — nothing inherited, nothing unset. What the ruler and the CSS emitters work in, once the style chain has been walked.

NameTypeDefault
startnumber
endnumber
specialNonNullable<IndentationSpecials | null | undefined>
bynumber

ResolvedStyleDefinition

NameTypeDefault
type"paragraph" | "table" | "character"

Word’s w:style/@w:type; absent means “paragraph”. A "character" entry never applies to a block: it is absent from the style picker, not a valid styleId, carries no paragraphStyle, bases only on character styles, and renders against its MARK’s selector rather than .pm-style-<id>.

Only HTMLCode (code mark) and Hyperlink (link mark) are recognised; every other w:rStyle flattens onto its runs at import.

namestring
languagestring | null

Proofing language (BCP 47), the middle of paragraph.proofingLanguage ?? style.language ?? doc.language — Word’s w:style/w:rPr/w:lang. Top-level, not in characterStyle, so it never reaches textStyleToCss. Inherits through basedOn; null resets to the document language, absent inherits.

basedOnstring | null
tableStyleTableStyle

type: "table" entries only (docs/partially-executed/table-styles-plan.md).

semiHiddenboolean
unhideWhenUsedboolean
quickFormatboolean
uiPrioritynumber
nextstring
characterStyleTextStyle
paragraphStyleResolvedParagraphStyle

ResolvedUser

NameTypeDefault
namestring
avatarstring

ResolveMentionSuggestionsCallback

User ids matching a mention query, in display order. text is what follows the trigger; empty means everyone worth suggesting.

Parameters:
NameTypeDefault
params{ text: string; }
Returns:
Promise<string[]>

ResolveUsersCallback

Resolves user ids to display data. The result is index-aligned with userIds.

Parameters:
NameTypeDefault
params{ userIds: string[]; }
Returns:
Promise<ResolvedUser[]>

RowAttrs

NameTypeDefault
heightnumber | null
heightRule"atLeast" | "exact" | null

Word’s w:trHeight/@w:hRule: exact pins the row, atLeast (or null) lets content grow it. Carried for the DOCX round trip — the editor renders both as a minimum.

keepTogetherboolean

The row never splits across pages (Word’s w:cantSplit).

isConditionalboolean
isValidboolean
errorMessagestring
codeTsstring

SectionAttrs

NameTypeDefault
orientation"portrait" | "landscape"
margin{ top: number; bottom: number; left: number; right: number; }
pageSizeSize
footerFromBottomnumber
headerFromTopnumber
lineNumbersLineNumbersAttrs | null
dirTextDirection | null
pageNumberingPageNumberingAttrs | null

null: continue from the previous section, in decimal.

columnsSectionColumns | null

null: one column.

pageBordersPageBorders | null

null: no page borders.

watermarkWatermark | null

null: no watermark.

SectionOptions

NameTypeDefault
orientation"portrait" | "landscape"
columnsSectionColumns | null

null switches back to one column.

margin{ top?: number; bottom?: number; left?: number; right?: number; layout?: "custom" | "narrow" | "moderate" | "wide"; }
pageSizeSize

SelectedBorders

NameTypeDefault
topboolean
bottomboolean
leftboolean
betweenboolean
outsideboolean
allboolean
insideVerticalboolean
insideHorizontalboolean

SerializedComment

NameTypeDefault
bodyJSONContent

ProseMirror JSON (a doc of paragraphs). Undefined once soft-deleted.

idstring
authorCommentAuthor
threadIdstring
createdAtstring
deletedAtstring
reactionsSerializedReaction[]

SerializedReaction

NameTypeDefault
emojistring
users{ id: string; }[]
createdAtstring

SerializedThread

NameTypeDefault
idstring
resolvedboolean
metadataRecord<string, unknown>
createdAtstring
deletedAtstring
commentsSerializedComment[]

Size

NameTypeDefault
widthnumber
heightnumber

SortOptions

NameTypeDefault
colIndexnumber
descendingboolean
orderBy"number" | "date" | "text"

SpacingAttrs

NameTypeDefault
beforenumber | null
afternumber | null
contextualboolean | null

Word’s “don’t add space between paragraphs of the same style” (w:contextualSpacing): between two blocks of one style, the before/after of a block that sets it is ignored. Inherits through the style like the other fields; null inherits.

StyleDefinition

NameTypeDefault
namestring
type"paragraph" | "table" | "character"

Word’s w:style/@w:type; absent means “paragraph”. A "character" entry never applies to a block: it is absent from the style picker, not a valid styleId, carries no paragraphStyle, bases only on character styles, and renders against its MARK’s selector rather than .pm-style-<id>.

Only HTMLCode (code mark) and Hyperlink (link mark) are recognised; every other w:rStyle flattens onto its runs at import.

basedOnstring | null
paragraphStyleParagraphStyle
characterStyleTextStyle
tableStyleTableStyle

type: "table" entries only (docs/partially-executed/table-styles-plan.md).

semiHiddenboolean
unhideWhenUsedboolean
quickFormatboolean
uiPrioritynumber
nextstring
languagestring | null

Proofing language (BCP 47), the middle of paragraph.proofingLanguage ?? style.language ?? doc.language — Word’s w:style/w:rPr/w:lang. Top-level, not in characterStyle, so it never reaches textStyleToCss. Inherits through basedOn; null resets to the document language, absent inherits.

StyleNumbering

A style’s numbering binding: a pointer into doc.attrs.listConfigs plus the level of that list the style occupies (Word’s w:numPr on a style’s pPr). A style family — Definitions L.1 … L.9 — shares one listRef with different levels. tabStop is the style-level fallback for the paragraph attr; what follows the number is the level’s (Word has no w:suff on a style).

NameTypeDefault
listRefstring
levelnumber
tabStopnumber

StylePaginationProps

NameTypeDefault
keepWithNextboolean
widowOrphanboolean
pageBreakBeforeboolean
keepLinesboolean

StyleSheetState

NameTypeDefault
resolvedStylesStyleSheet
overridesStyleSheet

doc.attrs.styleSheet as stored — what sub-editors read off the store.

TableAttrs

NameTypeDefault
alignTableAlign
widthTableWidth
layoutTableLayout
sortableSortOptions
bordersTableBorders | null

The edges the table states itself, over its style’s.

tableStylestring | null

A type: "table" stylesheet id; null is no style (Word’s TableNormal).

lookTableLook
bgColorstring | null

The table’s own shading (w:tblPr/w:shd), painted under its style’s region fills; “transparent” hides the style’s base fill.

bgColorThemestring | null
headerRowCountnumber

Leading rows that are header rows (th); clamp with getHeaderRowCount.

repeatHeaderRowsboolean

Paint the header rows again at the top of every page the table continues onto.

marginStartnumber

Offset from the start margin in px (Word’s w:tblInd), negative to pull the table out; start-aligned tables only.

floatingTableFloat | null

Word’s floating table placement, exporter-only; null for a table in the text flow.

idstring

TableBorders

NameTypeDefault
topMutable<Omit<IBorderOptions, "style"> & { style: BorderStyle; }>
bottomMutable<Omit<IBorderOptions, "style"> & { style: BorderStyle; }>
leftMutable<Omit<IBorderOptions, "style"> & { style: BorderStyle; }>
insideHorizontalMutable<Omit<IBorderOptions, "style"> & { style: BorderStyle; }>
insideVerticalMutable<Omit<IBorderOptions, "style"> & { style: BorderStyle; }>

TableDragState

NameTypeDefault
dragging{ node: Node; } | null

TableLook

Which of its table style’s regions a table turns on (Word’s w:tblLook, the Table Design tab’s Style Options). Independent of headerRowCount.

NameTypeDefault
firstRowboolean
lastRowboolean
firstColumnboolean
lastColumnboolean
bandedRowsboolean

Word’s noHBand, inverted.

bandedColumnsboolean

Word’s noVBand, inverted.

TableRegionStyle

The formatting one conditional region adds over the table style’s base.

NameTypeDefault
bordersPartial<Record<"top" | "bottom" | "left" | "right" | "insideH" | "insideV", Mutable<Omit<IBorderOptions, "style"> & { style: BorderStyle; }>>>
bgColorstring

The region’s cell fill: absent shows the layer below; “transparent” paints nothing and hides it (Word’s white, auto or nil shading).

bgColorThemestring | null
characterStyleTableTextStyle

TableResizingOptions

NameTypeDefault
handleWidthnumber
handleHeightnumber
cellMinWidthnumber
cellMinHeightnumber
defaultCellMinWidthnumber

TableStyle

A type: "table" style’s formatting. Resolved through basedOn per field: a stated border edge replaces the base’s, a region merges per field.

NameTypeDefault
bordersTableBorders

w:tblPr/w:tblBorders.

bgColorstring

w:tcPr/w:shd: every cell’s base fill, under the regions’.

bgColorThemestring | null
characterStyleTableTextStyle

w:rPr: every cell’s run formatting, under the regions’.

paddingPartial<CellPadding>

w:tblCellMar in px, per side. Flattened onto cells at import; kept for export.

marginStartnumber

w:tblInd in px. Flattened onto the table at import; kept for export.

paragraphPropertiesXmlElementData

w:pPr: the cells’ paragraph indent, spacing and alignment. Flattened onto the cell paragraphs at import; kept for export only, nothing renders it.

rowBandSizenumber

Rows per band (w:tblStyleRowBandSize). Absent, Word bands nothing.

colBandSizenumber
regionsPartial<Record<TableRegion, TableRegionStyle>>

TabStop

A paragraph tab stop — Word’s w:tab. pos is px from the start edge of the paragraph’s text area (the margin, not the indent), as in Word.

NameTypeDefault
posnumber
alignTabStopAlign
leaderTabStopLeader

TextStyle

A style’s character-level properties.

bgColor is rendered on type: "character" entries ONLY (e.g. HTMLCode’s shading): a paragraph style is one CSS rule on the block element, where a run fill would paint the whole paragraph. Use paragraphStyle.backgroundColor for a block fill and the textStyle/highlight mark for a one-off run fill.

color has the mark attr’s three states: “#RRGGBB”, AUTO_COLOR "auto" (resolved against the background at render time), or absent (inherit through basedOn).

NameTypeDefault
colorstring | null

“#RRGGBB”, the AUTO_COLOR sentinel "auto" (Word’s automatic color: flips black/white against the nearest background at render time), or null (the stylesheet decides). “auto” is legal ONLY here and in TextStyle.color; every other color slot treats it as absent.

fontSizenumber | null
fontFamilystring | null
capsCaps | null
letterSpacingnumber | null

Word’s character spacing (w:spacing in w:rPr), in px: positive expands, negative condenses. 0 is an explicit normal that beats a style’s spacing; null inherits.

bgColorstring | null
colorThemestring | null

Theme sidecars (docs/executed/document-theme-plan.md): non-null means the colour beside it is what the ref resolves to under doc.attrs.theme.

bgColorThemestring | null
strongboolean
emboolean
underlineboolean
strikethroughboolean
superscriptboolean
subscriptboolean

TextStyleAttrs

NameTypeDefault
colorstring | null

“#RRGGBB”, the AUTO_COLOR sentinel "auto" (Word’s automatic color: flips black/white against the nearest background at render time), or null (the stylesheet decides). “auto” is legal ONLY here and in TextStyle.color; every other color slot treats it as absent.

fontSizenumber | null
fontFamilystring | null
capsCaps | null
letterSpacingnumber | null

Word’s character spacing (w:spacing in w:rPr), in px: positive expands, negative condenses. 0 is an explicit normal that beats a style’s spacing; null inherits.

bgColorstring | null
colorThemestring | null

Theme sidecars (docs/executed/document-theme-plan.md): non-null means the colour beside it is what the ref resolves to under doc.attrs.theme.

bgColorThemestring | null
offTextStyleOff[] | null

Properties this run turns OFF against its paragraph’s style. Always in TEXT_STYLE_OFF order and never [] — a reordered or empty array is a different mark to Mark.eq, so adjacent text stops merging. Write through withOff.

TextStyleAttrsWithoutOff

NameTypeDefault
colorstring | null

“#RRGGBB”, the AUTO_COLOR sentinel "auto" (Word’s automatic color: flips black/white against the nearest background at render time), or null (the stylesheet decides). “auto” is legal ONLY here and in TextStyle.color; every other color slot treats it as absent.

fontSizenumber | null
fontFamilystring | null
capsCaps | null
letterSpacingnumber | null

Word’s character spacing (w:spacing in w:rPr), in px: positive expands, negative condenses. 0 is an explicit normal that beats a style’s spacing; null inherits.

bgColorstring | null
colorThemestring | null

Theme sidecars (docs/executed/document-theme-plan.md): non-null means the colour beside it is what the ref resolves to under doc.attrs.theme.

bgColorThemestring | null

ThemeSwatch

One cell of the picker’s theme grid; name and variant let a picker label it.

NameTypeDefault
hexstring
refstring
nameThemeSwatchColumn
variant{ lighter: boolean; percent: number; } | null

null on the base row.

Thread

NameTypeDefault
idstring
resolvedboolean
createdAtDate
deletedAtDate
metadataRecord<string, unknown>
commentsThreadComment[]

ThreadComment

NameTypeDefault
idstring
threadIdstring
createdAtDate
bodyJSONContent

ProseMirror JSON (a doc of paragraphs). Undefined once soft-deleted.

deletedAtDate

Set when the comment has been soft-deleted.

authorCommentAuthor
reactionsCommentReaction[]

Toast

What reaches the host’s onToast. description is localized by editor-react; key and params let a host render its own copy instead. Both are absent on toasts the host raises itself.

NameTypeDefault
typeToastType
descriptionstring
keyToastKey
paramsRecord<string, string | number>

ToastCallback

Parameters:
NameTypeDefault
toastToast
Returns:
void

ToastMessage

What an emitter hands getToaster — the key, its params, and a level.

NameTypeDefault
typeToastType
key"cannotInsertAcrossNodes" | "cannotRemoveOnlySection" | "cannotRemoveSectionBreakWhileSuggesting" | "flowLayoutLocked" | "missingSortColumn" | "sortColumnOutOfRange" | ... 6 more ... | "clipboardReadBlocked"
params{ column: number; columns: number; }

ToastParams

Values interpolated into a message. Keys absent here take no params.

NameTypeDefault
sortColumnOutOfRange{ column: number; columns: number; }

TOCattrs

NameTypeDefault
showPageNumbersboolean
alignNumberRightboolean
showLeaderDotsboolean

Dotted leader between text and the right-aligned number (only meaningful with alignNumberRight).

scope"document" | "section"

“document” lists every section’s headings (Word default); “section” only the TOC’s own.

instructionstring | null

The Word field instruction (TOC o "1-3" h …) an imported TOC came with, exported verbatim; null for a TOC made in the editor, whose instruction the export derives.

TOCbreakEntry

One page break cutting through a TOC node. Written by the pagination engine after each recompute; the TOC nodeview renders a spacer of paddingTop px between rows afterLine - 1 and afterLine.

NameTypeDefault
afterLinenumber
paddingTopnumber

TOCitem

Fully serializable — no live EditorView/Node/DOM references.

NameTypeDefault
idstring
typeNamestring

Node type name of the anchor (“heading”, “paragraph”, …).

itemIndexnumber
levelnumber
originalLevelnumber
isNumberedboolean
numberingLabelstring | undefined
runsTOCrun[]
textContentstring

Plain-text projection of runs (math omitted) — for search/aria/compact lists.

posnumber
sectionIndexnumber

0-based index of the section the anchor lives in — lets a section-scoped TOC filter.

styleIdstring | undefined

The anchor’s paragraph style, for an imported TOC’s \t switch.

outlineLevelnumber | undefined

A heading’s own outline level (not its list level), for \o; undefined otherwise.

pathstring | undefined
listRefstring | undefined
languagestring | undefined
pageBlockIdsstring[]

For an anchor pagination doesn’t place itself (inside a table, a callout…), the blocks whose page it takes, the first one laid out wins: its outer row’s first cell (a table placed row by row is keyed by it), then its outermost block (a table placed whole is keyed by its own id). Undefined for a top-level anchor.

captionLabelstring

A caption’s SEQ identifier (its first visible seq_field’s, My_Label); undefined for a paragraph that is no caption.

TOCstate

NameTypeDefault
contentTOCitem[]

ToggleCounterTrProps

NameTypeDefault
buttonType"number" | "bullet"
levelFormatLevelFormat

TrackChangesAttrs

Block-level lifecycle track-changes variants. Stored on the trackChanges node attribute.

  • deletion — the whole block (open + content + close) is being deleted. All inline content carries deletion marks. Hidden when track-changes display is off; removed on accept.
  • insertion — the whole block was inserted; content carries insertion marks. Removed on reject.
  • deleteClosure — only this block’s closing paragraph boundary (¶) is being deleted. Content stays. On accept, the block merges forward with the next block (tr.join). The attribute lives on the block BEFORE the boundary, not after, so the visual cue (red ¶) sits on its owning block.

Block-level attribute modifications (changes to node attrs like alignment, list numbering, heading level, etc.) live separately on the trackChangesModification node attribute — see trackChangesModificationAttrs. That separation lets a single node carry BOTH a lifecycle change and a pending modification at the same time (e.g. a paragraph being deleted whose alignment was also changed), with each resolvable independently — the Word-style “format change can sit on top of a deletion” semantic.

NameTypeDefault
type"deletion" | "insertion" | "deleteClosure"
idstring
datestring | null
userIdstring | null
userNamestring | null
requestedByIdstring | null

The user an agent made this change for, as comments’ CommentAuthor.requestedBy: the change is the agent’s (userId), and this keeps who asked. Absent on people’s own changes.

requestedByNamestring | null
previousOmit<TrackChangesAttrs, "previous"> | null

The still-pending insertion this deletion/deleteClosure overwrote — set only when a reviewer deletes ANOTHER user’s inserted block (the attr is a single slot, unlike inline marks which stack). Rejecting the deletion restores it, so the original proposal returns to pending instead of being silently accepted. Never nests: an insertion carries no previous.

columntrue

On a table_cell deletion: struck by a column delete, so accepting it widens the columns left, as the untracked delete does (TC-104). A range delete reaching into the table strikes cells too, and widens nothing.

trackChangesModificationAttrs

Block-level attribute modification track-change. Stored on the trackChangesModification node attribute, independent of TrackChangesAttrs.

attrs is a partial map of { attrName → previousValue } — only the keys the user has actually modified are present, paired with their pre-change values so the modification can be rolled back on reject. Invariant: the attribute is set to null rather than {} when no keys remain (e.g. after a cancel-out roll-back), so the presence of the attr always indicates a resolvable change.

Two reserved keys, both exported from constants: NODE_TYPE_MODIFICATION_KEY ("__nodeType") records a pending node TYPE change (paragraph ↔ heading) — its value is the previous type NAME rather than an attr value, and the resolver reverts it via setNodeMarkup instead of setNodeAttribute. NODE_TYPE_ATTRS_MODIFICATION_KEY ("__nodeTypeAttrs") rides alongside it holding the source attrs the type change dropped (heading.level), so the same setNodeMarkup can restore them. The pair is written and cleared together.

NameTypeDefault
idstring
datestring | null
userIdstring | null
userNamestring | null
requestedByIdstring | null

See TrackChangesAttrs.requestedById.

requestedByNamestring | null
attrsAttrs

TrackChangesState

NameTypeDefault
enabledboolean
showboolean
markActivityMapMap<string, number>

markId → lastActivityTimestamp, driving the merge of adjacent marks by the same user within a short window. On plugin state so editors don’t share it.

hasPendingboolean

Whether the doc holds ANY pending track change, kept incrementally so toolbar probes are O(1). When absent (tests, states without the plugin) consumers fall back to a cached full-doc walk.

TransactionFn

Parameters:
NameTypeDefault
propsTransactionFnProps
Returns:
boolean

TransactionFnProps

What a TransactionFn is called with. dispatch is absent on a dry run.

NameTypeDefault
trTransaction
stateEditorState
viewEditorView
dispatch(tr: Transaction) => void

Underline

NameTypeDefault
typeUnderlines
stylestring
thicknessstring | undefined
offsetstring | undefined

UnderlineAttrs

NameTypeDefault
variantUnderlines

Not type, which on a mark reads as mark.type. The DOM form stays data-underline-type.

colorstring | null
colorThemestring | null

UploadBlockAttrs

NameTypeDefault
uploadTypestring | null

UserPreferences

NameTypeDefault
showOutlineboolean
showRulerboolean
zoomLevelnumber
trackChanges{ show: boolean; enabled: boolean; }
showCommentsCommentDisplayMode
displayUnitsDisplayUnits
proofReadEnabledboolean
proofReadFloatingMenuboolean

Whether a squiggle under the caret opens the suggestion menu.

proofReadLoadingboolean
proofReadApiFailedboolean
formatLintEnabledboolean

Whether the format cleanup plugin collects suggestions.

XmlElementData

An OOXML element kept as read (elements and attributes only), written back verbatim.

NameTypeDefault
namestring
attrsRecord<string, string>
childrenXmlElementData[]

Other exports

ExportTypeDescription
AccessibilityRule"imageMissingAlt" /** Link text that says nothing out of context ("click here", a bare URL). */ | "linkTextNotDescriptive" /** The same link text pointing at more than one destination. */ | "duplicateLinkText" /** A paragraph formatted like a heading but not styled as one. */ | "headingLikeParagraph" /** An outline level reached without passing through its parent (1 → 3). */ | "skippedHeadingLevel" /** A table whose first row is not marked as a header row. */ | "tableMissingHeaderRow"The accessibility checker’s rules (v1). Per ATAG they surface judgement calls to the author, as Word/Docs/Acrobat do; none auto-fixes anything.
AlignmentDirection"top" | "middle" | "bottom"
AlignmentTypeValue"start" | "center" | "end" | "both" | "mediumKashida" | "distribute" | "numTab" | "highKashida" | "lowKashida" | "thaiDistribute" | "left" | "right"
AtomValueAtomValue<T>The value type of a nanostores atom.
AttrsWithDefaults{ [K in keyof T]: { default: T[K]; validate?: string | ((value: any) => void) } }ProseMirror attr specs for every key of T.
BlockHandleState{ node: Node; pos: number } | nullThe block under the drag handle, if any.
BorderPosition"top" | "bottom" | "left" | "right" | "between"
BorderStyle"single" | "dashed" | "dotted" | "double" | "groove" | "ridge" | "inset" | "outset" | "none"
Caps"all" | "small" | "none"Word’s two casing FORMATS, plus an explicit off. One slot, so all caps and small caps are mutually exclusive by construction. "none" is an explicit off that beats an inherited all-caps; null inherits.
CaseChange"sentence" | "uppercase" | "lowercase" | "capitalize"Case changes offered as EDITS: they rewrite the stored characters and store nothing. Clearing the casing FORMAT is Caps via setCaps instead.
CellAlignment${AlignmentDirection}-${TableAlign}
CommentDisplayMode"anchored" | "floating" | "minimized" | "none"
ContentHTMLContent | JSONContent | JSONContent[] | nullContent given as an HTML string or ProseMirror JSON.
CrossRefType"default" | "noContext" | "fullContext" | "aboveBelow" | "page" | "text"What a cross-reference shows, as Word’s Cross-reference dialog names it: the paragraph number in relative context, with no context or in full context, above/below, the page (Word’s PAGEREF) or the target’s text (“Heading text”).
CSSPropertiesProperties<string | number> & { [key: `--${string}`]: string | number | undefined }A style object: csstype Properties plus CSS custom properties (--name).
DisplayUnit"cm" | "inches" | "pt" | "px"
EditorMode"edit" | "review" | "view"Editor mutability mode. "edit" — full editing. "review" — all edits become tracked suggestions. Requires the track-changes plugin: configuring it without one throws. The toggle that would turn tracking off is refused for as long as the mode is set. "view" — read-only: local doc-changing transactions are dropped at dispatch, remote collab changes still apply.
EditorStoreExtensionsinterface EditorStoreExtensions {}Module-augment this interface to type the extension stores passed to createEditorStores.
FileKind"pdf" | "other"
FileRotation0 | 90 | 180 | 270The rotations a file node can store.
FindResultContentNodeWithPos | undefinedResult of a prosemirror-utils node lookup.
FloatHorizontalAlign"left" | "center" | "right" | "inside" | "outside"
FloatHorizontalRelativeTo"character" | "column" | "insideMargin" | "leftMargin" | "margin" | "outsideMargin" | "page" | "rightMargin"Word’s horizontal frames (wp:positionH/@relativeFrom).
FloatSide"left" | "right"Which side a square/tight float sits on.
FloatVerticalAlign"top" | "center" | "bottom" | "inside" | "outside"
FloatVerticalRelativeTo"bottomMargin" | "insideMargin" | "line" | "margin" | "outsideMargin" | "page" | "paragraph" | "topMargin"Word’s vertical frames (wp:positionV/@relativeFrom).
FloatWrap"inline" | "square" | "tight" | "topBottom" | "front" | "behind"How text wraps a positioned object (floating family): on its line, floated beside it, above and below, or out of flow in front of or behind it.
FollowBy"tab" | "space" | "nothing"
followNumberingWithreadonly ["tab", "space", "nothing"]What can follow a list number. FollowBy is its element type.
GlobalAttributeMapRecord<T, GlobalAttribute>The resolved global attributes of a schema, keyed by attribute name.
HeaderFooterVariant"default" | "even" | "first"
HTMLContentstring
ImageAlign"start" | "end" | "center" | "fullWidth"
ImageAnchoredWrapExclude<FloatWrap, "topBottom">Wrap modes an anchored picture takes (the floating family’s, see FloatWrap). Text above and below is the BLOCK image node instead.
ImageWrap"top-bottom" | "square"Wrap attr of the BLOCK image node. “square” is a legacy value from the first wrap attempt (float on the block node) — kept for parsing old docs. New wrap behaviours live on the inline image_anchored node (see ImageAnchoredWrap).
ImageWrapMode"top-bottom" | ImageAnchoredWrapThe full wrap-mode surface exposed by the setImageWrap command / toolbar. “top-bottom” selects the BLOCK image node (text above and below); every other mode selects the inline image_anchored node with that wrap.
IndentationSpecials"none" | "first-line" | "hanging"
Jsonstring | number | boolean | null | Json[] | { [key: string]: Json | undefined }Any JSON value.
JSONContentAttrsRecord<string, any>The attrs of a JSONContent node.
LevelFormatName"decimal" | "upperRoman" | "lowerRoman" | "upperLetter" | "lowerLetter" | "ordinal" | "cardinalText" | "ordinalText" | "hex" | "chicago" | "ideographDigital" | "japaneseCounting" | "aiueo" | "iroha" | "decimalFullWidth" | "decimalHalfWidth" | "japaneseLegal" | "japaneseDigitalTenThousand" | "decimalEnclosedCircle" | "decimalFullWidth2" | "aiueoFullWidth" | "irohaFullWidth" | "decimalZero" | "bullet" | "ganada" | "chosung" | "decimalEnclosedFullstop" | "decimalEnclosedParen" | "decimalEnclosedCircleChinese" | "ideographEnclosedCircle" | "ideographTraditional" | "ideographZodiac" | "ideographZodiacTraditional" | "taiwaneseCounting" | "ideographLegalTraditional" | "taiwaneseCountingThousand" | "taiwaneseDigital" | "chineseCounting" | "chineseLegalSimplified" | "chineseCountingThousand" | "koreanDigital" | "koreanCounting" | "koreanLegal" | "koreanDigital2" | "vietnameseCounting" | "russianLower" | "russianUpper" | "none" | "numberInDash" | "hebrew1" | "hebrew2" | "arabicAlpha" | "arabicAbjad" | "hindiVowels" | "hindiConsonants" | "hindiNumbers" | "hindiCounting" | "thaiLetters" | "thaiNumbers" | "thaiCounting" | "bahtText" | "dollarText" | "custom"
LevelFormatValueILevelsOptions["format"]A list level’s number format ("decimal", "lowerRoman", …).
LevelSuffixValue"nothing" | "space" | "tab"
LineHeightAtLeast{ pt: number; derived: number }A Word “At least” line height: renders as the multiplier derived; pt is written back on export while lineHeight still equals derived.
MaybeReadOnlyReadonly<T> | T
Mutable{ -readonly [P in keyof T]: T[P] }
NodeCommentsAttrNodeCommentEntry[] | nullValue of the nodeComments global attribute.
Nullable{ [P in keyof T]: T[P] | null }
NumberCasing"capitalize" | "uppercase" | "lowercase" | "firstLetter"Casing for the word-based number formats (cardinalText, ordinalText): capitalize — every word capitalised: “Forty-Two” (the converters’ native output); uppercase — “FORTY-TWO”; lowercase — “forty-two”; firstLetter — only the leading letter capitalised: “Forty-two”
NumberGender"masculine" | "feminine"The grammatical genders the numbering UI offers.
NumberingAttrValueNumberingAttrs | NumberingOffSentinel | nullThe numbering node attr: direct numbering (listRef: INHERIT_LIST_REF takes the list from the style), the off sentinel { listRef: null }, or null to inherit.
OoxmlBorderStyle"single" | "dashDotStroked" | "dashed" | "dashSmallGap" | "dotDash" | "dotDotDash" | "dotted" | "double" | "doubleWave" | "inset" | "nil" | "none" | "outset" | "thick" | "thickThinLargeGap" | "thickThinMediumGap" | "thickThinSmallGap" | "thinThickLargeGap" | "thinThickMediumGap" | "thinThickSmallGap" | "thinThickThinLargeGap" | "thinThickThinMediumGap" | "thinThickThinSmallGap" | "threeDEmboss" | "threeDEngrave" | "triple" | "wave"
PageNumberFormat"decimal" | "lowerRoman" | "upperRoman" | "lowerLetter" | "upperLetter"Word’s page-number formats (w:pgNumType/@w:fmt) the editor prints.
PageNumberType"currentPage" | "totalPages"
ResizeType"column" | "row"
StringLiteralsOnlyStringLiteralsOnly<T> = T extends string ? (string extends T ? never : T) : never
StyleSheetRecord<string, StyleDefinition>A document’s style definitions, keyed by style id.
TableAlign"start" | "center" | "end"
TABLE_REGIONSreadonly ["wholeTable", "band1Vert", "band2Vert", "band1Horz", "band2Horz", "firstCol", "lastCol", "firstRow", "lastRow", "nwCell", "neCell", "swCell", "seCell"]A table style’s conditional regions, in the order Word layers them: a later region wins, field by field.
TableRegion(typeof TABLE_REGIONS)[number]One of TABLE_REGIONS.
TableRegionBordersPartial<Record<"top" | "bottom" | "left" | "right" | "insideH" | "insideV", BorderOptions>>A region’s outer edges and the lines between its cells.
TableTextStylePick<TextStyle, "color" | "colorTheme" | "strong" | "em">The run formatting a table style carries: Word’s table styles change these per region.
TabStopAlign"start" | "center" | "end" | "decimal"Where text lands against a tab stop: decimal lines up on the first ”.”.
TabStopLeader"none" | "dot" | "hyphen" | "underscore"What fills the gap a tab leaves.
TextAlignType"justify" | "start" | "end" | "center"
TextDirection"ltr" | "rtl"
TextStyleOff"strong" | "em" | "underline" | "strikethrough" | "superscript" | "subscript"The marks a textStyle mark can negate — Word’s “bold style, unbolded run”. Turning a property ON is the standalone marks’ job; only OFF needs a slot, since a mark cannot be absent-with-emphasis. TEXT_STYLE_OFF in helpers/text-style.ts is the ordered runtime array, checked against this.
ThemeColorName"dark1" | "light1" | "dark2" | "light2" | "accent1" | "accent2" | "accent3" | "accent4" | "accent5" | "accent6" | "hyperlink" | "followedHyperlink" | "background1" | "text1" | "background2" | "text2"The theme colour names w:themeColor carries (ECMA-376 ST_ThemeColor minus “none”).
ThemeColorRefstringA theme colour name plus Word’s tint/shade byte: “accent1”, “accent1:tint=99”, “accent1:shade=BF”. A string so marks carrying it stay value-comparable.
ThemeColorSlot"dk1" | "lt1" | "dk2" | "lt2" | "accent1" | "accent2" | "accent3" | "accent4" | "accent5" | "accent6" | "hlink" | "folHlink"The twelve a:clrScheme slots of a DocumentTheme.
ThemeMappedSlot"dk1" | "lt1" | "dk2" | "lt2"The slots DocumentTheme["mapping"] can point the text/background names at.
ThemeSwatchColumn"background1" | "text1" | "background2" | "text2" | "accent1" | "accent2" | "accent3" | "accent4" | "accent5" | "accent6"Word’s theme grid columns, left to right.
ToastKey"cannotInsertAcrossNodes" | "cannotRemoveOnlySection" | "cannotRemoveSectionBreakWhileSuggesting" | "missingSortColumn" | "sortColumnOutOfRange" | "cannotSortMergedRows" | "nestedTablesNotAllowed" | "dispatchFailed" | "footnoteRemoved" | "endnoteRemoved"Every message core and the feature packs can raise. Core emits keys, not text, so a host can translate or reword messages without matching English.
ToastType"success" | "info" | "error" | "warning" | "default"
TOCItemType"numberedItem" | "heading"
TOCrun{ text: string; marks?: TOCrunMark[] } | { math: string }One renderable fragment of a TOC entry: formatted text, or LaTeX for an equation.
TOCrunMark"em" | "superscript" | "subscript"
TrackChangesUserCurrentUser & { requestedBy?: { id: string; name?: string } }Who a tracked change is attributed to; an agent’s carries the user it works for.
Underlines"single" | "double" | "thick" | "dotted" | "dottedHeavy" | "dash" | "dashedHeavy" | "wave" | "wavyHeavy"

AI tool contract

The shape a package builds agent tools against without depending on @stesura/ai, which re-exports it (see Extending the chat with custom tools). AiToolDeclaration is what the model sees and the server declares; AiEditorTool adds an execute that runs in the browser with AiToolExecutionOptions, AiServerTool one that runs in the route with AiServerToolContext. defineAiTool turns either into an AiTool (DefinedAiEditorTool or DefinedAiServerTool), whose run validates input and resolves to an AiToolRun. AiToolKind drives the ask-mode gate and the review UI, and a server tool’s is an AiServerToolKind (read or config); AiToolLabels names the status-chip strings. Input schemas are AiToolSchema: Standard Schema plus Standard JSON Schema, with AiToolSchemaResult, AiToolSchemaIssue and AiToolJsonSchemaOptions vendored as types.

AiToolSession is the read ledger of one conversation: read_document records the blocks it showed (AiReadBlock) and the AiReadView it showed them in, so an edit merges against the text the agent saw. Pass one as AiToolExecutionOptions.session.

IssueProvider is one source of findings for the agent’s list_issues and fix_issues: collect returns AiIssues, each with an AiIssueFixKind (none, tracked or direct), and apply takes AiIssueFixes and returns an AiIssueApplyResult.

Redaction

RedactionAttrs is the redaction mark’s attrs, and the block-leaf attribute’s: id, reason, status (RedactionStatus: proposed, confirmed, or final in an export’s prepared document), author, date, note, and for a final label fragments (RedactionFragment, one per line it occupied), shape (RedactionShape) and boxStyle (outline, or null for the fill: RedactionBoxStyle). A host’s reasons are a RedactionTaxonomy of RedactionReasons. A RedactionRegion is a redacted area of a picture, in fractions of its uncropped bitmap. See Redaction.

Last updated on