> ## Documentation Index
> Fetch the complete documentation index at: https://docs.reducto.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Types: editor: Editor

## `BrowserEditorHost`

Import from `@reductoai/docx-editor`, `@reductoai/docx-editor/model`.

```ts theme={null}
type BrowserEditorHost = Omit<EditorHost, "formatAt" | "find" | "billedSession"> & { billedSession?: string | null; onSettled?: (ir: LayoutDocument, dirtyPages: number[] | "all") => void; onSnapshot?: () => void; thread?: "worker" | "page"; collabAck: any; collabApply: any; collabPeers: any; collabPending: any; collabPresence: any; collabRange: any; collabResend: any; collabSnapshot: any; collabTokens: any; cursors: any; dispose: any; find: any; formatAt: any; remote: any; setView: any; startCollab: any }
```

## `ClientPoint`

A viewport point, for a flyout.

Not exported by name. You get it from the API.

| Name | Type | Description |
| - | - | - |
| `clientX` | `number` | |
| `clientY` | `number` | |

## `CompiledCommand`

References > Mark Citation, Mark Entry, Insert Table of Authorities and Insert Index.
A mark lands after the selection; `all` also marks every other place its text stands.

Import from `@reductoai/docx-editor`, `@reductoai/docx-editor/model`.

```ts theme={null}
type CompiledCommand = { all?: boolean; kind: "markCitation" } & MarkedCitation | { category?: number; keepFormatting?: boolean; kind: "insertTableOfAuthorities"; passim?: boolean } | { kind: "updateTableOfAuthorities" } | { all?: boolean; bold?: boolean; crossReference?: string; italic?: boolean; kind: "markIndexEntry"; main: string; sub?: string } | { columns?: number; headings?: boolean; kind: "insertIndex"; rightAlign?: boolean } | { kind: "updateIndex" }
```

## `ComponentCommand`

Commands the custom-components layer sends; each is one undo step.

Not exported by name. You get it from the API.

```ts theme={null}
type ComponentCommand = { fallback: ComponentFallback; float?: InsertImageFloat; id: string; kind: "insertComponent"; state: unknown; type: string } | { fallback?: ComponentFallback; key: string; kind: "setComponent"; state: unknown }
```

## `ComponentContext`

What a component's live view gets.

Import from `@reductoai/docx-editor`.

| Name | Type | Description |
| - | - | - |
| `box` | `PageBox` | |
| `flip` | `"h" \| "v" \| "hv" \| undefined` | |
| `info` | `ComponentInfo` | |
| `model` | `EditorModel` | |
| `page` | `number` | The page and the fallback's box on it, in points. A table split over pages has one view per part. |
| `part` | `number` | |
| `parts` | `number` | |
| `readOnly` | `boolean` | |
| `rotDeg` | `number` | A turned or mirrored picture: `el` is already turned with it, so a view draws upright. Degrees clockwise; the mirror applies before the turn. |
| `state` | `S` | The state, a table component's cells folded in. |
| `commit()` | `(next: S) => Promise<void>` | New state: the fallback is drawn again, and both land as one undo step. |
| `select()` | `() => void` | Puts the caret on the component, so Delete, Cut and Copy act on it. |

## `ComponentFallback`

What Word, the PDF and the canvas show for a component: a picture, a real
Word table whose cells hold the component's data, or free Word content.

Import from `@reductoai/docx-editor`.

```ts theme={null}
type ComponentFallback = { alt?: string; bytes: Uint8Array; heightPt: number; kind: "picture"; mime: SniffedPicture["mime"]; svg?: Uint8Array; widthPt: number } | { kind: "table"; rows: string[][]; style?: string } | { kind: "content"; ooxml: string }
```

## `ComponentInfo`

A component found in the body.

Import from `@reductoai/docx-editor`.

