> ## 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.

# EditorModel

`@reductoai/docx-editor/model`: the headless editor. Guide: [Headless editor](https://docs.reducto.ai/office/docx/ui/headless-editor.md).

## `EditorModel`

`@reductoai/docx-editor/model`: the headless layer. No Svelte, no DOM chrome;
the model, its observable protocol, input binding, clipboard, palette commands
and export helpers. A host that draws its own UI needs only this.

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

### `new EditorModel()`

```ts theme={null}
new EditorModel(options: EditorModelOptions)
```

### EditorModel properties

| Name | Type | Description |
| - | - | - |
| `afterOverlay` | `(() => void) \| null` | Runs after each overlay paint: a drag puts its frame back on the pointer. |
| `busy` | `boolean` | |
| `canMerge` | `boolean` | |
| `canRedo` | `boolean` | |
| `canUndo` | `boolean` | |
| `chartSheetOpen` | `boolean` | Word's Edit Data: the chart's workbook beside the pages, shown while a chart is selected. |
| `controls` | `ContentControlsModel` | |
| `customizableKeys` | `boolean` | read-only False: the host turned the Keyboard Shortcuts window off. |
| `drawingGrid` | `boolean` | View > Gridlines, the drawing grid; set through `setDrawingGrid`. |
| `error` | `string \| null` | |
| `find` | `FindModel` | |
| `fonts` | `Pick<FaceProvider, "fetch" \| "bytes">` | read-only |
| `format` | `FormatState \| null` | |
| `gridlines` | `boolean` | View Gridlines; set through `setGridlines`. |
| `historyTurns` | `number` | Counts undo and redo, so an open data window reloads what they put back. |
| `host` | `BrowserEditorHost \| null` | |
| `hover` | `StoryHit \| null` | The closed header/footer under the pointer; its band is hinted so a double-click has a target. |
| `i18n` | `EditorI18n` | The editor's language, from the `locale` and `messages` it was made with. |
| `inputEl` | `HTMLElement \| null` | |
| `inspectorVisible` | `boolean` | The format panel beside the pages: borders, shading, padding, row flow. |
| `ir` | `LayoutDocument \| null` | |
| `keys` | `DocxKeymap` | read-only Every key's command; hosts and users rebind them here. |
| `licenseError` | `string \| null` | Set once the package refused to open documents; the empty stage shows it instead of a drop target. |
| `links` | `LinkHandlers` | Hooks on link clicks and link hover; replace them at any time. |
| `locked` | `boolean` | Another writer owns the session (an agent turn); commands are dropped until it is done. |
| `markup` | `Markup` | Word's Display for Review; a new document opens in All Markup. |
| `memory` | `EditMemory` | Repeat, Go Back and the format painter's copied formatting. |
| `modifyPrompt` | `ModifyPrompt \| null` | Set when an opened file carries a password to modify or read-only recommended; answer with `answerModify`. |
| `name` | `string` | |
| `nav` | `NavModel` | Word's Navigation pane: the heading outline and find, in one left panel. |
| `notice` | `string \| null` | Transient progress line, e.g. while an image decodes. |
| `opening` | `boolean` | |
| `openPassword` | `string \| null` | File > Passwords: a save encrypts with it. Kept from the password the file opened with. |
| `outline` | `OutlineView \| null` | Word's Outline view (View > Outline); null lays the pages. |
| `overlayTick` | `number` | Bumps whenever the overlay is repainted or the pages scroll; anchored chrome follows it. |
| `page` | `number` | The page most in view, 1-based; 0 before a document is open. |
| `pageLabel` | `string` | |
| `pagesEl` | `HTMLElement \| null` | |
| `passwordPrompt` | `PasswordPrompt \| null` | Set when `open` met an encrypted file: answer with `unlock` or `cancelUnlock`. |
| `peerColor` | `(name: string) => string` | The colour of a writer's caret and range; `LiveOptions.peerColor` sets it. |
| `peers` | `PeerCursor[]` | Other writers' selections, painted over the pages in a shared session. |
| `pointing` | `boolean` | True while a pointer drag that selects text is held down. |
| `previewer` | `DocumentPreviewer \| null` | |
| `previewing` | `boolean` | Pages of the document still opening are on screen, read-only. |
| `progress` | `ProgressView \| null` | Phase block over the stage while a document opens; null when idle. |
| `readOnly` | `boolean` | A reader's view: the caret moves, text selects, Find and Copy work; every edit is dropped. |
| `review` | `ReviewModel` | |
| `revisionAuthor` | `string` | The name new tracked changes and comments carry; the session's default until one is set. |
| `rulerVisible` | `boolean` | Word's View › Ruler. |
| `scheme` | `"light" \| "dark"` | Page ink on screen; exports always paint light. |
| `selection` | `Selection \| null` | |
| `spell` | `SpellModel` | read-only |
| `story` | `StoryHit \| null` | |
| `suggesting` | `boolean` | |
| `suggestingPolicy` | `SuggestingPolicy` | Whether the user may switch Suggesting; "off" and "on" also win over the file's own setting. |
| `toolbarItems` | `ToolbarItems` | Controls the built-in format bar leaves off or adds; assign a new object to change it. |
| `transport` | `EditorTransport` | read-only |
| `ui` | `EditorUi` | read-only Menu, dialogs and other chrome state scoped to this editor. |
| `version` | `number` | Bumps on every change of this object or an adopted child. |
| `zoom` | `number` | CSS px per page px at the current zoom; 1 is 100%. |
| `zoomMode` | `ZoomMode` | What the host asked for: a scale, or "fit"/"page" that follow the window. |
| `openTextbox` | `PictureHit & { owner: StoryHit \| undefined } \| null` | read-only The text box being typed in, as a shape with a frame and handles. |
| `overlays` | `PageOverlays` | read-only Host nodes pinned to pages in points; they survive scroll, zoom and relayout. |
| `picture` | `PictureHit \| null` | read-only The picture the selection addresses, straight off the IR. |
| `scope` | `IndexScope \| undefined` | read-only |

### `answerModify()`

```ts theme={null}
answerModify(answer: ModifyAnswer): boolean
```

Resolves false, and marks the prompt `wrong`, when the password does not match.

### `applyCollabChange()`

```ts theme={null}
applyCollabChange(change: CollabChange, options?: ApplyOptions): Promise<void>
```

Applies `change` after the edits before it, as this writer's own: sent, and one undo step.

### `applyCollabChanges()`

```ts theme={null}
applyCollabChanges(steps: ApplyStep[]): Promise<void>
```

Applies `steps` in order after the edits before them: one layout, one undo step; each is sent and observed with its tag.

### `applyRunFormat()`

```ts theme={null}
applyRunFormat(format: RunFormat): void
```

### `attach()`

```ts theme={null}
attach(pagesEl: HTMLElement): void
```

### `bindInput()`

```ts theme={null}
bindInput(el: HTMLElement): void
```

### `cancelUnlock()`

```ts theme={null}
cancelUnlock(): void
```

### `changePicture()`

```ts theme={null}
changePicture(file?: File): Promise<void>
```

Change Picture: a picked file takes the selected picture's place in the same frame.

### `clearHover()`

```ts theme={null}
clearHover(): void
```

### `collabAck()`

```ts theme={null}
collabAck(seq: number): void
```

### `collabPeers()`

```ts theme={null}
collabPeers(peers: Peer[]): void
```

The other writers and their last reported selections; replaces the previous set.

### `collabPending()`

```ts theme={null}
collabPending(): Promise<boolean | undefined>
```

After the edits before this call: true while the server has not confirmed one; undefined off a session.

### `collabRemote()`

```ts theme={null}
collabRemote(change: CollabChange, seq: number): void
```

Server messages, in the order the server sent them.

### `collabResend()`

```ts theme={null}
collabResend(): void
```

### `collabSnapshot()`

```ts theme={null}
collabSnapshot(): Promise<CollabSnapshot | undefined>
```

The bytes as of the last sequenced change, after every queued edit; undefined while one is unconfirmed.

### `collabTokens()`

```ts theme={null}
collabTokens(stream?: string): Promise<readonly Token[] | undefined>
```

The body's tokens, or a story stream's, after the edits before this call.

### `collapse()`

```ts theme={null}
collapse(): void
```

### `compareWith()`

```ts theme={null}
compareWith(
  revised: Uint8Array,
  options?: CompareOptions & { name?: string },
): Promise<boolean>
```

Word's Compare: this document is the original, `revised` the later copy. The
result, `revised` with every difference as a tracked change, opens in its place.

### `copy()`

```ts theme={null}
copy(data: DataTransfer | null): void
```

### `copyFormat()`

```ts theme={null}
copyFormat(): void
```

Copy Format (Ctrl+Shift+C): remember the caret's character formatting.

### `destroy()`

```ts theme={null}
destroy(): void
```

### `drawOverlay()`

```ts theme={null}
drawOverlay(): void
```

### `dropCaret()`

```ts theme={null}
dropCaret(
  page: number,
  xHmm: number,
  yHmm: number,
  ir?: LayoutDocument | null,
): DropCaret | undefined
```

Where a picture drag would drop, without disturbing the live selection.

### `editShapeText()`

```ts theme={null}
editShapeText(): Promise<void>
```

Word's Add Text / Edit Text: open the selected shape's text, making it when there is none.

### `enterHeaderFooter()`

```ts theme={null}
enterHeaderFooter(kind: "header" | "footer"): Promise<boolean>
```

Word's Edit Header / Edit Footer: the caret moves into the band on the caret's page,
else the page in view. The caret's section gets an empty one first when it shows
none, as Word's Insert > Header does. False when read-only or still not found.

### `enterStory()`

```ts theme={null}
enterStory(hit: StoryHit, xHmm?: number, yHmm?: number): void
```

### `exitStory()`

```ts theme={null}
exitStory(): void
```

### `fail()`

```ts theme={null}
fail(message: unknown): void
```

Show a message (or an error's) as a transient toast.

### `floatHover()`

```ts theme={null}
floatHover(page: number, xHmm: number, yHmm: number): boolean
```

Whether a press here grabs a float, so the pointer can say so before the click.

### `focusInput()`

```ts theme={null}
focusInput(): void
```

### `goBack()`

```ts theme={null}
goBack(): void
```

Shift+F5: the caret visits the last few places an edit was made, newest first.

### `goToPage()`

```ts theme={null}
goToPage(input: string): boolean
```

Word's Go To page; false leaves the dialog open on input that names no page.

### `hitTest()`

```ts theme={null}
hitTest(clientX: number, clientY: number): EditorHit | null
```

The page, text position and link under a viewport point; null off the pages.

### `hoverAt()`

```ts theme={null}
hoverAt(page: number, xHmm: number, yHmm: number): void
```

Track the closed story under the pointer; the hint repaints only when it changes.

### `insertChart()`

```ts theme={null}
insertChart(
  chartType: "Line" | "ColumnClustered" | "ColumnStacked" | "ColumnStacked100" | "BarClustered" | "BarStacked" | "BarStacked100" | "LineMarkers" | "LineStacked" | "LineMarkersStacked" | "LineStacked100" | "LineMarkersStacked100" | "Area" | "AreaStacked" | "AreaStacked100" | "Pie" | "Doughnut" | "XYScatter" | "XYScatterLines" | "XYScatterLinesNoMarkers" | "XYScatterSmooth" | "XYScatterSmoothNoMarkers" | "Radar" | "RadarMarkers" | "RadarFilled" | "PieExploded" | "DoughnutExploded" | "PieOfPie" | "BarOfPie" | "3DLine" | "3DArea" | "3DAreaStacked" | "3DAreaStacked100" | "3DPie" | "3DPieExploded" | "Bubble" | "Bubble3DEffect" | "StockHLC" | "StockOHLC" | "StockVHLC" | "StockVOHLC" | "Surface" | "SurfaceWireframe" | "SurfaceTopView" | "SurfaceTopViewWireframe" | "3DColumn" | "3DColumnClustered" | "3DColumnStacked" | "3DColumnStacked100" | "3DBarClustered" | "3DBarStacked" | "3DBarStacked100" | "CylinderCol" | "CylinderColClustered" | "CylinderColStacked" | "CylinderColStacked100" | "CylinderBarClustered" | "CylinderBarStacked" | "CylinderBarStacked100" | "ConeCol" | "ConeColClustered" | "ConeColStacked" | "ConeColStacked100" | "ConeBarClustered" | "ConeBarStacked" | "ConeBarStacked100" | "PyramidCol" | "PyramidColClustered" | "PyramidColStacked" | "PyramidColStacked100" | "PyramidBarClustered" | "PyramidBarStacked" | "PyramidBarStacked100",
): Promise<void>
```

Insert Chart; a selected picture keeps its place and the chart lands after it.

### `insertImageFile()`

```ts theme={null}
insertImageFile(file: File): Promise<void>
```

### `insertNote()`

```ts theme={null}
insertNote(note: "footnote" | "endnote", mark?: string): Promise<void>
```

A note mark after the selection (`mark`: Word's Custom mark); the caret goes into the new note, and Escape comes back.

### `insertTextBox()`

```ts theme={null}
insertTextBox(): Promise<void>
```

Float a new text box off the caret and start typing in it, as Word does.

### `layerFor()`

```ts theme={null}
layerFor(page: number): HTMLElement | undefined
```

### `linkAt()`

```ts theme={null}
linkAt(page: number, xHmm: number, yHmm: number): string | undefined
```

The address a link under the point goes to: a URL, or `#bookmark`.

### `linkBox()`

```ts theme={null}
linkBox(page: number, xHmm: number, yHmm: number): LinkHover | undefined
```

The link under a page point and its text's box on that line in client pixels.

### `move()`

```ts theme={null}
move(move: KeyMove, extend: boolean): void
```

### `observes()`

```ts theme={null}
observes(key: string): boolean
```

### `open()`

```ts theme={null}
open(bytes: Uint8Array, name: string, options?: OpenOptions): Promise<boolean>
```

`keepView` takes new bytes for the document already on screen (another
writer saved it): the old pages stay up until the new layout is ready, and
scroll, caret and open panels survive where they still resolve.
Resolves true once the document is on screen.

### `openBlank()`

```ts theme={null}
openBlank(name?: string): Promise<boolean>
```

File > New: Word's blank document, opened in place of the current one.

### `openGoTo()`

```ts theme={null}
openGoTo(): void
```

### `pasteFormat()`

```ts theme={null}
pasteFormat(): void
```

Paste Format (Ctrl+Shift+V): lay the copied formatting over the selection.

### `pickImage()`

```ts theme={null}
pickImage(): Promise<void>
```

### `placeAt()`

```ts theme={null}
placeAt(
  page: number,
  xHmm: number,
  yHmm: number,
  mode: "word" | "paragraph" | "caret",
  extend: boolean,
): void
```

### `placeCaret()`

```ts theme={null}
placeCaret(point: PagePoint): void
```

### `redo()`

```ts theme={null}
redo(): void
```

### `redoOrRepeat()`

```ts theme={null}
redoOrRepeat(): void
```

Word's Ctrl+Y and F4: redo while there is something to redo, else repeat the last edit.

### `refreshFromHost()`

```ts theme={null}
refreshFromHost(): Promise<void>
```

The session changed under the editor (an agent edited it). Relayout from
the host, repaint every page and keep the caret where it still resolves.
A failure is toasted and rethrown: the caller must not report a repaint
that never reached the page.

### `resizeFont()`

```ts theme={null}
resizeFont(direction: -1 | 1): void
```

### `run()`

```ts theme={null}
run(command: EditorCommand): Promise<void>
```

### `runImage()`

```ts theme={null}
runImage(command: ImageCommand): void
```

### `runOnChart()`

```ts theme={null}
runOnChart(chart: Selection, command: ImageCommand): void
```

A data pane commits on blur, often after a click moved the caret: the edit goes to
the chart it came from, and the pane keeps the keyboard.

### `runTable()`

```ts theme={null}
runTable(command: TableCommand): void
```

### `saveBytes()`

```ts theme={null}
saveBytes(): Promise<Uint8Array<ArrayBufferLike>>
```

The bytes a Save writes: encrypted when `openPassword` is set.

### `scaleFor()`

```ts theme={null}
scaleFor(page: number): number
```

Display px per hmm on one page.

### `scrollCaretIntoView()`

```ts theme={null}
scrollCaretIntoView(placement?: "top" | "center" | "nearest"): void
```

`top` is Word's jump (a heading, Go To): the caret's line goes to the top of the window.
`center` puts a selection that is out of view in the middle of the window.

### `seedRevisionAuthor()`

```ts theme={null}
seedRevisionAuthor(name: string): void
```

The author a live session joined as, unless the host set one with `setRevisionAuthor`.

### `select()`

```ts theme={null}
select(selection: Selection): void
```

### `selectAll()`

```ts theme={null}
selectAll(): void
```

### `selectCollabRange()`

```ts theme={null}
selectCollabRange(from: number, to: number, stream?: string): Promise<boolean>
```

Selects tokens `from`..`to` of the body, or of story stream `stream`, and scrolls to them.

### `selectFloat()`

```ts theme={null}
selectFloat(page: number, xHmm: number, yHmm: number): boolean
```

A click landing on a floating picture selects the character that anchors it.

### `selectionBox()`

```ts theme={null}
selectionBox(): DOMRect | null
```

The selection's box in client pixels, for chrome that floats beside it; null when it is off screen.

### `selectionRects()`

```ts theme={null}
selectionRects(): DOMRect[]
```

One box per selected line in client pixels; empty for a caret.

### `selectionText()`

```ts theme={null}
selectionText(): string
```

The selection as plain text, as Copy puts it on the clipboard.

### `selectShape()`

```ts theme={null}
selectShape(shape: ShapeSelection): void
```

Select a shape by its anchoring character, moving to the story that holds it.

### `setAlignment()`

```ts theme={null}
setAlignment(alignment: "left" | "right" | "center" | "justify" | "distribute"): void
```

### `setDrawingGrid()`

```ts theme={null}
setDrawingGrid(on: boolean): void
```

Word's View > Gridlines: the document's drawing grid over each page.

### `setGridlines()`

```ts theme={null}
setGridlines(on: boolean): void
```

Word's View Gridlines: dashed rules where a table cell has no border.

### `setMarkup()`

```ts theme={null}
setMarkup(markup: Markup): Promise<void>
```

Simple and No Markup show the document as if accepted; Original as if every change were rejected.

### `setOpenPassword()`

```ts theme={null}
setOpenPassword(password: string | null): void
```

File > Passwords: "" or null saves without a password to open.

### `setOutline()`

```ts theme={null}
setOutline(outline: OutlineView | null): Promise<void>
```

Opens, changes (Show Level, collapsed headings) or, with null, closes Outline view.

### `setRevisionAuthor()`

```ts theme={null}
setRevisionAuthor(name: string): void
```

The name this writer's tracked changes and comments carry, in this and every later document.

### `setScheme()`

```ts theme={null}
setScheme(scheme: "light" | "dark"): void
```

### `setSuggesting()`

```ts theme={null}
setSuggesting(on: boolean): void
```

Under a policy other than "allow" the policy wins over `on`.

### `setTablePosition()`

```ts theme={null}
setTablePosition(patch: TablePosition): void
```

### `setTableWrap()`

```ts theme={null}
setTableWrap(wrap: "none" | "around"): void
```

### `setZoom()`

```ts theme={null}
setZoom(mode: ZoomMode): void
```

Zoom the pages: a scale (1 is 100%), "fit" for the window's width or "page" for a whole page.

### `snapTargets()`

```ts theme={null}
snapTargets(page: number, shapeId: number | undefined): SnapTargets
```

The guides a float dragged on `page` may line up with, itself left out.

### `stampOf()`

```ts theme={null}
stampOf(key: string): number
```

### `startCollab()`

```ts theme={null}
startCollab(options?: CollabOptions): Promise<void>
```

Joins a shared session; with no `send`, a session of one that confirms its own changes.

### `startComment()`

```ts theme={null}
startComment(): void
```

### `subscribe()`

```ts theme={null}
subscribe(listener: Listener, key?: string): Unsubscribe
```

Listen to one key, or to every change (including adopted children) when `key` is omitted.

### `tab()`

```ts theme={null}
tab(backward: boolean): void
```

The host settles Tab against the document as it is then, not the format shown now.

### `tapChart()`

```ts theme={null}
tapChart(point: PagePoint): void
```

### `toBytes()`

```ts theme={null}
toBytes(): Promise<Uint8Array<ArrayBufferLike>>
```

The current edit state as .docx bytes, carrying its Session for the next open.

### `toggleBold()`

```ts theme={null}
toggleBold(): void
```

### `toggleItalic()`

```ts theme={null}
toggleItalic(): void
```

### `toggleList()`

```ts theme={null}
toggleList(
  format: "none" | "bullet" | "decimal" | "decimalZero" | "lowerLetter" | "upperLetter" | "lowerRoman" | "upperRoman" | "hebrew1" | "hebrew2",
): void
```

### `toggleStrike()`

```ts theme={null}
toggleStrike(): void
```

### `toggleUnderline()`

```ts theme={null}
toggleUnderline(): void
```

### `toPdf()`

```ts theme={null}
toPdf(): Promise<{ bytes: Uint8Array; summary: string }>
```

### `toPng()`

```ts theme={null}
toPng(options?: Pick<PagePngOptions, "pages" | "scale">): Promise<RenderedPagePng[]>
```

### `typeIntoShape()`

```ts theme={null}
typeIntoShape(text: string): boolean
```

Keys typed on a selected shape go into its text, as in Word; a new story is made first. False when none takes text.

### `undo()`

```ts theme={null}
undo(): void
```

### `unlock()`

```ts theme={null}
unlock(password: string): Promise<boolean>
```

Retries the encrypted file `open` stopped on.

### `whenLicensed()`

```ts theme={null}
whenLicensed(): Promise<void>
```

Resolves once npm.reducto.ai trusts this install; else sets `licenseError` and rethrows.

## `EditorModelOptions`

`@reductoai/docx-editor/model`: the headless layer. No Svelte, no DOM chrome;
the model, its observable protocol, input binding, clipboard, palette commands
and export helpers. A host that draws its own UI needs only this.

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

```ts theme={null}
type EditorModelOptions = LanguageOptions & { fonts: Pick<FaceProvider, "bytes" | "fetch">; keybindings?: KeybindingOptions; links?: LinkHandlers; speculate?: boolean; spellDictionary?: SpellDictionary; transport: EditorTransport }
```

## `EditorTransport`

How the model reaches a session. `spawnWorker` is the bundler's business
(`new Worker(new URL("./host-worker.ts", import.meta.url), { type: "module" })`);
without one, or when the worker fails to load, `createHost` runs in the page.

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

| Name | Type | Description |
| - | - | - |
| `createHost` | `CreateEditorHost` | |
| `fonts` | `Pick<FaceProvider, "heldIds" \| "seed">` | |
| `spawnWorker?` | `() => HostChannel \| null` | |

## `attachEditorInput()`

```ts theme={null}
function attachEditorInput(stage: HTMLElement, model: EditorModel): () => void
```

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

## `serveEditorHost()`

```ts theme={null}
function serveEditorHost(
  options: ServeEditorHostOptions,
  scope?: WorkerScope,
): EditorHostHandle
```

Answer editor requests on `scope` until it is terminated. `scope` is the
worker's `self`, or a MessagePort when the worker also serves other traffic.

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

## `ServeEditorHostOptions`

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

| Name | Type | Description |
| - | - | - |
| `createHost` | `CreateEditorHost` | |
| `fonts` | `Pick<FaceProvider, "bytes">` | Face bytes to ship to the page for canvas `FontFace` loading. |

## `createDefaultHost()`

```ts theme={null}
function createDefaultHost(
  fonts: TableFaceProvider,
  bytes: Uint8Array,
  name: string,
  onProgress?: LayoutProgress,
  options?: DefaultHostOptions,
): Promise<SessionEditorHost>
```

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

## `portableFonts()`

```ts theme={null}
function portableFonts(fontsUrl?: string): TableFaceProvider
```

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

## `formatCommands()`

```ts theme={null}
function formatCommands(model: PaletteModel): PaletteCommand[]
```

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

## `WorkerConfig`

Sent to the worker before its first request, so it builds the same provider as the page.

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

| Name | Type | Description |
| - | - | - |
| `fontsUrl` | `string` | |
| `proxyUrl?` | `string` | The page's `proxyUrl`, so the worker's license traffic goes through it too. |
| `type` | `"configure"` | |
| `wasmUrl?` | `string` | URL of the layout engine the worker fetches. Default: the `engine.wasm` that `@reductoai/docx` ships. |

## `ProgressView`

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

| Name | Type | Description |
| - | - | - |
| `blocks` | `number` | Body blocks seen while parsing; names the parse row once it closes. |
| `inline` | `boolean` | A document already on screen, or its first pages, keeps the block small. |
| `name` | `string` | |
| `pages` | `number` | Page count from the last finished layout pass; 0 while unknown. |
| `phases` | `Phase[]` | |

## `Phase`

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

| Name | Type | Description |
| - | - | - |
| `detail` | `string` | |
| `elapsedMs` | `number` | Frozen at the moment the phase finished; live phases time themselves. |
| `id` | `PhaseId` | |
| `ratio` | `number \| null` | null when no total is known: the track runs indeterminate. |
| `startedAt` | `number` | |
| `status` | `PhaseStatus` | |

## `ZoomMode`

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

```ts theme={null}
type ZoomMode = "fit" | "page" | number
```
