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

# Formats and styles

## `RangeFormat`

`Excel.RangeFormat`.

Import from `@reductoai/xlsx/officejs`.

### RangeFormat properties

| Name | Type | Description |
| - | - | - |
| `autoIndent` | `boolean \| null` | Excel's Add Indent: distributed text keeps its indent at both ends (`justifyLastLine`). |
| `borders` | `RangeBorderCollection` | read-only |
| `columnWidth` | `number \| null` | Points; null when the columns differ. |
| `fill` | `RangeFill` | read-only |
| `font` | `RangeFont` | read-only |
| `horizontalAlignment` | `string \| null` | |
| `indentLevel` | `number \| null` | |
| `protection` | `FormatProtection` | read-only |
| `readingOrder` | `string \| null` | |
| `rowHeight` | `number \| null` | Points; null when the rows differ. |
| `shrinkToFit` | `boolean \| null` | |
| `textOrientation` | `number \| null` | Degrees from -90 to 90; 255 is stacked text. |
| `useStandardHeight` | `boolean \| null` | True when every row has the sheet's standard height; null when they differ. |
| `useStandardWidth` | `boolean \| null` | True when every column has the sheet's standard width; null when they differ. |
| `verticalAlignment` | `string \| null` | |
| `wrapText` | `boolean \| null` | |

### `RangeFormat.adjustIndent()`

```ts theme={null}
adjustIndent(amount: number): void
```

Moves each cell's indent by `amount` characters, kept within 0 to 250.

### `RangeFormat.autofitColumns()`

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

Sizes each column to its widest displayed value, measured in each cell's own font as Excel does.

### `RangeFormat.autofitRows()`

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

Clears custom heights, so Excel sizes the rows to their content on open.

### `RangeFormat.set()`

```ts theme={null}
set(properties: RangeFormat | UpdateData<RangeFormat>, options?: UpdateOptions): void
```

Sets several properties at once; a navigation member takes a nested batch.

## `RangeFont`

`Excel.RangeFont`.

Import from `@reductoai/xlsx/officejs`.

### RangeFont properties

| Name | Type | Description |
| - | - | - |
| `bold` | `boolean \| null` | |
| `color` | `string \| null` | |
| `italic` | `boolean \| null` | |
| `name` | `string \| null` | |
| `size` | `number \| null` | |
| `strikethrough` | `boolean \| null` | |
| `subscript` | `boolean \| null` | |
| `superscript` | `boolean \| null` | |
| `tintAndShade` | `number \| null` | Lightens (to 1) or darkens (to -1) the font colour. |
| `underline` | `string \| null` | |

### `RangeFont.set()`

```ts theme={null}
set(properties: RangeFont | UpdateData<RangeFont>, options?: UpdateOptions): void
```

Sets several properties at once; a navigation member takes a nested batch.

## `RangeFill`

`Excel.RangeFill`: solid and pattern fills; gradients read only.

Import from `@reductoai/xlsx/officejs`.

### RangeFill properties

| Name | Type | Description |
| - | - | - |
| `color` | `string \| null` | `#RRGGBB`: the solid colour or the background behind a pattern; no fill reads as white. |
| `pattern` | `FillPattern \| null` | |
| `patternColor` | `string \| null` | `#RRGGBB` of the pattern's lines; automatic (black) when the fill has no pattern colour. |
| `patternTintAndShade` | `number \| null` | |
| `tintAndShade` | `number \| null` | |

### `RangeFill.clear()`

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

### `RangeFill.set()`

```ts theme={null}
set(properties: RangeFill | UpdateData<RangeFill>, options?: UpdateOptions): void
```

Sets several properties at once; a navigation member takes a nested batch.

## `RangeBorder`

`Excel.RangeBorder`.

Import from `@reductoai/xlsx/officejs`.

### RangeBorder properties