| Name | Type | Description |
| - | - | - |
| `at?` | `Position` | Picture: the caret right after its character. |
| `blockCount?` | `number` | Content: how many body blocks it fills, from `bodyIndex`. |
| `bodyIndex?` | `number` | Table: its body index; the table's cells address it. Content: the body index of its first block. |
| `carrier` | `"picture" \| "table" \| "content"` | |
| `float?` | `boolean` | Picture: floats over the text (`wp:anchor`) rather than sitting in a line. |
| `id` | `string` | |
| `key` | `string` | Unique in this read. Equal to `id` except on a copy, which gets its own id at its next edit. |
| `rows?` | `string[][]` | Table: cell text row by row, the data a table component reads back. |
| `shapeId?` | `number` | Picture: `wp:docPr/@id`, the key into the layout's images and anchors. |
| `state` | `unknown` | The JSON state; undefined when the carrier's state does not parse. |
| `type` | `string` | |

## `CreateEditorHost`

Builds the in-thread session host; the same function serves the in-page fallback.

Import from `@reductoai/docx-editor`, `@reductoai/docx-editor/model`.

```ts theme={null}
type CreateEditorHost = (bytes: Uint8Array, name: string, onProgress?: LayoutProgress, session?: string) => Promise<SessionEditorHost>
```

## `DefaultHostOptions`

Import from `@reductoai/docx-editor`, `@reductoai/docx-editor/model`.

| Name | Type | Description |
| - | - | - |
| `proxyUrl?` | `string` | Your backend's `licenseProxy()` URL, for a session in a worker of your own: its license traffic goes there, as `mount`'s does. |

## `DocxKeymap`

Import from `@reductoai/docx-editor`, `@reductoai/docx-editor/model`.

```ts theme={null}
type DocxKeymap = Keymap<EditorModel>
```

## `DropCaret`

Not exported by name. You get it from the API.

| Name | Type | Description |
| - | - | - |
| `at` | `Position` | |
| `rect` | `Rect` | |

## `EditorCommand`

Import from `@reductoai/docx-editor`, `@reductoai/docx-editor/model`.

```ts theme={null}
type EditorCommand = { alone?: boolean; fresh?: boolean; kind: "insertText"; text: string; typed?: boolean } | { kind: "replaceAll"; matchCase?: boolean; ranges: ReviewRange[]; text: string } | { kind: "insertFragment"; paragraphs: PastedBlock[] } | { fallback?: PastedBlock[]; kind: "insertOoxml"; ooxml: string } | { kind: "deleteBackward" } | { kind: "deleteForward" } | { kind: "splitParagraph" } | { kind: "deleteSelection" } | { kind: "dropListMarker"; text?: string } | { format: RunFormat; kind: "runFormat" } | { format: ParagraphFormat; kind: "paragraphFormat" } | { format: ListNumberFormat | null; glyphs?: string[]; kind: "list"; text?: string } | { backward: boolean; kind: "tab" } | { delta: 1 | -1; kind: "listLevel" } | { kind: "listLevel"; level: number } | { kind: "restartNumbering"; start?: number } | { kind: "multilevelList"; levels: ListLevelDefinition[]; redefine?: boolean } | { change: OutlineChange; kind: "outlineLevel" } | { apply?: boolean; kind: "defineStyle"; style: StyleDefinition } | { kind: "updateStyleToMatch" } | { kind: "continueNumbering" } | { delta: 1 | -1; kind: "indent" } | { kind: "updateFields" } | { field: "DATE" | "TIME" | "PAGE" | "NUMPAGES"; kind: "insertField" } | { code: string; kind: "insertFieldCode" } | { kind: "insertNote"; mark?: string; note: "footnote" | "endnote" } | { delta: 1 | -1; kind: "moveParagraphs" } | { kind: "sortParagraphs" } & SortParagraphsOptions | { kind: "dropCap" } & DropCapOptions | { heightPt?: number; kind: "frameBox"; widthPt?: number; xPt: number; yPt: number } | { kind: "changeCase"; to?: LetterCase } | { delta: 1 | -1; kind: "hangingIndent" } | { format: SectionFormat; kind: "sectionFormat" } | { kind: "sectionBreak"; type: SectionBreakKind } | { kind: "addHeaderFooter"; part: "header" | "footer" } | { kind: "linkToPrevious"; linked: boolean; part: "header" | "footer"; section: number; type: HeaderFooterSlot["type"] } | { color: string | null; kind: "pageColor" } | { kind: "protectDocument"; mode: ProtectionMode; password?: string } | { kind: "unprotectDocument"; password?: string } | { kind: "writeProtection"; password?: string | null; readOnlyRecommended: boolean } | { kind: "watermark"; watermark: Watermark | null } | { kind: "themeColors"; scheme: ThemeColorScheme } | { kind: "paragraphSpacing"; preset: string } | { kind: "themeFonts"; scheme: ThemeFontScheme } | { kind: "removePageNumbers" } | { kind: "undo" } | { kind: "redo" } | InsertCommand | TableCommand | ReviewCommand | ImageCommand | ContentControlCommand | ComponentCommand | TocCommand | CompiledCommand
```

