> ## 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: Review and comments

## `AckReply`

What an ack brings back: a presence that waited on it, or the document repainted after a table repair.

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

| Name | Type | Description |
| - | - | - |
| `presence?` | `Presence` | |
| `result?` | `EditResult` | |

## `BalloonMount`

What a balloon slot hands back: `update` follows the card as it moves, picks up or squeezes.

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

| Name | Type | Description |
| - | - | - |
| `destroy()?` | `() => void` | |
| `update()?` | `(card: MarginCard) => void` | |

## `BalloonRender`

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

```ts theme={null}
type BalloonRender = (host: HTMLElement, card: MarginCard, model: EditorModel) => BalloonMount | (() => void) | void
```

## `BalloonSlot`

A host's own balloon content. The margin keeps the stacking, the connector and
the frame; `render` fills the card. `claims` picks the balloons it draws, the
rest keep the built-in card; without it every balloon is the host's.

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

```ts theme={null}
type BalloonSlot = BalloonRender | { render: BalloonRender; claims?: any }
```

## `CommentThread`

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

| Name | Type | Description |
| - | - | - |
| `replies` | `ReviewComment[]` | |
| `root` | `ReviewComment` | |

## `DocumentProtection`

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

| Name | Type | Description |
| - | - | - |
| `mode` | `ProtectionMode` | |
| `password` | `boolean` | |

## `MarginArea`

The shaded column beside one page.

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

| Name | Type | Description |
| - | - | - |
| `height` | `number` | |
| `left` | `number` | |
| `page` | `number` | |
| `top` | `number` | |
| `width` | `number` | |

## `MarginCard`

One balloon placed in the margin, in scroller px.

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

| Name | Type | Description |
| - | - | - |
| `active` | `boolean` | The balloon the caret or a click picked. |
| `anchor` | `ReviewAnchor` | |
| `compact` | `boolean` | Its page squeezed every balloon but the active one to one row. |
| `connector?` | `string` | SVG path from the text to the balloon; absent for an orphan. |
| `item?` | `PlacedItem` | A host's record (`ReviewModel.setItems`), with its `data`. |
| `left` | `number` | |
| `partner?` | `ReviewRevision` | The insertion typed over this deletion; one balloon settles both. |
| `revision?` | `ReviewRevision` | |
| `thread?` | `CommentThread` | |
| `top` | `number` | |
| `wedge?` | `string` | SVG path of the mark at a deletion that spans no text. |
| `width` | `number` | |

## `MarginLayout`

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

| Name | Type | Description |
| - | - | - |
| `areas` | `MarginArea[]` | |
| `cards` | `MarginCard[]` | |
| `more` | `MarginMore[]` | |

## `MarginMetrics`

Balloon column geometry, in scroller px; fixed, never scaled with the page.

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

| Name | Type | Description |
| - | - | - |
| `areaPad` | `number` | The shaded markup area reaches this far left of the balloons. |
| `cardWidth` | `number` | |
| `charsPerRow` | `number` | Rough text metrics, only to decide whether a page's stack must squeeze. |
| `columnGap` | `number` | Space between the page card and the balloon column. |
| `compactGap` | `number` | |
| `connectDrop` | `number` | The connector meets the balloon this far below its top edge. |
| `draftHeight` | `number` | |
| `lineHeight` | `number` | |
| `rowHeight` | `number` | One compact row, and the height a balloon takes before it is measured. |
| `stackGap` | `number` | |
| `wedgeHeight` | `number` | |
| `wedgeWidth` | `number` | |

## `MarginMore`

The count that stands in for the balloons a page had no room for.

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

| Name | Type | Description |
| - | - | - |
| `count` | `number` | |
| `left` | `number` | |
| `next?` | `ReviewAnchor` | The first hidden balloon below the active one, else the first hidden one. |
| `page` | `number` | |
| `top` | `number` | |
| `width` | `number` | |

## `Markup`

Word's Display for Review. Original lays every revision rejected and is read-only here.

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

```ts theme={null}
type Markup = "all" | "simple" | "none" | "original"
```

## `MarkupKinds`

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

| Name | Type | Description |
| - | - | - |
| `comments` | `boolean` | |
| `formatting` | `boolean` | |
| `insertionsDeletions` | `boolean` | |

## `ModifyAnswer`

`readOnly` opens it read-only; `edit` declines read-only recommended; `password` unlocks editing.

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

```ts theme={null}
type ModifyAnswer = "readOnly" | "edit" | { password: string }
```

## `ModifyPrompt`

Word's question on opening a reserved file: a password to modify, or read-only.

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

```ts theme={null}
type ModifyPrompt = WriteProtection & { name: string; wrong: boolean }
```

## `PasswordPrompt`

A file that needs its password to open; `wrong` after a refused try.

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

| Name | Type | Description |
| - | - | - |
| `name` | `string` | |
| `wrong` | `boolean` | |

## `ProtectionMode`

What a protected document still lets you do (`w:documentProtection/@w:edit`).

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

```ts theme={null}
type ProtectionMode = "readOnly" | "comments" | "trackedChanges" | "forms"
```

## `ReactBalloon`

A balloon's content as React; with `claims`, the balloons it leaves keep the built-in card.

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

```ts theme={null}
type ReactBalloon = ((card: MarginCard) => ReactNode) | { claims?: any; render: any }
```

## `ReviewAnchor`

One margin balloon's page-side end, in page-local hmm.

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

