# PivotState (@salmonui/pivot-table)

> The PivotState interface of @salmonui/pivot-table: Snapshot of the controller store; every field keeps its identity until it changes.

Canonical: https://salmonui.dev/docs/reference/pivot-table/PivotState

```ts
import type { PivotState } from '@salmonui/pivot-table';
```

Entry index: https://salmonui.dev/docs/reference/pivot-table (Markdown with every symbol of the entry: https://salmonui.dev/docs/reference/pivot-table.md).

## Reference

Kind: interface

```ts
interface PivotState {
    readonly result: PivotResult | null;
    readonly model: PivotModel;
    readonly draft: PivotModel | null;
    readonly status: PivotComputeStatus;
    readonly error: Error | null;
    readonly fields: readonly PivotFieldInfo[];
    readonly selection: readonly string[];
    readonly dialog: PivotDialogState | null;
}
```

Snapshot of the controller store; every field keeps its identity until it changes.

Members (8):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `result` | `readonly result: PivotResult \| null;` |  |  |
| `model` | `readonly model: PivotModel;` |  |  |
| `draft` | `readonly draft: PivotModel \| null;` |  | Draft model of a field list with `deferUpdate`; null when nothing is pending. |
| `status` | `readonly status: PivotComputeStatus;` |  |  |
| `error` | `readonly error: Error \| null;` |  |  |
| `fields` | `readonly fields: readonly PivotFieldInfo[];` |  |  |
| `selection` | `readonly selection: readonly string[];` |  | Selected cells as `rowKey\|columnKey`. |
| `dialog` | `readonly dialog: PivotDialogState \| null;` |  | Open dialog of the pivot parts (field list popup, editors, drill through), or null. |
