> ## 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: References and fields

## `FieldShading`

File > Options > Advanced > Field shading.

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

```ts theme={null}
type FieldShading = "never" | "selected" | "always"
```

## `FieldSpan`

One field as Word's field shading sees it.

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

| Name | Type | Description |
| - | - | - |
| `code` | `string` | |
| `range` | `ReviewRange` | The cached result; `start === end` for a field that keeps none. |
| `type` | `string` | The instruction's first word, upper case: `PAGE`, `TOC`, `REF`. |

## `MarkedCitation`

A long citation a TA field marks; `category` is 1 through 16, Word's seven named ones first.

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

| Name | Type | Description |
| - | - | - |
| `category?` | `number` | |
| `long` | `string` | |
| `short?` | `string` | |

## `TocCommand`

Tables of contents. `insertToc` lands Word's gallery block at the caret: a
`w:sdt` holding a "Contents" title and the filled TOC field. The field body
is read-only in the editor; the other commands act on the TOC under the focus.

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

```ts theme={null}
type TocCommand = { kind: "insertToc"; options?: TocOptions; title?: string } | { kind: "updateToc"; scope: "all" | "pageNumbers" } | { kind: "tocOptions"; options: TocOptions } | { kind: "removeToc" } | { kind: "insertTableOfFigures"; label: string; options?: Omit<TocOptions, "levels"> }
```

## `TocOptions`

Word's Table of Contents dialog: heading levels and the page-number column.

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

| Name | Type | Description |
| - | - | - |
| `entryFields?` | `boolean` | Collect TC entry fields too (\f). |
| `headingStyles?` | `boolean` | Collect the built-in heading styles in `levels` (\o); Word's Options > Styles. |
| `hyperlinks?` | `boolean` | Entries link to their headings (\h). |
| `leader?` | `TabStopLeader` | |
| `levels?` | `[number, number]` | Built-in heading levels the table collects, upper first; Word's default is 1-3. |
| `outlineLevels?` | `boolean` | Collect paragraphs by outline level too (\u). |
| `pageNumbers?` | `boolean` | |
| `rightAlignPageNumbers?` | `boolean` | Right-align the page numbers behind a leader; off puts them after one space. |
| `styles?` | `TocStyleLevel[]` | Other paragraph styles, by name, and the TOC level each lands on (\t); empty clears them. |

## `TocState`

The TOC whose field holds the focus, for toolbars and context menus.

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

| Name | Type | Description |
| - | - | - |
| `entries` | `number` | Entries in the cached result. |
| `entryFields` | `boolean` | |
| `figures?` | `string` | A table of figures: the caption label it lists. |
| `from` | `number` | Body blocks the field spans, `[from, to)`. |
| `headingStyles` | `boolean` | |
| `hyperlinks` | `boolean` | |
| `leader` | `TabStopLeader` | |
| `levels` | `[number, number]` | |
| `locked` | `boolean` | `w:fldLock`, or a locked content control around the field. |
| `outlineLevels` | `boolean` | |
| `pageNumbers` | `boolean` | |
| `rightAlignPageNumbers` | `boolean` | |
| `styles` | `TocStyleLevel[]` | |
| `to` | `number` | |

## `TocStyleLevel`

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

| Name | Type | Description |
| - | - | - |
| `level` | `number` | |
| `name` | `string` | |
