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

# Other classes: Other

## `CustomProperty`

One user-defined property in docProps/custom.xml.

Import from `@reductoai/docx/node`, `@reductoai/docx/officejs`.

### CustomProperty properties

| Name | Type | Description |
| - | - | - |
| `key` | `string` | read-only |
| `type` | `CustomPropertyType` | read-only Typed by the vt element Word wrote: lpwstr, r8, bool, or filetime. |
| `value` | `CustomPropertyValue` | read-only |

### `CustomProperty.delete()`

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

### `CustomProperty.set()`

```ts theme={null}
set(properties: CustomPropertyUpdateData, options?: UpdateOptions): void
```

## `CustomPropertyCollection`

The document's user-defined properties; keys are matched case-insensitively.

Import from `@reductoai/docx/node`, `@reductoai/docx/officejs`.

### CustomPropertyCollection properties

| Name | Type | Description |
| - | - | - |
| `items` | `T[]` | read-only |
| `length` | `number` | read-only |

### `CustomPropertyCollection.add()`

```ts theme={null}
add(key: string, value: CustomPropertyValue): CustomProperty
```

Create or replace the property with this key; the part is created on demand.

### `CustomPropertyCollection.at()`

```ts theme={null}
at(index: number): CustomProperty
```

### `CustomPropertyCollection.deleteAll()`

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

### `CustomPropertyCollection.getCount()`

```ts theme={null}
getCount(): ClientResult<number>
```

OfficeJS spelling of `items.length`; synchronous like the rest of OfficeJS here.

### `CustomPropertyCollection.getFirst()`

```ts theme={null}
getFirst(): CustomProperty
```

### `CustomPropertyCollection.getFirstOrNullObject()`

```ts theme={null}
getFirstOrNullObject(): CustomProperty & { isNullObject: boolean }
```

OfficeJS null-object variant; inspect `isNullObject` before other members.

### `CustomPropertyCollection.getItem()`

```ts theme={null}
getItem(key: string | number): CustomProperty
```

### `CustomPropertyCollection.getItemOrNullObject()`

```ts theme={null}
getItemOrNullObject(
  key: string,
): CustomProperty & { isNullObject: true } | CustomProperty & { isNullObject: false }
```

OfficeJS null-object variant; inspect `isNullObject` before other members.

### `CustomPropertyCollection.getLast()`

```ts theme={null}
getLast(): CustomProperty
```

### `CustomPropertyCollection.getLastOrNullObject()`

```ts theme={null}
getLastOrNullObject(): CustomProperty & { isNullObject: boolean }
```

OfficeJS null-object variant; inspect `isNullObject` before other members.

## `DocserverError`

A failure of the live session. `traceId` finds the server's log lines for it: the failed
request's, or the connection's for an error on the socket. `code: "version"`: the editor and
the server are too far apart; the session stops instead of reloading. The message says which to update.

Import from `@reductoai/docx-editor`.

### DocserverError properties

| Name | Type | Description |
| - | - | - |
| `stackTraceLimit` | `number` | static The `Error.stackTraceLimit` property specifies the number of stack frames collected by a stack trace (whether generated by `new Error().stack` or `Error.captureStackTrace(obj)`). The default value is `10` but may be set to any valid JavaScript number. Changes will affect any stack trace captured *after* the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames. |
| `cause?` | `unknown` | |
| `details` | `{ cause?: unknown; client: string; code?: "version"; doc: string; status?: number; traceId?: string }` | read-only |
| `message` | `string` | |
| `name` | `"DocserverError"` | read-only |
| `stack?` | `string` | |
| `code` | `"version" \| undefined` | read-only |
| `status` | `number \| undefined` | read-only |
| `traceId` | `string \| undefined` | read-only |

### `DocserverError.captureStackTrace()`

```ts theme={null}
static captureStackTrace(targetObject: object, constructorOpt?: Function): void
```

Creates a `.stack` property on `targetObject`, which when accessed returns
a string representing the location in the code at which
`Error.captureStackTrace()` was called.

```js theme={null}
const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack;  // Similar to `new Error().stack`
```

The first line of the trace will be prefixed with
`${myObject.name}: ${myObject.message}`.

The optional `constructorOpt` argument accepts a function. If given, all frames
above `constructorOpt`, including `constructorOpt`, will be omitted from the
generated stack trace.

The `constructorOpt` argument is useful for hiding implementation
details of error generation from the user. For instance:

```js theme={null}
function a() {
  b();
}

function b() {
  c();
}

function c() {
  // Create an error without stack trace to avoid calculating the stack trace twice.
  const { stackTraceLimit } = Error;
  Error.stackTraceLimit = 0;
  const error = new Error();
  Error.stackTraceLimit = stackTraceLimit;

  // Capture the stack trace above function b
  Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
  throw error;
}

a();
```

### `DocserverError.prepareStackTrace()`

```ts theme={null}
static prepareStackTrace(err: Error, stackTraces: CallSite[]): any
```

