> ## 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: Lists

## `ListFormat`

The numbering of the paragraphs a Range covers; minted by `Range.listFormat`.

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

### ListFormat properties

| Name | Type | Description |
| - | - | - |
| `isSingleList` | `boolean` | read-only Every covered paragraph carries numbering AND they all cite ONE list. |
| `list` | `List` | read-only The list of the FIRST list paragraph; a range with none refuses ItemNotFound-shaped. |
| `listLevelNumber` | `number` | 1-BASED level of the FIRST list paragraph (VBA's counting): OOXML `w:ilvl` plus one, so level 1 is ilvl 0. Reads 0 when the range holds no list paragraph — 0 is not a level, so it is an unambiguous "no numbering here". The WRITE moves EVERY list paragraph of the range to that level. |
| `listString` | `string` | read-only The painted marker of the FIRST list paragraph ("3.1."); "" when there is none. |
| `listTemplate` | `ListTemplate` | read-only The numbering definition of the FIRST list paragraph: its levels, linked styles and name. |
| `listType` | `ListTypeValue` | read-only Word.ListType, derived from the levels the first paragraph's list occupies. |
| `listValue` | `number` | read-only The FIRST list paragraph's ordinal among its siblings at its own level, counting from 1; 0 when the range holds no list paragraph. Sibling counting restarts under each lower-level ancestor, so it follows the marker for a list that starts at 1 and diverges from a level whose `w:start` or `w:startOverride` says otherwise. |

### `ListFormat.applyBulletDefault()`

```ts theme={null}
applyBulletDefault(_defaultListBehavior?: string): void
```

Put every covered paragraph on a FRESH bulleted list at level 1.

### `ListFormat.applyNumberDefault()`

```ts theme={null}
applyNumberDefault(_defaultListBehavior?: string): void
```

Put every covered paragraph on a FRESH decimal list at level 1.

### `ListFormat.applyOutlineNumberDefault()`

```ts theme={null}
applyOutlineNumberDefault(_defaultListBehavior?: string): void
```

Put every covered paragraph on a FRESH multi-level decimal outline —
"1.", "1.1.", "1.1.1." through all nine levels — all at level 1.
Use `listIndent` to move an item down the outline.

### `ListFormat.countNumberedItems()`

```ts theme={null}
countNumberedItems(options?: CountNumberedItemsOptions): ClientResult<number>
```

List paragraphs of the range; `options.level` narrows to ONE 1-based level.

### `ListFormat.listIndent()`

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

Move every list paragraph of the range one level DOWN, clamped at level 9.

### `ListFormat.listOutdent()`

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

Move every list paragraph of the range one level UP, clamped at level 1.

### `ListFormat.removeNumbers()`

```ts theme={null}
removeNumbers(_numberType?: string): void
```

Clear `w:numPr` on every covered paragraph, keeping its text.

### `ListFormat.set()`

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

**Not implemented.** These Office.js members throw: `isSingleListTemplate`, `applyListTemplateWithLevel`, `canContinuePreviousList`, `convertNumbersToText`.

## `ListItem`

OfficeJS-shaped list metadata for a paragraph.

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

### ListItem properties

| Name | Type | Description |
| - | - | - |
| `level` | `number` | |
| `listString` | `string` | read-only The evaluated marker label, from the layout numbering engine. Counters are shared through the abstract definition, so the walk advances state for every earlier list paragraph regardless of which numId it cites. |
| `siblingIndex` | `number` | read-only |

### `ListItem.getAncestor()`

```ts theme={null}
getAncestor(parentOnly?: boolean): Paragraph
```

The nearest lower-level item, or the exact parent when parentOnly is true.

### `ListItem.getAncestorOrNullObject()`

```ts theme={null}
getAncestorOrNullObject(
  parentOnly?: boolean,
): Paragraph & { isNullObject: true } | Paragraph & { isNullObject: false }
```

### `ListItem.getDescendants()`

```ts theme={null}
getDescendants(directChildrenOnly?: boolean): ParagraphCollection<Paragraph>
```

Descendant items in document order, optionally restricted to direct children.

### `ListItem.set()`

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

## `ListLevel`

One level of a list's numbering definition.

Import from `@reductoai/docx/officejs`.

### ListLevel properties

| Name | Type | Description |
| - | - | - |
| `alignment` | `string` | |
| `linkedStyle` | `string \| null` | Name of the paragraph style tied to this level; null when none is. "" or null unlinks. |
| `numberFormat` | `string` | The marker pattern, `w:lvlText`: "%1.%2." numbers, or the bullet character. |
| `numberPosition` | `number` | Where the marker starts, in points from the margin. |
| `numberStyle` | `string` | |
| `resetOnHigher` | `number` | The 1-based level after which this one restarts; 0 never restarts. |
| `startAt` | `number` | |
| `tabPosition` | `number` | The marker's tab stop in points; 499999.9375 (wdUndefined) when the level sets none. |
| `textPosition` | `number` | Where the text starts, in points: the level's left indent. |
| `trailingCharacter` | `string` | |

### `ListLevel.set()`

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

**Not implemented.** These Office.js members throw: `font`.

## `ListLevelCollection`

Word.ListLevelCollection: always Word's nine levels.

Import from `@reductoai/docx/officejs`.

### ListLevelCollection properties

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

### `ListLevelCollection.at()`

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

### `ListLevelCollection.getFirst()`

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

### `ListLevelCollection.getFirstOrNullObject()`

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

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

### `ListLevelCollection.getItem()`

```ts theme={null}
getItem(index: number): ListLevel
```

OfficeJS spelling of at().

### `ListLevelCollection.getLast()`

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

### `ListLevelCollection.getLastOrNullObject()`

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

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

## `ListTemplate`

The numbering definition of one list: its nine levels, name and outline flag.

Import from `@reductoai/docx/officejs`.

### ListTemplate properties

| Name | Type | Description |
| - | - | - |
| `listLevels` | `ListLevelCollection` | read-only |
| `name` | `string` | `w:abstractNum/w:name`; "" when the definition has none. |
| `outlineNumbered` | `boolean` | |

### `ListTemplate.set()`

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