| Name | Type | Description |
| - | - | - |
| `sideIndex` | `BorderIndex` | read-only |
| `color` | `string \| null` | |
| `style` | `string \| null` | |
| `tintAndShade` | `number \| null` | Lightens (to 1) or darkens (to -1) the line colour; an edge with no line stays empty. |
| `weight` | `string \| null` | |

### `RangeBorder.set()`

```ts theme={null}
set(properties: RangeBorder | UpdateData<RangeBorder>, options?: UpdateOptions): void
```

Sets several properties at once; a navigation member takes a nested batch.

## `RangeBorderCollection`

`Excel.RangeBorderCollection`.

Import from `@reductoai/xlsx/officejs`.

### RangeBorderCollection properties

| Name | Type | Description |
| - | - | - |
| `count` | `number` | read-only |
| `items` | `RangeBorder[]` | read-only |
| `tintAndShade` | `number \| null` | The common tint of the edges with a line; null when they differ. |

### `RangeBorderCollection.getItem()`

```ts theme={null}
getItem(index: BorderIndex): RangeBorder
```

### `RangeBorderCollection.getItemAt()`

```ts theme={null}
getItemAt(index: number): RangeBorder
```

## `FormatProtection`

`Excel.FormatProtection`: what sheet protection does to the cells.

Import from `@reductoai/xlsx/officejs`.

### FormatProtection properties

| Name | Type | Description |
| - | - | - |
| `formulaHidden` | `boolean \| null` | A hidden formula does not show in the formula bar while the sheet is protected. |
| `locked` | `boolean \| null` | A locked cell cannot be changed while the sheet is protected; cells are locked by default. |

### `FormatProtection.set()`

```ts theme={null}
set(
  properties: FormatProtection | UpdateData<FormatProtection>,
  options?: UpdateOptions,
): void
```

Sets several properties at once.

## `Style`

`Excel.Style`.

Import from `@reductoai/xlsx/officejs`.

### Style properties

| Name | Type | Description |
| - | - | - |
| `autoIndent` | `boolean` | |
| `borders` | `RangeBorderCollection` | read-only EdgeTop, EdgeBottom, EdgeLeft and EdgeRight; a style has no inside lines. |
| `builtIn` | `boolean` | read-only |
| `fill` | `RangeFill` | read-only |
| `font` | `RangeFont` | read-only |
| `formulaHidden` | `boolean` | |
| `horizontalAlignment` | `string` | |
| `includeAlignment` | `boolean` | |
| `includeBorder` | `boolean` | |
| `includeFont` | `boolean` | |
| `includeNumber` | `boolean` | |
| `includePatterns` | `boolean` | |
| `includeProtection` | `boolean` | |
| `indentLevel` | `number` | |
| `locked` | `boolean` | |
| `name` | `string` | read-only |
| `numberFormat` | `string` | |
| `numberFormatLocal` | `string` | |
| `readingOrder` | `string` | |
| `shrinkToFit` | `boolean` | |
| `textOrientation` | `number` | |
| `verticalAlignment` | `string` | |
| `wrapText` | `boolean` | |

### `Style.delete()`

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

Cells of the style keep how they look and become Normal; Normal cannot be deleted.

### `Style.set()`

```ts theme={null}
set(properties: Style | UpdateData<Style>, options?: UpdateOptions): void
```

## `StyleCollection`

`Excel.StyleCollection`.

Import from `@reductoai/xlsx/officejs`.

### StyleCollection properties

| Name | Type | Description |
| - | - | - |
| `items` | `Style[]` | read-only |

### `StyleCollection.add()`

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

A new style with Normal's format; the name must be new.

### `StyleCollection.getCount()`

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

### `StyleCollection.getItem()`

```ts theme={null}
getItem(name: string): Style
```

### `StyleCollection.getItemAt()`

```ts theme={null}
getItemAt(index: number): Style
```

### `StyleCollection.getItemOrNullObject()`

```ts theme={null}
getItemOrNullObject(name: string): Style & { isNullObject: boolean }
```