## `EditorComponent`

A component definition with an optional live view; the return of `mount` unmounts it.

Import from `@reductoai/docx-editor`.

| Name | Type | Description |
| - | - | - |
| `type` | `string` | Names the kind, such as "acme.signature": letters, digits, '.', '\_' and '-'. |
| `fallback()` | `(state: S) => ComponentFallback \| Promise<ComponentFallback>` | What Word shows. Pure: same state, same fallback. Runs on every state change. |
| `mount()?` | `(el: HTMLElement, ctx: ComponentContext<S>) => void \| (() => void)` | |
| `read()?` | `(rows: string[][], stored: S) => S` | A table component's data lives in its cells, which a Word user may edit. `read` folds the cells back into the state; without it the stored state is taken as is. |

## `EditorHit`

What lies under a viewport point: the page, the point in page hmm, the text position and any link.

Import from `@reductoai/docx-editor`, `@reductoai/docx-editor/model`.

| Name | Type | Description |
| - | - | - |
| `link` | `string \| null` | The `href` of the link under the point. |
| `page` | `number` | The page number that `overlays` and `linkAt` take. |
| `position` | `Position \| null` | The text position under the point; null off the text. |
| `x` | `number` | Hundredths of a millimetre from the page's left edge. |
| `y` | `number` | Hundredths of a millimetre from the page's top edge. |

## `EditorHost`

Not exported by name. You get it from the API.