See [https://v8.dev/docs/stack-trace-api#customizing-stack-traces](https://v8.dev/docs/stack-trace-api#customizing-stack-traces)

## `DocumentDefaults`

Extension (Word's "Set As Default", VBA `Font.SetAsTemplateDefault`): the
document's `w:docDefaults`, the bottom layer every style and table style
inherits. Reads are what a paragraph with no style properties shows.

Import from `@reductoai/docx/officejs`.

### DocumentDefaults properties

| Name | Type | Description |
| - | - | - |
| `font` | `Font` | read-only |
| `paragraphFormat` | `ParagraphFormat` | read-only |

## `DocumentLayout`

Explicit headless extension; geometry is intentionally not presented as an OfficeJS member.

Import from `@reductoai/docx/node`, `@reductoai/docx/officejs`.

### `DocumentLayout.getOverlaps()`

```ts theme={null}
getOverlaps(
  range: Chart | Shape | Range | Paragraph | Field,
  options?: LayoutOverlapOptions,
): Promise<RangeLayoutOverlap[]>
```

Find laid content intersecting a range or shape, excluding its own ink.
This is a geometry diagnostic, not a validity rule: callers choose which
kinds, intersection depths, and intentional overlaps are acceptable.
Shape and header/footer range queries also report header/footer ink,
flagged `inHeaderFooter`; a header range collides against every story
on the page, body text included.

### `DocumentLayout.getRects()`

```ts theme={null}
getRects(
  target: Section | Chart | Shape | Range | Paragraph | Table | TableCell | Field | TableRow,
): Promise<RangeLayoutRect[]>
```

Where a range's text, or a floating shape's or chart's frame, landed.
A shape or chart resolves to one rectangle per page (normally one);
a paragraph resolves to one rectangle per laid line (`basis: "line"`).
A blank paragraph reports its laid line box (zero width, real y and
height), so empty spacers are still addressable geometry. A Table,
TableRow, or TableCell resolves to its laid grid box per page
(`basis: "cellBox"`) — the box the borders paint on, not the text ink;
measure text via getRange("Whole"). A Section resolves to its per-page
text-area box (`basis: "textArea"`), whose bottom edge is the true
vertical budget. A paragraph that stops short of that edge with clean
properties usually carries a run-level page break — read
`Paragraph.hasPageBreak`, because page breaks never show in `text`.
A footnote-story range resolves on its reference's page (the note area);
endnote stories carry no laid provenance yet and refuse by name.

## `DocumentProperties`

Import from `@reductoai/docx/node`, `@reductoai/docx/officejs`.

### DocumentProperties properties

| Name | Type | Description |
| - | - | - |
| `customProperties` | `CustomPropertyCollection` | read-only |
| `applicationName` | `string` | read-only |
| `author` | `string` | `dc:creator` — the document's original author. |
| `category` | `string` | |
| `comments` | `string` | `dc:description` — the file-level Comments field, unrelated to review comments. |
| `company` | `string` | |
| `creationDate` | `Date \| undefined` | read-only Undefined when the document carries no `dcterms:created`, or an unparsable one. |
| `format` | `string` | `dc:format` — free text; an empty write removes it. |
| `keywords` | `string` | |
| `lastAuthor` | `string` | read-only `cp:lastModifiedBy` — written by the application that last saved the file. |
| `lastPrintDate` | `Date \| undefined` | `cp:lastPrinted` — when Word last printed the document. |
| `lastSaveTime` | `Date \| undefined` | `dcterms:modified` — when the file was last saved. Nothing stamps it on save in this build, so the value a caller writes is the value that ships. |
| `manager` | `string` | |
| `revisionNumber` | `string` | read-only `cp:revision` is a string in the OOXML core properties, and stays one here. |
| `security` | `number` | `DocSecurity` in docProps/app.xml; 0 (none) when the part or element is absent. |
| `subject` | `string` | |
| `template` | `string` | read-only |
| `title` | `string` | |

### `DocumentProperties.set()`

```ts theme={null}
set(properties: DocumentPropertiesUpdateData, options?: UpdateOptions): void
```

## `EditMemory`

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

### EditMemory properties

| Name | Type | Description |
| - | - | - |
| `painter` | `RunFormat \| undefined` | |
| `repeatable` | `EditorCommand[]` | read-only What Repeat runs, in order: a run of Backspace repeats as many presses. |

### `EditMemory.goBack()`

```ts theme={null}
goBack(): Position | undefined
```

The next older edit spot on each press, wrapping round after the oldest.

### `EditMemory.moved()`

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

### `EditMemory.ran()`

```ts theme={null}
ran(command: EditorCommand, after: Position | undefined, autoCorrected?: boolean): void
```

Word's Repeat takes the last action: the typing since a caret move or the last
word's space, a run of deletes, or a format. Anything else, Undo, Redo and an
AutoCorrect step leave nothing to repeat.

### `EditMemory.repeated()`

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

A Repeat stands alone: typing after it starts a new run.