| Name | Type | Description |
| - | - | - |
| `color` | `string` | |
| `id` | `string` | |
| `key` | `string` | Names the record; a header change has one anchor per page, all sharing it. |
| `kind` | `"comment" \| "revision" \| "draft" \| string & {}` | A host's items carry their own kind (`setItems`). |
| `orphan` | `boolean` | Range markers gone: the balloon sits at the top of the column, no connector. |
| `page` | `number` | |
| `partnerId?` | `string` | The insertion that replaced this deletion's words; one balloon covers both. |
| `slot` | `string` | Names this one balloon on its page. |
| `top` | `number` | Top of the line the balloon aligns with. |
| `wedge` | `boolean` | A deletion in the final view spans no text: Word marks the spot with a wedge. |
| `x` | `number` | Where the connector meets the text: the range's last edge, at its baseline. |
| `y` | `number` | |

## `ReviewCommand`

Comments and tracked changes; `scope` names what accept/reject acts on.

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

```ts theme={null}
type ReviewCommand = { kind: "addComment"; text: string } | { id: string; kind: "replyComment"; text: string } | { id: string; kind: "editComment"; text: string } | { id: string; kind: "resolveComment"; resolved: boolean } | { id: string; kind: "deleteComment" } | { kind: "acceptRevisions"; scope: ReviewScope } | { kind: "rejectRevisions"; scope: ReviewScope }
```

## `ReviewComment`

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

| Name | Type | Description |
| - | - | - |
| `author` | `string` | |
| `color?` | `string` | The author's ink, the same the layout paints the balloon with. |
| `date?` | `string` | ISO 8601, absent when the part carries no date. |
| `id` | `string` | |
| `initials` | `string` | |
| `parentId?` | `string` | Set on replies: the thread root's id. |
| `range?` | `ReviewRange` | Absent when the range markers are gone (orphaned record). |
| `resolved` | `boolean` | |
| `text` | `string` | |

## `ReviewEditor`

The slice of `EditorModel` the review pane drives.

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

| Name | Type | Description |
| - | - | - |
| `busy` | `boolean` | An edit is in flight: the caret has moved but the review snapshot has not. |
| `host` | `BrowserEditorHost \| null` | |
| `i18n` | `EditorI18n` | |
| `ir` | `LayoutDocument \| null` | |
| `selection` | `Selection \| null` | |
| `story` | `StoryHit \| null` | The header/footer open for editing; a revision there is measured on its page. |
| `enterStory()` | `(hit: StoryHit) => void` | |
| `exitStory()` | `() => void` | |
| `fail()` | `(message: string) => void` | |
| `focusInput()` | `() => void` | |
| `run()` | `(command: EditorCommand) => Promise<void>` | |
| `scrollCaretIntoView()` | `() => void` | |
| `select()` | `(selection: Selection) => void` | |

## `ReviewItem`

One host record. `bookmark` follows edits and saves with the document; `range` stays where it was given.

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

| Name | Type | Description |
| - | - | - |
| `balloon?` | `boolean` | False: marks only, no balloon. |
| `bookmark?` | `string` | A bookmark's name (`addBookmark`); a hidden one starts with `_`. Wins over `range`. |
| `color?` | `string` | |
| `data?` | `unknown` | Anything the host's balloon needs. |
| `id` | `string` | Unique within its kind. |
| `range?` | `ReviewRange` | |

## `ReviewMark`

One range the review paints over the text, in page hmm.

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

| Name | Type | Description |
| - | - | - |
| `active` | `boolean` | Its balloon is the active one. |
| `color` | `string` | |
| `id` | `string` | |
| `key` | `string` | The balloon's key; a replacing insertion carries its deletion's. |
| `kind` | `ReviewMarkKind` | |
| `rects` | `Rect[]` | |

## `ReviewMarkKind`

A host's items mark under their own kind once `markKinds` names it.

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

```ts theme={null}
type ReviewMarkKind = "comment" | "revision" | string & {}
```

## `ReviewRange`

A comment or revision's anchor, in the offset space `EditorHost.text` uses.

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

| Name | Type | Description |
| - | - | - |
| `end` | `number` | An offset in `endTarget` when that is set, else in `target`. |
| `endTarget?` | `EditTarget` | Set when the range closes in a later target: a comment over several paragraphs. |
| `start` | `number` | |
| `target` | `EditTarget` | |

## `ReviewRevision`

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

| Name | Type | Description |
| - | - | - |
| `author` | `string` | |
| `color?` | `string` | The author's ink as the body paints it; moves are green for every author. |
| `date?` | `string` | |
| `id` | `string` | |
| `part?` | `"table"` | Set on a table property change: Word's balloon reads "Formatted Table". |
| `pieces?` | `RevisionPiece[]` | An insertion's or deletion's `text` in the formatting Word's balloon keeps. |
| `range?` | `ReviewRange` | |
| `replaces?` | `string` | The deletion this insertion was typed over: same author, same minute, adjacent. |
| `text` | `string` | Inserted or deleted text; for a run format change, Word's "Font: Bold" phrases. |
| `type` | `"insert" \| "delete" \| "format" \| "other"` | |

## `ReviewScope`

`ids` resolves several revisions in one step: a deletion and the insertion that replaced it.

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

```ts theme={null}
type ReviewScope = "selection" | "all" | { id: string } | { ids: string[] }
```

## `RevisionPiece`

A stretch of revision text in one look; `mark` is a struck paragraph mark, a pilcrow that ends the line.

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

| Name | Type | Description |
| - | - | - |
| `bold?` | `true` | |
| `font?` | `string` | |
| `italic?` | `true` | |
| `mark?` | `true` | |
| `strike?` | `true` | |
| `text` | `string` | |
| `underline?` | `true` | |

## `SuggestingPolicy`

"allow" lets the user switch; "off" keeps every edit direct; "on" tracks every edit.

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

```ts theme={null}
type SuggestingPolicy = "allow" | "off" | "on"
```