| Name | Type | Description |
| - | - | - |
| `revisionAuthor` | `string` | The name stamped on tracked changes and comments this writer makes. |
| `sessionStamp?` | `string \| null` | The document's `ReductoSession` custom property as opened; null when it has none. |
| `suggesting` | `boolean` | Tracked-change ("suggesting") mode: edits become revisions instead of direct changes. |
| `allStyles()?` | `() => Promise<StyleListEntry[]>` | The Styles pane's "All styles" list. |
| `apply()` | `(selection: Selection, command: EditorCommand) => Promise<EditResult>` | |
| `autoCorrected()?` | `() => boolean` | The last command ended in an AutoFormat or AutoCorrect step, which Word's Repeat cannot repeat. |
| `billedSession()?` | `() => Promise<string \| null>` | The Session the engine's open joined and billed (`s_<id>@<ISO start>`); null when it bills nothing. |
| `bookmarks()?` | `() => EditorBookmark[]` | Body bookmarks in document order, hidden ones included. |
| `canRedo()` | `() => boolean` | |
| `canUndo()` | `() => boolean` | |
| `captions()?` | `() => CaptionEntry[]` | Body captions (SEQ-numbered paragraphs) in document order. |
| `characterStyles()` | `() => StyleChoice[]` | Character styles a picker can offer, then Word's Quick Styles the document lacks; apply with `runFormat` `characterStyle`. |
| `chartWorkbook()?` | `(selection: Selection) => Promise<ChartWorkbook \| undefined>` | The workbook of the chart the selection holds; undefined when it has none to open. |
| `citations()?` | `() => Promise<MarkedCitation[]>` | Long citations TA fields mark, for Mark Citation's list. |
| `comments()` | `() => ReviewComment[]` | Body comments in document order, replies right after their root. |
| `compare()?` | `(revised: Uint8Array, options?: CompareOptions) => Promise<Uint8Array<ArrayBufferLike>>` | Word's Compare with this document as the original: `revised` with every difference tracked, as bytes. |
| `components()?` | `() => ComponentInfo[]` | Custom components of the body in document order. |
| `contentControls()` | `() => ContentControlInfo[]` | Body content controls in document order, an outer control before the ones it nests. |
| `fields()?` | `() => FieldSpan[]` | Fields of the body and every story, for Word's field shading. |
| `find()` | `(query: string, options?: { matchCase?: boolean }) => ReviewRange[]` | Hits for `query` in the main story; replace one by selecting it and typing. |
| `formatAt()` | `(at: Position \| Selection) => FormatState` | Formatting at a caret, or over a selection: a toggle is on only when the whole range has it. |
| `headerFooters()?` | `() => HeaderFooterSlot[]` | Each laid page's header and footer, as of the last layout. |
| `layout()` | `() => Promise<LayoutDocument>` | Current IR; lays out on first call and after every command. |
| `notes()?` | `() => NoteRef[]` | Body footnote and endnote marks in document order. |
| `numberedItems()?` | `() => Promise<NumberedItem[]>` | Numbered body paragraphs, for Insert Cross-reference's "Numbered item". |
| `ooxml()` | `(selection: Selection) => Promise<string>` | The selection's WML for the clipboard; a `pkg:package` when pictures or links travel with it. |
| `outline()` | `() => OutlineEntry[]` | Body headings in document order, for a navigation pane. |
| `paragraphStyles()` | `() => StyleChoice[]` | Paragraph styles a picker can offer, the default first, then Word's Quick Styles the document lacks (`builtin`). |
| `revisions()` | `() => ReviewRevision[]` | Body tracked changes in document order. |
| `styleDefinition()?` | `(id: string) => Promise<StyleDefinitionState \| undefined>` | Modify Style's starting values: the style's own properties. |
| `tableStyles()` | `() => StyleChoice[]` | Table styles a picker can offer. |
| `targets()` | `(story?: string) => EditTarget[]` | Every editable target in address order: the body, or one auxiliary story. |
| `text()` | `(target: EditTarget) => string` | Plain text of one target, in the offset space positions use. |
| `toBytes()` | `(options?: SaveOptions) => Promise<Uint8Array<ArrayBufferLike>>` | `session` is written as the `ReductoSession` custom property first. |

## `EditorHostHandle`

What the worker itself can do with the session the page edits.

Import from `@reductoai/docx-editor`, `@reductoai/docx-editor/model`.

| Name | Type | Description |
| - | - | - |
| `recordExternal()` | `<T>(run: (host: SessionEditorHost) => Promise<T>) => Promise<T>` | Runs `run` on the open session between the page's requests: one undo step, and in a shared session one change sent at once. The page repaints on `refreshFromHost()`. |

## `EditorI18n`

Import from `@reductoai/docx-editor`, `@reductoai/docx-editor/model`.

```ts theme={null}
type EditorI18n = I18n<MessageKey>
```

## `FindEditor`

Not exported by name. You get it from the API.

```ts theme={null}
type FindEditor = ReviewEditor & { nav: NavModel; drawOverlay: any }
```

## `HostChannel`

Where host requests go: a dedicated Worker, or one end of a MessageChannel
whose other end a worker that also does other work serves (see serveEditorHost).

Not exported by name. You get it from the API.

| Name | Type | Description |
| - | - | - |
| `onerror?` | `((event: ErrorEvent) => void) \| null` | |
| `onmessage` | `((event: MessageEvent) => void) \| null` | |
| `close()?` | `() => void` | |
| `postMessage()` | `(message: unknown, transfer?: Transferable[]) => void` | |
| `terminate()?` | `() => void` | |

## `HostRequest`

Not exported by name. You get it from the API.

```ts theme={null}
type HostRequest = { haveFaces: string[]; id: number } & HostRequestBody
```

