> ## 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: Formatting and styles

## `Border`

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

| Name | Type | Description |
| - | - | - |
| `bottom?` | `BorderLine` | |
| `diagonal?` | `BorderLine` | |
| `diagonalDown` | `boolean` | |
| `diagonalUp` | `boolean` | |
| `left?` | `BorderLine` | |
| `right?` | `BorderLine` | |
| `top?` | `BorderLine` | |

## `BorderLine`

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

| Name | Type | Description |
| - | - | - |
| `color?` | `Color` | |
| `style` | `string` | |

## `BorderPen`

Import from `@reductoai/xlsx/editor`.

| Name | Type | Description |
| - | - | - |
| `color?` | `string` | |
| `line?` | `string` | |

## `CellFormat`

The active cell's format, which the Home tab shows.

Import from `@reductoai/xlsx/editor`.

| Name | Type | Description |
| - | - | - |
| `bold` | `boolean` | |
| `category` | `NumberCategory` | |
| `color` | `string` | `#RRGGBB`. |
| `fill` | `string \| null` | `#RRGGBB`; null is No Fill. |
| `font` | `string` | |
| `horizontal` | `HorizontalAlign` | |
| `indent` | `number` | |
| `italic` | `boolean` | |
| `merged` | `boolean` | The active cell is in a merged area: Merge & Center shows pressed. |
| `numberFormat` | `string` | |
| `orientation` | `number` | |
| `size` | `number` | |
| `strike` | `boolean` | |
| `underline` | `Underline` | |
| `vertical` | `VerticalAlign` | |
| `wrap` | `boolean` | |

## `CellFormatPatch`

What Format Cells changes; a field left out keeps each cell's own.

Import from `@reductoai/xlsx/editor`.

| Name | Type | Description |
| - | - | - |
| `border?` | `BorderPreset` | |
| `borderColor?` | `string` | |
| `fill?` | `string \| null` | `#RRGGBB`, or null for No Fill. |
| `font?` | `FontChange` | |
| `horizontal?` | `HorizontalAlign` | |
| `indent?` | `number` | |
| `numberFormat?` | `string` | |
| `orientation?` | `number` | Degrees from -90 to 90; 255 is vertical text. |
| `vertical?` | `VerticalAlign` | |
| `wrap?` | `boolean` | |

## `CellStyleCommand`

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

```ts theme={null}
type CellStyleCommand = { includes?: StyleCategory[]; name: string; type: "newCellStyle" } | { from: Workbook; replace?: boolean; type: "mergeStyles" }
```

## `Color`

SpreadsheetML `CT_Color`.

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

```ts theme={null}
type Color = SmlColor
```

## `DrawBordersCommand`

A border pen stroke on `area` (Draw Border, Draw Border Grid); `pen: null` erases.

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

| Name | Type | Description |
| - | - | - |
| `area` | `CellArea` | |
| `edges` | `PenEdges` | |
| `pen` | `BorderPen \| null` | |
| `type` | `"drawBorders"` | |

## `Dxf`

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

| Name | Type | Description |
| - | - | - |
| `bold?` | `boolean` | |
| `border?` | `DxfBorder` | A table style element's edges: `horizontal` and `vertical` are the lines inside its region. |
| `fillColor?` | `Color` | |
| `fontColor?` | `Color` | |
| `italic?` | `boolean` | |
| `numFmt?` | `string` | |
| `strike?` | `boolean` | |
| `underline?` | `boolean` | |
| `underlineStyle?` | `string` | |
| `vertAlign?` | `string` | |

## `DxfBorder`

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

```ts theme={null}
type DxfBorder = Partial<Record<"top" | "bottom" | "left" | "right" | "horizontal" | "vertical", BorderLine>>
```

## `FaceManifest`

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

```ts theme={null}
type FaceManifest = NonNullable<LayoutDocument["faceManifest"]>
```

## `Fill`

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

