> ## 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: Text and formatting

## `FormatState`

Run-level formatting in force at a position, for toolbar state.

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

| Name | Type | Description |
| - | - | - |
| `alignment` | `"left" \| "center" \| "right" \| "justify" \| undefined` | |
| `bold` | `boolean` | |
| `caps?` | `true` | Effective `w:caps`, `w:smallCaps` and `w:vanish`; absent when off. |
| `cell?` | `CellState` | Set with `table`, for a body table (stories carry no cell state). |
| `characterStyle?` | `string` | The run's character style id (`w:rStyle`); absent when none. |
| `charSpacingPt?` | `number` | Format > Font > Advanced: `w:spacing`, `w:w`, `w:position` and `w:kern`; absent at Word's default. |
| `color` | `string \| undefined` | RRGGBB, or undefined for auto/theme-resolved-unknown. |
| `contentControl?` | `ContentControlInfo` | The innermost content control holding the position. |
| `doubleStrike?` | `true` | Effective `w:dstrike`; absent when off. |
| `font` | `string \| undefined` | Effective face (ascii slot) after styles; undefined when unresolved. |
| `hidden?` | `true` | |
| `highlight` | `HighlightColor \| undefined` | ST\_HighlightColor name; undefined when none. |
| `image?` | `ImageState` | Set when the selection spans exactly one picture, or the caret follows one. |
| `italic` | `boolean` | |
| `kerningPt?` | `number` | |
| `language?` | `string` | Effective proofing language (`w:lang/@w:val`) and `w:noProof`. |
| `link?` | `string` | Address of the hyperlink under the position: a URL or `"#Bookmark"`. |
| `linkText?` | `string` | The text of that hyperlink, when it has characters. |
| `list` | `boolean` | |
| `noProof?` | `true` | |
| `paragraph?` | `ParagraphState` | Present for a paragraph or cell caret. |
| `positionPt?` | `number` | |
| `protection?` | `DocumentProtection` | Review > Protect Document; absent when the document is not protected. |
| `scaling?` | `number` | |
| `section?` | `SectionState` | Body positions only: the page setup of their section. |
| `sizePt` | `number \| undefined` | Effective size in points after styles. |
| `smallCaps?` | `true` | |
| `strike` | `boolean` | |
| `table` | `boolean` | The position sits in a table cell. |
| `toc?` | `TocState` | Set when the position sits inside a TOC field. |
| `underline` | `boolean` | |
| `underlineColor?` | `string` | Underline colour, RRGGBB or "auto"; absent when the underline takes the text colour. |
| `underlineStyle?` | `UnderlineStyle` | A named `w:u` style other than single, e.g. "double" or "words". |
| `vertAlign?` | `Exclude<VerticalAlignment, "baseline">` | Effective `w:vertAlign`; absent at the baseline. |
| `writeProtection?` | `WriteProtection` | |

## `NavTab`

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

```ts theme={null}
type NavTab = "headings" | "results"
```

## `ParagraphSpacingPreset`

One gallery entry: space after in twips and the auto line spacing in 240ths.

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

| Name | Type | Description |
| - | - | - |
| `after` | `number` | |
| `label` | `string` | |
| `line` | `number` | |
| `name` | `string` | |

## `ParagraphState`

The paragraph under the focus: direct style reference and the effective indents and spacing.

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

| Name | Type | Description |
| - | - | - |
| `borders` | `Partial<Record<ParagraphBorderSide, CellBorder>>` | Effective `w:pBdr` sides after styles; a side is absent when nothing draws there. |
| `dropCap?` | `DropCapState` | The paragraph is, or starts after, a dropped initial. |
| `firstLineIndentPt` | `number` | Positive is a first-line indent, negative a hanging one. |
| `leftIndentPt` | `number` | |
| `lineSpacing` | `number \| undefined` | Multiple of single spacing; undefined for exact/at-least rules. |
| `listLevel` | `number \| undefined` | 0..8 inside a list. |
| `listLevels?` | `ListLevelDefinition[]` | Inside a list: its nine levels, as Define New Multilevel List shows them. |
| `numbering?` | `NumberingChoices` | Inside a list: whether Word offers Restart Numbering and Continue Numbering here. |
| `rightIndentPt` | `number` | |
| `shading` | `string \| undefined` | Effective RRGGBB fill after styles; undefined when none. |
| `spaceAfterPt` | `number` | |
| `spaceBeforePt` | `number` | |
| `styleId` | `string \| undefined` | `w:pStyle` on the paragraph, or the document's default paragraph style. |
| `suppressLineNumbers?` | `true` | Layout > Line Numbers > Suppress for Current Paragraph. |
| `tabStops` | `TabStop[]` | Direct `w:tabs` stops, sorted by position. |