## `HostRequestBody`

Not exported by name. You get it from the API.

```ts theme={null}
type HostRequestBody = { bytes: Uint8Array; name: string; session?: string; type: "open"; view?: LayoutView } | { command: EditorCommand; selection: Selection; type: "apply" } | { type: "layout" } | { at: Position | Selection; type: "formatAt" } | { matchCase: boolean; query: string; type: "find" } | { type: "numberedItems" } | { type: "citations" } | { styleId?: string; type: "styleInfo" } | { selection: Selection; type: "ooxml" } | { selection: Selection; type: "chartWorkbook" } | { session?: string; type: "toBytes" } | { options?: CompareOptions; revised: Uint8Array; type: "compare" } | { suggesting?: boolean; type: "display"; view?: LayoutView } | { name: string; type: "revisionAuthor" } | { block?: number; observe?: boolean; seq: number; type: "collabStart" } | { selection: Selection; steps: ApplyStep[]; type: "collabApply" } | { from: number; stream?: string; to: number; type: "collabRange" } | { stream?: string; type: "collabTokens" } | { changes: SequencedChange[]; selection: Selection; type: "collabRemote" } | { selection?: Selection; seq: number; type: "collabAck" } | { type: "collabResend" } | { type: "collabSnapshot" } | { type: "collabPending" } | { selection: Selection; type: "collabPresence" } | { peers: Peer[]; type: "collabPeers" }
```

## `InsertCommand`

Structural inserts at the caret; a non-empty selection is replaced first.

Not exported by name. You get it from the API.

```ts theme={null}
type InsertCommand = { cols: number; kind: "insertTable"; rows: number } | { kind: "textToTable"; separator?: string } | { break: "line" | "page" | "column"; kind: "insertBreak" } | { kind: "setLink"; text?: string; url: string } | { kind: "removeLink" } | { kind: "addBookmark"; name: string } | { kind: "deleteBookmark"; name: string } | { kind: "convertNotes"; to: "endnote" | "footnote" | "swap" } | { kind: "insertCrossReference" } & CrossReference | { kind: "insertCaption" } & CaptionSpec
```

## `KeyMove`

Not exported by name. You get it from the API.

```ts theme={null}
type KeyMove = CaretMove | "pageUp" | "pageDown"
```

## `LanguageOptions`

Import from `@reductoai/docx-editor`, `@reductoai/docx-editor/model`.

| Name | Type | Description |
| - | - | - |
| `locale?` | `string` | BCP 47 tag; it also picks plural rules, dates and numbers. Default "en". |
| `messages?` | `Partial<Messages>` | A catalog from `@reductoai/docx-editor/locales/<tag>`, or any part of one; English fills the rest. |

## `LinkClick`