| Name | Type | Description |
| - | - | - |
| `bgColor?` | `Color` | |
| `fgColor?` | `Color` | |
| `gradientBottom?` | `number` | |
| `gradientDegree?` | `number` | |
| `gradientLeft?` | `number` | |
| `gradientRight?` | `number` | |
| `gradientStops` | `GradientStop[]` | |
| `gradientTop?` | `number` | |
| `gradientType?` | `string` | |
| `patternType?` | `string` | |

## `Font`

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

| Name | Type | Description |
| - | - | - |
| `bold` | `boolean` | |
| `color?` | `Color` | |
| `family?` | `number` | |
| `italic` | `boolean` | |
| `name?` | `string` | |
| `scheme?` | `string` | |
| `size?` | `number` | |
| `strike` | `boolean` | |
| `underline` | `boolean` | |
| `underlineStyle?` | `string` | |
| `vertAlign?` | `string` | |

## `FontChange`

A font change; colours are `#RRGGBB`.

Import from `@reductoai/xlsx/editor`.

| Name | Type | Description |
| - | - | - |
| `bold?` | `boolean` | |
| `color?` | `string` | |
| `italic?` | `boolean` | |
| `name?` | `string` | |
| `size?` | `number` | Points, 1..409. |
| `strike?` | `boolean` | |
| `underline?` | `Underline` | |

## `GradientStop`

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

| Name | Type | Description |
| - | - | - |
| `color` | `Color` | |
| `position` | `number` | |

## `HorizontalAlign`

Import from `@reductoai/xlsx/editor`.

```ts theme={null}
type HorizontalAlign = "General" | "Left" | "Center" | "Right" | "Justify" | "Fill" | "CenterAcrossSelection" | "Distributed"
```

## `NumberCategory`

Import from `@reductoai/xlsx/editor`.

```ts theme={null}
type NumberCategory = typeof NUMBER_FORMATS[number]["category"] | "Custom"
```

## `NumberFormat`

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

| Name | Type | Description |
| - | - | - |
| `formatCode` | `string` | |
| `id` | `number` | |

## `Styles`

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

| Name | Type | Description |
| - | - | - |
| `borders` | `Border[]` | |
| `cellXfs` | `CellFormat[]` | |
| `defaultFont` | `string` | |
| `defaultFontSize` | `number` | |
| `fills` | `Fill[]` | |
| `fonts` | `Font[]` | |
| `numFmts` | `NumberFormat[]` | |

## `TextColumnFormat`

Text to Columns' Column data format: as typed, as text, or not imported.

Import from `@reductoai/xlsx/editor`.

```ts theme={null}
type TextColumnFormat = "general" | "text" | "skip"
```

## `TextRun`

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

| Name | Type | Description |
| - | - | - |
| `baseline?` | `number` | |
| `bold` | `boolean` | |
| `color?` | `Color` | |
| `family?` | `number` | |
| `fontName?` | `string` | |
| `italic` | `boolean` | |
| `kern?` | `number` | |
| `scheme?` | `string` | |
| `size?` | `number` | |
| `strike` | `boolean` | |
| `text` | `string` | |
| `underline` | `boolean` | |
| `underlineStyle?` | `string` | |
| `vertAlign?` | `string` | |

## `Theme`

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

| Name | Type | Description |
| - | - | - |
| `colors` | `string[]` | |
| `majorFont?` | `string` | |
| `minorFont?` | `string` | |

## `ThemeCommand`

Import from `@reductoai/xlsx/editor`.

```ts theme={null}
type ThemeCommand = { theme: OfficeTheme; type: "theme" } | { scheme: ThemeColorScheme; type: "themeColors" } | { scheme: ThemeFontScheme; type: "themeFonts" }
```

## `Underline`

Import from `@reductoai/xlsx/editor`.

```ts theme={null}
type Underline = "None" | "Single" | "Double"
```

## `VerticalAlign`

Import from `@reductoai/xlsx/editor`.

```ts theme={null}
type VerticalAlign = "Top" | "Center" | "Bottom" | "Justify" | "Distributed"
```
