> ## 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: Conditional formats

## `CfDatePeriod`

Import from `@reductoai/xlsx/editor`.

```ts theme={null}
type CfDatePeriod = "Yesterday" | "Today" | "Tomorrow" | "LastSevenDays" | "LastWeek" | "ThisWeek" | "NextWeek" | "LastMonth" | "ThisMonth" | "NextMonth"
```

## `CfFormula`

A rule formula anchored at a one-based cell, read at any other one-based cell.

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

```ts theme={null}
type CfFormula = (text: string, row: number, col: number) => (row: number, col: number) => Scalar
```

## `CfGuess`

What the quick rule dialogs open with, read off the selection.

Import from `@reductoai/xlsx/editor`.

| Name | Type | Description |
| - | - | - |
| `active` | `string` | The active cell as the formula bar shows it. |
| `max` | `number \| null` | |
| `mean` | `number \| null` | Average, smallest and largest number in the selection; null without numbers. |
| `min` | `number \| null` | |

## `CfLook`

The colours and font a rule paints, for the Format column's sample.

Import from `@reductoai/xlsx/editor`.

| Name | Type | Description |
| - | - | - |
| `bold?` | `boolean` | |
| `border?` | `string` | |
| `fill?` | `string` | |
| `font?` | `string` | |
| `italic?` | `boolean` | |

## `CfOperator`

Import from `@reductoai/xlsx/editor`.

```ts theme={null}
type CfOperator = "Between" | "NotBetween" | "EqualTo" | "NotEqualTo" | "GreaterThan" | "LessThan" | "GreaterThanOrEqual" | "LessThanOrEqual"
```

## `CfRuleRow`

One row of Manage Rules; `index` is the rule's place in the sheet's order, 0 applied first.

Import from `@reductoai/xlsx/editor`.

| Name | Type | Description |
| - | - | - |
| `appliesTo` | `string` | Absolute addresses after "=", as Applies to shows them. |
| `description` | `string` | |
| `graphic` | `boolean` | A scale, a bar or an icon set ignores Stop If True; Excel greys its box. |
| `index` | `number` | |
| `look` | `CfLook \| null` | |
| `spec` | `CfRuleSpec \| null` | The rule as New Rule edits it; null for a scale, a bar or an icon set. |
| `stopIfTrue` | `boolean` | |
| `style` | `CfStyle \| null` | The preset whose look the rule has; null for any other format. |

## `CfRuleSpec`

A rule from Conditional Formatting's galleries and quick dialogs; bounds are typed as in Excel's boxes.

Import from `@reductoai/xlsx/editor`.

```ts theme={null}
type CfRuleSpec = { formula1: string; formula2?: string; kind: "cellValue"; operator: CfOperator; style: CfStyle } | { kind: "text"; operator?: CfTextOperator; style: CfStyle; text: string } | { formula: string; kind: "formula"; style: CfStyle } | { criterion: "Blanks" | "NonBlanks" | "Errors" | "NonErrors"; kind: "cells"; style: CfStyle } | { kind: "date"; period: CfDatePeriod; style: CfStyle } | { kind: "duplicates"; style: CfStyle; unique?: boolean } | { bottom?: boolean; kind: "topBottom"; percent?: boolean; rank: number; style: CfStyle } | { below?: boolean; kind: "average"; style: CfStyle } | { color: string; gradient: boolean; kind: "dataBar" } | { colors: string[]; kind: "colorScale" } | { kind: "iconSet"; set: string }
```

## `CfScope`

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

```ts theme={null}
type CfScope = "selection" | "sheet"
```

## `CfStyle`

The "with" pick of Excel's quick rule dialogs.

Import from `@reductoai/xlsx/editor`.

```ts theme={null}
type CfStyle = "lightRedDarkRed" | "yellowDarkYellow" | "greenDarkGreen" | "lightRed" | "redText" | "redBorder"
```

## `CfTextOperator`

Import from `@reductoai/xlsx/editor`.

```ts theme={null}
type CfTextOperator = "Contains" | "NotContains" | "BeginsWith" | "EndsWith"
```

## `ErrorRule`

Import from `@reductoai/xlsx/view`.

```ts theme={null}
type ErrorRule = typeof ERROR_RULES[number]
```

## `RuleDialog`

Quick dialogs the Highlight Cells and Top/Bottom submenus open, as Excel names them.

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

```ts theme={null}
type RuleDialog = "GreaterThan" | "LessThan" | "Between" | "EqualTo" | "Text" | "Date" | "Duplicates" | "Top10" | "Top10Percent" | "Bottom10" | "Bottom10Percent" | "AboveAverage" | "BelowAverage"
```