`follow`: the click opens the link (Cmd/Ctrl+click, a reader's click, Open link); else it only placed the caret.

Import from `@reductoai/docx-editor`, `@reductoai/docx-editor/model`.

| Name | Type | Description |
| - | - | - |
| `event?` | `MouseEvent` | |
| `follow` | `boolean` | |
| `href` | `string` | |

## `LinkHandlers`

Import from `@reductoai/docx-editor`, `@reductoai/docx-editor/model`.

| Name | Type | Description |
| - | - | - |
| `onClick?` | `(link: LinkClick) => boolean \| void` | Every click on a link and every Open link; true when following, and the editor does not open it. |
| `onHover?` | `(link: LinkHover \| null) => void` | The link under the pointer changed; null once it leaves every link. |

## `LinkHover`

The link under the pointer and the box of its text on that line, in client pixels.

Import from `@reductoai/docx-editor`, `@reductoai/docx-editor/model`.

| Name | Type | Description |
| - | - | - |
| `href` | `string` | |
| `rect` | `DOMRect` | |

## `MessageKey`

Import from `@reductoai/docx-editor`, `@reductoai/docx-editor/model`.

```ts theme={null}
type MessageKey = keyof typeof en
```

## `Messages`

A whole catalog; a host's override is `Partial<Messages>`.

Import from `@reductoai/docx-editor`, `@reductoai/docx-editor/model`.

```ts theme={null}
type Messages = Record<MessageKey, string>
```

## `NavEditor`

Not exported by name. You get it from the API.

| Name | Type | Description |
| - | - | - |
| `find` | `{ query: string; search: any }` | |
| `host` | `{ outline: any } \| null` | |
| `ir` | `LayoutDocument \| null` | The layout the snapshot came with: a new one means new headings. |
| `selection` | `Selection \| null` | |
| `drawOverlay()` | `() => void` | |
| `focusInput()` | `() => void` | |
| `scrollCaretIntoView()` | `(placement?: "top" \| "center" \| "nearest") => void` | |
| `select()` | `(selection: Selection) => void` | |

## `OpenOptions`

`markup` is the Display for Review the document opens in; All Markup when absent.

Import from `@reductoai/docx-editor`, `@reductoai/docx-editor/model`.

| Name | Type | Description |
| - | - | - |
| `keepView?` | `boolean` | |
| `markup?` | `Markup` | |
| `password?` | `string` | |

## `PaletteCommand`

Import from `@reductoai/docx-editor`, `@reductoai/docx-editor/model`.

| Name | Type | Description |
| - | - | - |
| `detail?` | `string` | Dim right-hand line: the current value, a unit, a hint. |
| `group` | `PaletteGroup` | |
| `id` | `string` | |
| `keys?` | `string` | The keys that run it, labelled for the platform ("⌘B"). |
| `keywords?` | `string[]` | Extra match terms; the label always matches on its own. |
| `label` | `string` | |
| `run?` | `() => void \| Promise<void>` | Omit when `step` is set: the step owns the action. |
| `step?` | `PaletteStep` | |
| `takesFocus?` | `boolean` | The action opens its own input, so the host must not take focus back. |
| `transient?` | `boolean` | The id encodes an argument (`text:size:12`), so it earns no usage weight. |

## `PaletteGroup`

Not exported by name. You get it from the API.

```ts theme={null}
type PaletteGroup = "text" | "paragraph" | "insert" | "table" | "picture" | "review" | "document"
```

## `PaletteModel`

The slice of `EditorModel` the command tree reads and drives. Narrow so a test can fake it.

Not exported by name. You get it from the API.

| Name | Type | Description |
| - | - | - |
| `canMerge` | `boolean` | |
| `format` | `FormatState \| null` | |
| `host` | `{ bookmarks?: any; captions?: any; notes?: any; outline?: any; paragraphStyles: any; tableStyles: any; text?: any } \| null` | |
| `i18n` | `EditorI18n` | |
| `review` | `{ revisions: readonly ReviewRevision[]; accept: any; reject: any }` | |
| `selection` | `Selection \| null` | |
| `suggesting` | `boolean` | |
| `suggestingPolicy?` | `SuggestingPolicy` | Absent is "allow". |
| `run()` | `(command: EditorCommand) => Promise<void>` | |
| `select()?` | `(selection: Selection) => void` | |
| `setSuggesting()` | `(on: boolean) => void` | |
| `setTablePosition()` | `(patch: TablePosition) => void` | |
| `setTableWrap()` | `(wrap: "none" \| "around") => void` | |

## `PaletteStep`

Not exported by name. You get it from the API.

| Name | Type | Description |
| - | - | - |
| `items?` | `PaletteCommand[]` | Fixed children, filtered and ranked like any other list. |
| `placeholder` | `string` | |
| `resolve?` | `(query: string) => PromptResult \| null` | Typed argument; `null` means the query is not one, so the list filters as usual. |
| `title` | `string` | Crumb shown to the left of the input. |

## `PastedBlock`

Not exported by name. You get it from the API.

```ts theme={null}
type PastedBlock = PastedParagraph | PastedTable
```

## `PromptResult`

A typed argument: accept it and run, accept it and ask the next question, or explain.

Not exported by name. You get it from the API.

```ts theme={null}
type PromptResult = { detail?: string; label: string; ok: true; run?: () => void; step?: PaletteStep } | { hint: string; ok: false }
```

## `ReactToolbarAddition`

A control on the built-in bar: a React node, or a framework-free slot.

Import from `@reductoai/docx-editor/react`.

```ts theme={null}
type ReactToolbarAddition = Omit<ToolbarAddition, "slot"> & ({ node: ReactNode; slot?: never } | { node?: never; slot: EditorSlot })
```

## `ReactToolbarItems`

Import from `@reductoai/docx-editor/react`.

```ts theme={null}
type ReactToolbarItems = Omit<ToolbarItems, "add"> & { add?: readonly ReactToolbarAddition[] }
```

## `SaveBytes`

Hands the exported bytes to the user; a sandboxed frame passes its host's download.

Import from `@reductoai/docx-editor`, `@reductoai/docx-editor/model`.

```ts theme={null}
type SaveBytes = (bytes: Uint8Array, filename: string, type: string) => unknown
```

## `SaveOptions`

Not exported by name. You get it from the API.

| Name | Type | Description |
| - | - | - |
| `session?` | `string` | |

## `SlotName`

Import from `@reductoai/docx-editor`.

```ts theme={null}
type SlotName = typeof SLOT_NAMES[number]
```

## `SpellDictionary`

Where "Add to dictionary" keeps the user's words; a host may store them server-side.

Import from `@reductoai/docx-editor`, `@reductoai/docx-editor/model`.

| Name | Type | Description |
| - | - | - |
| `add()` | `(word: string) => void \| Promise<void>` | |
| `load()` | `() => readonly string[] \| Promise<readonly string[]>` | |

## `SpellEditor`

Not exported by name. You get it from the API.

| Name | Type | Description |
| - | - | - |
| `ir` | `LayoutDocument \| null` | |
| `page` | `number` | The page most in view, 1-based. |
| `readOnly` | `boolean` | |
| `selection` | `Selection \| null` | |
| `drawOverlay()` | `() => void` | |
| `run()` | `(command: EditorCommand) => Promise<void>` | |
| `select()` | `(selection: Selection) => void` | |

## `Speller`

The dictionary: which words it does not know, and what it would write instead.

Import from `@reductoai/docx-editor`, `@reductoai/docx-editor/model`.

| Name | Type | Description |
| - | - | - |
| `misspelled()` | `(words: string[]) => Promise<string[]>` | |
| `suggest()` | `(word: string) => Promise<string[]>` | |

## `StoryHit`

Not exported by name. You get it from the API.

| Name | Type | Description |
| - | - | - |
| `kind` | `StoryKind` | |
| `page` | `number` | |
| `story` | `string` | |

## `ToolbarAddition`

A host's own control on the built-in bar.

Import from `@reductoai/docx-editor`, `@reductoai/docx-editor/model`.

| Name | Type | Description |
| - | - | - |
| `label?` | `string` | Heads a section of its own in the More tools menu once the bar folds it. Default "More". |
| `section?` | `ToolbarSection` | Drawn at the end of this section; absent: a section of its own after the built-in ones. |
| `slot` | `EditorSlot` | |

## `ToolbarControl`

Import from `@reductoai/docx-editor`, `@reductoai/docx-editor/model`.

```ts theme={null}
type ToolbarControl = typeof TOOLBAR_SECTIONS[ToolbarSection][number]
```

## `ToolbarItems`

Changes to the built-in format bar. A hidden control's command still runs from its
key and the command palette.

Import from `@reductoai/docx-editor`, `@reductoai/docx-editor/model`.

| Name | Type | Description |
| - | - | - |
| `add?` | `readonly ToolbarAddition[]` | |
| `hide?` | `readonly (ToolbarSection \| ToolbarControl)[]` | Sections or single controls to leave off the bar. |

## `WorkerScope`

Not exported by name. You get it from the API.

| Name | Type | Description |
| - | - | - |
| `onmessage` | `((event: MessageEvent<HostRequest>) => void) \| null` | |
| `postMessage()` | `(message: unknown, options?: { transfer?: Transferable[] }) => void` | |