## `PastedParagraph`

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

| Name | Type | Description |
| - | - | - |
| `paragraph?` | `PastedParagraphFormat` | |
| `runs` | `PastedRun[]` | |

## `PastedParagraphFormat`

Keep Source Formatting's paragraph look. Set, it replaces the destination's style,
alignment and list on every pasted paragraph that brings its own mark.

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

| Name | Type | Description |
| - | - | - |
| `alignment?` | `ParagraphAlignment` | |
| `list?` | `{ format: ListNumberFormat; level: number }` | |
| `styleId?` | `string` | Style id or built-in name; absent means Normal. |

## `PastedRun`

One formatted span of a pasted fragment; `href` makes it a hyperlink.

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

| Name | Type | Description |
| - | - | - |
| `format?` | `RunFormat` | |
| `href?` | `string` | |
| `text` | `string` | |

## `PastedTable`

A pasted table on its grid: `rows[r]` lists the cells that start in row r.

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

| Name | Type | Description |
| - | - | - |
| `cols` | `number` | |
| `rows` | `PastedCell[][]` | |

## `StyleChoice`

One choice for a paragraph style picker.

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

| Name | Type | Description |
| - | - | - |
| `builtin?` | `true` | A Word built-in the document does not define yet; applying it adds Word's definition. |
| `id` | `string` | |
| `inUse?` | `true` | A story names it, or it is the default paragraph style: Word's "In current document" list. |
| `look?` | `StyleLook` | |
| `name` | `string` | |
| `tableLook?` | `TableStyleLook` | For a table style: what each conditional region paints, for a gallery thumbnail. |

## `StyleDefinition`

One style as Word's New Style and Modify Style dialogs edit it.

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

| Name | Type | Description |
| - | - | - |
| `autoUpdate?` | `boolean` | Word's "Automatically update" (`w:autoRedefine`). |
| `basedOn?` | `string \| null` | Style id or name; null removes it. |
| `id?` | `string` | The style to change; absent creates a new style called `name`. |
| `name` | `string` | |
| `next?` | `string \| null` | Paragraph style for the next paragraph, by id or name; null removes it. |
| `paragraph?` | `Omit<ParagraphFormat, "styleId">` | |
| `quickStyle?` | `boolean` | Add to the Quick Style gallery (`w:qFormat`). |
| `run?` | `RunFormat` | |
| `type?` | `StyleKind` | Only read on create; Word's default is linked (a paragraph style with a character twin). |

## `StyleDefinitionState`

What Modify Style reads back; `run` and `paragraph` are the style's own properties, not inherited ones.

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

```ts theme={null}
type StyleDefinitionState = Required<Pick<StyleDefinition, "name" | "run">> & { autoUpdate: boolean; basedOn?: string; builtin: boolean; id: string; next?: string; paragraph: Omit<ParagraphFormat, "styleId">; quickStyle: boolean; type: StyleKind | "table" | "numbering" }
```

## `StyleKind`

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

```ts theme={null}
type StyleKind = "paragraph" | "character" | "linked"
```

## `StyleLook`

How a paragraph style's text looks, for a picker that previews each style.

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

| Name | Type | Description |
| - | - | - |
| `bold?` | `boolean` | |
| `color?` | `string` | RRGGBB; absent for automatic colour. |
| `font?` | `string` | |
| `italic?` | `boolean` | |
| `sizePt?` | `number` | |
| `smallCaps?` | `true` | |
