# @salmonui/data-grid/engine API reference

> 444 exported symbols of @salmonui/data-grid/engine: 53 functions, 173 interfaces, 207 types and 11 constants.

Canonical: https://salmonui.dev/docs/reference/data-grid/engine

```ts
import { … } from '@salmonui/data-grid/engine';
```

## Functions

### clampColumnWidth

Kind: function

Page: https://salmonui.dev/docs/reference/data-grid/engine/clampColumnWidth

```ts
function clampColumnWidth<Row>(column: CompiledColumn<Row>, width: number): number;
```

Clamps a px width to the column's `minWidth`/`maxWidth` (and at least 1px).

### columnZone

Kind: function

Page: https://salmonui.dev/docs/reference/data-grid/engine/columnZone-function

```ts
function columnZone<Row>(columns: ColumnSnapshot<Row>, columnId: ColumnId): ColumnZone;
```

Current freeze zone of a visible leaf in a column snapshot (`center` for unknown or hidden ids).

### compilePattern

Kind: function

Page: https://salmonui.dev/docs/reference/data-grid/engine/compilePattern

```ts
function compilePattern(pattern: string, operator: 'like' | 'wildcard'): RegExp;
```

Compiles `like` (`%` / `*` = any sequence) or `wildcard` (`*` = any sequence, `?` = one character) into an anchored RegExp.

### computeRange

Kind: function

Page: https://salmonui.dev/docs/reference/data-grid/engine/computeRange

```ts
function computeRange(metrics: Metrics, offset: number, extent: number, overscan: number): VirtualRange;
```

Visible range for a scroll offset and viewport extent, widened by
`overscan` items on each side. Works for rows and columns.

### createAggregatesModule

Kind: function

Page: https://salmonui.dev/docs/reference/data-grid/engine/createAggregatesModule

```ts
function createAggregatesModule<Row>(): AggregatesModule<Row>;
```

Creates the `aggregates` module. Options come from
`options.aggregates` (`AggregatesOptions`); the initial descriptors from
`options.defaultQuery.aggregates`.

### createColumnMetrics

Kind: function

Page: https://salmonui.dev/docs/reference/data-grid/engine/createColumnMetrics

```ts
function createColumnMetrics(widths: ArrayLike<number>): ColumnMetrics;
```

### createDataGridApi

Kind: function

Page: https://salmonui.dev/docs/reference/data-grid/engine/createDataGridApi

```ts
function createDataGridApi<Row>(engine: DataGridEngine<Row>): DataGridApi<Row>;
```

### createDataGridEngine

Kind: function

Page: https://salmonui.dev/docs/reference/data-grid/engine/createDataGridEngine

```ts
function createDataGridEngine<Row, const Modules extends readonly DataGridModule<Row>[] = readonly [
]>(options: DataGridOptions<Row> & {
    readonly modules?: Modules;
}): DataGridEngineWithModules<Row, Modules>;
```

Creates a framework-agnostic DataGrid engine. Features are modules; without
modules the engine compiles columns, holds rows, and runs an empty pipeline.

### createDataGridQuery

Kind: function

Page: https://salmonui.dev/docs/reference/data-grid/engine/createDataGridQuery

```ts
function createDataGridQuery(init?: DataGridQueryInit | null): DataQuery;
```

Builds a complete, deeply frozen `DataQuery` from a partial one.

### createFilterModule

Kind: function

Page: https://salmonui.dev/docs/reference/data-grid/engine/createFilterModule

```ts
function createFilterModule<Row>(config?: FilterModuleConfig<Row>): FilterModule<Row>;
```

Creates the `filter` module. Options are read from `options.filter`
(`FilterOptions`); initial filters from `options.defaultQuery.filters`.
Create one module instance per engine (custom operators are per instance).

### createFixedRowMetrics

Kind: function

Page: https://salmonui.dev/docs/reference/data-grid/engine/createFixedRowMetrics

```ts
function createFixedRowMetrics(count: number, rowHeight: number): RowMetrics;
```

O(1) metrics for the fixed row height fast path.

### createFocusModule

Kind: function

Page: https://salmonui.dev/docs/reference/data-grid/engine/createFocusModule

```ts
function createFocusModule<Row>(): FocusModule<Row>;
```

Creates the `focus` module. Options are read from `options.focus`
(`FocusOptions`); the initial direction is the grid `direction` option.

### createGroupingModule

Kind: function

Page: https://salmonui.dev/docs/reference/data-grid/engine/createGroupingModule

```ts
function createGroupingModule<Row>(): GroupingModule<Row>;
```

Creates the `grouping` module. Options come from
`options.grouping` (`GroupingOptions`); the initial grouping from
`options.defaultQuery.grouping`. Register `createSortModule()` too so the
grouped order comes from the shared sort keys; without it the group stage
sorts by the group keys itself.

### createKeymap

Kind: function

Page: https://salmonui.dev/docs/reference/data-grid/engine/createKeymap

```ts
function createKeymap(options?: KeymapOptions): Keymap;
```

Compiles the binding table for one platform. User bindings replace the
combos of their command; a user combo that a built-in binding also uses in
the same context logs a development warning and wins (the built-in loses
that combo in that context).

### createLocalDataSource

Kind: function

Page: https://salmonui.dev/docs/reference/data-grid/engine/createLocalDataSource

```ts
function createLocalDataSource<Row>(rows?: readonly Row[], options?: LocalDataSourceOptions<Row>): LocalDataSource<Row>;
```

In-memory data source (`mode: 'local'`). Rows are held by reference and the
array is treated as immutable: every change produces a new array and one
event. The engine runs every pipeline stage locally.

### createPagingModule

Kind: function

Page: https://salmonui.dev/docs/reference/data-grid/engine/createPagingModule

```ts
function createPagingModule<Row>(): PagingModule<Row>;
```

Creates the `paging` module. Options are read from `options.paging`
(`PagingOptions`); `options.defaultQuery.paging` sets the initial page.

### createRowModel

Kind: function

Page: https://salmonui.dev/docs/reference/data-grid/engine/createRowModel

```ts
function createRowModel<Row>(input: RowModelSnapshot<Row>, order: Int32Array): RowModelSnapshot<Row>;
```

Helper for stage authors: a model over the same source with a new visible order (source indices).

### createScrollMapping

Kind: function

Page: https://salmonui.dev/docs/reference/data-grid/engine/createScrollMapping

```ts
function createScrollMapping(totalHeight: number, viewportHeight: number, maxScrollHeight?: number): ScrollMapping;
```

### createSearchModule

Kind: function

Page: https://salmonui.dev/docs/reference/data-grid/engine/createSearchModule

```ts
function createSearchModule<Row>(): SearchModule<Row>;
```

Creates the `search` module. Options are read from `options.search`
(`SearchOptions`); `options.defaultQuery.search` sets the initial search.

### createSelectionApi

Kind: function

Page: https://salmonui.dev/docs/reference/data-grid/engine/createSelectionApi

```ts
function createSelectionApi<Row>(engine: DataGridEngine<Row>): SelectionApi<Row>;
```

Selection methods over an engine with the `selection` module (spread into the DataGrid API).

### createSelectionModule

Kind: function

Page: https://salmonui.dev/docs/reference/data-grid/engine/createSelectionModule

```ts
function createSelectionModule<Row>(): SelectionModule<Row>;
```

Creates the `selection` module. Options are read from `options.selection`
(`SelectionOptions`).

### createSortModule

Kind: function

Page: https://salmonui.dev/docs/reference/data-grid/engine/createSortModule

```ts
function createSortModule<Row>(): SortModule<Row>;
```

Creates the `sort` module. Options are read from `options.sort`
(`SortOptions`); the initial sort comes from `options.defaultQuery.sorting`.

### createVariableRowMetrics

Kind: function

Page: https://salmonui.dev/docs/reference/data-grid/engine/createVariableRowMetrics

```ts
function createVariableRowMetrics(count: number, heightAt: (index: number) => number): VariableRowMetrics;
```

Builds variable row metrics in O(n) from a height function.

### dataRowCount

Kind: function

Page: https://salmonui.dev/docs/reference/data-grid/engine/dataRowCount

```ts
function dataRowCount<Row>(model: RowModelSnapshot<Row>): number;
```

Number of data rows a model covers (excludes synthetic rows of a view).

### declaredZone

Kind: function

Page: https://salmonui.dev/docs/reference/data-grid/engine/declaredZone

```ts
function declaredZone<Row>(column: CompiledColumn<Row>, state: Pick<ColumnsState, 'freeze'>): ColumnZone;
```

Freeze zone of a column from its definition and the runtime overrides (count shorthand excluded).

### defineDataGridModule

Kind: function

Page: https://salmonui.dev/docs/reference/data-grid/engine/defineDataGridModule

```ts
function defineDataGridModule<Row, State, Command extends DataGridCommand, const Name extends string, Methods extends ModuleMethods<Row> = {}>(module: DataGridModule<Row, State, Command, Name, Methods>): DataGridModule<Row, State, Command, Name, Methods>;
```

Identity helper that keeps the module name, command union, and methods as literal types for the façade.

### deserializeDataGridQuery

Kind: function

Page: https://salmonui.dev/docs/reference/data-grid/engine/deserializeDataGridQuery

```ts
function deserializeDataGridQuery(text: string): DataQuery;
```

Inverse of `serializeDataGridQuery`. Throws on malformed input.

### effectiveSortKeys

Kind: function

Page: https://salmonui.dev/docs/reference/data-grid/engine/effectiveSortKeys

```ts
function effectiveSortKeys<Row>(query: DataQuery, columns: ColumnSnapshot<Row>): SortKey<Row>[];
```

Effective sort keys: grouped columns first (direction from the
sort list, else the group descriptor, else ascending), then the remaining
sort descriptors. Unknown columns are ignored.

### filtersNarrow

Kind: function

Page: https://salmonui.dev/docs/reference/data-grid/engine/filtersNarrow

```ts
function filtersNarrow<Row>(prev: readonly FilterEntry[], next: readonly FilterEntry[], state: FilterState, columns?: ColumnSnapshot<Row>): boolean;
```

True when every row passing `next` also passes `prev`, so `next` can run over the previous result.

### findColumn

Kind: function

Page: https://salmonui.dev/docs/reference/data-grid/engine/findColumn

```ts
function findColumn<Row>(engine: DataGridEngine<Row>, fieldOrId: string): CompiledColumn<Row> | undefined;
```

Leaf column by column id, else the first leaf with that `field`.

### fitColumnWidths

Kind: function

Page: https://salmonui.dev/docs/reference/data-grid/engine/fitColumnWidths

```ts
function fitColumnWidths(columns: readonly FitColumn[], target: number): number[] | null;
```

Expands column widths proportionally so that their sum reaches `target`.
Columns are never shrunk: when
the widths already reach `target` the input widths are returned unchanged
and the grid scrolls horizontally. Flexible columns grow in proportion to
their width, capped at `max`; the result is whole px and sums to `target`
unless every flexible column is capped. Returns `null` when nothing changes.

### getColumnFilters

Kind: function

Page: https://salmonui.dev/docs/reference/data-grid/engine/getColumnFilters

```ts
function getColumnFilters(filters: readonly FilterEntry[], columnId: ColumnId): readonly FilterDescriptor[];
```

Top-level conditions on one column (filter bar / menu state for renderers).

### getSortInfo

Kind: function

Page: https://salmonui.dev/docs/reference/data-grid/engine/getSortInfo

```ts
function getSortInfo(query: DataQuery, columnId: ColumnId): {
    readonly direction: 'asc' | 'desc';
    readonly priority: number;
} | null;
```

Per-column header state for renderers: direction and 1-based priority, or null.

### getSourceIndex

Kind: function

Page: https://salmonui.dev/docs/reference/data-grid/engine/getSourceIndex

```ts
function getSourceIndex<Row>(model: RowModelSnapshot<Row>, visibleIndex: number): number;
```

Source index of the row at a visible index, or -1 (also for synthetic rows such as group captions).

### groupTargetKey

Kind: function

Page: https://salmonui.dev/docs/reference/data-grid/engine/groupTargetKey

```ts
function groupTargetKey(target: GroupTarget): string | null;
```

Normalizes a group target to its path key.

### isColumnVisible

Kind: function

Page: https://salmonui.dev/docs/reference/data-grid/engine/isColumnVisible

```ts
function isColumnVisible<Row>(column: CompiledColumn<Row>, state: ColumnsState): boolean;
```

### isJsonValue

Kind: function

Page: https://salmonui.dev/docs/reference/data-grid/engine/isJsonValue

```ts
function isJsonValue(value: unknown): value is Json;
```

True when `value` survives a JSON round trip unchanged: null, booleans,
finite numbers, strings, arrays, and plain objects of those. `undefined` is
allowed only as an object property value (it is dropped by JSON).

### keyComboFromEvent

Kind: function

Page: https://salmonui.dev/docs/reference/data-grid/engine/keyComboFromEvent

```ts
function keyComboFromEvent(event: KeyEventLike): string;
```

Canonical combo of a key event. Letters are read from `code` when Alt is
held (macOS Option produces composed characters: Alt+J is `∆`) and from
`key` otherwise, so Ctrl+A follows the keyboard layout.

### normalizeFilterOperator

Kind: function

Page: https://salmonui.dev/docs/reference/data-grid/engine/normalizeFilterOperator

```ts
function normalizeFilterOperator(name: string): FilterOperator | null;
```

Canonical built-in operator for a name (case-insensitive).

### normalizeKeyCombo

Kind: function

Page: https://salmonui.dev/docs/reference/data-grid/engine/normalizeKeyCombo

```ts
function normalizeKeyCombo(combo: string, platform?: KeyPlatform): string;
```

Canonical combo string: modifiers in `Ctrl+Meta+Alt+Shift` order, then the
key. `Mod` resolves to `Meta` on macOS and `Ctrl` elsewhere; `Cmd`/`Command`
mean `Meta`, `Control` means `Ctrl`, `Option` means `Alt`.

### orderLeaves

Kind: function

Page: https://salmonui.dev/docs/reference/data-grid/engine/orderLeaves

```ts
function orderLeaves<Row>(leaves: readonly CompiledColumn<Row>[], order: readonly ColumnId[] | null): CompiledColumn<Row>[];
```

Leaves in runtime order: the explicit order first, then the remaining leaves in definition order.

### orderModules

Kind: function

Page: https://salmonui.dev/docs/reference/data-grid/engine/orderModules

```ts
function orderModules<M extends {
    readonly name: string;
    readonly dependencies?: readonly string[];
}>(modules: readonly M[]): M[];
```

Dependency order, then registration order. Throws on duplicates, missing dependencies, and cycles.

### previewColumnsCommand

Kind: function

Page: https://salmonui.dev/docs/reference/data-grid/engine/previewColumnsCommand

```ts
function previewColumnsCommand<Row>(columns: ColumnSnapshot<Row>, state: ColumnsState, command: ColumnsCommand): ColumnsState | null;
```

Pure dry run of a `columns.*` command: the state it would produce, or null
when it would be rejected. Renderers use it to report proposed values
before the engine commits (controlled `columnVisibility` and friends).

### resolveColumnKeys

Kind: function

Page: https://salmonui.dev/docs/reference/data-grid/engine/resolveColumnKeys

```ts
function resolveColumnKeys<Row>(columns: ColumnSnapshot<Row>, keys: readonly string[], by: ColumnKeyKind): {
    ids: ColumnId[];
    missing: string[];
};
```

Resolves column keys (by id, field, or header text) to leaf column ids.

### resolveColumnWidth

Kind: function

Page: https://salmonui.dev/docs/reference/data-grid/engine/resolveColumnWidth

```ts
function resolveColumnWidth(width: ColumnWidthSpec, containerWidth?: number): number | null;
```

Resolves a column width to pixels. Percent widths need the container width.
Returns null for `auto` (measured by the renderer) or when a percent width
has no container width yet.

### rowIdFromKey

Kind: function

Page: https://salmonui.dev/docs/reference/data-grid/engine/rowIdFromKey

```ts
function rowIdFromKey<Row>(key: string | readonly string[] | ((row: Row) => RowId | number)): (row: Row) => RowId;
```

Builds a `getRowId` from a primary key: a field name, several field names
(joined with `\u001f`), or a function. The React `DataGrid` uses it for `primaryKey` columns.

### sameRange

Kind: function

Page: https://salmonui.dev/docs/reference/data-grid/engine/sameRange

```ts
function sameRange(a: VirtualRange, b: VirtualRange): boolean;
```

### searchColumns

Kind: function

Page: https://salmonui.dev/docs/reference/data-grid/engine/searchColumns

```ts
function searchColumns<Row>(columnIds: readonly ColumnId[] | 'all', columns: ColumnSnapshot<Row>): CompiledColumn<Row>[];
```

Columns a search descriptor reads, in leaf order.

### searchRowOrder

Kind: function

Page: https://salmonui.dev/docs/reference/data-grid/engine/searchRowOrder

```ts
function searchRowOrder<Row>(rows: readonly Row[], base: Int32Array | null, d: SearchDescriptor, columns: ColumnSnapshot<Row>): Int32Array;
```

Rows of `base` (null = identity over `rows`) matching the search in any column.

### serializeDataGridQuery

Kind: function

Page: https://salmonui.dev/docs/reference/data-grid/engine/serializeDataGridQuery

```ts
function serializeDataGridQuery(query: DataQuery): string;
```

Deterministic serialization of a query: sorted object keys, array order
preserved, local-only `custom` aggregate functions dropped. Equal queries
produce equal strings, so the result is usable as a cache key.

### shallowEqual

Kind: function

Page: https://salmonui.dev/docs/reference/data-grid/engine/shallowEqual

```ts
function shallowEqual<T>(a: T, b: T): boolean;
```

Shallow equality for selector results: `Object.is`, or same keys/items with `Object.is` values.

### sortRowOrder

Kind: function

Page: https://salmonui.dev/docs/reference/data-grid/engine/sortRowOrder

```ts
function sortRowOrder<Row>(rows: readonly Row[], order: Int32Array | null, keys: readonly SortKey<Row>[], locale: string, warm?: readonly CompiledColumn<Row>[]): Int32Array;
```

Stable multi-key sort of `order` (source indexes; null = identity over
`rows`). Returns a new array; the input is never written.

### visibleColumnIndex

Kind: function

Page: https://salmonui.dev/docs/reference/data-grid/engine/visibleColumnIndex

```ts
function visibleColumnIndex<Row>(columns: ColumnSnapshot<Row>, columnId: ColumnId): number;
```

Display position of a column among the visible leaves (left zone, center, right zone), or -1.

## Interfaces

### AbortSignalLike

Kind: interface

Page: https://salmonui.dev/docs/reference/data-grid/engine/AbortSignalLike

```ts
interface AbortSignalLike {
    readonly aborted: boolean;
    readonly reason?: unknown;
    addEventListener(type: 'abort', listener: () => void): void;
    removeEventListener(type: 'abort', listener: () => void): void;
}
```

Minimal structural view of an `AbortSignal`.

- `@salmonui`

/core neutral subpaths compile
without the DOM lib, so it cannot name the platform type; at runtime the engine passes a
real `AbortSignal` whenever the platform provides `AbortController`.

Members (4):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `aborted` | `readonly aborted: boolean;` |  |  |
| `reason` | `readonly reason?: unknown;` | optional |  |
| `addEventListener` | `addEventListener(type: 'abort', listener: () => void): void;` |  |  |
| `removeEventListener` | `removeEventListener(type: 'abort', listener: () => void): void;` |  |  |

### AggregateDescriptor

Kind: interface

Page: https://salmonui.dev/docs/reference/data-grid/engine/AggregateDescriptor

```ts
interface AggregateDescriptor {
    readonly columnId: ColumnId;
    readonly type: AggregateType;
    readonly custom?: {
        custom(rows: readonly unknown[], column: unknown): unknown;
    }['custom'];
    readonly placement: readonly ('footer' | 'groupFooter' | 'groupCaption')[];
    readonly format?: string;
}
```

Members (5):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `columnId` | `readonly columnId: ColumnId;` |  |  |
| `type` | `readonly type: AggregateType;` |  |  |
| `custom` | `readonly custom?: {     custom(rows: readonly unknown[], column: unknown): unknown; }['custom'];` | optional | Local only; never serialized. The Data Grid passes its compiled column. |
| `placement` | `readonly placement: readonly ('footer' \| 'groupFooter' \| 'groupCaption')[];` |  |  |
| `format` | `readonly format?: string;` | optional |  |

### AggregateModelSnapshot

Kind: interface

Page: https://salmonui.dev/docs/reference/data-grid/engine/AggregateModelSnapshot

```ts
interface AggregateModelSnapshot {
    readonly scope: 'page' | 'all';
    readonly read?: (model: RowModelSnapshot<unknown>, g: number) => AggregateValues | null;
    range?(result: AggregateModelSnapshot, owner: object, slot: number, a: number, b: number): AggregateValues;
}
```

Opaque aggregate results carried by the row model (see `./index.js` aggregates).

Members (1):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `scope` | `readonly scope: 'page' \| 'all';` |  |  |

### AggregatesOptions

Kind: interface

Page: https://salmonui.dev/docs/reference/data-grid/engine/AggregatesOptions

```ts
interface AggregatesOptions {
    readonly scope?: AggregateScope;
    readonly custom?: Readonly<Record<string, CustomAggregate>> | ((customId: string) => CustomAggregate | undefined);
}
```

Members (2):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `scope` | `readonly scope?: AggregateScope;` | optional | `page` (default): with paging, footer and group aggregates cover the rows of the current page. `all` (`disablePageWiseAggregates`): they cover every row of the query. |
| `custom` | `readonly custom?: Readonly<Record<string, CustomAggregate>> \| ((customId: string) => CustomAggregate \| undefined);` | optional | Custom aggregates referenced by `customId` in commands (functions are not serializable). |

### AggregatesState

Kind: interface

Page: https://salmonui.dev/docs/reference/data-grid/engine/AggregatesState

```ts
interface AggregatesState {
    readonly aggregates: readonly AggregateInput[];
    readonly scope: AggregateScope;
}
```

Members (2):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `aggregates` | `readonly aggregates: readonly AggregateInput[];` |  |  |
| `scope` | `readonly scope: AggregateScope;` |  |  |

### BeforeCommandEvent

Kind: interface

Page: https://salmonui.dev/docs/reference/data-grid/engine/BeforeCommandEvent

```ts
interface BeforeCommandEvent {
    readonly command: DataGridCommand;
}
```

Members (1):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `command` | `readonly command: DataGridCommand;` |  |  |

### CellRef

Kind: interface

Page: https://salmonui.dev/docs/reference/data-grid/engine/CellRef

```ts
interface CellRef {
    readonly rowId: RowId;
    readonly columnId: ColumnId;
}
```

Members (2):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `rowId` | `readonly rowId: RowId;` |  |  |
| `columnId` | `readonly columnId: ColumnId;` |  |  |

### CellSnapshot

Kind: interface

Page: https://salmonui.dev/docs/reference/data-grid/engine/CellSnapshot

```ts
interface CellSnapshot {
    readonly rowId: RowId;
    readonly columnId: ColumnId;
    readonly value: unknown;
    readonly formattedValue: string;
}
```

Members (4):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `rowId` | `readonly rowId: RowId;` |  |  |
| `columnId` | `readonly columnId: ColumnId;` |  |  |
| `value` | `readonly value: unknown;` |  |  |
| `formattedValue` | `readonly formattedValue: string;` |  |  |

### CellSpanBlock

Kind: interface

Page: https://salmonui.dev/docs/reference/data-grid/engine/CellSpanBlock

```ts
interface CellSpanBlock {
    readonly rowIndex: number;
    readonly columnIndex: number;
    readonly rowSpan: number;
    readonly colSpan: number;
}
```

A span block in visible coordinates: its anchor (top-left) cell and its size.

Members (4):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `rowIndex` | `readonly rowIndex: number;` |  | Visible row index of the anchor (first) row. |
| `columnIndex` | `readonly columnIndex: number;` |  | Visible column index (left zone, center, right zone) of the anchor column. |
| `rowSpan` | `readonly rowSpan: number;` |  |  |
| `colSpan` | `readonly colSpan: number;` |  |  |

### CellSpanResolver

Kind: interface

Page: https://salmonui.dev/docs/reference/data-grid/engine/CellSpanResolver

```ts
interface CellSpanResolver {
    (rowIndex: number, columnIndex: number): CellSpanBlock | null;
    readonly active?: () => boolean;
}
```

The span block covering a visible cell, or null when the cell is not part
of a span (a 1x1 block). Called only on user actions (moves, selection,
editing), never per frame; it must be cheap when nothing spans.

### ChildGridConfig

Kind: interface

Page: https://salmonui.dev/docs/reference/data-grid/engine/ChildGridConfig

```ts
interface ChildGridConfig<Child = unknown, Parent = unknown, Nested = unknown> {
    readonly relationField?: string;
    readonly parentField?: string;
    readonly childField?: string;
    readonly data: readonly Child[] | DataSource<Child> | ((parent: ChildGridParent<Parent>) => readonly Child[] | DataSource<Child>);
    readonly getRowId?: (row: Child, index: number) => RowId;
    readonly columns?: readonly ColumnDef<Child>[];
    readonly options?: Partial<DataGridOptions<Child>>;
    readonly childGrid?: ChildGridConfig<Nested, Child>;
}
```

One child grid level. `Child` is the child row type, `Parent` the row type
of the grid it nests in, and `Nested` the row type of the next level
(`childGrid`).

Members (8):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `relationField` | `readonly relationField?: string;` | optional | Field present in both parent and child rows. |
| `parentField` | `readonly parentField?: string;` | optional | Parent field whose value selects the children. Default `relationField`. |
| `childField` | `readonly childField?: string;` | optional | Child field compared with the parent value. Default `relationField`. |
| `data` | `readonly data: readonly Child[] \| DataSource<Child> \| ((parent: ChildGridParent<Parent>) => readonly Child[] \| DataSource<Child>);` |  | Child rows: one array shared by every parent (indexed once by relation key), a data source (local sources are indexed, remote and live sources receive the relation filter), or a factory per parent. |
| `getRowId` | `readonly getRowId?: (row: Child, index: number) => RowId;` | optional | Default: the value of the child column marked `primaryKey`, as a string. |
| `columns` | `readonly columns?: readonly ColumnDef<Child>[];` | optional |  |
| `options` | `readonly options?: Partial<DataGridOptions<Child>>;` | optional | Further child grid options (modules are the renderer's). |
| `childGrid` | `readonly childGrid?: ChildGridConfig<Nested, Child>;` | optional | Next nesting level. |

### ChildGridDescriptor

Kind: interface

Page: https://salmonui.dev/docs/reference/data-grid/engine/ChildGridDescriptor

```ts
interface ChildGridDescriptor<Child = unknown> {
    readonly id: string;
    readonly parentRowId: RowId;
    readonly depth: number;
    readonly relation: ChildRelation;
    readonly filter: FilterDescriptor;
    readonly dataSource: DataSource<Child>;
    readonly options: DataGridOptions<Child>;
}
```

Members (7):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `id` | `readonly id: string;` |  | `<parent grid id>/<parent row id>`. |
| `parentRowId` | `readonly parentRowId: RowId;` |  |  |
| `depth` | `readonly depth: number;` |  | Depth of the child grid (1 for children of the root). |
| `relation` | `readonly relation: ChildRelation;` |  |  |
| `filter` | `readonly filter: FilterDescriptor;` |  | The relation condition the scoped source applies. |
| `dataSource` | `readonly dataSource: DataSource<Child>;` |  |  |
| `options` | `readonly options: DataGridOptions<Child>;` |  | Complete options for the child engine, without modules. |

### ChildGridParent

Kind: interface

Page: https://salmonui.dev/docs/reference/data-grid/engine/ChildGridParent

```ts
interface ChildGridParent<Row = unknown> {
    readonly rowId: RowId;
    readonly row: Row;
    readonly depth: number;
}
```

The parent row a child grid belongs to.

Members (3):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `rowId` | `readonly rowId: RowId;` |  |  |
| `row` | `readonly row: Row;` |  |  |
| `depth` | `readonly depth: number;` |  |  |

### ChildRelation

Kind: interface

Page: https://salmonui.dev/docs/reference/data-grid/engine/ChildRelation

```ts
interface ChildRelation {
    readonly parentField: string;
    readonly childField: string;
    readonly value: unknown;
}
```

Members (3):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `parentField` | `readonly parentField: string;` |  |  |
| `childField` | `readonly childField: string;` |  |  |
| `value` | `readonly value: unknown;` |  | Parent value (raw). |

### ChildScope

Kind: interface

Page: https://salmonui.dev/docs/reference/data-grid/engine/ChildScope

```ts
interface ChildScope {
    readonly childField: string;
    readonly value: unknown;
    readonly getRowId?: (row: never, index: number) => RowId;
}
```

Members (3):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `childField` | `readonly childField: string;` |  |  |
| `value` | `readonly value: unknown;` |  |  |
| `getRowId` | `readonly getRowId?: (row: never, index: number) => RowId;` | optional | Required for array sources that are written to. |

### ClipboardCopy

Kind: interface

Page: https://salmonui.dev/docs/reference/data-grid/engine/ClipboardCopy

```ts
interface ClipboardCopy {
    readonly text: string;
    readonly cells: number;
    readonly rows: readonly RowId[];
    readonly columns: readonly ColumnId[];
    readonly source: 'range' | 'rows' | 'cell' | 'none';
}
```

Members (5):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `text` | `readonly text: string;` |  |  |
| `cells` | `readonly cells: number;` |  | Copied cells (data cells, headers excluded). |
| `rows` | `readonly rows: readonly RowId[];` |  |  |
| `columns` | `readonly columns: readonly ColumnId[];` |  |  |
| `source` | `readonly source: 'range' \| 'rows' \| 'cell' \| 'none';` |  |  |

### ClipboardOptions

Kind: interface

Page: https://salmonui.dev/docs/reference/data-grid/engine/ClipboardOptions

```ts
interface ClipboardOptions {
    readonly copyFormatted?: boolean;
    readonly maxCells?: number;
}
```

Members (2):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `copyFormatted` | `readonly copyFormatted?: boolean;` | optional | Copy formatted text (default) or raw values. `column.clipboardFormatter` always wins. |
| `maxCells` | `readonly maxCells?: number;` | optional | Maximum cells in one copy (guards accidental copies of huge selections). Default 1,000,000. |

### ClipboardState

Kind: interface

Page: https://salmonui.dev/docs/reference/data-grid/engine/ClipboardState

```ts
interface ClipboardState {
    readonly version: number;
    readonly lastPaste: PasteResult | null;
}
```

Members (2):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `version` | `readonly version: number;` |  |  |
| `lastPaste` | `readonly lastPaste: PasteResult \| null;` |  |  |

### ColumnDef

Kind: interface

Page: https://salmonui.dev/docs/reference/data-grid/engine/ColumnDef

```ts
interface ColumnDef<Row> {
    readonly id?: string;
    readonly field?: string;
    readonly valueGetter?: (row: Row) => unknown;
    readonly valueSetter?: (row: Row, value: unknown) => Row;
    readonly type?: ColumnType;
    readonly format?: string | FormatOptions;
    readonly header?: string;
    readonly headerValueGetter?: (column: CompiledColumn<Row>) => string;
    readonly align?: 'start' | 'center' | 'end' | 'justify';
    readonly headerAlign?: 'start' | 'center' | 'end';
    readonly width?: ColumnWidth;
    readonly minWidth?: number;
    readonly maxWidth?: number;
    readonly hidden?: boolean;
    readonly pinned?: 'start' | 'end' | 'center';
    readonly lockPosition?: boolean;
    readonly sortable?: boolean;
    readonly filterable?: boolean;
    readonly searchable?: boolean;
    readonly groupable?: boolean;
    readonly groupByFormat?: boolean;
    readonly groupKey?: (row: Row) => unknown;
    readonly editable?: boolean;
    readonly resizable?: boolean;
    readonly reorderable?: boolean;
    readonly primaryKey?: boolean;
    readonly identity?: boolean;
    readonly defaultValue?: unknown;
    readonly editor?: string;
    readonly editorProps?: {
        readonly [key: string]: unknown;
    };
    readonly validation?: ColumnValidation<Row, ValidatorContext<Row, CompiledColumn<Row>>>;
    readonly displayAsCheckbox?: boolean;
    readonly hideable?: boolean;
    readonly valueParser?: (input: unknown, ctx: ValueContext<Row>) => unknown;
    readonly valueFormatter?: (value: unknown, ctx: ValueContext<Row>) => string;
    readonly clipboardFormatter?: (value: unknown, ctx: ValueContext<Row>) => string;
    readonly sortComparator?: (a: unknown, b: unknown, rowA: Row, rowB: Row) => number;
    readonly filterComparator?: (value: unknown, filterValue: Json, operator: FilterOperator) => boolean;
    readonly lookup?: ColumnLookup;
    readonly columns?: readonly ColumnDef<Row>[];
    readonly meta?: Json;
}
```

Members (41):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `id` | `readonly id?: string;` | optional | columnId precedence: `id` > `field` > generated (development warning). |
| `field` | `readonly field?: string;` | optional | Dot paths are allowed: `customer.name`. |
| `valueGetter` | `readonly valueGetter?: (row: Row) => unknown;` | optional |  |
| `valueSetter` | `readonly valueSetter?: (row: Row, value: unknown) => Row;` | optional |  |
| `type` | `readonly type?: ColumnType;` | optional | Inferred from the first non-null value when absent. `selection` is the row selection checkbox column; `rowNumber` the row number column. |
| `format` | `readonly format?: string \| FormatOptions;` | optional |  |
| `header` | `readonly header?: string;` | optional |  |
| `headerValueGetter` | `readonly headerValueGetter?: (column: CompiledColumn<Row>) => string;` | optional | Computes the header text from the compiled column. Called once per column compile; its result replaces `header` everywhere header text is shown or exported. |
| `align` | `readonly align?: 'start' \| 'center' \| 'end' \| 'justify';` | optional |  |
| `headerAlign` | `readonly headerAlign?: 'start' \| 'center' \| 'end';` | optional |  |
| `width` | `readonly width?: ColumnWidth;` | optional |  |
| `minWidth` | `readonly minWidth?: number;` | optional |  |
| `maxWidth` | `readonly maxWidth?: number;` | optional |  |
| `hidden` | `readonly hidden?: boolean;` | optional | Default false. Runtime visibility is state in the `columns` module. |
| `pinned` | `readonly pinned?: 'start' \| 'end' \| 'center';` | optional | Logical pin side: `start` is the left zone in LTR, `end` the right zone, `center` the fixed zone (the column stays at its scroll-start position while the center columns scroll on both sides of it). |
| `lockPosition` | `readonly lockPosition?: boolean;` | optional | Fixed at the start of its zone, not reorderable. |
| `sortable` | `readonly sortable?: boolean;` | optional |  |
| `filterable` | `readonly filterable?: boolean;` | optional |  |
| `searchable` | `readonly searchable?: boolean;` | optional |  |
| `groupable` | `readonly groupable?: boolean;` | optional |  |
| `groupByFormat` | `readonly groupByFormat?: boolean;` | optional | Group by the formatted value (`format`) instead of the raw value. |
| `groupKey` | `readonly groupKey?: (row: Row) => unknown;` | optional | Custom group key: rows group by this per-row value instead of the column value (`groupByFormat` is then ignored for bucketing). Local data only; groups order by key. See docs/site/content/grouping.md. |
| `editable` | `readonly editable?: boolean;` | optional |  |
| `resizable` | `readonly resizable?: boolean;` | optional |  |
| `reorderable` | `readonly reorderable?: boolean;` | optional |  |
| `primaryKey` | `readonly primaryKey?: boolean;` | optional |  |
| `identity` | `readonly identity?: boolean;` | optional | Server-generated key. |
| `defaultValue` | `readonly defaultValue?: unknown;` | optional | Value of the column in a row added through editing. |
| `editor` | `readonly editor?: string;` | optional | Editor preset name: `text`, `number`, `select`, `checkbox`, `date`, `datetime`, or a registered custom editor. Inferred from `type` when absent. |
| `editorProps` | `readonly editorProps?: {     readonly [key: string]: unknown; };` | optional | Props of the built-in editor, passed to the editor as is. |
| `validation` | `readonly validation?: ColumnValidation<Row, ValidatorContext<Row, CompiledColumn<Row>>>;` | optional | Validation rules. |
| `displayAsCheckbox` | `readonly displayAsCheckbox?: boolean;` | optional |  |
| `hideable` | `readonly hideable?: boolean;` | optional | Listed in the column chooser. Default true. |
| `valueParser` | `readonly valueParser?: (input: unknown, ctx: ValueContext<Row>) => unknown;` | optional |  |
| `valueFormatter` | `readonly valueFormatter?: (value: unknown, ctx: ValueContext<Row>) => string;` | optional |  |
| `clipboardFormatter` | `readonly clipboardFormatter?: (value: unknown, ctx: ValueContext<Row>) => string;` | optional |  |
| `sortComparator` | `readonly sortComparator?: (a: unknown, b: unknown, rowA: Row, rowB: Row) => number;` | optional |  |
| `filterComparator` | `readonly filterComparator?: (value: unknown, filterValue: Json, operator: FilterOperator) => boolean;` | optional | Custom filter comparer: replaces the built-in test of every built-in operator on this column. Called once per distinct cell value with the raw value, the condition's value, and the camelCase operator; returns whether the value matches. Local data only. |
| `lookup` | `readonly lookup?: ColumnLookup;` | optional | Lookup (foreign-key) column; needs the `lookup` module. |
| `columns` | `readonly columns?: readonly ColumnDef<Row>[];` | optional | Stacked header group: child definitions. |
| `meta` | `readonly meta?: Json;` | optional |  |

### ColumnFacet

Kind: interface

Page: https://salmonui.dev/docs/reference/data-grid/engine/ColumnFacet

```ts
interface ColumnFacet {
    readonly columnId: ColumnId;
    readonly status: 'ready' | 'unavailable';
    readonly values: readonly FacetValue[];
    readonly distinctCount: number;
    readonly selectedCount: number;
    readonly rowCount: number;
    readonly truncated: boolean;
    readonly stale: boolean;
    readonly error: null;
}
```

Members (9):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `columnId` | `readonly columnId: ColumnId;` |  |  |
| `status` | `readonly status: 'ready' \| 'unavailable';` |  | `unavailable`: the remote source performed filtering; facets must come from the data source. |
| `values` | `readonly values: readonly FacetValue[];` |  |  |
| `distinctCount` | `readonly distinctCount: number;` |  | Distinct values matching `search`, before `offset`/`limit`. |
| `selectedCount` | `readonly selectedCount: number;` |  | Of `distinctCount`, the values the column's current filter keeps (`selected`); lets a paged checklist count its checked values. |
| `rowCount` | `readonly rowCount: number;` |  | Rows passing every other column's filter. |
| `truncated` | `readonly truncated: boolean;` |  |  |
| `stale` | `readonly stale: boolean;` |  |  |
| `error` | `readonly error: null;` |  |  |

### ColumnFlags

Kind: interface

Page: https://salmonui.dev/docs/reference/data-grid/engine/ColumnFlags

```ts
interface ColumnFlags {
    readonly allowSorting: boolean;
    readonly allowFiltering: boolean;
    readonly allowSearching: boolean;
    readonly allowGrouping: boolean;
    readonly allowEditing: boolean;
    readonly allowResizing: boolean;
    readonly allowReordering: boolean;
    readonly isPrimaryKey: boolean;
    readonly isIdentity: boolean;
    readonly lockColumn: boolean;
    readonly displayAsCheckBox: boolean;
    readonly showInColumnChooser: boolean;
}
```

Members (12):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `allowSorting` | `readonly allowSorting: boolean;` |  |  |
| `allowFiltering` | `readonly allowFiltering: boolean;` |  |  |
| `allowSearching` | `readonly allowSearching: boolean;` |  |  |
| `allowGrouping` | `readonly allowGrouping: boolean;` |  |  |
| `allowEditing` | `readonly allowEditing: boolean;` |  |  |
| `allowResizing` | `readonly allowResizing: boolean;` |  |  |
| `allowReordering` | `readonly allowReordering: boolean;` |  |  |
| `isPrimaryKey` | `readonly isPrimaryKey: boolean;` |  |  |
| `isIdentity` | `readonly isIdentity: boolean;` |  |  |
| `lockColumn` | `readonly lockColumn: boolean;` |  |  |
| `displayAsCheckBox` | `readonly displayAsCheckBox: boolean;` |  |  |
| `showInColumnChooser` | `readonly showInColumnChooser: boolean;` |  |  |

### ColumnLookup

Kind: interface

Page: https://salmonui.dev/docs/reference/data-grid/engine/ColumnLookup

```ts
interface ColumnLookup {
    readonly data: readonly unknown[] | LookupSource;
    readonly keyField?: string;
    readonly displayField: string;
}
```

`column.lookup`: the cell holds a value matched against `keyField` of the
lookup rows; the grid shows, sorts, filters, searches, and groups by
`displayField`.

Members (3):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `data` | `readonly data: readonly unknown[] \| LookupSource;` |  | Lookup rows, or a source that loads them by value (`@salmonui/data` `createLookup`, `createJsonLookup`). |
| `keyField` | `readonly keyField?: string;` | optional | Field of the lookup rows matched against the cell value. Default: the column `field`. Dot paths allowed. |
| `displayField` | `readonly displayField: string;` |  | Field of the lookup rows displayed. Dot paths allowed. |

### ColumnLookupStatus

Kind: interface

Page: https://salmonui.dev/docs/reference/data-grid/engine/ColumnLookupStatus

```ts
interface ColumnLookupStatus {
    readonly status: LookupStatus;
    readonly error: string | null;
    readonly size: number;
}
```

Members (3):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `status` | `readonly status: LookupStatus;` |  |  |
| `error` | `readonly error: string \| null;` |  | Error message of the last failed load, or null. |
| `size` | `readonly size: number;` |  | Keys resolved so far. |

### ColumnMetrics

Kind: interface

Page: https://salmonui.dev/docs/reference/data-grid/engine/ColumnMetrics

```ts
interface ColumnMetrics {
    readonly count: number;
    readonly totalWidth: number;
    offsetOf(index: number): number;
    widthOf(index: number): number;
    indexAt(offset: number): number;
}
```

Horizontal metrics for one column zone.

Members (5):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `count` | `readonly count: number;` |  |  |
| `totalWidth` | `readonly totalWidth: number;` |  |  |
| `offsetOf` | `offsetOf(index: number): number;` |  |  |
| `widthOf` | `widthOf(index: number): number;` |  |  |
| `indexAt` | `indexAt(offset: number): number;` |  |  |

### ColumnSnapshot

Kind: interface

Page: https://salmonui.dev/docs/reference/data-grid/engine/ColumnSnapshot

```ts
interface ColumnSnapshot<Row> {
    readonly tree: readonly CompiledColumn<Row>[];
    readonly leaves: readonly CompiledColumn<Row>[];
    readonly zones: ReadonlyMap<ColumnId, 'left' | 'center' | 'right'>;
    readonly visible: readonly CompiledColumn<Row>[];
    readonly left: readonly CompiledColumn<Row>[];
    readonly center: readonly CompiledColumn<Row>[];
    readonly right: readonly CompiledColumn<Row>[];
    readonly fixed: readonly CompiledColumn<Row>[];
    readonly byId: ReadonlyMap<ColumnId, CompiledColumn<Row>>;
    readonly headerRowCount: number;
}
```

Members (10):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `tree` | `readonly tree: readonly CompiledColumn<Row>[];` |  | Every node of the header tree, depth-first, groups before their children. |
| `leaves` | `readonly leaves: readonly CompiledColumn<Row>[];` |  | Leaf (data) columns in definition order, including hidden ones (identity is stable across reorder). |
| `zones` | `readonly zones: ReadonlyMap<ColumnId, 'left' \| 'center' \| 'right'>;` |  | Runtime freeze zone of every visible leaf (definition `pinned`, runtime pin/unpin, and `frozenColumns` counts). |
| `visible` | `readonly visible: readonly CompiledColumn<Row>[];` |  | Visible leaves in runtime order: left zone, center, right zone. |
| `left` | `readonly left: readonly CompiledColumn<Row>[];` |  |  |
| `center` | `readonly center: readonly CompiledColumn<Row>[];` |  |  |
| `right` | `readonly right: readonly CompiledColumn<Row>[];` |  |  |
| `fixed` | `readonly fixed: readonly CompiledColumn<Row>[];` |  | Center leaves in the fixed zone (`pinned: 'center'`), in runtime order: a subset of `center`, so `visible` order, keyboard order and `aria-colindex` stay the visual order. Empty (a shared frozen array) when no column is fixed. |
| `byId` | `readonly byId: ReadonlyMap<ColumnId, CompiledColumn<Row>>;` |  |  |
| `headerRowCount` | `readonly headerRowCount: number;` |  | Number of header rows (tree depth). |

### ColumnValidation

Kind: interface

Page: https://salmonui.dev/docs/reference/data-grid/engine/ColumnValidation

```ts
interface ColumnValidation<Row = unknown, Ctx = ValidatorContext<Row>> {
    readonly required?: RuleValue<boolean>;
    readonly min?: RuleValue<number | string>;
    readonly max?: RuleValue<number | string>;
    readonly range?: RuleValue<readonly [
        number | string,
        number | string
    ]>;
    readonly minLength?: RuleValue<number>;
    readonly maxLength?: RuleValue<number>;
    readonly rangeLength?: RuleValue<readonly [
        number,
        number
    ]>;
    readonly number?: RuleValue<boolean>;
    readonly digits?: RuleValue<boolean>;
    readonly email?: RuleValue<boolean>;
    readonly url?: RuleValue<boolean>;
    readonly date?: RuleValue<boolean>;
    readonly dateIso?: RuleValue<boolean>;
    readonly creditcard?: RuleValue<boolean>;
    readonly tel?: RuleValue<boolean>;
    readonly pattern?: RuleValue<string | RegExp>;
    readonly validate?: CustomValidator<Row, Ctx> | readonly [
        CustomValidator<Row, Ctx>,
        string
    ] | readonly CustomValidator<Row, Ctx>[];
    readonly messages?: Partial<ValidationMessages>;
}
```

Members (18):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `required` | `readonly required?: RuleValue<boolean>;` | optional |  |
| `min` | `readonly min?: RuleValue<number \| string>;` | optional |  |
| `max` | `readonly max?: RuleValue<number \| string>;` | optional |  |
| `range` | `readonly range?: RuleValue<readonly [     number \| string,     number \| string ]>;` | optional |  |
| `minLength` | `readonly minLength?: RuleValue<number>;` | optional |  |
| `maxLength` | `readonly maxLength?: RuleValue<number>;` | optional |  |
| `rangeLength` | `readonly rangeLength?: RuleValue<readonly [     number,     number ]>;` | optional |  |
| `number` | `readonly number?: RuleValue<boolean>;` | optional |  |
| `digits` | `readonly digits?: RuleValue<boolean>;` | optional |  |
| `email` | `readonly email?: RuleValue<boolean>;` | optional |  |
| `url` | `readonly url?: RuleValue<boolean>;` | optional |  |
| `date` | `readonly date?: RuleValue<boolean>;` | optional |  |
| `dateIso` | `readonly dateIso?: RuleValue<boolean>;` | optional |  |
| `creditcard` | `readonly creditcard?: RuleValue<boolean>;` | optional |  |
| `tel` | `readonly tel?: RuleValue<boolean>;` | optional |  |
| `pattern` | `readonly pattern?: RuleValue<string \| RegExp>;` | optional | A pattern string or a RegExp, tested as a search: a partial match passes, so anchor the pattern (`^[A-Z]{3}$`) to require the whole value. |
| `validate` | `readonly validate?: CustomValidator<Row, Ctx> \| readonly [     CustomValidator<Row, Ctx>,     string ] \| readonly CustomValidator<Row, Ctx>[];` | optional | One custom validator, `[validator, message]`, or several. |
| `messages` | `readonly messages?: Partial<ValidationMessages>;` | optional | Message overrides of this column, keyed by rule name; they win over `edit.messages`. |

### ColumnWidthSpec

Kind: interface

Page: https://salmonui.dev/docs/reference/data-grid/engine/ColumnWidthSpec

```ts
interface ColumnWidthSpec {
    readonly initial: ColumnWidth;
    readonly min: number;
    readonly max: number;
}
```

Members (3):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `initial` | `readonly initial: ColumnWidth;` |  |  |
| `min` | `readonly min: number;` |  |  |
| `max` | `readonly max: number;` |  | `Infinity` when unbounded. |

### ColumnsState

Kind: interface

Page: https://salmonui.dev/docs/reference/data-grid/engine/ColumnsState

```ts
interface ColumnsState {
    readonly visibility: Readonly<Record<ColumnId, boolean>>;
    readonly widths: Readonly<Record<ColumnId, number>>;
    readonly order: readonly ColumnId[] | null;
    readonly freeze: Readonly<Record<ColumnId, ColumnFreeze | null>>;
    readonly frozenCount: {
        readonly left: number;
        readonly right: number;
    };
}
```

Members (5):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `visibility` | `readonly visibility: Readonly<Record<ColumnId, boolean>>;` |  | Runtime visibility overrides keyed by columnId; absent ids use `!column.def.hidden`. |
| `widths` | `readonly widths: Readonly<Record<ColumnId, number>>;` |  | Runtime widths in px keyed by columnId (resize, autofit, restore); absent ids use `column.width`. |
| `order` | `readonly order: readonly ColumnId[] \| null;` |  | Runtime leaf order; null keeps definition order. |
| `freeze` | `readonly freeze: Readonly<Record<ColumnId, ColumnFreeze \| null>>;` |  | Runtime freeze overrides keyed by columnId (`null`: unfrozen); absent ids use `column.freeze`. |
| `frozenCount` | `readonly frozenCount: {     readonly left: number;     readonly right: number; };` |  | Frozen column counts: the first `left` and last `right` visible leaves are frozen. |

### ColumnsStateInit

Kind: interface

Page: https://salmonui.dev/docs/reference/data-grid/engine/ColumnsStateInit

```ts
interface ColumnsStateInit {
    readonly visibility?: Readonly<Record<ColumnId, boolean>>;
    readonly widths?: Readonly<Record<ColumnId, number>>;
    readonly order?: readonly ColumnId[] | null;
    readonly freeze?: Readonly<Record<ColumnId, ColumnFreeze | null>>;
    readonly frozenCount?: {
        readonly left?: number;
        readonly right?: number;
    };
}
```

Initial runtime column state (`DataGridOptions.initialColumnState`); applied before the server snapshot.

Members (5):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `visibility` | `readonly visibility?: Readonly<Record<ColumnId, boolean>>;` | optional |  |
| `widths` | `readonly widths?: Readonly<Record<ColumnId, number>>;` | optional |  |
| `order` | `readonly order?: readonly ColumnId[] \| null;` | optional |  |
| `freeze` | `readonly freeze?: Readonly<Record<ColumnId, ColumnFreeze \| null>>;` | optional | Runtime freeze overrides (`null` unfreezes a column that declares `pinned`). |
| `frozenCount` | `readonly frozenCount?: {     readonly left?: number;     readonly right?: number; };` | optional | Frozen column counts. |

### CommandEvent

Kind: interface

Page: https://salmonui.dev/docs/reference/data-grid/engine/CommandEvent

```ts
interface CommandEvent {
    readonly command: DataGridCommand;
    readonly result: CommandResult;
    readonly version: number;
}
```

Members (3):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `command` | `readonly command: DataGridCommand;` |  |  |
| `result` | `readonly result: CommandResult;` |  |  |
| `version` | `readonly version: number;` |  |  |

### CommandRejection

Kind: interface

Page: https://salmonui.dev/docs/reference/data-grid/engine/CommandRejection

```ts
interface CommandRejection {
    readonly rejected: true;
    readonly reason: string;
    readonly state?: unknown;
}
```

Returned from `reduce` through `ctx.reject(reason)`.

Members (3):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `rejected` | `readonly rejected: true;` |  |  |
| `reason` | `readonly reason: string;` |  |  |
| `state` | `readonly state?: unknown;` | optional | State to publish although the command is rejected (validation errors of a refused commit). |

### CompiledColumn

Kind: interface

Page: https://salmonui.dev/docs/reference/data-grid/engine/CompiledColumn

```ts
interface CompiledColumn<Row> {
    readonly columnId: ColumnId;
    readonly path: readonly ColumnId[];
    readonly leaf: boolean;
    readonly depth: number;
    readonly leafIndex: number;
    readonly children: readonly ColumnId[];
    readonly def: ColumnDef<Row>;
    readonly field: string | null;
    readonly headerText: string;
    readonly accessor: (row: Row) => unknown;
    readonly setter: ((row: Row, value: unknown) => Row) | null;
    readonly type: ColumnType;
    readonly typeSource: ColumnTypeSource;
    readonly format: FormatDescriptor | null;
    readonly formatter: (value: unknown, row: Row) => string;
    readonly clipboardFormatter: (value: unknown, row: Row) => string;
    readonly parser: (input: unknown, row: Row) => unknown;
    readonly comparer: (a: unknown, b: unknown, rowA: Row, rowB: Row) => number;
    readonly width: ColumnWidthSpec;
    readonly flags: ColumnFlags;
    readonly freeze: 'left' | 'right' | 'fixed' | null;
    readonly moduleMeta: Readonly<Record<string, unknown>>;
    readonly lookup?: CompiledLookup;
}
```

Members (23):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `columnId` | `readonly columnId: ColumnId;` |  |  |
| `path` | `readonly path: readonly ColumnId[];` |  | Stacked header ancestry, root first, including this column. |
| `leaf` | `readonly leaf: boolean;` |  |  |
| `depth` | `readonly depth: number;` |  | Header depth (0 for top level). |
| `leafIndex` | `readonly leafIndex: number;` |  | Position among leaf columns in definition order; -1 for group headers. |
| `children` | `readonly children: readonly ColumnId[];` |  | Child column ids for group headers; empty for leaves. |
| `def` | `readonly def: ColumnDef<Row>;` |  |  |
| `field` | `readonly field: string \| null;` |  |  |
| `headerText` | `readonly headerText: string;` |  |  |
| `accessor` | `readonly accessor: (row: Row) => unknown;` |  |  |
| `setter` | `readonly setter: ((row: Row, value: unknown) => Row) \| null;` |  |  |
| `type` | `readonly type: ColumnType;` |  |  |
| `typeSource` | `readonly typeSource: ColumnTypeSource;` |  |  |
| `format` | `readonly format: FormatDescriptor \| null;` |  |  |
| `formatter` | `readonly formatter: (value: unknown, row: Row) => string;` |  |  |
| `clipboardFormatter` | `readonly clipboardFormatter: (value: unknown, row: Row) => string;` |  |  |
| `parser` | `readonly parser: (input: unknown, row: Row) => unknown;` |  |  |
| `comparer` | `readonly comparer: (a: unknown, b: unknown, rowA: Row, rowB: Row) => number;` |  |  |
| `width` | `readonly width: ColumnWidthSpec;` |  |  |
| `flags` | `readonly flags: ColumnFlags;` |  |  |
| `freeze` | `readonly freeze: 'left' \| 'right' \| 'fixed' \| null;` |  | Definition freeze: `fixed` (`pinned: 'center'`) stays in the center zone and is listed in `ColumnSnapshot.fixed`. |
| `moduleMeta` | `readonly moduleMeta: Readonly<Record<string, unknown>>;` |  | Filled by module `extendColumns`. |
| `lookup` | `readonly lookup?: CompiledLookup;` | optional | Set by the `lookup` module on lookup columns (raw value accessor, display lookup). |

### CompiledLookup

Kind: interface

Page: https://salmonui.dev/docs/reference/data-grid/engine/CompiledLookup

```ts
interface CompiledLookup {
    readonly keyField: string;
    readonly displayField: string;
    readonly type: ColumnType;
    readonly data: readonly unknown[] | LookupSource;
    rawValue(row: unknown): unknown;
    display(key: unknown): unknown;
}
```

`CompiledColumn.lookup` of a lookup column (filled by the `lookup` module).

Members (6):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `keyField` | `readonly keyField: string;` |  |  |
| `displayField` | `readonly displayField: string;` |  |  |
| `type` | `readonly type: ColumnType;` |  | Display value type: inferred from local lookup rows, `'string'` for remote lookups. |
| `data` | `readonly data: readonly unknown[] \| LookupSource;` |  |  |
| `rawValue` | `rawValue(row: unknown): unknown;` |  | Raw key of a row (the column's original accessor). `engine.getCellValue` returns this. |
| `display` | `display(key: unknown): unknown;` |  | Display value of a key, or null when unknown (remote: may queue a load). |

### CompiledValidator

Kind: interface

Page: https://salmonui.dev/docs/reference/data-grid/engine/CompiledValidator

```ts
interface CompiledValidator {
    readonly required: boolean;
    validate(value: unknown, row: unknown): readonly string[];
    readonly custom: AsyncCheck | null;
}
```

One column's compiled rules.

Members (3):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `required` | `readonly required: boolean;` |  | True when a `required` rule (or an implicit primary-key requirement) applies. |
| `validate` | `validate(value: unknown, row: unknown): readonly string[];` |  | Synchronous built-in rules: the first failing message, as a one-element array, or `NO_ERRORS`. |
| `custom` | `readonly custom: AsyncCheck \| null;` |  | Custom validators: a message, null, or a promise of either. Null when the column has no custom rule. |

### ConflictSnapshot

Kind: interface

Page: https://salmonui.dev/docs/reference/data-grid/engine/ConflictSnapshot

```ts
interface ConflictSnapshot<Row> {
    readonly rowId: RowId;
    readonly local: Row;
    readonly server: Row;
    readonly base: Row | null;
    readonly cells: readonly {
        readonly columnId: ColumnId;
        readonly local: unknown;
        readonly server: unknown;
    }[];
    readonly version?: string;
}
```

A version conflict reported by a write (structural copy of `@salmonui/data` `ConflictSnapshot`).

Members (6):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `rowId` | `readonly rowId: RowId;` |  |  |
| `local` | `readonly local: Row;` |  |  |
| `server` | `readonly server: Row;` |  |  |
| `base` | `readonly base: Row \| null;` |  |  |
| `cells` | `readonly cells: readonly {     readonly columnId: ColumnId;     readonly local: unknown;     readonly server: unknown; }[];` |  |  |
| `version` | `readonly version?: string;` | optional |  |

### CopyOptions

Kind: interface

Page: https://salmonui.dev/docs/reference/data-grid/engine/CopyOptions

```ts
interface CopyOptions {
    readonly includeHeaders?: boolean;
    readonly copyFormatted?: boolean;
    readonly getValue?: (rowId: RowId, columnId: ColumnId) => unknown;
}
```

Members (3):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `includeHeaders` | `readonly includeHeaders?: boolean;` | optional |  |
| `copyFormatted` | `readonly copyFormatted?: boolean;` | optional | Formatted text or raw values for this copy; default the `clipboard.copyFormatted` option. `column.clipboardFormatter` always wins. |
| `getValue` | `readonly getValue?: (rowId: RowId, columnId: ColumnId) => unknown;` | optional | Value of a cell (default: the engine value); the renderer passes draft values. |

### CustomOperatorContext

Kind: interface

Page: https://salmonui.dev/docs/reference/data-grid/engine/CustomOperatorContext

```ts
interface CustomOperatorContext<Row = unknown> {
    readonly column: CompiledColumn<Row>;
    readonly matchCase: boolean;
    readonly ignoreAccent: boolean;
}
```

Members (3):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `column` | `readonly column: CompiledColumn<Row>;` |  |  |
| `matchCase` | `readonly matchCase: boolean;` |  |  |
| `ignoreAccent` | `readonly ignoreAccent: boolean;` |  |  |

### DataGridApi

Kind: interface

Page: https://salmonui.dev/docs/reference/data-grid/engine/DataGridApi

```ts
interface DataGridApi<Row> {
    readonly engine: DataGridEngine<Row>;
    getColumn(fieldOrId: string): CompiledColumn<Row> | undefined;
    getColumns(): readonly CompiledColumn<Row>[];
    getVisibleColumns(): readonly CompiledColumn<Row>[];
    getHiddenColumns(): readonly CompiledColumn<Row>[];
    getColumnAt(index: number): CompiledColumn<Row> | undefined;
    getColumnIndex(fieldOrId: string): number;
    showColumns(fieldsOrIds: string | readonly string[]): CommandResult;
    hideColumns(fieldsOrIds: string | readonly string[]): CommandResult;
    getViewRows(): readonly Row[];
    getFilteredRows(): readonly Row[];
    getRow(rowId: RowId): Row | undefined;
    getRowInfo(rowId: RowId): RowSnapshot<Row> | undefined;
    getRowIndex(rowId: RowId): number;
    getRowIdAt(index: number): RowId | undefined;
    getCell(rowId: RowId, field: string): CellSnapshot | undefined;
    getDataSource(): DataSource<Row>;
    getPrimaryKeyFields(): readonly string[];
    sortColumn(field: string, direction: 'asc' | 'desc', options?: {
        readonly multiple?: boolean;
    }): CommandResult;
    removeSort(field: string): CommandResult;
    clearSorting(): CommandResult;
    filterColumn(field: string, operator: string, value: Json, options?: FilterColumnOptions): CommandResult;
    clearFiltering(fields?: string | readonly string[]): CommandResult;
    removeFilter(field: string): CommandResult;
    getColumnFacet(field: string, options?: FacetOptions): ColumnFacet | undefined;
    search(text: string): CommandResult;
    clearSearch(): CommandResult;
    goToPage(page: number): CommandResult;
    setPageSize(pageSize: number): CommandResult;
    getPageInfo(): PageInfo | undefined;
    groupColumn(field: string, index?: number): CommandResult;
    ungroupColumn(field: string): CommandResult;
    clearGrouping(): CommandResult;
    toggleGroup(group: GroupTarget, expanded?: boolean): CommandResult;
    expandAllGroups(): CommandResult;
    collapseAllGroups(): CommandResult;
    getGroup(rowId: RowId): GroupRowSnapshot | undefined;
    getAggregates(groupId?: RowId): AggregateValues | undefined;
    refresh(): void;
    dispose(): void;
}
```

Imperative DataGrid API over an engine (re-exported by `@salmonui/data-grid` as
`DataGridCoreApi` and extended there). Every method that takes a column accepts
a `field` or a column id: the column id wins, else the first leaf with that
`field`. Mutating methods dispatch a serializable command and return its
`CommandResult`; read methods return engine-owned frozen values or raw row
references.

Members (40):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `engine` | `readonly engine: DataGridEngine<Row>;` |  |  |
| `getColumn` | `getColumn(fieldOrId: string): CompiledColumn<Row> \| undefined;` |  | Leaf column by column id, else the first leaf with that `field`. |
| `getColumns` | `getColumns(): readonly CompiledColumn<Row>[];` |  | Every leaf column in definition order, including hidden ones. |
| `getVisibleColumns` | `getVisibleColumns(): readonly CompiledColumn<Row>[];` |  | Visible leaves in runtime order. |
| `getHiddenColumns` | `getHiddenColumns(): readonly CompiledColumn<Row>[];` |  | Leaves hidden at runtime, in definition order. |
| `getColumnAt` | `getColumnAt(index: number): CompiledColumn<Row> \| undefined;` |  | Visible leaf at an index of `getVisibleColumns()`. |
| `getColumnIndex` | `getColumnIndex(fieldOrId: string): number;` |  | Index of a column in `getVisibleColumns()`, or -1. |
| `showColumns` | `showColumns(fieldsOrIds: string \| readonly string[]): CommandResult;` |  |  |
| `hideColumns` | `hideColumns(fieldsOrIds: string \| readonly string[]): CommandResult;` |  |  |
| `getViewRows` | `getViewRows(): readonly Row[];` |  | Rows of the current view (after the query pipeline), as raw references. |
| `getFilteredRows` | `getFilteredRows(): readonly Row[];` |  | Rows passing search and every filter, in sort order, across every page, as raw references. Without the `filter` module, every row. |
| `getRow` | `getRow(rowId: RowId): Row \| undefined;` |  |  |
| `getRowInfo` | `getRowInfo(rowId: RowId): RowSnapshot<Row> \| undefined;` |  |  |
| `getRowIndex` | `getRowIndex(rowId: RowId): number;` |  | Visible index of a row, or -1. |
| `getRowIdAt` | `getRowIdAt(index: number): RowId \| undefined;` |  | Row id at a visible index (the inverse of `getRowIndex`), or undefined. |
| `getCell` | `getCell(rowId: RowId, field: string): CellSnapshot \| undefined;` |  |  |
| `getDataSource` | `getDataSource(): DataSource<Row>;` |  |  |
| `getPrimaryKeyFields` | `getPrimaryKeyFields(): readonly string[];` |  | `field` of each `primaryKey` leaf column, in column order. |
| `sortColumn` | `sortColumn(field: string, direction: 'asc' \| 'desc', options?: {     readonly multiple?: boolean; }): CommandResult;` |  | `multiple` adds to the current sort (Ctrl+click). Needs the `sort` module. |
| `removeSort` | `removeSort(field: string): CommandResult;` |  |  |
| `clearSorting` | `clearSorting(): CommandResult;` |  |  |
| `filterColumn` | `filterColumn(field: string, operator: string, value: Json, options?: FilterColumnOptions): CommandResult;` |  | An array value with a scalar operator ORs one condition per value. Needs the `filter` module. |
| `clearFiltering` | `clearFiltering(fields?: string \| readonly string[]): CommandResult;` |  | Clears every filter, or the filters of the given columns. |
| `removeFilter` | `removeFilter(field: string): CommandResult;` |  |  |
| `getColumnFacet` | `getColumnFacet(field: string, options?: FacetOptions): ColumnFacet \| undefined;` |  | Distinct values with counts for checkbox / Excel filters, or undefined without the `filter` module. |
| `search` | `search(text: string): CommandResult;` |  | Searches with the `search` module settings; empty text clears the search. |
| `clearSearch` | `clearSearch(): CommandResult;` |  |  |
| `goToPage` | `goToPage(page: number): CommandResult;` |  | Needs the `paging` module. |
| `setPageSize` | `setPageSize(pageSize: number): CommandResult;` |  |  |
| `getPageInfo` | `getPageInfo(): PageInfo \| undefined;` |  | Pager model, or undefined without the `paging` module. |
| `groupColumn` | `groupColumn(field: string, index?: number): CommandResult;` |  | Needs the `grouping` module. |
| `ungroupColumn` | `ungroupColumn(field: string): CommandResult;` |  |  |
| `clearGrouping` | `clearGrouping(): CommandResult;` |  |  |
| `toggleGroup` | `toggleGroup(group: GroupTarget, expanded?: boolean): CommandResult;` |  | Toggles (or sets) one group by row id, path key, or path. |
| `expandAllGroups` | `expandAllGroups(): CommandResult;` |  |  |
| `collapseAllGroups` | `collapseAllGroups(): CommandResult;` |  |  |
| `getGroup` | `getGroup(rowId: RowId): GroupRowSnapshot \| undefined;` |  | Caption or footer snapshot of a group row id, or undefined. |
| `getAggregates` | `getAggregates(groupId?: RowId): AggregateValues \| undefined;` |  | Without an argument the footer aggregates (undefined without the `aggregates` module); with a group row id that group's aggregates (undefined for an unknown id). |
| `refresh` | `refresh(): void;` |  | Re-reads the data with the current query and keeps the grid state: `engine.refresh()`. |
| `dispose` | `dispose(): void;` |  |  |

### DataGridEngine

Kind: interface

Page: https://salmonui.dev/docs/reference/data-grid/engine/DataGridEngine

```ts
interface DataGridEngine<Row> {
    readonly id: string;
    getSnapshot(): DataGridSnapshot<Row>;
    getServerSnapshot(): DataGridSnapshot<Row>;
    subscribe(listener: () => void): () => void;
    select<T>(selector: (snapshot: DataGridSnapshot<Row>) => T): T;
    subscribeSelector<T>(selector: (snapshot: DataGridSnapshot<Row>) => T, listener: (value: T) => void, isEqual?: (a: T, b: T) => boolean): () => void;
    subscribeCell(rowId: RowId, columnId: ColumnId, listener: () => void): () => void;
    subscribeRow(rowId: RowId, listener: () => void): () => void;
    subscribeHeader(columnId: ColumnId, listener: () => void): () => void;
    subscribeModule(name: string, listener: () => void): () => void;
    getCellSnapshot(rowId: RowId, columnId: ColumnId): CellSnapshot | undefined;
    getRowSnapshot(rowId: RowId): RowSnapshot<Row> | undefined;
    getHeaderSnapshot(columnId: ColumnId): HeaderSnapshot | undefined;
    getModuleState<T = unknown>(name: string): T | undefined;
    getSelector(moduleName: string, selectorName: string): ((snapshot: DataGridSnapshot<Row>) => unknown) | undefined;
    getRow(rowId: RowId): Row | undefined;
    getRowIndex(rowId: RowId): number;
    getRowAt(index: number): Row | undefined;
    getRowIdAt(index: number): RowId | undefined;
    getCellValue(rowId: RowId, columnId: ColumnId): unknown;
    getDataSource(): DataSource<Row>;
    setColumns(columns: readonly ColumnDef<Row>[]): void;
    setLocale(next: {
        readonly locale?: string;
        readonly currency?: string;
        readonly timeZone?: string | undefined;
        readonly direction?: 'ltr' | 'rtl';
    }): boolean;
    dispatch(command: DataGridCommand): CommandResult;
    hasCommand(type: string): boolean;
    batch(run: () => void): void;
    onBeforeCommand(listener: (event: BeforeCommandEvent) => boolean | string | void): () => void;
    onCommand(listener: (event: CommandEvent) => void): () => void;
    getCommandLog(): readonly DataGridCommand[];
    getInstrumentation(): DataGridInstrumentation | null;
    connect(): () => void;
    reload(): void;
    refresh(): void;
    readonly disposed: boolean;
    dispose(): void;
}
```

Members (35):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `id` | `readonly id: string;` |  |  |
| `getSnapshot` | `getSnapshot(): DataGridSnapshot<Row>;` |  |  |
| `getServerSnapshot` | `getServerSnapshot(): DataGridSnapshot<Row>;` |  |  |
| `subscribe` | `subscribe(listener: () => void): () => void;` |  |  |
| `select` | `select<T>(selector: (snapshot: DataGridSnapshot<Row>) => T): T;` |  |  |
| `subscribeSelector` | `subscribeSelector<T>(selector: (snapshot: DataGridSnapshot<Row>) => T, listener: (value: T) => void, isEqual?: (a: T, b: T) => boolean): () => void;` |  |  |
| `subscribeCell` | `subscribeCell(rowId: RowId, columnId: ColumnId, listener: () => void): () => void;` |  |  |
| `subscribeRow` | `subscribeRow(rowId: RowId, listener: () => void): () => void;` |  |  |
| `subscribeHeader` | `subscribeHeader(columnId: ColumnId, listener: () => void): () => void;` |  |  |
| `subscribeModule` | `subscribeModule(name: string, listener: () => void): () => void;` |  |  |
| `getCellSnapshot` | `getCellSnapshot(rowId: RowId, columnId: ColumnId): CellSnapshot \| undefined;` |  |  |
| `getRowSnapshot` | `getRowSnapshot(rowId: RowId): RowSnapshot<Row> \| undefined;` |  |  |
| `getHeaderSnapshot` | `getHeaderSnapshot(columnId: ColumnId): HeaderSnapshot \| undefined;` |  |  |
| `getModuleState` | `getModuleState<T = unknown>(name: string): T \| undefined;` |  |  |
| `getSelector` | `getSelector(moduleName: string, selectorName: string): ((snapshot: DataGridSnapshot<Row>) => unknown) \| undefined;` |  |  |
| `getRow` | `getRow(rowId: RowId): Row \| undefined;` |  | Raw row by id (source rows, including rows filtered out of the view). |
| `getRowIndex` | `getRowIndex(rowId: RowId): number;` |  | Visible index of a row, or -1. |
| `getRowAt` | `getRowAt(index: number): Row \| undefined;` |  |  |
| `getRowIdAt` | `getRowIdAt(index: number): RowId \| undefined;` |  |  |
| `getCellValue` | `getCellValue(rowId: RowId, columnId: ColumnId): unknown;` |  |  |
| `getDataSource` | `getDataSource(): DataSource<Row>;` |  |  |
| `setColumns` | `setColumns(columns: readonly ColumnDef<Row>[]): void;` |  | Recompiles only when the array identity or a definition identity changes. |
| `setLocale` | `setLocale(next: {     readonly locale?: string;     readonly currency?: string;     readonly timeZone?: string \| undefined;     readonly direction?: 'ltr' \| 'rtl'; }): boolean;` |  | Changes the locale, currency, time zone, or direction at runtime. A format change recompiles the column formatters once and re-runs the pipeline (collation follows the locale); a direction change updates `snapshot.direction` and the focus module. Omitted fields keep their value (`timeZone: undefined` given explicitly resets to the runtime zone). Returns false when nothing changed. |
| `dispatch` | `dispatch(command: DataGridCommand): CommandResult;` |  |  |
| `hasCommand` | `hasCommand(type: string): boolean;` |  | Whether a registered module declares the command type (UI commands probe it before dispatching). |
| `batch` | `batch(run: () => void): void;` |  |  |
| `onBeforeCommand` | `onBeforeCommand(listener: (event: BeforeCommandEvent) => boolean \| string \| void): () => void;` |  |  |
| `onCommand` | `onCommand(listener: (event: CommandEvent) => void): () => void;` |  |  |
| `getCommandLog` | `getCommandLog(): readonly DataGridCommand[];` |  |  |
| `getInstrumentation` | `getInstrumentation(): DataGridInstrumentation \| null;` |  |  |
| `connect` | `connect(): () => void;` |  | With `deferDataSource`: subscribes to the source and issues the pending read. Returns the disconnect (unsubscribes, aborts the in-flight read, which the next `connect()` re-issues). A no-op when already connected. |
| `reload` | `reload(): void;` |  | Re-reads the data source with the current query (retry after a data error). Before `connect()` the read waits for it. |
| `refresh` | `refresh(): void;` |  | Refresh: drops the row and cell snapshot caches, invalidates the source cache (`DataSource.invalidate`), aborts and re-issues the current read, and keeps every module state (sort, filter, group, page, selection, expansion). Rows mutated in place render their new values. |
| `disposed` | `readonly disposed: boolean;` |  |  |
| `dispose` | `dispose(): void;` |  |  |

### DataGridInstrumentation

Kind: interface

Page: https://salmonui.dev/docs/reference/data-grid/engine/DataGridInstrumentation

```ts
interface DataGridInstrumentation {
    readonly columnCompiles: number;
    readonly columnDefCompiles: number;
    readonly columnTypeResolves: number;
    readonly snapshots: number;
    readonly pipelineRuns: number;
    readonly stageRuns: Readonly<Record<string, number>>;
    readonly stageUpdates: Readonly<Record<string, number>>;
    readonly notifications: number;
    readonly selectorEvaluations: number;
    readonly cellSnapshots: number;
    readonly rowSnapshots: number;
    readonly dataReads: number;
    readonly staleResults: number;
    readonly commands: number;
}
```

Members (14):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `columnCompiles` | `readonly columnCompiles: number;` |  |  |
| `columnDefCompiles` | `readonly columnDefCompiles: number;` |  |  |
| `columnTypeResolves` | `readonly columnTypeResolves: number;` |  |  |
| `snapshots` | `readonly snapshots: number;` |  |  |
| `pipelineRuns` | `readonly pipelineRuns: number;` |  |  |
| `stageRuns` | `readonly stageRuns: Readonly<Record<string, number>>;` |  |  |
| `stageUpdates` | `readonly stageUpdates: Readonly<Record<string, number>>;` |  | Stage executions served by the incremental `update` path (a subset of `stageRuns`). |
| `notifications` | `readonly notifications: number;` |  |  |
| `selectorEvaluations` | `readonly selectorEvaluations: number;` |  |  |
| `cellSnapshots` | `readonly cellSnapshots: number;` |  |  |
| `rowSnapshots` | `readonly rowSnapshots: number;` |  |  |
| `dataReads` | `readonly dataReads: number;` |  |  |
| `staleResults` | `readonly staleResults: number;` |  |  |
| `commands` | `readonly commands: number;` |  |  |

### DataGridModule

Kind: interface

Page: https://salmonui.dev/docs/reference/data-grid/engine/DataGridModule

```ts
interface DataGridModule<Row = unknown, State = unknown, Command extends DataGridCommand = DataGridCommand, Name extends string = string, Methods extends ModuleMethods<Row> = {}> {
    readonly name: Name;
    readonly dependencies?: readonly string[];
    readonly inSnapshot?: boolean;
    readonly commands: readonly Command['type'][];
    initialState(options: DataGridOptions<Row>): State;
    reduce?(state: State, command: Command, ctx: ModuleContext<Row>): State | CommandRejection;
    extendColumns?(columns: readonly CompiledColumn<Row>[], ctx: ModuleContext<Row>): readonly CompiledColumn<Row>[];
    extendQuery?(query: DataQuery, state: State): DataQuery;
    readonly pipeline?: readonly PipelineStage<Row, State>[];
    readonly selectors?: Readonly<Record<string, (snapshot: DataGridSnapshot<Row>) => unknown>>;
    readonly methods?: Methods;
    notify?(previous: State, next: State, ctx: ModuleContext<Row>): NotificationScope;
    hiddenColumns?(state: State): readonly ColumnId[];
    interceptRead?(query: DataQuery, state: State, ctx: ModuleContext<Row>): boolean;
    onQueryChange?(previous: DataQuery, next: DataQuery, ctx: ModuleContext<Row>): void;
    onConnect?(ctx: ModuleContext<Row>): void;
    onSourceEvent?(event: DataSourceEvent<Row>, state: State, ctx: ModuleContext<Row>): boolean;
    dispose?(): void;
}
```

Members (18):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `name` | `readonly name: Name;` |  |  |
| `dependencies` | `readonly dependencies?: readonly string[];` | optional | Validated at engine creation. |
| `inSnapshot` | `readonly inSnapshot?: boolean;` | optional | When true (default) the slice lives in `snapshot.modules[name]` and every change replaces the grid snapshot. High-churn modules (focus, selection, drafts) set false and notify through row/cell/header/module channels only. |
| `commands` | `readonly commands: readonly Command['type'][];` |  | Declared, validated, serializable. Every type must start with `${name}.`. |
| `initialState` | `initialState(options: DataGridOptions<Row>): State;` |  |  |
| `reduce` | `reduce?(state: State, command: Command, ctx: ModuleContext<Row>): State \| CommandRejection;` | optional |  |
| `extendColumns` | `extendColumns?(columns: readonly CompiledColumn<Row>[], ctx: ModuleContext<Row>): readonly CompiledColumn<Row>[];` | optional |  |
| `extendQuery` | `extendQuery?(query: DataQuery, state: State): DataQuery;` | optional |  |
| `pipeline` | `readonly pipeline?: readonly PipelineStage<Row, State>[];` | optional |  |
| `selectors` | `readonly selectors?: Readonly<Record<string, (snapshot: DataGridSnapshot<Row>) => unknown>>;` | optional |  |
| `methods` | `readonly methods?: Methods;` | optional | Reads that need more than the snapshot (facets, pager totals). Must not change state; names may not collide with command actions. |
| `notify` | `notify?(previous: State, next: State, ctx: ModuleContext<Row>): NotificationScope;` | optional |  |
| `hiddenColumns` | `hiddenColumns?(state: State): readonly ColumnId[];` | optional | Leaf columns this module hides from the visible column set (grouped columns with `showGroupedColumns: false`). |
| `interceptRead` | `interceptRead?(query: DataQuery, state: State, ctx: ModuleContext<Row>): boolean;` | optional | Remote sources only: return true to serve the main read of `query` yourself (lazy grouping loads group levels instead of rows). The engine then shows no source rows and runs only the stages the source did not perform. |
| `onQueryChange` | `onQueryChange?(previous: DataQuery, next: DataQuery, ctx: ModuleContext<Row>): void;` | optional | Called after the effective query changed (sort, filter, search, page, group). Runs inside the dispatch of the command that changed it; may dispatch commands through `ctx` (selection clears itself here when it does not persist). |
| `onConnect` | `onConnect?(ctx: ModuleContext<Row>): void;` | optional | `engine.connect()` ran (`deferDataSource`): start loads that were held while disconnected. |
| `onSourceEvent` | `onSourceEvent?(event: DataSourceEvent<Row>, state: State, ctx: ModuleContext<Row>): boolean;` | optional | A data source event (patch or reset). Return true to consume it: the engine then leaves its source rows unchanged (infinite scroll applies write echoes to the blocks it owns). |
| `dispose` | `dispose?(): void;` | optional |  |

### DataGridOptions

Kind: interface

Page: https://salmonui.dev/docs/reference/data-grid/engine/DataGridOptions

```ts
interface DataGridOptions<Row> {
    readonly getRowId: (row: Row, index: number) => RowId;
    readonly columns: readonly ColumnDef<Row>[];
    readonly dataSource: readonly Row[] | DataSource<Row>;
    readonly modules?: readonly DataGridModule<Row>[];
    readonly defaultQuery?: DataGridQueryInit;
    readonly id?: string;
    readonly direction?: 'ltr' | 'rtl';
    readonly locale?: string;
    readonly timeZone?: string;
    readonly currency?: string;
    readonly rowHeight?: number | ((row: Row) => number);
    readonly estimatedRowHeight?: number;
    readonly headerRowHeight?: number;
    readonly defaultColumnWidth?: number;
    readonly initialRows?: number;
    readonly initialColumns?: number;
    readonly initialColumnState?: {
        readonly visibility?: Readonly<Record<ColumnId, boolean>>;
        readonly widths?: Readonly<Record<ColumnId, number>>;
        readonly order?: readonly ColumnId[] | null;
        readonly freeze?: Readonly<Record<ColumnId, 'left' | 'right' | 'fixed' | null>>;
        readonly frozenCount?: {
            readonly left?: number;
            readonly right?: number;
        };
    };
    readonly dev?: boolean;
    readonly onWarning?: (warning: DataGridWarning) => void;
    readonly instrument?: boolean;
    readonly recordCommands?: boolean;
    readonly deferDataSource?: boolean;
    readonly cellSpans?: CellSpanResolver;
    readonly [module: string]: unknown;
}
```

Members (23):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `getRowId` | `readonly getRowId: (row: Row, index: number) => RowId;` |  | Required. Index-based ids are never generated by the core. |
| `columns` | `readonly columns: readonly ColumnDef<Row>[];` |  |  |
| `dataSource` | `readonly dataSource: readonly Row[] \| DataSource<Row>;` |  | A plain array is wrapped in `createLocalDataSource`. |
| `modules` | `readonly modules?: readonly DataGridModule<Row>[];` | optional |  |
| `defaultQuery` | `readonly defaultQuery?: DataGridQueryInit;` | optional | Initial query (`where`/`take` equivalent). Modules read their part in `initialState`. |
| `id` | `readonly id?: string;` | optional |  |
| `direction` | `readonly direction?: 'ltr' \| 'rtl';` | optional |  |
| `locale` | `readonly locale?: string;` | optional |  |
| `timeZone` | `readonly timeZone?: string;` | optional |  |
| `currency` | `readonly currency?: string;` | optional | Default ISO 4217 currency for `C` formats. Default `USD`. |
| `rowHeight` | `readonly rowHeight?: number \| ((row: Row) => number);` | optional |  |
| `estimatedRowHeight` | `readonly estimatedRowHeight?: number;` | optional |  |
| `headerRowHeight` | `readonly headerRowHeight?: number;` | optional |  |
| `defaultColumnWidth` | `readonly defaultColumnWidth?: number;` | optional |  |
| `initialRows` | `readonly initialRows?: number;` | optional | Rows in the deterministic server/initial range. Default 20. |
| `initialColumns` | `readonly initialColumns?: number;` | optional | Center columns in the deterministic server/initial range. Default 20. |
| `initialColumnState` | `readonly initialColumnState?: {     readonly visibility?: Readonly<Record<ColumnId, boolean>>;     readonly widths?: Readonly<Record<ColumnId, number>>;     readonly order?: readonly ColumnId[] \| null;     readonly freeze?: Readonly<Record<ColumnId, 'left' \| 'right' \| 'fixed' \| null>>;     readonly frozenCount?: {         readonly left?: number;         readonly right?: number;     }; };` | optional | Initial runtime column visibility, widths (px), and order, applied before the server snapshot. |
| `dev` | `readonly dev?: boolean;` | optional | Development checks and warnings. Defaults to `process.env.NODE_ENV !== 'production'`. |
| `onWarning` | `readonly onWarning?: (warning: DataGridWarning) => void;` | optional |  |
| `instrument` | `readonly instrument?: boolean;` | optional | Expose store counters through `getInstrumentation()`. |
| `recordCommands` | `readonly recordCommands?: boolean;` | optional | Keep a serializable log of applied commands (`getCommandLog()`). |
| `deferDataSource` | `readonly deferDataSource?: boolean;` | optional | Creating the engine performs no data-source side effect: no `subscribe`, no `read` (so no load, fetch, stream, or user callback). Only a local source with a `getRows()` snapshot is read at creation; remote and live reads are requested but held until `connect()` (the snapshot shows their loading state). Renderers set it so creation stays render-pure. |
| `cellSpans` | `readonly cellSpans?: CellSpanResolver;` | optional | Span resolver of a renderer that draws cell spans: focus moves, cell selection, and editing treat a span as one cell at its anchor. Omit it when nothing spans. |

### DataGridPersistence

Kind: interface

Page: https://salmonui.dev/docs/reference/data-grid/engine/DataGridPersistence

```ts
interface DataGridPersistence {
    readonly key: string;
    readonly initialState: DataGridState;
    load(): Promise<RestoreResult | null>;
    save(): Promise<void>;
    reset(): Promise<RestoreResult>;
    restore(state: DataGridState): RestoreResult;
    clear(): Promise<void>;
    dispose(): void;
}
```

Members (8):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `key` | `readonly key: string;` |  |  |
| `initialState` | `readonly initialState: DataGridState;` |  | State captured when the binding was created (what `reset()` restores). |
| `load` | `load(): Promise<RestoreResult \| null>;` |  | Loads and restores the stored state; null when nothing is stored or it is invalid. |
| `save` | `save(): Promise<void>;` |  | Saves now (skipped when unchanged since the last save or load). |
| `reset` | `reset(): Promise<RestoreResult>;` |  | Restores `initialState` and removes the stored entry. |
| `restore` | `restore(state: DataGridState): RestoreResult;` |  | Restores a state now without saving it (the stored entry is unchanged until the next tracked change). |
| `clear` | `clear(): Promise<void>;` |  | Removes the stored entry. |
| `dispose` | `dispose(): void;` |  |  |

### DataGridPersistenceOptions

Kind: interface

Page: https://salmonui.dev/docs/reference/data-grid/engine/DataGridPersistenceOptions

```ts
interface DataGridPersistenceOptions extends DataGridStateOptions, DeserializeDataGridStateOptions {
    readonly storage: DataGridStateStorageAdapter;
    readonly key?: string;
    readonly schedule?: (flush: () => void) => void;
    readonly onError?: (error: unknown) => void;
}
```

Members (6):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `storage` | `readonly storage: DataGridStateStorageAdapter;` |  |  |
| `key` | `readonly key?: string;` | optional | Storage key. Default `engine.id`. |
| `schedule` | `readonly schedule?: (flush: () => void) => void;` | optional | Schedules a coalesced save. Default: one microtask. |
| `onError` | `readonly onError?: (error: unknown) => void;` | optional | Load and save failures (storage errors, invalid stored state). |
| `exclude` | `exclude?: readonly DataGridStatePart[];` | optional, inherited | Parts left out of reads and restores. |
| `migrate` | `migrate?: ((state: Record<string, unknown>, version: number) => DataGridState \| null);` | optional, inherited | Upgrades a state of another version; return null to reject it. |

### DataGridQueryInit

Kind: interface

Page: https://salmonui.dev/docs/reference/data-grid/engine/DataGridQueryInit

```ts
interface DataGridQueryInit {
    readonly search?: SearchDescriptor | null;
    readonly filters?: readonly FilterEntry[];
    readonly sorting?: readonly SortDescriptor[];
    readonly grouping?: readonly GroupDescriptor[];
    readonly aggregates?: readonly AggregateDescriptor[];
    readonly paging?: PagingDescriptor | null;
    readonly expansion?: Partial<ExpansionDescriptor>;
}
```

Partial query accepted by `createDataGridQuery` and the `defaultQuery` option.

Members (7):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `search` | `readonly search?: SearchDescriptor \| null;` | optional |  |
| `filters` | `readonly filters?: readonly FilterEntry[];` | optional |  |
| `sorting` | `readonly sorting?: readonly SortDescriptor[];` | optional |  |
| `grouping` | `readonly grouping?: readonly GroupDescriptor[];` | optional |  |
| `aggregates` | `readonly aggregates?: readonly AggregateDescriptor[];` | optional |  |
| `paging` | `readonly paging?: PagingDescriptor \| null;` | optional |  |
| `expansion` | `readonly expansion?: Partial<ExpansionDescriptor>;` | optional |  |

### DataGridSnapshot

Kind: interface

Page: https://salmonui.dev/docs/reference/data-grid/engine/DataGridSnapshot

```ts
interface DataGridSnapshot<Row> {
    readonly version: number;
    readonly columns: ColumnSnapshot<Row>;
    readonly rows: RowModelSnapshot<Row>;
    readonly viewport: ViewportSnapshot;
    readonly data: DataStatusSnapshot;
    readonly query: DataQuery;
    readonly direction: 'ltr' | 'rtl';
    readonly locale: string;
    readonly modules: Readonly<Record<string, unknown>>;
}
```

Members (9):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `version` | `readonly version: number;` |  |  |
| `columns` | `readonly columns: ColumnSnapshot<Row>;` |  |  |
| `rows` | `readonly rows: RowModelSnapshot<Row>;` |  |  |
| `viewport` | `readonly viewport: ViewportSnapshot;` |  |  |
| `data` | `readonly data: DataStatusSnapshot;` |  |  |
| `query` | `readonly query: DataQuery;` |  |  |
| `direction` | `readonly direction: 'ltr' \| 'rtl';` |  |  |
| `locale` | `readonly locale: string;` |  |  |
| `modules` | `readonly modules: Readonly<Record<string, unknown>>;` |  |  |

### DataGridStateApi

Kind: interface

Page: https://salmonui.dev/docs/reference/data-grid/engine/DataGridStateApi

```ts
interface DataGridStateApi {
    getState(options?: DataGridStateOptions): DataGridState;
    restoreState(state: DataGridState | string, options?: DataGridStateOptions & DeserializeDataGridStateOptions): RestoreResult;
    resetState(): RestoreResult;
    readonly initialState: DataGridState;
}
```

The `getState` / `restoreState` / `resetState` instance methods.

Members (4):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `getState` | `getState(options?: DataGridStateOptions): DataGridState;` |  | Persistable state (columns, pinning, sorting, filters, grouping, paging, search, selection, scroll). |
| `restoreState` | `restoreState(state: DataGridState \| string, options?: DataGridStateOptions & DeserializeDataGridStateOptions): RestoreResult;` |  | Restores a state (object or serialized) in one batch without recompiling columns. |
| `resetState` | `resetState(): RestoreResult;` |  | Restores the state captured when this API was created. |
| `initialState` | `readonly initialState: DataGridState;` |  | The state captured when this API was created (what `resetState` restores). |

### DataGridStateOptions

Kind: interface

Page: https://salmonui.dev/docs/reference/data-grid/engine/DataGridStateOptions

```ts
interface DataGridStateOptions {
    readonly exclude?: readonly DataGridStatePart[];
}
```

Members (1):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `exclude` | `readonly exclude?: readonly DataGridStatePart[];` | optional | Parts left out of reads and restores. |

### DataGridStateStorageAdapter

Kind: interface

Page: https://salmonui.dev/docs/reference/data-grid/engine/DataGridStateStorageAdapter

```ts
interface DataGridStateStorageAdapter {
    load(key: string): unknown;
    save(key: string, state: DataGridState): unknown;
    remove?(key: string): unknown;
}
```

Injected storage, sync or async. `@salmonui/data` `createKeyValueStateStorage` and `createJsonStateStorage` fit structurally.

Members (3):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `load` | `load(key: string): unknown;` |  |  |
| `save` | `save(key: string, state: DataGridState): unknown;` |  |  |
| `remove` | `remove?(key: string): unknown;` | optional |  |

### DataGridWarning

Kind: interface

Page: https://salmonui.dev/docs/reference/data-grid/engine/DataGridWarning

```ts
interface DataGridWarning {
    readonly code: string;
    readonly message: string;
    readonly gridId: string;
}
```

Members (3):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `code` | `readonly code: string;` |  |  |
| `message` | `readonly message: string;` |  |  |
| `gridId` | `readonly gridId: string;` |  |  |

### DataQuery

Kind: interface

Page: https://salmonui.dev/docs/reference/data-grid/engine/DataQuery

```ts
interface DataQuery {
    readonly search: SearchDescriptor | null;
    readonly filters: readonly FilterEntry[];
    readonly sorting: readonly SortDescriptor[];
    readonly grouping: readonly GroupDescriptor[];
    readonly aggregates: readonly AggregateDescriptor[];
    readonly paging: PagingDescriptor | null;
    readonly expansion: ExpansionDescriptor;
}
```

Members (7):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `search` | `readonly search: SearchDescriptor \| null;` |  |  |
| `filters` | `readonly filters: readonly FilterEntry[];` |  | Top level: conditions on the same column fold by `predicate`; columns and groups are ANDed. |
| `sorting` | `readonly sorting: readonly SortDescriptor[];` |  |  |
| `grouping` | `readonly grouping: readonly GroupDescriptor[];` |  |  |
| `aggregates` | `readonly aggregates: readonly AggregateDescriptor[];` |  |  |
| `paging` | `readonly paging: PagingDescriptor \| null;` |  | null when the paging module is off. |
| `expansion` | `readonly expansion: ExpansionDescriptor;` |  |  |

### DataSource

Kind: interface

Page: https://salmonui.dev/docs/reference/data-grid/engine/DataSource

```ts
interface DataSource<Row> {
    readonly mode: DataSourceMode;
    read(request: DataSourceRequest): DataSourceResult<Row> | Promise<DataSourceResult<Row>>;
    write?(request: WriteRequest<Row>): Promise<WriteResult<Row>>;
    subscribe?(listener: (event: DataSourceEvent<Row>) => void): () => void;
    invalidate?(scope?: 'rows' | 'counts' | 'facets' | 'all'): void;
    readonly capabilities?: Partial<DataSourceCapabilities>;
}
```

Members (6):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `mode` | `readonly mode: DataSourceMode;` |  |  |
| `read` | `read(request: DataSourceRequest): DataSourceResult<Row> \| Promise<DataSourceResult<Row>>;` |  |  |
| `write` | `write?(request: WriteRequest<Row>): Promise<WriteResult<Row>>;` | optional |  |
| `subscribe` | `subscribe?(listener: (event: DataSourceEvent<Row>) => void): () => void;` | optional |  |
| `invalidate` | `invalidate?(scope?: 'rows' \| 'counts' \| 'facets' \| 'all'): void;` | optional | Drops cached results; `engine.refresh()` calls it with `'all'` before re-reading. Must not notify. |
| `capabilities` | `readonly capabilities?: Partial<DataSourceCapabilities>;` | optional |  |

### DataSourceCapabilities

Kind: interface

Page: https://salmonui.dev/docs/reference/data-grid/engine/DataSourceCapabilities

```ts
interface DataSourceCapabilities {
    readonly facets: boolean;
    readonly lazyGroups: boolean;
    readonly treeChildren: boolean;
    readonly cursor: boolean;
    readonly infinite: boolean;
    readonly lookups: boolean;
    readonly write: boolean;
    readonly exportJobs: boolean;
    readonly reload: boolean;
}
```

Members (9):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `facets` | `readonly facets: boolean;` |  |  |
| `lazyGroups` | `readonly lazyGroups: boolean;` |  |  |
| `treeChildren` | `readonly treeChildren: boolean;` |  |  |
| `cursor` | `readonly cursor: boolean;` |  |  |
| `infinite` | `readonly infinite: boolean;` |  |  |
| `lookups` | `readonly lookups: boolean;` |  |  |
| `write` | `readonly write: boolean;` |  |  |
| `exportJobs` | `readonly exportJobs: boolean;` |  |  |
| `reload` | `readonly reload: boolean;` |  |  |

### DataSourceFacetRequest

Kind: interface

Page: https://salmonui.dev/docs/reference/data-grid/engine/DataSourceFacetRequest

```ts
interface DataSourceFacetRequest {
    readonly columnId: ColumnId;
    readonly search?: string;
    readonly limit?: number;
}
```

Members (3):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `columnId` | `readonly columnId: ColumnId;` |  |  |
| `search` | `readonly search?: string;` | optional | Case-insensitive substring of the label. |
| `limit` | `readonly limit?: number;` | optional | Entries at most (checklist page); `complete: false` when more exist. |

### DataSourceFacetResult

Kind: interface

Page: https://salmonui.dev/docs/reference/data-grid/engine/DataSourceFacetResult

```ts
interface DataSourceFacetResult {
    readonly columnId: ColumnId;
    readonly entries: readonly {
        readonly key: string;
        readonly label: string;
        readonly count: number;
    }[];
    readonly complete: boolean;
}
```

Members (3):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `columnId` | `readonly columnId: ColumnId;` |  |  |
| `entries` | `readonly entries: readonly {     readonly key: string;     readonly label: string;     readonly count: number; }[];` |  | `key`: the server's value key (`BLANK_FACET_KEY` for blanks); `label`: display text. Sorted by label. |
| `complete` | `readonly complete: boolean;` |  | False when `limit` truncated the list. |

### DataSourceRequest

Kind: interface

Page: https://salmonui.dev/docs/reference/data-grid/engine/DataSourceRequest

```ts
interface DataSourceRequest {
    readonly version: number;
    readonly query: DataQuery;
    readonly range?: {
        readonly start: number;
        readonly end: number;
    };
    readonly cursor?: string | null;
    readonly groupPath?: readonly GroupPathSegment[];
    readonly parentRowId?: RowId | null;
    readonly facet?: DataSourceFacetRequest;
    readonly signal: AbortSignalLike;
}
```

Members (8):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `version` | `readonly version: number;` |  |  |
| `query` | `readonly query: DataQuery;` |  |  |
| `range` | `readonly range?: {     readonly start: number;     readonly end: number; };` | optional |  |
| `cursor` | `readonly cursor?: string \| null;` | optional |  |
| `groupPath` | `readonly groupPath?: readonly GroupPathSegment[];` | optional | Lazy group load: `[]` loads the root group level; a non-empty path loads that group's children. Absent for plain reads. |
| `parentRowId` | `readonly parentRowId?: RowId \| null;` | optional | Tree read (tree mode over a remote source, `createRemoteTree`): `null` reads the root level, a row id reads that row's children. Sources answer with `TreeRowEnvelope`-shaped items (`{ kind: 'tree', row, parentId, hasChildren, childCount?, depth?, children? }`). Absent for plain reads. |
| `facet` | `readonly facet?: DataSourceFacetRequest;` | optional | Facet read: distinct values of a column with counts over the rows passing search and every other column's filter, for remote checklist and Excel filters. Sources answer with `facet`. |
| `signal` | `readonly signal: AbortSignalLike;` |  |  |

### DataSourceResult

Kind: interface

Page: https://salmonui.dev/docs/reference/data-grid/engine/DataSourceResult

```ts
interface DataSourceResult<Row> {
    readonly version: number;
    readonly rows: readonly Row[];
    readonly totalRowCount?: number;
    readonly performed?: readonly PerformedStage[];
    readonly aggregates?: AggregateValues;
    readonly pageInfo?: {
        readonly hasNextPage?: boolean;
        readonly hasPreviousPage?: boolean;
        readonly endCursor?: string | null;
    };
    readonly rowOffset?: number;
    readonly facet?: DataSourceFacetResult;
}
```

Members (8):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `version` | `readonly version: number;` |  |  |
| `rows` | `readonly rows: readonly Row[];` |  | Plain rows; group envelopes for lazy group loads. |
| `totalRowCount` | `readonly totalRowCount?: number;` | optional |  |
| `performed` | `readonly performed?: readonly PerformedStage[];` | optional |  |
| `aggregates` | `readonly aggregates?: AggregateValues;` | optional | Totals over every matching row (remote aggregates). |
| `pageInfo` | `readonly pageInfo?: {     readonly hasNextPage?: boolean;     readonly hasPreviousPage?: boolean;     readonly endCursor?: string \| null; };` | optional |  |
| `rowOffset` | `readonly rowOffset?: number;` | optional | Row index of `rows[0]` for a `range` read (block sources after evicting leading blocks); default `range.start`, or 0 for `capabilities.infinite` sources. |
| `facet` | `readonly facet?: DataSourceFacetResult;` | optional | Answer to a `facet` request. |

### DataStatusSnapshot

Kind: interface

Page: https://salmonui.dev/docs/reference/data-grid/engine/DataStatusSnapshot

```ts
interface DataStatusSnapshot {
    readonly status: 'idle' | 'loading' | 'ready' | 'error';
    readonly error: unknown;
    readonly totalRowCount: number;
    readonly version: number;
    readonly mode: DataSourceMode;
    readonly performed: readonly PerformedStage[];
    readonly aggregates: AggregateValues | null;
}
```

Members (7):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `status` | `readonly status: 'idle' \| 'loading' \| 'ready' \| 'error';` |  |  |
| `error` | `readonly error: unknown;` |  |  |
| `totalRowCount` | `readonly totalRowCount: number;` |  |  |
| `version` | `readonly version: number;` |  | Version of the request that produced the current rows; 0 before the first result. |
| `mode` | `readonly mode: DataSourceMode;` |  |  |
| `performed` | `readonly performed: readonly PerformedStage[];` |  | Stages the source performed for the current rows (always empty for local and live). |
| `aggregates` | `readonly aggregates: AggregateValues \| null;` |  | Server totals of the current result (`DataSourceResult.aggregates`), or null. |

### DeserializeDataGridStateOptions

Kind: interface

Page: https://salmonui.dev/docs/reference/data-grid/engine/DeserializeDataGridStateOptions

```ts
interface DeserializeDataGridStateOptions {
    readonly migrate?: (state: Record<string, unknown>, version: number) => DataGridState | null;
}
```

Members (1):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `migrate` | `readonly migrate?: (state: Record<string, unknown>, version: number) => DataGridState \| null;` | optional | Upgrades a state of another version; return null to reject it. |

### DetailInfo

Kind: interface

Page: https://salmonui.dev/docs/reference/data-grid/engine/DetailInfo

```ts
interface DetailInfo {
    readonly enabled: boolean;
    readonly defaultExpanded: boolean;
    readonly height: number;
}
```

Members (3):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `enabled` | `readonly enabled: boolean;` |  |  |
| `defaultExpanded` | `readonly defaultExpanded: boolean;` |  |  |
| `height` | `readonly height: number;` |  |  |

### DetailLoadContext

Kind: interface

Page: https://salmonui.dev/docs/reference/data-grid/engine/DetailLoadContext

```ts
interface DetailLoadContext<Row> {
    readonly rowId: RowId;
    readonly row: Row;
    readonly signal: AbortSignalLike;
}
```

Members (3):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `rowId` | `readonly rowId: RowId;` |  |  |
| `row` | `readonly row: Row;` |  |  |
| `signal` | `readonly signal: AbortSignalLike;` |  |  |

### DetailLoadSnapshot

Kind: interface

Page: https://salmonui.dev/docs/reference/data-grid/engine/DetailLoadSnapshot

```ts
interface DetailLoadSnapshot {
    readonly status: 'idle' | 'loading' | 'ready' | 'error';
    readonly data: unknown;
    readonly error: unknown;
}
```

Members (3):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `status` | `readonly status: 'idle' \| 'loading' \| 'ready' \| 'error';` |  |  |
| `data` | `readonly data: unknown;` |  |  |
| `error` | `readonly error: unknown;` |  |  |

### DetailOptions

Kind: interface

Page: https://salmonui.dev/docs/reference/data-grid/engine/DetailOptions

```ts
interface DetailOptions<Row> {
    readonly enabled?: boolean;
    readonly defaultExpanded?: boolean;
    readonly expanded?: Readonly<Record<RowId, boolean>>;
    readonly hasDetail?: (row: Row) => boolean;
    readonly load?: (ctx: DetailLoadContext<Row>) => unknown;
    readonly height?: number;
}
```

Members (6):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `enabled` | `readonly enabled?: boolean;` | optional | Enables detail rows. Default true when the module is registered. |
| `defaultExpanded` | `readonly defaultExpanded?: boolean;` | optional | Every data row starts expanded. Default false. |
| `expanded` | `readonly expanded?: Readonly<Record<RowId, boolean>>;` | optional | Initial per-row expansion overrides. |
| `hasDetail` | `readonly hasDetail?: (row: Row) => boolean;` | optional | Rows without a detail (no expand toggle). Evaluated only for expanded rows. |
| `load` | `readonly load?: (ctx: DetailLoadContext<Row>) => unknown;` | optional | Async detail content (`detailDataBound`). Started on explicit expand and by `detail.load`. |
| `height` | `readonly height?: number;` | optional | Estimated detail row height in px before measurement. Default 150. |

### DetailResolver

Kind: interface

Page: https://salmonui.dev/docs/reference/data-grid/engine/DetailResolver

```ts
interface DetailResolver {
    readonly all: boolean;
    readonly ids: ReadonlySet<RowId>;
    readonly sourceIndexOf: (rowId: RowId) => number;
    readonly hasDetail: ((row: unknown) => boolean) | null;
    readonly source: readonly unknown[];
}
```

Resolves which rows of an inner view get a detail row (the module's expansion state).

Members (5):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `all` | `readonly all: boolean;` |  | Expand-all mode: every visible data row except `collapsed` (and rows failing `hasDetail`). |
| `ids` | `readonly ids: ReadonlySet<RowId>;` |  | Explicit mode: expanded ids. Expand-all mode: ids collapsed explicitly. |
| `sourceIndexOf` | `readonly sourceIndexOf: (rowId: RowId) => number;` |  | Source index of a row id, or -1. |
| `hasDetail` | `readonly hasDetail: ((row: unknown) => boolean) \| null;` |  | Data row object at an inner index (for `hasDetail`), when available. |
| `source` | `readonly source: readonly unknown[];` |  |  |

### DetailState

Kind: interface

Page: https://salmonui.dev/docs/reference/data-grid/engine/DetailState

```ts
interface DetailState {
    readonly enabled: boolean;
    readonly defaultExpanded: boolean;
    readonly expanded: Readonly<Record<RowId, boolean>>;
    readonly loadVersion: number;
}
```

Members (4):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `enabled` | `readonly enabled: boolean;` |  |  |
| `defaultExpanded` | `readonly defaultExpanded: boolean;` |  |  |
| `expanded` | `readonly expanded: Readonly<Record<RowId, boolean>>;` |  | Row id -> expanded, overriding `defaultExpanded` (only values that differ from it). |
| `loadVersion` | `readonly loadVersion: number;` |  | Bumped when an async load settles. |

### DropPoint

Kind: interface

Page: https://salmonui.dev/docs/reference/data-grid/engine/DropPoint

```ts
interface DropPoint {
    readonly index: number;
    readonly rowId: RowId | null;
    readonly kind: RowKind;
    readonly position: DropPosition;
    readonly groupId: RowId | null;
    readonly parentId?: RowId | null;
}
```

Where a pointer is over the visible row model.

Members (6):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `index` | `readonly index: number;` |  | Visible index (clamped); `count` when the model is empty. |
| `rowId` | `readonly rowId: RowId \| null;` |  | Id of the row under the pointer, or null for an empty model. |
| `kind` | `readonly kind: RowKind;` |  |  |
| `position` | `readonly position: DropPosition;` |  |  |
| `groupId` | `readonly groupId: RowId \| null;` |  | Group (caption row id) the drop lands in, or null when ungrouped. |
| `parentId` | `readonly parentId?: RowId \| null;` | optional | Tree mode: the parent the dropped rows join (null: roots); absent outside tree mode. |

### DropTarget

Kind: interface

Page: https://salmonui.dev/docs/reference/data-grid/engine/DropTarget

```ts
interface DropTarget extends DropPoint {
    readonly dropIndex: number;
    readonly valid: boolean;
    readonly reason: string | null;
}
```

Members (9):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `dropIndex` | `readonly dropIndex: number;` |  | The data row index the first dropped row takes after the drop (`reorderRows(fromIndexes, dropIndex)` semantics); -1 when unknown (a collapsed group's rows). |
| `valid` | `readonly valid: boolean;` |  |  |
| `reason` | `readonly reason: string \| null;` |  | `self`, `sorted`, `groupChange`, `lazyGroups`, `emptyGroup`, or null. |
| `index` | `index: number;` | inherited | Visible index (clamped); `count` when the model is empty. |
| `rowId` | `rowId: string \| null;` | inherited | Id of the row under the pointer, or null for an empty model. |
| `kind` | `kind: RowKind;` | inherited |  |
| `position` | `position: DropPosition;` | inherited |  |
| `groupId` | `groupId: string \| null;` | inherited | Group (caption row id) the drop lands in, or null when ungrouped. |
| `parentId` | `parentId?: string \| null;` | optional, inherited | Tree mode: the parent the dropped rows join (null: roots); absent outside tree mode. |

### EditApi

Kind: interface

Page: https://salmonui.dev/docs/reference/data-grid/engine/EditApi

```ts
interface EditApi<Row> {
    startEdit(rowId?: RowId, field?: string): CommandResult;
    save(): CommandResult;
    saveCell(): CommandResult;
    cancelEdit(): CommandResult;
    setEditValue(rowId: RowId, field: string, value: unknown): CommandResult;
    addRow(row?: Readonly<Record<string, unknown>>, index?: number): CommandResult;
    deleteRows(rowIds?: RowId | readonly RowId[]): CommandResult;
    updateRow(rowId: RowId, row: Readonly<Record<string, unknown>>): CommandResult;
    updateCell(rowId: RowId, field: string, value: unknown): CommandResult;
    setCellValue(rowId: RowId, field: string, value: unknown): CommandResult;
    setRowData(rowId: RowId, row: Row): CommandResult;
    applyChanges(changes: EditDataChanges<Row>): CommandResult;
    getPendingChanges(): EditBatchChanges<Row>;
    getBatchPreview(): EditPreview | undefined;
    getEditSnapshot(): EditSnapshot | undefined;
    hasUnsavedChanges(): boolean;
    whenEditSettled(): Promise<void>;
    validateBatch(): Promise<boolean>;
    undo(): CommandResult;
    redo(): CommandResult;
    canUndo(): boolean;
    canRedo(): boolean;
}
```

Edit methods. Columns are named by `field` or column id (the column id
wins); value maps (`addRow`, `updateRow`) are keyed the same way.

Members (22):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `startEdit` | `startEdit(rowId?: RowId, field?: string): CommandResult;` |  | Row and dialog mode edit the row, batch and cell mode the cell (default: first editable). Without a row id, the first selected row. |
| `save` | `save(): CommandResult;` |  | Saves the edit: commits the active row or cell; in batch mode saves every pending change. |
| `saveCell` | `saveCell(): CommandResult;` |  | Commits the active editor only: the row in row and dialog mode, the cell in batch and cell mode (batch mode keeps the change pending). |
| `cancelEdit` | `cancelEdit(): CommandResult;` |  | Discards the active editor; in batch mode without an open editor, every pending change. |
| `setEditValue` | `setEditValue(rowId: RowId, field: string, value: unknown): CommandResult;` |  | Sets the draft of the active editor (or of any editable cell). |
| `addRow` | `addRow(row?: Readonly<Record<string, unknown>>, index?: number): CommandResult;` |  | Adds a row (and edits it). `index` 0 adds at the top, an index at or past the end at the bottom; other positions are rejected (`unsupportedIndex`). Without an index the row goes to `newRowPosition`. |
| `deleteRows` | `deleteRows(rowIds?: RowId \| readonly RowId[]): CommandResult;` |  | Batch mode marks the rows; other modes write at once. Without ids, the selected rows. |
| `updateRow` | `updateRow(rowId: RowId, row: Readonly<Record<string, unknown>>): CommandResult;` |  | Validates and writes the values. |
| `updateCell` | `updateCell(rowId: RowId, field: string, value: unknown): CommandResult;` |  | Edits a cell as a user would: batch mode keeps a draft; other modes write at once. |
| `setCellValue` | `setCellValue(rowId: RowId, field: string, value: unknown): CommandResult;` |  | Silent data update of one cell (no edit lifecycle or validation). Local data sources only. |
| `setRowData` | `setRowData(rowId: RowId, row: Row): CommandResult;` |  | Silent replacement of a row (no edit lifecycle or validation). Local data sources only. |
| `applyChanges` | `applyChanges(changes: EditDataChanges<Row>): CommandResult;` |  | Silent bulk data update (no edit lifecycle or validation). Local data sources only. |
| `getPendingChanges` | `getPendingChanges(): EditBatchChanges<Row>;` |  | Added, changed, and deleted rows not saved yet. |
| `getBatchPreview` | `getBatchPreview(): EditPreview \| undefined;` |  |  |
| `getEditSnapshot` | `getEditSnapshot(): EditSnapshot \| undefined;` |  |  |
| `hasUnsavedChanges` | `hasUnsavedChanges(): boolean;` |  |  |
| `whenEditSettled` | `whenEditSettled(): Promise<void>;` |  | Resolves when pending writes and async validators settled. |
| `validateBatch` | `validateBatch(): Promise<boolean>;` |  | Validates every pending change without saving and publishes the errors; resolves true when everything is valid once async validators settled. |
| `undo` | `undo(): CommandResult;` |  | Reverts the last edit action (needs `undo: true`). |
| `redo` | `redo(): CommandResult;` |  | Re-applies the last undone action. |
| `canUndo` | `canUndo(): boolean;` |  |  |
| `canRedo` | `canRedo(): boolean;` |  |  |

### EditBatchChanges

Kind: interface

Page: https://salmonui.dev/docs/reference/data-grid/engine/EditBatchChanges

```ts
interface EditBatchChanges<Row> {
    readonly addedRecords: readonly Row[];
    readonly changedRecords: readonly Row[];
    readonly deletedRecords: readonly Row[];
}
```

`getBatchChanges()`: rows with the drafts applied.

Members (3):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `addedRecords` | `readonly addedRecords: readonly Row[];` |  |  |
| `changedRecords` | `readonly changedRecords: readonly Row[];` |  |  |
| `deletedRecords` | `readonly deletedRecords: readonly Row[];` |  |  |

### EditCellContext

Kind: interface

Page: https://salmonui.dev/docs/reference/data-grid/engine/EditCellContext

```ts
interface EditCellContext<Row> {
    readonly row: Row;
    readonly rowId: RowId;
    readonly columnId: ColumnId;
    readonly column: CompiledColumn<Row>;
    readonly isNew: boolean;
}
```

Context of `isCellEditable` (`canEditCell` policy).

Members (5):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `row` | `readonly row: Row;` |  |  |
| `rowId` | `readonly rowId: RowId;` |  |  |
| `columnId` | `readonly columnId: ColumnId;` |  |  |
| `column` | `readonly column: CompiledColumn<Row>;` |  |  |
| `isNew` | `readonly isNew: boolean;` |  |  |

### EditChange

Kind: interface

Page: https://salmonui.dev/docs/reference/data-grid/engine/EditChange

```ts
interface EditChange {
    readonly rows: readonly RowId[];
    readonly cells: readonly CellRef[];
    readonly all: boolean;
}
```

Members (3):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `rows` | `readonly rows: readonly RowId[];` |  |  |
| `cells` | `readonly cells: readonly CellRef[];` |  |  |
| `all` | `readonly all: boolean;` |  | Too many targets: every subscribed row is notified. |

### EditDataChanges

Kind: interface

Page: https://salmonui.dev/docs/reference/data-grid/engine/EditDataChanges

```ts
interface EditDataChanges<Row> {
    readonly added?: readonly Row[];
    readonly changed?: readonly Row[];
    readonly deleted?: readonly RowId[];
}
```

Rows to apply with `applyChanges()`.

Members (3):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `added` | `readonly added?: readonly Row[];` | optional |  |
| `changed` | `readonly changed?: readonly Row[];` | optional | Replacement rows, matched by row id. |
| `deleted` | `readonly deleted?: readonly RowId[];` | optional |  |

### EditDisplay

Kind: interface

Page: https://salmonui.dev/docs/reference/data-grid/engine/EditDisplay

```ts
interface EditDisplay {
    readonly value: unknown;
    readonly formattedValue: string;
}
```

Display value of a draft-backed cell; identity is stable until the draft changes.

Members (2):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `value` | `readonly value: unknown;` |  |  |
| `formattedValue` | `readonly formattedValue: string;` |  |  |

### EditDraft

Kind: interface

Page: https://salmonui.dev/docs/reference/data-grid/engine/EditDraft

```ts
interface EditDraft {
    readonly rowId: RowId;
    readonly columnId: ColumnId;
    readonly initialValue: unknown;
    readonly value: unknown;
    readonly dirty: boolean;
    readonly errors: readonly string[];
    readonly pending: boolean;
}
```

One draft value (read-only view).

Members (7):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `rowId` | `readonly rowId: RowId;` |  |  |
| `columnId` | `readonly columnId: ColumnId;` |  |  |
| `initialValue` | `readonly initialValue: unknown;` |  |  |
| `value` | `readonly value: unknown;` |  |  |
| `dirty` | `readonly dirty: boolean;` |  |  |
| `errors` | `readonly errors: readonly string[];` |  |  |
| `pending` | `readonly pending: boolean;` |  |  |

### EditMessages

Kind: interface

Page: https://salmonui.dev/docs/reference/data-grid/engine/EditMessages

```ts
interface EditMessages {
    readonly saveFailed: string;
    readonly saveRejected: string;
    readonly partialSave: string;
    readonly conflict: string;
}
```

Save and conflict texts of the edit module (localizable through `EditOptions.messages`).

Members (4):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `saveFailed` | `readonly saveFailed: string;` |  | A write failed without a message (also a write that never settled). |
| `saveRejected` | `readonly saveRejected: string;` |  | The data source rejected the whole write without row or cell errors. |
| `partialSave` | `readonly partialSave: string;` |  | Some rows of a write failed (`lastError`). |
| `conflict` | `readonly conflict: string;` |  | Row error of a write conflict. |

### EditOptions

Kind: interface

Page: https://salmonui.dev/docs/reference/data-grid/engine/EditOptions

```ts
interface EditOptions<Row = unknown> {
    readonly enabled?: boolean;
    readonly edit?: boolean;
    readonly add?: boolean;
    readonly delete?: boolean;
    readonly mode?: EditMode;
    readonly newRowPosition?: NewRowPosition;
    readonly showNewRow?: boolean;
    readonly tabToNextRow?: boolean;
    readonly isCellEditable?: (ctx: EditCellContext<Row>) => boolean;
    readonly validateRow?: RowValidator<Row>;
    readonly messages?: Partial<EditMessageTable>;
    readonly newRow?: () => Partial<Row>;
    readonly undo?: boolean;
    readonly undoLimit?: number;
    readonly keyedRows?: boolean;
}
```

Members (15):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `enabled` | `readonly enabled?: boolean;` | optional | Default true. |
| `edit` | `readonly edit?: boolean;` | optional | Existing rows can be edited. Default true. |
| `add` | `readonly add?: boolean;` | optional | Rows can be added. Default true. |
| `delete` | `readonly delete?: boolean;` | optional | Rows can be deleted. Default true. |
| `mode` | `readonly mode?: EditMode;` | optional | `row` is inline row editing. Default `row`. |
| `newRowPosition` | `readonly newRowPosition?: NewRowPosition;` | optional | Where added rows appear. Default `top`. Tree mode: `above` / `below` the focused row as its sibling, or as its last `child`; the added row carries its `parentId` in `WriteRequest.added`. |
| `showNewRow` | `readonly showNewRow?: boolean;` | optional | An always-visible blank add row at `newRowPosition`; row mode only. Saving it writes the record and shows a fresh blank row. Default false. |
| `tabToNextRow` | `readonly tabToNextRow?: boolean;` | optional | Tab from the last editable cell continues in the next row. Default true in batch and cell mode, false otherwise. |
| `isCellEditable` | `readonly isCellEditable?: (ctx: EditCellContext<Row>) => boolean;` | optional | Extra per-cell policy (`canEditCell`); column and row rules apply first. |
| `validateRow` | `readonly validateRow?: RowValidator<Row>;` | optional | Row-level validation before a row (or batch) commits; may be async. |
| `messages` | `readonly messages?: Partial<EditMessageTable>;` | optional | Validation and save / conflict message overrides (`EditMessages`). |
| `newRow` | `readonly newRow?: () => Partial<Row>;` | optional | Initial values of an added row, merged over the columns' `defaultValue`. |
| `undo` | `readonly undo?: boolean;` | optional | Records an undo history. Default false: nothing is recorded. |
| `undoLimit` | `readonly undoLimit?: number;` | optional | Maximum undo entries kept (oldest dropped first). Default 10. |
| `keyedRows` | `readonly keyedRows?: boolean;` | optional | `getRowId` is the application's own key (a renderer passes true when the app set `getRowId`), so rows are addressable without a `primaryKey` column and `edit-no-primary-key` is not reported. Default false. |

### EditPreview

Kind: interface

Page: https://salmonui.dev/docs/reference/data-grid/engine/EditPreview

```ts
interface EditPreview {
    readonly cells: readonly EditPreviewCell[];
    readonly addedRowIds: readonly RowId[];
    readonly deletedRowIds: readonly RowId[];
    readonly dirtyCellCount: number;
    readonly invalidCellCount: number;
}
```

`edit.getBatchPreview()`: non-mutating diff for a save-review UI.

Members (5):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `cells` | `readonly cells: readonly EditPreviewCell[];` |  |  |
| `addedRowIds` | `readonly addedRowIds: readonly RowId[];` |  |  |
| `deletedRowIds` | `readonly deletedRowIds: readonly RowId[];` |  |  |
| `dirtyCellCount` | `readonly dirtyCellCount: number;` |  |  |
| `invalidCellCount` | `readonly invalidCellCount: number;` |  |  |

### EditPreviewCell

Kind: interface

Page: https://salmonui.dev/docs/reference/data-grid/engine/EditPreviewCell

```ts
interface EditPreviewCell {
    readonly rowId: RowId;
    readonly columnId: ColumnId;
    readonly previous: unknown;
    readonly value: unknown;
    readonly errors: readonly string[];
}
```

Members (5):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `rowId` | `readonly rowId: RowId;` |  |  |
| `columnId` | `readonly columnId: ColumnId;` |  |  |
| `previous` | `readonly previous: unknown;` |  |  |
| `value` | `readonly value: unknown;` |  |  |
| `errors` | `readonly errors: readonly string[];` |  |  |

### EditSnapshot

Kind: interface

Page: https://salmonui.dev/docs/reference/data-grid/engine/EditSnapshot

```ts
interface EditSnapshot {
    readonly activeRowId: RowId | null;
    readonly activeCell: CellRef | null;
    readonly addedRows: readonly RowId[];
    readonly deletedRows: readonly RowId[];
    readonly changedRows: readonly RowId[];
    readonly dirtyCellCount: number;
    readonly cellErrors: Readonly<Record<string, readonly string[]>>;
    readonly rowErrors: Readonly<Record<RowId, readonly string[]>>;
    readonly status: EditStatus;
}
```

`edit.getSnapshot()`.

Members (9):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `activeRowId` | `readonly activeRowId: RowId \| null;` |  |  |
| `activeCell` | `readonly activeCell: CellRef \| null;` |  |  |
| `addedRows` | `readonly addedRows: readonly RowId[];` |  |  |
| `deletedRows` | `readonly deletedRows: readonly RowId[];` |  |  |
| `changedRows` | `readonly changedRows: readonly RowId[];` |  |  |
| `dirtyCellCount` | `readonly dirtyCellCount: number;` |  |  |
| `cellErrors` | `readonly cellErrors: Readonly<Record<string, readonly string[]>>;` |  |  |
| `rowErrors` | `readonly rowErrors: Readonly<Record<RowId, readonly string[]>>;` |  |  |
| `status` | `readonly status: EditStatus;` |  |  |

### EditState

Kind: interface

Page: https://salmonui.dev/docs/reference/data-grid/engine/EditState

```ts
interface EditState {
    readonly options: ResolvedEditOptions;
    readonly version: number;
    readonly newRowId: RowId | null;
    readonly active: EditTarget | null;
    readonly status: EditStatus;
    readonly dirtyCellCount: number;
    readonly addedRowIds: readonly RowId[];
    readonly deletedRowIds: readonly RowId[];
    readonly pendingWrites: number;
    readonly lastError: string | null;
    readonly lastBulk: {
        readonly requested: number;
        readonly applied: number;
    } | null;
    readonly canUndo: boolean;
    readonly addedTreePlacements?: Readonly<Record<RowId, AddedTreePlacement>>;
    readonly canRedo: boolean;
    readonly change: EditChange;
}
```

Members (15):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `options` | `readonly options: ResolvedEditOptions;` |  |  |
| `version` | `readonly version: number;` |  |  |
| `newRowId` | `readonly newRowId: RowId \| null;` |  | The always-visible add row (`showNewRow`), or null. It is not in `addedRowIds` and counts as an unsaved change only once it has a changed value; a fresh id follows every save or cancel of it. |
| `active` | `readonly active: EditTarget \| null;` |  |  |
| `status` | `readonly status: EditStatus;` |  |  |
| `dirtyCellCount` | `readonly dirtyCellCount: number;` |  |  |
| `addedRowIds` | `readonly addedRowIds: readonly RowId[];` |  | Added, unsaved rows in display order (identity changes only when the list changes). |
| `deletedRowIds` | `readonly deletedRowIds: readonly RowId[];` |  | Rows marked for deletion in batch mode. |
| `pendingWrites` | `readonly pendingWrites: number;` |  |  |
| `lastError` | `readonly lastError: string \| null;` |  | Message of the last failed write, cleared by the next successful one. |
| `lastBulk` | `readonly lastBulk: {     readonly requested: number;     readonly applied: number; } \| null;` |  | Outcome of the last `edit.setValues` (paste, fill): cells requested and cells that took a value. |
| `canUndo` | `readonly canUndo: boolean;` |  | An `edit.undo` would apply (always false with `undo: false`). |
| `addedTreePlacements` | `readonly addedTreePlacements?: Readonly<Record<RowId, AddedTreePlacement>>;` | optional | Tree mode: where each added row goes (`above` / `below` / `child` of an anchor row); absent when none. |
| `canRedo` | `readonly canRedo: boolean;` |  | An `edit.redo` would apply. |
| `change` | `readonly change: EditChange;` |  |  |

### EditTarget

Kind: interface

Page: https://salmonui.dev/docs/reference/data-grid/engine/EditTarget

```ts
interface EditTarget {
    readonly rowId: RowId;
    readonly columnId: ColumnId | null;
    readonly isNew: boolean;
}
```

The row (row and dialog modes) or cell (batch and cell modes) being edited.

Members (3):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `rowId` | `readonly rowId: RowId;` |  |  |
| `columnId` | `readonly columnId: ColumnId \| null;` |  | The edited cell; in row and dialog mode the cell that has the editor focus. |
| `isNew` | `readonly isNew: boolean;` |  |  |

### EditWriteOutcome

Kind: interface

Page: https://salmonui.dev/docs/reference/data-grid/engine/EditWriteOutcome

```ts
interface EditWriteOutcome<Row> {
    readonly token: number;
    readonly mode: EditMode;
    readonly request: WriteRequest<Row>;
    readonly result: WriteResult<Row> | null;
    readonly error: unknown;
    readonly failedRowIds: readonly RowId[];
}
```

Outcome of the last write (`edit.getLastWrite()`).

Members (6):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `token` | `readonly token: number;` |  |  |
| `mode` | `readonly mode: EditMode;` |  |  |
| `request` | `readonly request: WriteRequest<Row>;` |  |  |
| `result` | `readonly result: WriteResult<Row> \| null;` |  |  |
| `error` | `readonly error: unknown;` |  |  |
| `failedRowIds` | `readonly failedRowIds: readonly RowId[];` |  |  |

### ExpansionDescriptor

Kind: interface

Page: https://salmonui.dev/docs/reference/data-grid/engine/ExpansionDescriptor

```ts
interface ExpansionDescriptor {
    readonly groups: Readonly<Record<string, boolean>>;
    readonly tree: Readonly<Record<RowId, boolean>>;
    readonly detail: Readonly<Record<RowId, boolean>>;
    readonly defaultGroupExpanded: boolean;
}
```

Members (4):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `groups` | `readonly groups: Readonly<Record<string, boolean>>;` |  |  |
| `tree` | `readonly tree: Readonly<Record<RowId, boolean>>;` |  |  |
| `detail` | `readonly detail: Readonly<Record<RowId, boolean>>;` |  |  |
| `defaultGroupExpanded` | `readonly defaultGroupExpanded: boolean;` |  |  |

### FacetOptions

Kind: interface

Page: https://salmonui.dev/docs/reference/data-grid/engine/FacetOptions

```ts
interface FacetOptions {
    readonly search?: string;
    readonly offset?: number;
    readonly limit?: number;
}
```

Members (3):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `search` | `readonly search?: string;` | optional | Case- and accent-insensitive substring match on the label (Excel checklist search box). |
| `offset` | `readonly offset?: number;` | optional |  |
| `limit` | `readonly limit?: number;` | optional | Default 1000 (`facetLimit`). |

### FacetValue

Kind: interface

Page: https://salmonui.dev/docs/reference/data-grid/engine/FacetValue

```ts
interface FacetValue {
    readonly key: string;
    readonly value: Json;
    readonly label: string;
    readonly count: number;
    readonly blank: boolean;
    readonly selected: boolean;
}
```

Members (6):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `key` | `readonly key: string;` |  | Stable key: `BLANK_FACET_KEY`, or a type-tagged value (`s:`, `n:`, `d:`, `b:`). |
| `value` | `readonly value: Json;` |  | Filter value for `in` / `equal` (dates as ISO strings); null for blanks. |
| `label` | `readonly label: string;` |  | Formatted display value ('' for blanks; the renderer localizes the blank label). |
| `count` | `readonly count: number;` |  |  |
| `blank` | `readonly blank: boolean;` |  |  |
| `selected` | `readonly selected: boolean;` |  | Whether the column's current filter keeps this value (all true when the column is unfiltered). |

### FieldValidatorContext

Kind: interface

Page: https://salmonui.dev/docs/reference/data-grid/engine/FieldValidatorContext

```ts
interface FieldValidatorContext {
    readonly name: string;
    readonly formData: FormDataLike | null;
    readonly isNew: false;
}
```

Context of a form field's custom validators (`@salmonui/inputs/form` `Field`). It is passed as both the `row` and the
`ctx` argument, so `validate(value, { formData })` reads other fields.

Members (3):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `name` | `readonly name: string;` |  | The field's `name` (`''` without one). |
| `formData` | `readonly formData: FormDataLike \| null;` |  | The owning form's data at validation time; `null` outside a form. |
| `isNew` | `readonly isNew: false;` |  |  |

### FilterColumnOptions

Kind: interface

Page: https://salmonui.dev/docs/reference/data-grid/engine/FilterColumnOptions

```ts
interface FilterColumnOptions {
    readonly logic?: 'and' | 'or';
    readonly matchCase?: boolean;
    readonly ignoreAccents?: boolean;
}
```

Options of `DataGridApi.filterColumn`.

Members (3):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `logic` | `readonly logic?: 'and' \| 'or';` | optional | Combination with the column's previous condition. Default `and`. |
| `matchCase` | `readonly matchCase?: boolean;` | optional |  |
| `ignoreAccents` | `readonly ignoreAccents?: boolean;` | optional |  |

### FilterDescriptor

Kind: interface

Page: https://salmonui.dev/docs/reference/data-grid/engine/FilterDescriptor

```ts
interface FilterDescriptor {
    readonly kind?: 'condition';
    readonly columnId: ColumnId;
    readonly operator: FilterOperator | (string & {});
    readonly value: Json;
    readonly predicate: 'and' | 'or';
    readonly matchCase?: boolean;
    readonly ignoreAccent?: boolean;
    readonly source: FilterSource;
}
```

Members (8):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `kind` | `readonly kind?: 'condition';` | optional |  |
| `columnId` | `readonly columnId: ColumnId;` |  |  |
| `operator` | `readonly operator: FilterOperator \| (string & {});` |  | A built-in operator or the name of a custom operator registered with `createFilterModule({ operators })`. |
| `value` | `readonly value: Json;` |  | `between`: `[from, to]` (inclusive). `in` / `notIn`: an array. Dates: ISO strings or epoch milliseconds. |
| `predicate` | `readonly predicate: 'and' \| 'or';` |  | Combination with the previous condition on the same column at the top level; ignored inside a group. |
| `matchCase` | `readonly matchCase?: boolean;` | optional |  |
| `ignoreAccent` | `readonly ignoreAccent?: boolean;` | optional |  |
| `source` | `readonly source: FilterSource;` |  |  |

### FilterGroupDescriptor

Kind: interface

Page: https://salmonui.dev/docs/reference/data-grid/engine/FilterGroupDescriptor

```ts
interface FilterGroupDescriptor {
    readonly kind: 'group';
    readonly predicate: 'and' | 'or';
    readonly not?: boolean;
    readonly filters: readonly FilterEntry[];
    readonly source?: FilterSource;
}
```

Nested AND/OR group: `predicate` combines its members (`{ predicate: 'or',
filters: [A, B] }` is A OR B); member
predicates are ignored. A top-level group is ANDed with the other
top-level entries; a nested group is one member of its parent.

Members (5):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `kind` | `readonly kind: 'group';` |  |  |
| `predicate` | `readonly predicate: 'and' \| 'or';` |  |  |
| `not` | `readonly not?: boolean;` | optional | Negates the combined group: NOT (A AND B). |
| `filters` | `readonly filters: readonly FilterEntry[];` |  |  |
| `source` | `readonly source?: FilterSource;` | optional |  |

### FilterModuleConfig

Kind: interface

Page: https://salmonui.dev/docs/reference/data-grid/engine/FilterModuleConfig

```ts
interface FilterModuleConfig<Row = unknown> {
    readonly operators?: Readonly<Record<string, CustomFilterOperator<Row>>>;
}
```

Members (1):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `operators` | `readonly operators?: Readonly<Record<string, CustomFilterOperator<Row>>>;` | optional |  |

### FilterOptions

Kind: interface

Page: https://salmonui.dev/docs/reference/data-grid/engine/FilterOptions

```ts
interface FilterOptions {
    readonly enabled?: boolean;
    readonly caseSensitive?: boolean;
    readonly ignoreAccent?: boolean;
}
```

Members (3):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `enabled` | `readonly enabled?: boolean;` | optional | Enables filtering. When false, filter commands other than `filter.clear` are rejected. Default true. |
| `caseSensitive` | `readonly caseSensitive?: boolean;` | optional | Default `matchCase` for conditions that omit it. Default false. |
| `ignoreAccent` | `readonly ignoreAccent?: boolean;` | optional | Default `ignoreAccent` (NFD diacritic strip). Default false. |

### FilterState

Kind: interface

Page: https://salmonui.dev/docs/reference/data-grid/engine/FilterState

```ts
interface FilterState {
    readonly filters: readonly FilterEntry[];
    readonly enabled: boolean;
    readonly caseSensitive: boolean;
    readonly ignoreAccent: boolean;
}
```

Members (4):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `filters` | `readonly filters: readonly FilterEntry[];` |  |  |
| `enabled` | `readonly enabled: boolean;` |  |  |
| `caseSensitive` | `readonly caseSensitive: boolean;` |  |  |
| `ignoreAccent` | `readonly ignoreAccent: boolean;` |  |  |

### FitColumn

Kind: interface

Page: https://salmonui.dev/docs/reference/data-grid/engine/FitColumn

```ts
interface FitColumn {
    readonly width: number;
    readonly max: number;
    readonly flexible: boolean;
}
```

One visible leaf column as seen by `fitColumnWidths`.

Members (3):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `width` | `readonly width: number;` |  | Resolved (declared or user) width in px. |
| `max` | `readonly max: number;` |  | `maxWidth` in px (`Infinity` when unset). |
| `flexible` | `readonly flexible: boolean;` |  | False for columns that never stretch (fixed-size columns such as the selection column). |

### FocusOptions

Kind: interface

Page: https://salmonui.dev/docs/reference/data-grid/engine/FocusOptions

```ts
interface FocusOptions {
    readonly pageSize?: number;
    readonly headerNavigation?: boolean;
}
```

Members (2):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `pageSize` | `readonly pageSize?: number;` | optional | Rows per PageUp/PageDown when the command carries no `pageSize`. Default 10. |
| `headerNavigation` | `readonly headerNavigation?: boolean;` | optional | Whether ArrowUp from the first row enters the header. Default true. |

### FocusState

Kind: interface

Page: https://salmonui.dev/docs/reference/data-grid/engine/FocusState

```ts
interface FocusState {
    readonly target: FocusTarget | null;
    readonly mode: 'navigate' | 'edit';
    readonly direction: 'ltr' | 'rtl';
    readonly lastCell: {
        readonly rowId: RowId;
        readonly columnId: ColumnId;
    } | null;
    readonly intent: FocusIntent | null;
}
```

Members (5):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `target` | `readonly target: FocusTarget \| null;` |  |  |
| `mode` | `readonly mode: 'navigate' \| 'edit';` |  |  |
| `direction` | `readonly direction: 'ltr' \| 'rtl';` |  | Resolved text direction (the `direction` option, or what the renderer detected from `dir`). |
| `lastCell` | `readonly lastCell: {     readonly rowId: RowId;     readonly columnId: ColumnId; } \| null;` |  | Last body cell, so moving back from the header returns to it. |
| `intent` | `readonly intent: FocusIntent \| null;` |  | Span-aware moves: the column a vertical move aimed at, or the row a horizontal move aimed at, when it landed on a span anchor elsewhere. The next move in the same axis continues from it, so moving down through a column span returns to the original column. Null otherwise. |

### FormDataLike

Kind: interface

Page: https://salmonui.dev/docs/reference/data-grid/engine/FormDataLike

```ts
interface FormDataLike {
    get(name: string): unknown;
    getAll(name: string): unknown[];
    has(name: string): boolean;
}
```

The read side of `FormData` (core has no DOM types).

Members (3):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `get` | `get(name: string): unknown;` |  |  |
| `getAll` | `getAll(name: string): unknown[];` |  |  |
| `has` | `has(name: string): boolean;` |  |  |

### FormatOptions

Kind: interface

Page: https://salmonui.dev/docs/reference/data-grid/engine/FormatOptions

```ts
interface FormatOptions {
    readonly type?: 'number' | 'date' | 'datetime';
    readonly format?: string;
    readonly skeleton?: string;
    readonly currency?: string;
    readonly minimumFractionDigits?: number;
    readonly maximumFractionDigits?: number;
    readonly useGrouping?: boolean;
    readonly timeZone?: string;
}
```

Number presets (`N2`, `C`, `P1`), custom number patterns (`#,##0.00`), date skeletons (`yMMMd`, `short`), or custom date patterns (`dd/MM/yyyy HH:mm`).

Members (8):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `type` | `readonly type?: 'number' \| 'date' \| 'datetime';` | optional |  |
| `format` | `readonly format?: string;` | optional | Preset or custom pattern. |
| `skeleton` | `readonly skeleton?: string;` | optional | Date skeleton such as `yMd`, `yMMMEd`, `Hm`, or a style: `short` \| `medium` \| `long` \| `full`. |
| `currency` | `readonly currency?: string;` | optional | ISO 4217 code for currency formats. Defaults to the grid `currency` option. |
| `minimumFractionDigits` | `readonly minimumFractionDigits?: number;` | optional |  |
| `maximumFractionDigits` | `readonly maximumFractionDigits?: number;` | optional |  |
| `useGrouping` | `readonly useGrouping?: boolean;` | optional |  |
| `timeZone` | `readonly timeZone?: string;` | optional | IANA time zone. Defaults to the grid `timeZone` option. Set it for deterministic SSR output. |

### Formatter

Kind: interface

Page: https://salmonui.dev/docs/reference/data-grid/engine/Formatter

```ts
interface Formatter {
    readonly locale: string;
    readonly currency: string;
    readonly timeZone: string | undefined;
    format(value: unknown, format?: string | FormatOptions, type?: ColumnType): string;
    number(value: unknown, format?: string | FormatOptions): string;
    date(value: unknown, format?: string | FormatOptions): string;
    dateTime(value: unknown, format?: string | FormatOptions): string;
    money(value: unknown, fractionDigits?: number, currency?: string): string;
    percent(value: unknown, fractionDigits?: number): string;
}
```

Members (9):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `locale` | `readonly locale: string;` |  |  |
| `currency` | `readonly currency: string;` |  |  |
| `timeZone` | `readonly timeZone: string \| undefined;` |  |  |
| `format` | `format(value: unknown, format?: string \| FormatOptions, type?: ColumnType): string;` |  | Formats like a column `format`: number presets (`N2`, `C`, `P1`), number patterns (`#,##0.00`), date skeletons (`yMMMd`) and styles (`short`), date patterns (`dd/MM/yyyy HH:mm`), or `FormatOptions`. `type` defaults to `date` for `Date` values and `number` for numbers. |
| `number` | `number(value: unknown, format?: string \| FormatOptions): string;` |  |  |
| `date` | `date(value: unknown, format?: string \| FormatOptions): string;` |  |  |
| `dateTime` | `dateTime(value: unknown, format?: string \| FormatOptions): string;` |  |  |
| `money` | `money(value: unknown, fractionDigits?: number, currency?: string): string;` |  |  |
| `percent` | `percent(value: unknown, fractionDigits?: number): string;` |  |  |

### FormatterOptions

Kind: interface

Page: https://salmonui.dev/docs/reference/data-grid/engine/FormatterOptions

```ts
interface FormatterOptions {
    readonly locale?: string;
    readonly currency?: string;
    readonly timeZone?: string;
}
```

Members (3):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `locale` | `readonly locale?: string;` | optional | BCP 47 locale. Default `en-US`. |
| `currency` | `readonly currency?: string;` | optional | ISO 4217 code for currency formats. Default `USD`. |
| `timeZone` | `readonly timeZone?: string;` | optional | IANA time zone for dates. Default: the runtime zone (set it for deterministic SSR output). |

### GroupDescriptor

Kind: interface

Page: https://salmonui.dev/docs/reference/data-grid/engine/GroupDescriptor

```ts
interface GroupDescriptor {
    readonly columnId: ColumnId;
    readonly format?: string;
    readonly direction?: 'asc' | 'desc';
}
```

Members (3):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `columnId` | `readonly columnId: ColumnId;` |  |  |
| `format` | `readonly format?: string;` | optional | Group-by-format: a number or date format (`N0`, `yMMM`) whose formatted value is the group key. |
| `direction` | `readonly direction?: 'asc' \| 'desc';` | optional | Group order when the sort list has no descriptor for the column. Default `asc`. |

### GroupPathSegment

Kind: interface

Page: https://salmonui.dev/docs/reference/data-grid/engine/GroupPathSegment

```ts
interface GroupPathSegment {
    readonly columnId: ColumnId;
    readonly key: Json;
}
```

One level of a group path: the grouped column and the group key (JSON form of the value).

Members (2):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `columnId` | `readonly columnId: ColumnId;` |  |  |
| `key` | `readonly key: Json;` |  |  |

### GroupRowSnapshot

Kind: interface

Page: https://salmonui.dev/docs/reference/data-grid/engine/GroupRowSnapshot

```ts
interface GroupRowSnapshot {
    readonly id: RowId;
    readonly kind: 'group' | 'groupFooter';
    readonly index: number;
    readonly depth: number;
    readonly parentId: RowId | null;
    readonly path: readonly GroupPathSegment[];
    readonly pathKey: string;
    readonly columnId: ColumnId;
    readonly headerText: string;
    readonly key: Json;
    readonly value: unknown;
    readonly formattedKey: string;
    readonly count: number;
    readonly expanded: boolean;
    readonly aggregates: AggregateValues;
    readonly posInSet: number;
    readonly setSize: number;
    readonly status: LazyStatus;
    readonly error: unknown;
    readonly hasMore: boolean;
}
```

Caption or footer row of a group, for renderers and templates.

Members (20):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `id` | `readonly id: RowId;` |  |  |
| `kind` | `readonly kind: 'group' \| 'groupFooter';` |  |  |
| `index` | `readonly index: number;` |  | Visible index. |
| `depth` | `readonly depth: number;` |  | Group level (0 = top). |
| `parentId` | `readonly parentId: RowId \| null;` |  |  |
| `path` | `readonly path: readonly GroupPathSegment[];` |  |  |
| `pathKey` | `readonly pathKey: string;` |  |  |
| `columnId` | `readonly columnId: ColumnId;` |  |  |
| `headerText` | `readonly headerText: string;` |  |  |
| `key` | `readonly key: Json;` |  | JSON form of the key (path segment key). |
| `value` | `readonly value: unknown;` |  | Raw key value (first row's value, or the group-by-format label). |
| `formattedKey` | `readonly formattedKey: string;` |  |  |
| `count` | `readonly count: number;` |  | Data rows in the group (all of them, also in lazy mode). |
| `expanded` | `readonly expanded: boolean;` |  |  |
| `aggregates` | `readonly aggregates: AggregateValues;` |  | Group aggregates as shown (page-wise when paged with `scope: 'page'`). |
| `posInSet` | `readonly posInSet: number;` |  | 1-based position among sibling groups and their number (`aria-posinset`, `aria-setsize`). |
| `setSize` | `readonly setSize: number;` |  |  |
| `status` | `readonly status: LazyStatus;` |  | Lazy mode load state of the group's children; `ready` for local groups. |
| `error` | `readonly error: unknown;` |  |  |
| `hasMore` | `readonly hasMore: boolean;` |  | Lazy mode: more children can be loaded (`grouping.loadMore`). |

### GroupTreeSnapshot

Kind: interface

Page: https://salmonui.dev/docs/reference/data-grid/engine/GroupTreeSnapshot

```ts
interface GroupTreeSnapshot {
    readonly depth: number;
    readonly count: number;
}
```

Opaque group structure carried by the row model (see `./index.js` grouping).

Members (2):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `depth` | `readonly depth: number;` |  | Grouping levels. |
| `count` | `readonly count: number;` |  | Groups over all levels. |

### GroupedRowEnvelope

Kind: interface

Page: https://salmonui.dev/docs/reference/data-grid/engine/GroupedRowEnvelope

```ts
interface GroupedRowEnvelope<Row> {
    readonly kind: 'group';
    readonly key: Json;
    readonly columnId: ColumnId;
    readonly groupPath: readonly GroupPathSegment[];
    readonly count: number;
    readonly aggregates?: AggregateValues;
    readonly items?: readonly (Row | GroupedRowEnvelope<Row>)[];
}
```

Group envelope of a lazy group load (`DataSourceRequest.groupPath`).

Members (7):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `kind` | `readonly kind: 'group';` |  |  |
| `key` | `readonly key: Json;` |  |  |
| `columnId` | `readonly columnId: ColumnId;` |  |  |
| `groupPath` | `readonly groupPath: readonly GroupPathSegment[];` |  |  |
| `count` | `readonly count: number;` |  | Total descendants (data rows), not loaded descendants. |
| `aggregates` | `readonly aggregates?: AggregateValues;` | optional |  |
| `items` | `readonly items?: readonly (Row \| GroupedRowEnvelope<Row>)[];` | optional | Omitted for lazy groups. |

### GroupingOptions

Kind: interface

Page: https://salmonui.dev/docs/reference/data-grid/engine/GroupingOptions

```ts
interface GroupingOptions {
    readonly enabled?: boolean;
    readonly showGroupedColumns?: boolean;
    readonly defaultExpanded?: boolean;
    readonly expandedGroups?: Readonly<Record<string, boolean>>;
    readonly lazy?: boolean;
    readonly lazyChunk?: number;
}
```

Members (6):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `enabled` | `readonly enabled?: boolean;` | optional | Enables grouping. When false, grouping commands are rejected and the query has no grouping. Default true. |
| `showGroupedColumns` | `readonly showGroupedColumns?: boolean;` | optional | Keep grouped columns visible. Default true. |
| `defaultExpanded` | `readonly defaultExpanded?: boolean;` | optional | Groups start expanded. Default true (false in lazy mode). |
| `expandedGroups` | `readonly expandedGroups?: Readonly<Record<string, boolean>>;` | optional | Initial per-group expansion by group path key or row id. |
| `lazy` | `readonly lazy?: boolean;` | optional | Load group levels on demand from a remote source with `capabilities.lazyGroups`. |
| `lazyChunk` | `readonly lazyChunk?: number;` | optional | Lazy mode: child rows per load. Default 100. |

### GroupingState

Kind: interface

Page: https://salmonui.dev/docs/reference/data-grid/engine/GroupingState

```ts
interface GroupingState {
    readonly enabled: boolean;
    readonly grouping: readonly GroupDescriptor[];
    readonly showGroupedColumns: boolean;
    readonly expanded: Readonly<Record<string, boolean>>;
    readonly defaultExpanded: boolean;
    readonly lazy: boolean;
    readonly lazyVersion: number;
    readonly lazyTotal?: number | null;
}
```

Members (8):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `enabled` | `readonly enabled: boolean;` |  |  |
| `grouping` | `readonly grouping: readonly GroupDescriptor[];` |  |  |
| `showGroupedColumns` | `readonly showGroupedColumns: boolean;` |  |  |
| `expanded` | `readonly expanded: Readonly<Record<string, boolean>>;` |  | Group path key -> expanded, overriding `defaultExpanded`. |
| `defaultExpanded` | `readonly defaultExpanded: boolean;` |  |  |
| `lazy` | `readonly lazy: boolean;` |  |  |
| `lazyVersion` | `readonly lazyVersion: number;` |  | Lazy store version (bumped when a lazy load settles). |
| `lazyTotal` | `readonly lazyTotal?: number \| null;` | optional | Lazy mode: top-level groups matching the query, as the root level reported them (the pager pages top-level groups); null before the root loads and outside lazy mode. |

### HeaderSnapshot

Kind: interface

Page: https://salmonui.dev/docs/reference/data-grid/engine/HeaderSnapshot

```ts
interface HeaderSnapshot {
    readonly columnId: ColumnId;
    readonly headerText: string;
    readonly leaf: boolean;
    readonly depth: number;
    readonly visible: boolean;
    readonly freeze: 'left' | 'right' | null;
    readonly flags: ColumnFlags;
}
```

Members (7):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `columnId` | `readonly columnId: ColumnId;` |  |  |
| `headerText` | `readonly headerText: string;` |  |  |
| `leaf` | `readonly leaf: boolean;` |  |  |
| `depth` | `readonly depth: number;` |  |  |
| `visible` | `readonly visible: boolean;` |  |  |
| `freeze` | `readonly freeze: 'left' \| 'right' \| null;` |  |  |
| `flags` | `readonly flags: ColumnFlags;` |  |  |

### HierarchyOptions

Kind: interface

Page: https://salmonui.dev/docs/reference/data-grid/engine/HierarchyOptions

```ts
interface HierarchyOptions<Child = unknown, Row = unknown, Nested = unknown> {
    readonly childGrid?: ChildGridConfig<Child, Row, Nested>;
    readonly depth?: number;
}
```

`options.hierarchy`: `Child` is the first-level child row type, `Row` the grid's row type.

Members (2):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `childGrid` | `readonly childGrid?: ChildGridConfig<Child, Row, Nested>;` | optional |  |
| `depth` | `readonly depth?: number;` | optional | Nesting depth of this grid (0 for the root). Set on child options. |

### HierarchyState

Kind: interface

Page: https://salmonui.dev/docs/reference/data-grid/engine/HierarchyState

```ts
interface HierarchyState {
    readonly enabled: boolean;
    readonly depth: number;
}
```

Members (2):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `enabled` | `readonly enabled: boolean;` |  |  |
| `depth` | `readonly depth: number;` |  |  |

### KeyBinding

Kind: interface

Page: https://salmonui.dev/docs/reference/data-grid/engine/KeyBinding

```ts
interface KeyBinding {
    readonly command: string;
    readonly keys: readonly string[];
    readonly mac?: readonly string[];
    readonly contexts: readonly KeyContext[];
    readonly feature: 'focus' | 'selection' | 'sort' | 'columns' | 'pager' | 'grouping' | 'editing' | 'clipboard' | 'print' | 'menu' | 'rows' | 'grid';
    readonly core: boolean;
}
```

Members (6):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `command` | `readonly command: string;` |  | Keyboard command name, `<area>.<action>` (`focus.down`, `edit.begin`). |
| `keys` | `readonly keys: readonly string[];` |  | Windows/Linux combos. `Mod` is Ctrl there and Cmd on macOS. |
| `mac` | `readonly mac?: readonly string[];` | optional | macOS combos when they differ (authoritative on Mac). |
| `contexts` | `readonly contexts: readonly KeyContext[];` |  |  |
| `feature` | `readonly feature: 'focus' \| 'selection' \| 'sort' \| 'columns' \| 'pager' \| 'grouping' \| 'editing' \| 'clipboard' \| 'print' \| 'menu' \| 'rows' \| 'grid';` |  | Feature that implements the behavior; informational. |
| `core` | `readonly core: boolean;` |  | True for the core keyboard table rows; false for Salmon UI additions. |

### KeyEventLike

Kind: interface

Page: https://salmonui.dev/docs/reference/data-grid/engine/KeyEventLike

```ts
interface KeyEventLike {
    readonly key: string;
    readonly code?: string;
    readonly ctrlKey: boolean;
    readonly metaKey: boolean;
    readonly altKey: boolean;
    readonly shiftKey: boolean;
}
```

Structural subset of a DOM `KeyboardEvent` (the engine compiles without the DOM lib).

Members (6):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `key` | `readonly key: string;` |  |  |
| `code` | `readonly code?: string;` | optional |  |
| `ctrlKey` | `readonly ctrlKey: boolean;` |  |  |
| `metaKey` | `readonly metaKey: boolean;` |  |  |
| `altKey` | `readonly altKey: boolean;` |  |  |
| `shiftKey` | `readonly shiftKey: boolean;` |  |  |

### Keymap

Kind: interface

Page: https://salmonui.dev/docs/reference/data-grid/engine/Keymap

```ts
interface Keymap {
    readonly platform: KeyPlatform;
    resolve(event: KeyEventLike, context: KeyContext): string | null;
    resolveCombo(combo: string, context: KeyContext): string | null;
    combosOf(command: string): readonly string[];
    readonly bindings: readonly KeyBinding[];
}
```

Members (5):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `platform` | `readonly platform: KeyPlatform;` |  |  |
| `resolve` | `resolve(event: KeyEventLike, context: KeyContext): string \| null;` |  | Keyboard command bound to the event's combo in `context`, or null. |
| `resolveCombo` | `resolveCombo(combo: string, context: KeyContext): string \| null;` |  |  |
| `combosOf` | `combosOf(command: string): readonly string[];` |  | Effective canonical combos of a command on this platform. |
| `bindings` | `readonly bindings: readonly KeyBinding[];` |  |  |

### KeymapOptions

Kind: interface

Page: https://salmonui.dev/docs/reference/data-grid/engine/KeymapOptions

```ts
interface KeymapOptions {
    readonly platform?: KeyPlatform;
    readonly bindings?: KeyBindingOverrides;
    readonly table?: readonly KeyBinding[];
    readonly warn?: (code: string, message: string) => void;
}
```

Members (4):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `platform` | `readonly platform?: KeyPlatform;` | optional |  |
| `bindings` | `readonly bindings?: KeyBindingOverrides;` | optional | Replaces the combos of the named commands (Custom Bindings). An empty array unbinds. |
| `table` | `readonly table?: readonly KeyBinding[];` | optional |  |
| `warn` | `readonly warn?: (code: string, message: string) => void;` | optional |  |

### LocalDataPatch

Kind: interface

Page: https://salmonui.dev/docs/reference/data-grid/engine/LocalDataPatch

```ts
interface LocalDataPatch<Row> {
    readonly append?: readonly Row[];
    readonly upsert?: readonly Row[];
    readonly remove?: readonly RowId[];
}
```

Members (3):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `append` | `readonly append?: readonly Row[];` | optional |  |
| `upsert` | `readonly upsert?: readonly Row[];` | optional | Replaces rows with a matching id; unknown ids are appended. |
| `remove` | `readonly remove?: readonly RowId[];` | optional |  |

### LocalDataSource

Kind: interface

Page: https://salmonui.dev/docs/reference/data-grid/engine/LocalDataSource

```ts
interface LocalDataSource<Row> extends DataSource<Row> {
    readonly mode: 'local';
    getRows(): readonly Row[];
    setRows(rows: readonly Row[]): void;
    patch(patch: LocalDataPatch<Row>): void;
    write(request: WriteRequest<Row>): Promise<WriteResult<Row>>;
    subscribe(listener: (event: DataSourceEvent<Row>) => void): () => void;
}
```

Members (9):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `mode` | `readonly mode: 'local';` |  |  |
| `getRows` | `getRows(): readonly Row[];` |  |  |
| `setRows` | `setRows(rows: readonly Row[]): void;` |  |  |
| `patch` | `patch(patch: LocalDataPatch<Row>): void;` |  |  |
| `write` | `write(request: WriteRequest<Row>): Promise<WriteResult<Row>>;` |  |  |
| `subscribe` | `subscribe(listener: (event: DataSourceEvent<Row>) => void): () => void;` |  |  |
| `read` | `read: (request: DataSourceRequest) => DataSourceResult<Row> \| Promise<DataSourceResult<Row>>;` | inherited |  |
| `invalidate` | `invalidate?: ((scope?: "all" \| "counts" \| "facets" \| "rows" \| undefined) => void);` | optional, inherited | Drops cached results; `engine.refresh()` calls it with `'all'` before re-reading. Must not notify. |
| `capabilities` | `capabilities?: Partial<DataSourceCapabilities>;` | optional, inherited |  |

### LocalDataSourceOptions

Kind: interface

Page: https://salmonui.dev/docs/reference/data-grid/engine/LocalDataSourceOptions

```ts
interface LocalDataSourceOptions<Row> {
    readonly getRowId?: (row: Row, index: number) => RowId;
}
```

Members (1):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `getRowId` | `readonly getRowId?: (row: Row, index: number) => RowId;` | optional | Required for `patch` upsert/remove and for `write`. The engine passes its own when it wraps an array. |

### LocaleInput

Kind: interface

Page: https://salmonui.dev/docs/reference/data-grid/engine/LocaleInput

```ts
interface LocaleInput extends FormatterOptions {
    readonly direction?: 'ltr' | 'rtl' | 'auto';
    readonly localeText?: Readonly<Record<string, unknown>>;
}
```

Members (5):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `direction` | `readonly direction?: 'ltr' \| 'rtl' \| 'auto';` | optional | `auto` derives the direction from the locale (like `dir="auto"`). Default `ltr`. |
| `localeText` | `readonly localeText?: Readonly<Record<string, unknown>>;` | optional | Text overrides over English. |
| `locale` | `locale?: string;` | optional, inherited | BCP 47 locale. Default `en-US`. |
| `currency` | `currency?: string;` | optional, inherited | ISO 4217 code for currency formats. Default `USD`. |
| `timeZone` | `timeZone?: string;` | optional, inherited | IANA time zone for dates. Default: the runtime zone (set it for deterministic SSR output). |

### LocaleTextState

Kind: interface

Page: https://salmonui.dev/docs/reference/data-grid/engine/LocaleTextState

```ts
interface LocaleTextState {
    readonly text: LocaleText;
}
```

Members (1):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `text` | `readonly text: LocaleText;` |  |  |

### LookupRequest

Kind: interface

Page: https://salmonui.dev/docs/reference/data-grid/engine/LookupRequest

```ts
interface LookupRequest {
    readonly keys: readonly Json[];
    readonly keyField: string;
    readonly displayField: string;
    readonly signal: AbortSignalLike;
}
```

Members (4):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `keys` | `readonly keys: readonly Json[];` |  | Keys the grid needs (deduplicated, never already requested). A lookup may return more rows. |
| `keyField` | `readonly keyField: string;` |  |  |
| `displayField` | `readonly displayField: string;` |  |  |
| `signal` | `readonly signal: AbortSignalLike;` |  |  |

### LookupSource

Kind: interface

Page: https://salmonui.dev/docs/reference/data-grid/engine/LookupSource

```ts
interface LookupSource {
    load(request: LookupRequest): readonly unknown[] | Promise<readonly unknown[]>;
}
```

Remote (or computed) lookup. `@salmonui/data` ships cached implementations (`createLookup`, `createJsonLookup`).

Members (1):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `load` | `load(request: LookupRequest): readonly unknown[] \| Promise<readonly unknown[]>;` |  |  |

### LookupState

Kind: interface

Page: https://salmonui.dev/docs/reference/data-grid/engine/LookupState

```ts
interface LookupState {
    readonly version: number;
    readonly columns: Readonly<Record<ColumnId, ColumnLookupStatus>>;
}
```

Members (2):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `version` | `readonly version: number;` |  | Bumped whenever a lookup table or status changes. |
| `columns` | `readonly columns: Readonly<Record<ColumnId, ColumnLookupStatus>>;` |  |  |

### ModuleContext

Kind: interface

Page: https://salmonui.dev/docs/reference/data-grid/engine/ModuleContext

```ts
interface ModuleContext<Row> {
    getSnapshot(): DataGridSnapshot<Row>;
    getModuleState<T = unknown>(name: string): T | undefined;
    dispatch(command: DataGridCommand): CommandResult;
    getColumns(): ColumnSnapshot<Row>;
    getRows(): RowModelSnapshot<Row>;
    getStageInput(name: PipelineStageName): RowModelSnapshot<Row> | undefined;
    getDataSource(): DataSource<Row>;
    isConnected?(): boolean;
    getRow(rowId: RowId): Row | undefined;
    getRowIndex(rowId: RowId): number;
    getRowIdAt(index: number): RowId | undefined;
    readonly timeZone: string | undefined;
    reject(reason: string, state?: unknown): CommandRejection;
    warn(code: string, message: string): void;
}
```

Members (14):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `getSnapshot` | `getSnapshot(): DataGridSnapshot<Row>;` |  |  |
| `getModuleState` | `getModuleState<T = unknown>(name: string): T \| undefined;` |  |  |
| `dispatch` | `dispatch(command: DataGridCommand): CommandResult;` |  |  |
| `getColumns` | `getColumns(): ColumnSnapshot<Row>;` |  |  |
| `getRows` | `getRows(): RowModelSnapshot<Row>;` |  |  |
| `getStageInput` | `getStageInput(name: PipelineStageName): RowModelSnapshot<Row> \| undefined;` |  | The row model entering a pipeline stage (brings the pipeline up to date first). For a stage skipped because a remote source performed it, the model that would have entered it. Undefined when no module registers it. |
| `getDataSource` | `getDataSource(): DataSource<Row>;` |  |  |
| `isConnected` | `isConnected?(): boolean;` | optional | False until `connect()` for an engine created with `deferDataSource`: modules must not start loads (user callbacks, fetches) before it; see `DataGridModule.onConnect`. |
| `getRow` | `getRow(rowId: RowId): Row \| undefined;` |  | Raw row by id (source rows, including rows filtered out of the view), or undefined. |
| `getRowIndex` | `getRowIndex(rowId: RowId): number;` |  | Visible index of a row (after the pipeline), or -1. |
| `getRowIdAt` | `getRowIdAt(index: number): RowId \| undefined;` |  | Row id at a visible index. |
| `timeZone` | `readonly timeZone: string \| undefined;` |  | The grid `timeZone` option (undefined: the runtime's local zone). |
| `reject` | `reject(reason: string, state?: unknown): CommandRejection;` |  | Rejects the command; `state`, when given, is still applied and notified (the command result stays `rejected`). |
| `warn` | `warn(code: string, message: string): void;` |  |  |

### NotificationScope

Kind: interface

Page: https://salmonui.dev/docs/reference/data-grid/engine/NotificationScope

```ts
interface NotificationScope {
    readonly grid?: boolean;
    readonly rows?: readonly RowId[];
    readonly cells?: readonly CellRef[];
    readonly headers?: readonly ColumnId[];
    readonly allRows?: boolean;
    readonly allHeaders?: boolean;
}
```

Members (6):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `grid` | `readonly grid?: boolean;` | optional | Replace the grid snapshot (bump `version`). |
| `rows` | `readonly rows?: readonly RowId[];` | optional |  |
| `cells` | `readonly cells?: readonly CellRef[];` | optional |  |
| `headers` | `readonly headers?: readonly ColumnId[];` | optional |  |
| `allRows` | `readonly allRows?: boolean;` | optional | Notify every subscribed row (large selection changes: O(subscribed rows), not O(changed rows)). |
| `allHeaders` | `readonly allHeaders?: boolean;` | optional | Notify every subscribed header. |

### PageInfo

Kind: interface

Page: https://salmonui.dev/docs/reference/data-grid/engine/PageInfo

```ts
interface PageInfo {
    readonly enabled: boolean;
    readonly page: number;
    readonly pageSize: number;
    readonly pageCount: number;
    readonly totalRowCount: number;
    readonly start: number;
    readonly end: number;
}
```

Members (7):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `enabled` | `readonly enabled: boolean;` |  |  |
| `page` | `readonly page: number;` |  | Effective 1-based page (clamped). |
| `pageSize` | `readonly pageSize: number;` |  |  |
| `pageCount` | `readonly pageCount: number;` |  |  |
| `totalRowCount` | `readonly totalRowCount: number;` |  | Rows across all pages. |
| `start` | `readonly start: number;` |  | First and one-past-last row index of the page within `totalRowCount`. |
| `end` | `readonly end: number;` |  |  |

### PagingDescriptor

Kind: interface

Page: https://salmonui.dev/docs/reference/data-grid/engine/PagingDescriptor

```ts
interface PagingDescriptor {
    readonly page: number;
    readonly pageSize: number;
}
```

Members (2):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `page` | `readonly page: number;` |  |  |
| `pageSize` | `readonly pageSize: number;` |  |  |

### PagingOptions

Kind: interface

Page: https://salmonui.dev/docs/reference/data-grid/engine/PagingOptions

```ts
interface PagingOptions {
    readonly enabled?: boolean;
    readonly pageSize?: number;
    readonly page?: number;
    readonly totalRowCount?: number | null;
}
```

Members (4):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `enabled` | `readonly enabled?: boolean;` | optional | Enables paging. Default true when the module is registered. |
| `pageSize` | `readonly pageSize?: number;` | optional | Default 12. |
| `page` | `readonly page?: number;` | optional | Initial 1-based page (`defaultQuery.paging.page` wins when present). |
| `totalRowCount` | `readonly totalRowCount?: number \| null;` | optional | Total row count of a source that pages remotely (`performed` includes `page`). Wins over the total the source reports; use it when the source cannot report one. Ignored when the page stage runs locally. |

### PagingState

Kind: interface

Page: https://salmonui.dev/docs/reference/data-grid/engine/PagingState

```ts
interface PagingState {
    readonly enabled: boolean;
    readonly page: number;
    readonly pageSize: number;
    readonly totalRowCount: number | null;
}
```

Members (4):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `enabled` | `readonly enabled: boolean;` |  |  |
| `page` | `readonly page: number;` |  | Requested 1-based page; the effective page is clamped to the page count. |
| `pageSize` | `readonly pageSize: number;` |  |  |
| `totalRowCount` | `readonly totalRowCount: number \| null;` |  | `PagingOptions.totalRowCount`; null uses the source total. |

### PasteResult

Kind: interface

Page: https://salmonui.dev/docs/reference/data-grid/engine/PasteResult

```ts
interface PasteResult {
    readonly rows: number;
    readonly columns: number;
    readonly applied: number;
    readonly skipped: number;
    readonly clipped: boolean;
    readonly target: CellRange | null;
}
```

Members (6):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `rows` | `readonly rows: number;` |  | Rows x columns of the parsed text. |
| `columns` | `readonly columns: number;` |  |  |
| `applied` | `readonly applied: number;` |  | Target cells that received a value (also while async validation of the write is pending). |
| `skipped` | `readonly skipped: number;` |  | Target cells skipped (read-only, outside the grid). |
| `clipped` | `readonly clipped: boolean;` |  | True when the text was cut to fit the selected range or the grid edge. |
| `target` | `readonly target: CellRange \| null;` |  | Top-left target cell and the covered range. |

### PipelineStage

Kind: interface

Page: https://salmonui.dev/docs/reference/data-grid/engine/PipelineStage

```ts
interface PipelineStage<Row, State = unknown> {
    readonly name: PipelineStageName;
    key(query: DataQuery, state: State): readonly unknown[];
    run(input: RowModelSnapshot<Row>, ctx: StageContext<Row, State>): RowModelSnapshot<Row>;
    update?(input: RowModelSnapshot<Row>, previous: {
        readonly input: RowModelSnapshot<Row>;
        readonly output: RowModelSnapshot<Row>;
    }, delta: RowDelta, ctx: StageContext<Row, State>): RowModelSnapshot<Row> | undefined;
}
```

Members (4):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `name` | `readonly name: PipelineStageName;` |  |  |
| `key` | `key(query: DataQuery, state: State): readonly unknown[];` |  | Inputs besides the row model and compiled columns. The stage re-runs only when the row model identity, the compiled leaf columns, or one of these values (compared with `Object.is`) changes. |
| `run` | `run(input: RowModelSnapshot<Row>, ctx: StageContext<Row, State>): RowModelSnapshot<Row>;` |  | Pure. Must not mutate `input`; return `input` itself when nothing changes. |
| `update` | `update?(input: RowModelSnapshot<Row>, previous: {     readonly input: RowModelSnapshot<Row>;     readonly output: RowModelSnapshot<Row>; }, delta: RowDelta, ctx: StageContext<Row, State>): RowModelSnapshot<Row> \| undefined;` | optional | Optional incremental path. Called instead of `run` when the stage key and the compiled leaves are unchanged, every earlier stage was also updated incrementally (or passed its input through), and the source rows changed only by `delta` since the stage last ran. `previous` holds the stage's last input and output (indexes in the previous source array). Must return exactly what `run(input, ctx)` would return, or undefined to fall back to `run`. |

### ResolvedEditOptions

Kind: interface

Page: https://salmonui.dev/docs/reference/data-grid/engine/ResolvedEditOptions

```ts
interface ResolvedEditOptions {
    readonly enabled: boolean;
    readonly edit: boolean;
    readonly add: boolean;
    readonly delete: boolean;
    readonly mode: EditMode;
    readonly newRowPosition: 'top' | 'bottom';
    readonly treeRowPosition?: 'above' | 'below' | 'child';
    readonly showNewRow: boolean;
    readonly tabToNextRow: boolean;
    readonly undo: boolean;
    readonly undoLimit: number;
    readonly keyedRows: boolean;
}
```

Members (12):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `enabled` | `readonly enabled: boolean;` |  |  |
| `edit` | `readonly edit: boolean;` |  |  |
| `add` | `readonly add: boolean;` |  |  |
| `delete` | `readonly delete: boolean;` |  |  |
| `mode` | `readonly mode: EditMode;` |  |  |
| `newRowPosition` | `readonly newRowPosition: 'top' \| 'bottom';` |  | Render edge of added rows (a tree position maps to `top` for `above`, else `bottom`). |
| `treeRowPosition` | `readonly treeRowPosition?: 'above' \| 'below' \| 'child';` | optional | Tree mode `newRowPosition` (`above` / `below` / `child`), when one is set. |
| `showNewRow` | `readonly showNewRow: boolean;` |  |  |
| `tabToNextRow` | `readonly tabToNextRow: boolean;` |  |  |
| `undo` | `readonly undo: boolean;` |  |  |
| `undoLimit` | `readonly undoLimit: number;` |  |  |
| `keyedRows` | `readonly keyedRows: boolean;` |  |  |

### ResolvedLocale

Kind: interface

Page: https://salmonui.dev/docs/reference/data-grid/engine/ResolvedLocale

```ts
interface ResolvedLocale {
    readonly locale: string;
    readonly direction: 'ltr' | 'rtl';
    readonly currency: string;
    readonly timeZone: string | undefined;
    readonly localeText: LocaleText;
}
```

Members (5):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `locale` | `readonly locale: string;` |  |  |
| `direction` | `readonly direction: 'ltr' \| 'rtl';` |  |  |
| `currency` | `readonly currency: string;` |  |  |
| `timeZone` | `readonly timeZone: string \| undefined;` |  |  |
| `localeText` | `readonly localeText: LocaleText;` |  |  |

### ResolvedSelectionOptions

Kind: interface

Page: https://salmonui.dev/docs/reference/data-grid/engine/ResolvedSelectionOptions

```ts
interface ResolvedSelectionOptions {
    readonly enabled: boolean;
    readonly type: SelectionType;
    readonly mode: SelectionMode;
    readonly cellSelectionMode: CellSelectionMode;
    readonly columns: boolean;
    readonly checkbox: boolean;
    readonly checkboxOnly: boolean;
    readonly checkboxMode: CheckboxMode;
    readonly toggle: boolean;
    readonly persist: boolean;
    readonly simpleMultiRow: boolean;
    readonly enterMoves: boolean;
}
```

Members (12):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `enabled` | `readonly enabled: boolean;` |  |  |
| `type` | `readonly type: SelectionType;` |  |  |
| `mode` | `readonly mode: SelectionMode;` |  |  |
| `cellSelectionMode` | `readonly cellSelectionMode: CellSelectionMode;` |  |  |
| `columns` | `readonly columns: boolean;` |  |  |
| `checkbox` | `readonly checkbox: boolean;` |  |  |
| `checkboxOnly` | `readonly checkboxOnly: boolean;` |  |  |
| `checkboxMode` | `readonly checkboxMode: CheckboxMode;` |  |  |
| `toggle` | `readonly toggle: boolean;` |  |  |
| `persist` | `readonly persist: boolean;` |  |  |
| `simpleMultiRow` | `readonly simpleMultiRow: boolean;` |  |  |
| `enterMoves` | `readonly enterMoves: boolean;` |  |  |

### RestoreResult

Kind: interface

Page: https://salmonui.dev/docs/reference/data-grid/engine/RestoreResult

```ts
interface RestoreResult {
    readonly status: 'applied' | 'partial';
    readonly ignoredColumns: readonly string[];
    readonly rejected: readonly {
        readonly type: string;
        readonly reason: string;
    }[];
    readonly skipped: readonly DataGridStatePart[];
    readonly scroll: {
        readonly top: number;
        readonly left: number;
    } | null;
}
```

Members (5):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `status` | `readonly status: 'applied' \| 'partial';` |  |  |
| `ignoredColumns` | `readonly ignoredColumns: readonly string[];` |  | Fields or ids in the state that match no column (dropped). |
| `rejected` | `readonly rejected: readonly {     readonly type: string;     readonly reason: string; }[];` |  | Commands the engine rejected. |
| `skipped` | `readonly skipped: readonly DataGridStatePart[];` |  | Parts that could not be restored because their module is not registered. |
| `scroll` | `readonly scroll: {     readonly top: number;     readonly left: number; } \| null;` |  | Scroll offset for the renderer to apply (scroll is renderer state). |

### RowDelta

Kind: interface

Page: https://salmonui.dev/docs/reference/data-grid/engine/RowDelta

```ts
interface RowDelta {
    readonly previousCount: number;
    readonly count: number;
    readonly removed: Int32Array;
    readonly updated: Int32Array;
}
```

Change from one source rows array to the next within one data version
chain (local patches, or a `setRows` that differs from the previous array
in a few rows). Rows that are not listed keep their object identity and
their relative order; removed rows disappear; updated rows were replaced in
place; new rows are appended at the end (from index
`previousCount - removed.length`).

Members (4):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `previousCount` | `readonly previousCount: number;` |  | Row count of the previous source array. |
| `count` | `readonly count: number;` |  | Row count of the new source array. |
| `removed` | `readonly removed: Int32Array;` |  | Previous source indexes of removed rows, ascending. |
| `updated` | `readonly updated: Int32Array;` |  | Previous source indexes of rows replaced in place (still present), ascending. |

### RowDragDropOptions

Kind: interface

Page: https://salmonui.dev/docs/reference/data-grid/engine/RowDragDropOptions

```ts
interface RowDragDropOptions {
    readonly enabled?: boolean;
    readonly allowGroupChange?: boolean;
    readonly orderField?: string;
    readonly handoff?: RowDragHandoff;
}
```

Members (4):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `enabled` | `readonly enabled?: boolean;` | optional | Enables row drag and drop. Default true when the module is registered. |
| `allowGroupChange` | `readonly allowGroupChange?: boolean;` | optional | Allow drops into another group (grouped column values are rewritten). Default false. |
| `orderField` | `readonly orderField?: string;` | optional | Column id (or field) holding a persisted order; drops write new values to it. |
| `handoff` | `readonly handoff?: RowDragHandoff;` | optional | Shared registry for drags between grids. |

### RowDragDropState

Kind: interface

Page: https://salmonui.dev/docs/reference/data-grid/engine/RowDragDropState

```ts
interface RowDragDropState {
    readonly enabled: boolean;
    readonly allowGroupChange: boolean;
    readonly orderField: string | null;
    readonly drag: RowDragSession | null;
    readonly lastDrop: RowDropStatus | null;
}
```

Members (5):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `enabled` | `readonly enabled: boolean;` |  |  |
| `allowGroupChange` | `readonly allowGroupChange: boolean;` |  |  |
| `orderField` | `readonly orderField: string \| null;` |  |  |
| `drag` | `readonly drag: RowDragSession \| null;` |  |  |
| `lastDrop` | `readonly lastDrop: RowDropStatus \| null;` |  |  |

### RowDragEventInfo

Kind: interface

Page: https://salmonui.dev/docs/reference/data-grid/engine/RowDragEventInfo

```ts
interface RowDragEventInfo<Row = unknown> {
    readonly data: readonly Row[];
    readonly rowIds: readonly RowId[];
    readonly fromIndex: number;
    readonly dropIndex: number;
    readonly valid: boolean;
    readonly reason: string | null;
}
```

Row drag event fields the core owns (`rows`, `target`, and `originalEvent` are the renderer's).

Members (6):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `data` | `readonly data: readonly Row[];` |  | Dragged row objects. |
| `rowIds` | `readonly rowIds: readonly RowId[];` |  |  |
| `fromIndex` | `readonly fromIndex: number;` |  |  |
| `dropIndex` | `readonly dropIndex: number;` |  |  |
| `valid` | `readonly valid: boolean;` |  |  |
| `reason` | `readonly reason: string \| null;` |  |  |

### RowDragHandoff

Kind: interface

Page: https://salmonui.dev/docs/reference/data-grid/engine/RowDragHandoff

```ts
interface RowDragHandoff {
    begin(payload: Omit<RowDragPayload, 'token'>, onDropped: (targetGridId: string) => void): string;
    get(token: string): RowDragPayload | undefined;
    complete(token: string, targetGridId: string): void;
    cancel(token: string): void;
}
```

Caller-owned registry shared by grids that drag rows between each other (`rowDragDrop.handoff`).

Members (4):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `begin` | `begin(payload: Omit<RowDragPayload, 'token'>, onDropped: (targetGridId: string) => void): string;` |  |  |
| `get` | `get(token: string): RowDragPayload \| undefined;` |  |  |
| `complete` | `complete(token: string, targetGridId: string): void;` |  | The target grid accepted the rows. |
| `cancel` | `cancel(token: string): void;` |  |  |

### RowDragPayload

Kind: interface

Page: https://salmonui.dev/docs/reference/data-grid/engine/RowDragPayload

```ts
interface RowDragPayload<Row = unknown> {
    readonly token: string;
    readonly sourceGridId: string;
    readonly rowIds: readonly RowId[];
    readonly rows: readonly Row[];
}
```

Members (4):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `token` | `readonly token: string;` |  |  |
| `sourceGridId` | `readonly sourceGridId: string;` |  |  |
| `rowIds` | `readonly rowIds: readonly RowId[];` |  |  |
| `rows` | `readonly rows: readonly Row[];` |  | Row objects by reference (volatile, never serialized). |

### RowDragSession

Kind: interface

Page: https://salmonui.dev/docs/reference/data-grid/engine/RowDragSession

```ts
interface RowDragSession {
    readonly id: number;
    readonly token: string | null;
    readonly external: boolean;
    readonly rowIds: readonly RowId[];
    readonly fromIndexes: readonly number[];
    readonly fromIndex: number;
    readonly over: DropTarget | null;
}
```

Members (7):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `id` | `readonly id: number;` |  |  |
| `token` | `readonly token: string \| null;` |  | Handoff token (cross-grid), or null. |
| `external` | `readonly external: boolean;` |  | True when the rows come from another grid. |
| `rowIds` | `readonly rowIds: readonly RowId[];` |  | Dragged rows in visible order. |
| `fromIndexes` | `readonly fromIndexes: readonly number[];` |  | Data row indexes of the dragged rows (ascending; -1 for rows not in the view). Empty for external drags. |
| `fromIndex` | `readonly fromIndex: number;` |  | The first dragged row's data row index. |
| `over` | `readonly over: DropTarget \| null;` |  |  |

### RowDropStatus

Kind: interface

Page: https://salmonui.dev/docs/reference/data-grid/engine/RowDropStatus

```ts
interface RowDropStatus {
    readonly id: number;
    readonly status: 'pending' | 'applied' | 'rejected' | 'invalid' | 'error';
    readonly reason: string | null;
}
```

Members (3):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `id` | `readonly id: number;` |  |  |
| `status` | `readonly status: 'pending' \| 'applied' \| 'rejected' \| 'invalid' \| 'error';` |  |  |
| `reason` | `readonly reason: string \| null;` |  |  |

### RowMetrics

Kind: interface

Page: https://salmonui.dev/docs/reference/data-grid/engine/RowMetrics

```ts
interface RowMetrics {
    readonly count: number;
    readonly totalHeight: number;
    offsetOf(index: number): number;
    heightOf(index: number): number;
    indexAt(offset: number): number;
}
```

Vertical metrics of the visible row model. Offsets are in virtual px.

Members (5):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `count` | `readonly count: number;` |  |  |
| `totalHeight` | `readonly totalHeight: number;` |  |  |
| `offsetOf` | `offsetOf(index: number): number;` |  | Top offset of the row at `index` (`index === count` returns `totalHeight`). |
| `heightOf` | `heightOf(index: number): number;` |  |  |
| `indexAt` | `indexAt(offset: number): number;` |  | Index of the row that contains `offset`, clamped to `[0, count - 1]`; 0 when empty. |

### RowModelSnapshot

Kind: interface

Page: https://salmonui.dev/docs/reference/data-grid/engine/RowModelSnapshot

```ts
interface RowModelSnapshot<Row> {
    readonly source: readonly Row[];
    readonly sourceIds: readonly RowId[];
    readonly order: Int32Array | null;
    readonly count: number;
    readonly groups?: GroupTreeSnapshot | null;
    readonly aggregates?: AggregateModelSnapshot | null;
    readonly view?: RowModelView | null;
    readonly pinned?: Int32Array | null;
}
```

Visible row model. Rows are stored by reference in `source` with parallel
`sourceIds`; `order` maps a visible index to a source index (null means the
identity order). No per-row wrapper objects exist.

Members (8):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `source` | `readonly source: readonly Row[];` |  |  |
| `sourceIds` | `readonly sourceIds: readonly RowId[];` |  |  |
| `order` | `readonly order: Int32Array \| null;` |  | Data rows in view order (source indexes). With a `view`, the data order the view windows into. |
| `count` | `readonly count: number;` |  | Visible rows: `order.length`, or `view.count` when a view mixes in synthetic rows. |
| `groups` | `readonly groups?: GroupTreeSnapshot \| null;` | optional | Group structure from the `group` stage (grouping module). |
| `aggregates` | `readonly aggregates?: AggregateModelSnapshot \| null;` | optional | Aggregate results from the `aggregate` stage (aggregates module). |
| `view` | `readonly view?: RowModelView \| null;` | optional | Visible row model mixing synthetic rows (group captions and footers) with data rows, addressed by visible index without a materialized list. When present, `count === view.count` and index lookups go through the view. |
| `pinned` | `readonly pinned?: Int32Array \| null;` | optional | Pinned rows: source indexes of the rows at visible indexes `[0, pinned.length)`, in sort order. They are outside the page window, the groups, and the detail rows. Absent when no row is pinned. |

### RowModelView

Kind: interface

Page: https://salmonui.dev/docs/reference/data-grid/engine/RowModelView

```ts
interface RowModelView {
    readonly kind: 'grouped' | 'lazyGrouped' | 'detail' | 'plain' | 'pinned' | 'infinite' | 'tree';
    readonly inner?: RowModelView | null;
    readonly count: number;
    readonly dataCount: number;
    kindAt(index: number): RowKind;
    sourceIndexAt(index: number): number;
    idAt(index: number): RowId | undefined;
    depthAt(index: number): number;
    indexOfSource(sourceIndex: number): number;
    parentOfSource(sourceIndex: number): RowId | null;
    resolve(id: RowId): ViewRowInfo | undefined;
    page?(start: number, end: number): RowModelView;
}
```

Visible row model of a grouped (or otherwise structured) grid.

Members (12):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `kind` | `readonly kind: 'grouped' \| 'lazyGrouped' \| 'detail' \| 'plain' \| 'pinned' \| 'infinite' \| 'tree';` |  |  |
| `inner` | `readonly inner?: RowModelView \| null;` | optional | The view a wrapping view (`detail`) adds rows to; absent for base views. |
| `count` | `readonly count: number;` |  | Visible rows (captions, data rows, footers). |
| `dataCount` | `readonly dataCount: number;` |  | Data rows the view windows into (paging totals). A tree view paging by root rows (`pageBy: 'root'` with paging on) counts root rows here until the page stage windows it. |
| `kindAt` | `kindAt(index: number): RowKind;` |  |  |
| `sourceIndexAt` | `sourceIndexAt(index: number): number;` |  | Source index of the data row at `index`, or -1 for synthetic and view-owned rows. |
| `idAt` | `idAt(index: number): RowId \| undefined;` |  |  |
| `depthAt` | `depthAt(index: number): number;` |  |  |
| `indexOfSource` | `indexOfSource(sourceIndex: number): number;` |  | Visible index of a source row, or -1 (filtered out or inside a collapsed group). |
| `parentOfSource` | `parentOfSource(sourceIndex: number): RowId \| null;` |  | Id of the group directly containing a source row, or null. |
| `resolve` | `resolve(id: RowId): ViewRowInfo \| undefined;` |  | Synthetic and view-owned rows by id. |
| `page` | `page?(start: number, end: number): RowModelView;` | optional | Group-aware page window over data positions `[start, end)`. |

### RowPlacement

Kind: interface

Page: https://salmonui.dev/docs/reference/data-grid/engine/RowPlacement

```ts
interface RowPlacement {
    readonly rowIds: readonly RowId[];
    readonly targetRowId: RowId | null;
    readonly position: 'before' | 'after';
    readonly parentId?: RowId | null;
}
```

Moves `rowIds` (in this order) next to `targetRowId`; a null target means the start (`before`) or the end (`after`).

Members (4):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `rowIds` | `readonly rowIds: readonly RowId[];` |  |  |
| `targetRowId` | `readonly targetRowId: RowId \| null;` |  |  |
| `position` | `readonly position: 'before' \| 'after';` |  |  |
| `parentId` | `readonly parentId?: RowId \| null;` | optional | Tree mode: the new parent of the moved rows (null: roots; absent outside tree mode). `targetRowId` / `position` stay a placement in the source array; the moved rows' subtrees travel with them, and flat (`parentIdField`) data also lists the rows whose parent changes in `changed`. |

### RowSelection

Kind: interface

Page: https://salmonui.dev/docs/reference/data-grid/engine/RowSelection

```ts
interface RowSelection {
    readonly scope: 'explicit' | 'allFiltered';
    readonly ids: ReadonlySet<RowId>;
    readonly anchorId: RowId | null;
}
```

Members (3):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `scope` | `readonly scope: 'explicit' \| 'allFiltered';` |  | `explicit`: `ids` are selected. `allFiltered`: every row matching the query is selected except `ids`. |
| `ids` | `readonly ids: ReadonlySet<RowId>;` |  | Live, module-owned set (selected ids, or excluded ids for `allFiltered`). Do not retain or mutate. |
| `anchorId` | `readonly anchorId: RowId \| null;` |  |  |

### RowSnapshot

Kind: interface

Page: https://salmonui.dev/docs/reference/data-grid/engine/RowSnapshot

```ts
interface RowSnapshot<Row> {
    readonly id: RowId;
    readonly kind: RowKind;
    readonly row: Row | null;
    readonly index: number;
    readonly depth: number;
    readonly parentId: RowId | null;
}
```

Members (6):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `id` | `readonly id: RowId;` |  |  |
| `kind` | `readonly kind: RowKind;` |  |  |
| `row` | `readonly row: Row \| null;` |  |  |
| `index` | `readonly index: number;` |  | Position in the visible row model; -1 when the row is filtered out. |
| `depth` | `readonly depth: number;` |  |  |
| `parentId` | `readonly parentId: RowId \| null;` |  |  |

### RowValidationContext

Kind: interface

Page: https://salmonui.dev/docs/reference/data-grid/engine/RowValidationContext

```ts
interface RowValidationContext {
    readonly rowId: RowId;
    readonly isNew: boolean;
    readonly changedColumnIds: readonly ColumnId[];
}
```

Members (3):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `rowId` | `readonly rowId: RowId;` |  |  |
| `isNew` | `readonly isNew: boolean;` |  |  |
| `changedColumnIds` | `readonly changedColumnIds: readonly ColumnId[];` |  | Columns with a changed value (all editable columns for a new row). |

### ScrollMapping

Kind: interface

Page: https://salmonui.dev/docs/reference/data-grid/engine/ScrollMapping

```ts
interface ScrollMapping {
    readonly compressed: boolean;
    readonly scrollHeight: number;
    readonly totalHeight: number;
    readonly ratio: number;
    toVirtual(scrollTop: number): number;
    toPhysical(virtualTop: number): number;
    segmentAt(virtualTop: number, estimatedRowHeight: number): {
        index: number;
        count: number;
        rowsPerSegment: number;
    } | null;
}
```

Maps between the physical scroll offset of the scroll container and the
virtual offset of the row model. Below `maxScrollHeight` the mapping is the
identity. Above it the physical scroll height is capped and the offset is
mapped linearly (scroll height compression), so 10M+ rows stay reachable in
browsers that cap element heights (~17.9M px Firefox, ~33.5M px Chromium).

Members (7):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `compressed` | `readonly compressed: boolean;` |  |  |
| `scrollHeight` | `readonly scrollHeight: number;` |  | Physical height of the scrollable content. |
| `totalHeight` | `readonly totalHeight: number;` |  |  |
| `ratio` | `readonly ratio: number;` |  | Virtual px per physical px (1 when not compressed). |
| `toVirtual` | `toVirtual(scrollTop: number): number;` |  |  |
| `toPhysical` | `toPhysical(virtualTop: number): number;` |  |  |
| `segmentAt` | `segmentAt(virtualTop: number, estimatedRowHeight: number): {     index: number;     count: number;     rowsPerSegment: number; } \| null;` |  | Deterministic segment of a virtual offset; null when not compressed. |

### SearchDescriptor

Kind: interface

Page: https://salmonui.dev/docs/reference/data-grid/engine/SearchDescriptor

```ts
interface SearchDescriptor {
    readonly text: string;
    readonly columnIds: readonly ColumnId[] | 'all';
    readonly operator: SearchOperator;
    readonly ignoreCase: boolean;
    readonly ignoreAccent: boolean;
}
```

Members (5):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `text` | `readonly text: string;` |  |  |
| `columnIds` | `readonly columnIds: readonly ColumnId[] \| 'all';` |  |  |
| `operator` | `readonly operator: SearchOperator;` |  |  |
| `ignoreCase` | `readonly ignoreCase: boolean;` |  |  |
| `ignoreAccent` | `readonly ignoreAccent: boolean;` |  |  |

### SearchOptions

Kind: interface

Page: https://salmonui.dev/docs/reference/data-grid/engine/SearchOptions

```ts
interface SearchOptions {
    readonly enabled?: boolean;
    readonly fields?: readonly ColumnId[] | 'all';
    readonly operator?: SearchOperator;
    readonly ignoreCase?: boolean;
    readonly ignoreAccent?: boolean;
    readonly key?: string;
}
```

Members (6):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `enabled` | `readonly enabled?: boolean;` | optional | Default true. When false, `search.set` is rejected. |
| `fields` | `readonly fields?: readonly ColumnId[] \| 'all';` | optional | Searched columns. Default `'all'`: every leaf with `allowSearching` except date/datetime columns. |
| `operator` | `readonly operator?: SearchOperator;` | optional | Default `'contains'`. |
| `ignoreCase` | `readonly ignoreCase?: boolean;` | optional | Default true. |
| `ignoreAccent` | `readonly ignoreAccent?: boolean;` | optional | Default false. |
| `key` | `readonly key?: string;` | optional | Initial search text (`defaultQuery.search` wins when present). |

### SearchState

Kind: interface

Page: https://salmonui.dev/docs/reference/data-grid/engine/SearchState

```ts
interface SearchState {
    readonly text: string;
    readonly columnIds: readonly ColumnId[] | 'all';
    readonly operator: SearchOperator;
    readonly ignoreCase: boolean;
    readonly ignoreAccent: boolean;
    readonly enabled: boolean;
    readonly descriptor: SearchDescriptor | null;
}
```

Members (7):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `text` | `readonly text: string;` |  |  |
| `columnIds` | `readonly columnIds: readonly ColumnId[] \| 'all';` |  |  |
| `operator` | `readonly operator: SearchOperator;` |  |  |
| `ignoreCase` | `readonly ignoreCase: boolean;` |  |  |
| `ignoreAccent` | `readonly ignoreAccent: boolean;` |  |  |
| `enabled` | `readonly enabled: boolean;` |  |  |
| `descriptor` | `readonly descriptor: SearchDescriptor \| null;` |  | The query descriptor (null when `text` is empty). |

### SelectionApi

Kind: interface

Page: https://salmonui.dev/docs/reference/data-grid/engine/SelectionApi

```ts
interface SelectionApi<Row> {
    selectRows(rowIds: RowId | readonly RowId[], options?: {
        mode?: RowMode;
    }): CommandResult;
    selectRowRange(fromId: RowId, toId: RowId, options?: {
        mode?: 'replace' | 'add';
    }): CommandResult;
    toggleRowSelection(rowId: RowId): CommandResult;
    selectAll(): CommandResult;
    selectAllFiltered(): CommandResult;
    clearSelection(parts?: {
        rows?: boolean;
        cells?: boolean;
        columns?: boolean;
    }): CommandResult;
    selectCells(cells: readonly CellKey[], options?: {
        mode?: 'replace' | 'add' | 'toggle';
    }): CommandResult;
    selectCellRange(anchor: CellKey, focus: CellKey, options?: {
        mode?: 'replace' | 'add';
    }): CommandResult;
    selectColumns(columnIds: ColumnId | readonly ColumnId[], options?: {
        mode?: 'replace' | 'add' | 'toggle';
    }): CommandResult;
    isRowSelected(rowId: RowId): boolean;
    getSelectedRowIds(): readonly RowId[];
    getSelectedRows(): readonly Row[];
    getSelection(): SerializedSelection | undefined;
    setSelection(selection: SerializedSelection): CommandResult;
    getSelectionSummary(): SelectionSummary | undefined;
}
```

Members (15):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `selectRows` | `selectRows(rowIds: RowId \| readonly RowId[], options?: {     mode?: RowMode; }): CommandResult;` |  | Replaces by default; `add` keeps the current selection. |
| `selectRowRange` | `selectRowRange(fromId: RowId, toId: RowId, options?: {     mode?: 'replace' \| 'add'; }): CommandResult;` |  | Selects the rows between two ids (visible order). |
| `toggleRowSelection` | `toggleRowSelection(rowId: RowId): CommandResult;` |  |  |
| `selectAll` | `selectAll(): CommandResult;` |  | Ctrl+A: every row of the current page (all rows without paging). |
| `selectAllFiltered` | `selectAllFiltered(): CommandResult;` |  | Every row matching the query on every page, O(1) (scope `allFiltered`). |
| `clearSelection` | `clearSelection(parts?: {     rows?: boolean;     cells?: boolean;     columns?: boolean; }): CommandResult;` |  | Clears every selection, or only the `rows`, `cells` or `columns` parts. |
| `selectCells` | `selectCells(cells: readonly CellKey[], options?: {     mode?: 'replace' \| 'add' \| 'toggle'; }): CommandResult;` |  |  |
| `selectCellRange` | `selectCellRange(anchor: CellKey, focus: CellKey, options?: {     mode?: 'replace' \| 'add'; }): CommandResult;` |  |  |
| `selectColumns` | `selectColumns(columnIds: ColumnId \| readonly ColumnId[], options?: {     mode?: 'replace' \| 'add' \| 'toggle'; }): CommandResult;` |  |  |
| `isRowSelected` | `isRowSelected(rowId: RowId): boolean;` |  |  |
| `getSelectedRowIds` | `getSelectedRowIds(): readonly RowId[];` |  | Selected row ids. |
| `getSelectedRows` | `getSelectedRows(): readonly Row[];` |  | Selected raw rows, in the order of `getSelectedRowIds()`. |
| `getSelection` | `getSelection(): SerializedSelection \| undefined;` |  | Serializable selection (scope, ids or excluded ids, cell ranges, columns). |
| `setSelection` | `setSelection(selection: SerializedSelection): CommandResult;` |  |  |
| `getSelectionSummary` | `getSelectionSummary(): SelectionSummary \| undefined;` |  |  |

### SelectionChange

Kind: interface

Page: https://salmonui.dev/docs/reference/data-grid/engine/SelectionChange

```ts
interface SelectionChange {
    readonly from: number;
    readonly reset: boolean;
    readonly added: readonly RowId[];
    readonly removed: readonly RowId[];
    readonly cellRows: readonly RowId[] | 'all';
    readonly columns: boolean;
}
```

Members (6):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `from` | `readonly from: number;` |  |  |
| `reset` | `readonly reset: boolean;` |  | The row set was replaced (scope change or replace). |
| `added` | `readonly added: readonly RowId[];` |  | Ids added to / removed from `rows.ids` (flips only). Empty on reset. |
| `removed` | `readonly removed: readonly RowId[];` |  |  |
| `cellRows` | `readonly cellRows: readonly RowId[] \| 'all';` |  | Rows to notify for a cell range change. |
| `columns` | `readonly columns: boolean;` |  |  |

### SelectionOptions

Kind: interface

Page: https://salmonui.dev/docs/reference/data-grid/engine/SelectionOptions

```ts
interface SelectionOptions {
    readonly enabled?: boolean;
    readonly type?: SelectionType;
    readonly mode?: SelectionMode;
    readonly cellSelectionMode?: CellSelectionMode;
    readonly columns?: boolean;
    readonly checkbox?: boolean;
    readonly checkboxOnly?: boolean;
    readonly checkboxMode?: CheckboxMode;
    readonly toggle?: boolean;
    readonly persist?: boolean;
    readonly simpleMultiRow?: boolean;
    readonly enterMoves?: boolean;
    readonly defaultSelectedRowIds?: readonly RowId[];
}
```

Members (13):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `enabled` | `readonly enabled?: boolean;` | optional | Enables selection. Default true. |
| `type` | `readonly type?: SelectionType;` | optional | Default `single`. |
| `mode` | `readonly mode?: SelectionMode;` | optional | Default `row`. |
| `cellSelectionMode` | `readonly cellSelectionMode?: CellSelectionMode;` | optional | Cell range shape. Default `flow`. |
| `columns` | `readonly columns?: boolean;` | optional | Enables column selection. |
| `checkbox` | `readonly checkbox?: boolean;` | optional | A checkbox column drives row selection. |
| `checkboxOnly` | `readonly checkboxOnly?: boolean;` | optional | Only the checkbox selects rows. |
| `checkboxMode` | `readonly checkboxMode?: CheckboxMode;` | optional |  |
| `toggle` | `readonly toggle?: boolean;` | optional | Clicking the only selected row deselects it. Default true. |
| `persist` | `readonly persist?: boolean;` | optional | Keep selection across sort, filter, search, page, and group changes. Default false. |
| `simpleMultiRow` | `readonly simpleMultiRow?: boolean;` | optional | Plain clicks toggle rows in multiple mode. |
| `enterMoves` | `readonly enterMoves?: boolean;` | optional | Enter / Shift+Enter select and move down / up. Default true. |
| `defaultSelectedRowIds` | `readonly defaultSelectedRowIds?: readonly RowId[];` | optional |  |

### SelectionPreview

Kind: interface

Page: https://salmonui.dev/docs/reference/data-grid/engine/SelectionPreview

```ts
interface SelectionPreview {
    readonly scope: 'explicit' | 'allFiltered';
    readonly changes: {
        readonly rows: boolean;
        readonly cells: boolean;
        readonly columns: boolean;
    };
    readonly added: readonly RowId[];
    readonly removed: readonly RowId[];
    readonly selectedRowIds: readonly RowId[];
    readonly excludedRowIds: readonly RowId[];
    readonly cellRanges: readonly CellRange[];
    readonly addedCells: readonly CellKey[];
    readonly removedCells: readonly CellKey[];
    readonly columnIds: readonly ColumnId[];
    readonly addedColumns: readonly ColumnId[];
    readonly removedColumns: readonly ColumnId[];
}
```

Proposed selection of a command (rows, cells and columns), computed without
committing: before-events and controlled renderers. Parts the command leaves
alone report the current selection with empty added / removed lists. Large
fields are computed on first read; read them synchronously.

Members (12):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `scope` | `readonly scope: 'explicit' \| 'allFiltered';` |  |  |
| `changes` | `readonly changes: {     readonly rows: boolean;     readonly cells: boolean;     readonly columns: boolean; };` |  | Which parts of the selection the command changes. |
| `added` | `readonly added: readonly RowId[];` |  | Rows that become selected / deselected; computed on first read. |
| `removed` | `readonly removed: readonly RowId[];` |  |  |
| `selectedRowIds` | `readonly selectedRowIds: readonly RowId[];` |  | Selected ids after the command; materialized on first read (O(selected)). Read synchronously. |
| `excludedRowIds` | `readonly excludedRowIds: readonly RowId[];` |  | Excluded ids when the scope is `allFiltered`. |
| `cellRanges` | `readonly cellRanges: readonly CellRange[];` |  | Cell ranges after the command. |
| `addedCells` | `readonly addedCells: readonly CellKey[];` |  | Cells (data rows, visible columns) that become selected / deselected; O(cells in the old and new ranges) on first read. |
| `removedCells` | `readonly removedCells: readonly CellKey[];` |  |  |
| `columnIds` | `readonly columnIds: readonly ColumnId[];` |  | Selected column ids after the command. |
| `addedColumns` | `readonly addedColumns: readonly ColumnId[];` |  |  |
| `removedColumns` | `readonly removedColumns: readonly ColumnId[];` |  |  |

### SelectionState

Kind: interface

Page: https://salmonui.dev/docs/reference/data-grid/engine/SelectionState

```ts
interface SelectionState {
    readonly options: ResolvedSelectionOptions;
    readonly version: number;
    readonly rows: RowSelection;
    readonly cells: {
        readonly anchor: CellKey | null;
        readonly ranges: readonly CellRange[];
    };
    readonly columns: readonly ColumnId[];
    readonly change: SelectionChange;
}
```

Members (6):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `options` | `readonly options: ResolvedSelectionOptions;` |  |  |
| `version` | `readonly version: number;` |  |  |
| `rows` | `readonly rows: RowSelection;` |  |  |
| `cells` | `readonly cells: {     readonly anchor: CellKey \| null;     readonly ranges: readonly CellRange[]; };` |  |  |
| `columns` | `readonly columns: readonly ColumnId[];` |  |  |
| `change` | `readonly change: SelectionChange;` |  | What the last command changed (membership flips of `rows.ids`). |

### SelectionSummary

Kind: interface

Page: https://salmonui.dev/docs/reference/data-grid/engine/SelectionSummary

```ts
interface SelectionSummary {
    readonly scope: 'explicit' | 'allFiltered';
    readonly count: number;
    readonly total: number;
    readonly header: 'none' | 'some' | 'all';
    readonly cellRangeCount: number;
    readonly columnCount: number;
}
```

Members (6):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `scope` | `readonly scope: 'explicit' \| 'allFiltered';` |  |  |
| `count` | `readonly count: number;` |  | Selected rows among the rows matching the current query. |
| `total` | `readonly total: number;` |  | Rows matching the current query (all pages). |
| `header` | `readonly header: 'none' \| 'some' \| 'all';` |  | Header select-all checkbox state. |
| `cellRangeCount` | `readonly cellRangeCount: number;` |  |  |
| `columnCount` | `readonly columnCount: number;` |  |  |

### SortDescriptor

Kind: interface

Page: https://salmonui.dev/docs/reference/data-grid/engine/SortDescriptor

```ts
interface SortDescriptor {
    readonly columnId: ColumnId;
    readonly direction: 'asc' | 'desc';
}
```

Members (2):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `columnId` | `readonly columnId: ColumnId;` |  |  |
| `direction` | `readonly direction: 'asc' \| 'desc';` |  |  |

### SortOptions

Kind: interface

Page: https://salmonui.dev/docs/reference/data-grid/engine/SortOptions

```ts
interface SortOptions {
    readonly enabled?: boolean;
    readonly mode?: SortMode;
    readonly allowUnsort?: boolean;
}
```

Members (3):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `enabled` | `readonly enabled?: boolean;` | optional | Enables sorting. When false, interactive sort commands are rejected. Default true. |
| `mode` | `readonly mode?: SortMode;` | optional | Single or multi-column sorting. Default `'multiple'`. |
| `allowUnsort` | `readonly allowUnsort?: boolean;` | optional | The third toggle click clears the column. Default true. |

### SortState

Kind: interface

Page: https://salmonui.dev/docs/reference/data-grid/engine/SortState

```ts
interface SortState {
    readonly sorting: readonly SortDescriptor[];
    readonly enabled: boolean;
    readonly mode: SortMode;
    readonly allowUnsort: boolean;
}
```

Members (4):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `sorting` | `readonly sorting: readonly SortDescriptor[];` |  |  |
| `enabled` | `readonly enabled: boolean;` |  |  |
| `mode` | `readonly mode: SortMode;` |  |  |
| `allowUnsort` | `readonly allowUnsort: boolean;` |  |  |

### SparseRowMetrics

Kind: interface

Page: https://salmonui.dev/docs/reference/data-grid/engine/SparseRowMetrics

```ts
interface SparseRowMetrics extends VariableRowMetrics {
    setExceptionHeight(j: number, height: number): number;
}
```

Members (7):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `indexAt` | `indexAt: (offset: number) => number;` | inherited | Index of the row that contains `offset`, clamped to `[0, count - 1]`; 0 when empty. |
| `setExceptionHeight` | `setExceptionHeight(j: number, height: number): number;` |  | Sets exception `j`'s height; returns the delta. |
| `count` | `count: number;` | inherited |  |
| `totalHeight` | `totalHeight: number;` | inherited |  |
| `offsetOf` | `offsetOf: (index: number) => number;` | inherited | Top offset of the row at `index` (`index === count` returns `totalHeight`). |
| `heightOf` | `heightOf: (index: number) => number;` | inherited |  |
| `setHeight` | `setHeight: (index: number, height: number) => number;` | inherited | Sets a row height; returns the height delta (0 when unchanged). |

### SparseRows

Kind: interface

Page: https://salmonui.dev/docs/reference/data-grid/engine/SparseRows

```ts
interface SparseRows {
    readonly detailCount: number;
    detailIndex(j: number): number;
}
```

Rows whose height differs from the fixed row height, ascending by index.

Members (2):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `detailCount` | `readonly detailCount: number;` |  |  |
| `detailIndex` | `detailIndex(j: number): number;` |  | Visible index of exception `j` (ascending in `j`). |

### StageContext

Kind: interface

Page: https://salmonui.dev/docs/reference/data-grid/engine/StageContext

```ts
interface StageContext<Row, State> {
    readonly query: DataQuery;
    readonly columns: ColumnSnapshot<Row>;
    readonly state: State;
    readonly locale: string;
    readonly timeZone: string | undefined;
    readonly sourceIndexOf?: (rowId: RowId) => number;
    readonly sourceChange?: {
        readonly from: readonly Row[];
        readonly delta: RowDelta;
    } | null;
}
```

Members (6):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `query` | `readonly query: DataQuery;` |  |  |
| `columns` | `readonly columns: ColumnSnapshot<Row>;` |  |  |
| `state` | `readonly state: State;` |  |  |
| `locale` | `readonly locale: string;` |  |  |
| `timeZone` | `readonly timeZone: string \| undefined;` |  | The grid `timeZone` option (undefined: the runtime's local zone). |
| `sourceIndexOf` | `readonly sourceIndexOf?: (rowId: RowId) => number;` | optional | Source index of a row id through the engine id index, or -1. |

### ValidationMessages

Kind: interface

Page: https://salmonui.dev/docs/reference/data-grid/engine/ValidationMessages

```ts
interface ValidationMessages {
    readonly required: string;
    readonly min: string;
    readonly max: string;
    readonly range: string;
    readonly minLength: string;
    readonly maxLength: string;
    readonly rangeLength: string;
    readonly number: string;
    readonly digits: string;
    readonly email: string;
    readonly url: string;
    readonly date: string;
    readonly dateIso: string;
    readonly creditcard: string;
    readonly tel: string;
    readonly pattern: string;
    readonly validate: string;
}
```

Message templates; `{0}` and `{1}` are the rule arguments.

Members (17):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `required` | `readonly required: string;` |  |  |
| `min` | `readonly min: string;` |  |  |
| `max` | `readonly max: string;` |  |  |
| `range` | `readonly range: string;` |  |  |
| `minLength` | `readonly minLength: string;` |  |  |
| `maxLength` | `readonly maxLength: string;` |  |  |
| `rangeLength` | `readonly rangeLength: string;` |  |  |
| `number` | `readonly number: string;` |  |  |
| `digits` | `readonly digits: string;` |  |  |
| `email` | `readonly email: string;` |  |  |
| `url` | `readonly url: string;` |  |  |
| `date` | `readonly date: string;` |  |  |
| `dateIso` | `readonly dateIso: string;` |  |  |
| `creditcard` | `readonly creditcard: string;` |  |  |
| `tel` | `readonly tel: string;` |  |  |
| `pattern` | `readonly pattern: string;` |  |  |
| `validate` | `readonly validate: string;` |  |  |

### ValidatorContext

Kind: interface

Page: https://salmonui.dev/docs/reference/data-grid/engine/ValidatorContext

```ts
interface ValidatorContext<Row, Column = unknown> {
    readonly rowId: RowId;
    readonly columnId: string;
    readonly column: Column;
    readonly isNew: boolean;
}
```

Context passed to custom validators; `Column` is the host's column (the Data Grid passes its compiled column).

Members (4):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `rowId` | `readonly rowId: RowId;` |  |  |
| `columnId` | `readonly columnId: string;` |  |  |
| `column` | `readonly column: Column;` |  |  |
| `isNew` | `readonly isNew: boolean;` |  | True for a row added in this edit session (not yet saved). |

### ValueContext

Kind: interface

Page: https://salmonui.dev/docs/reference/data-grid/engine/ValueContext

```ts
interface ValueContext<Row> {
    readonly row: Row;
    readonly column: CompiledColumn<Row>;
    readonly locale: string;
}
```

Members (3):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `row` | `readonly row: Row;` |  |  |
| `column` | `readonly column: CompiledColumn<Row>;` |  |  |
| `locale` | `readonly locale: string;` |  |  |

### VariableRowMetrics

Kind: interface

Page: https://salmonui.dev/docs/reference/data-grid/engine/VariableRowMetrics

```ts
interface VariableRowMetrics extends RowMetrics {
    setHeight(index: number, height: number): number;
}
```

Row metrics with measured or per-row heights, kept in a Fenwick tree (O(log n) updates and lookups).

Members (6):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `setHeight` | `setHeight(index: number, height: number): number;` |  | Sets a row height; returns the height delta (0 when unchanged). |
| `count` | `count: number;` | inherited |  |
| `totalHeight` | `totalHeight: number;` | inherited |  |
| `offsetOf` | `offsetOf: (index: number) => number;` | inherited | Top offset of the row at `index` (`index === count` returns `totalHeight`). |
| `heightOf` | `heightOf: (index: number) => number;` | inherited |  |
| `indexAt` | `indexAt: (offset: number) => number;` | inherited | Index of the row that contains `offset`, clamped to `[0, count - 1]`; 0 when empty. |

### ViewRowInfo

Kind: interface

Page: https://salmonui.dev/docs/reference/data-grid/engine/ViewRowInfo

```ts
interface ViewRowInfo {
    readonly index: number;
    readonly kind: RowKind;
    readonly depth: number;
    readonly parentId: RowId | null;
    readonly row: unknown;
}
```

A row the view owns or synthesizes, resolved by id.

Members (5):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `index` | `readonly index: number;` |  |  |
| `kind` | `readonly kind: RowKind;` |  |  |
| `depth` | `readonly depth: number;` |  |  |
| `parentId` | `readonly parentId: RowId \| null;` |  |  |
| `row` | `readonly row: unknown;` |  | The data row for `kind: 'data'` rows the view owns (lazy group children); null for synthetic rows. |

### ViewportSnapshot

Kind: interface

Page: https://salmonui.dev/docs/reference/data-grid/engine/ViewportSnapshot

```ts
interface ViewportSnapshot {
    readonly scrollTop: number;
    readonly scrollLeft: number;
    readonly width: number;
    readonly height: number;
    readonly rows: {
        readonly start: number;
        readonly end: number;
        readonly overscanStart: number;
        readonly overscanEnd: number;
        readonly offsetTop: number;
        readonly totalHeight: number;
    };
    readonly columns: {
        readonly start: number;
        readonly end: number;
        readonly offsetLeft: number;
        readonly totalWidth: number;
    };
    readonly segment: {
        readonly index: number;
        readonly count: number;
        readonly rowsPerSegment: number;
    } | null;
}
```

Members (7):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `scrollTop` | `readonly scrollTop: number;` |  |  |
| `scrollLeft` | `readonly scrollLeft: number;` |  |  |
| `width` | `readonly width: number;` |  |  |
| `height` | `readonly height: number;` |  |  |
| `rows` | `readonly rows: {     readonly start: number;     readonly end: number;     readonly overscanStart: number;     readonly overscanEnd: number;     readonly offsetTop: number;     readonly totalHeight: number; };` |  |  |
| `columns` | `readonly columns: {     readonly start: number;     readonly end: number;     readonly offsetLeft: number;     readonly totalWidth: number; };` |  |  |
| `segment` | `readonly segment: {     readonly index: number;     readonly count: number;     readonly rowsPerSegment: number; } \| null;` |  |  |

### VirtualRange

Kind: interface

Page: https://salmonui.dev/docs/reference/data-grid/engine/VirtualRange

```ts
interface VirtualRange {
    readonly start: number;
    readonly end: number;
    readonly overscanStart: number;
    readonly overscanEnd: number;
}
```

A rendered window: `[start, end)` is visible, `[overscanStart, overscanEnd)` is rendered.

Members (4):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `start` | `readonly start: number;` |  |  |
| `end` | `readonly end: number;` |  |  |
| `overscanStart` | `readonly overscanStart: number;` |  |  |
| `overscanEnd` | `readonly overscanEnd: number;` |  |  |

### WriteRequest

Kind: interface

Page: https://salmonui.dev/docs/reference/data-grid/engine/WriteRequest

```ts
interface WriteRequest<Row> {
    readonly version: number;
    readonly added: readonly {
        readonly tempId: RowId;
        readonly row: Row;
        readonly parentId?: RowId | null;
    }[];
    readonly changed: readonly {
        readonly rowId: RowId;
        readonly row: Row;
        readonly previous: Row;
        readonly changedColumnIds: readonly ColumnId[];
    }[];
    readonly deleted: readonly {
        readonly rowId: RowId;
        readonly row: Row;
    }[];
    readonly mode: 'row' | 'dialog' | 'batch' | 'cell';
    readonly signal: AbortSignalLike;
    readonly moved?: RowPlacement;
}
```

Members (7):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `version` | `readonly version: number;` |  |  |
| `added` | `readonly added: readonly {     readonly tempId: RowId;     readonly row: Row;     readonly parentId?: RowId \| null; }[];` |  | `parentId` (tree mode): the parent the added row joins (null: a root); its `parentIdField` value is already set for flat data. |
| `changed` | `readonly changed: readonly {     readonly rowId: RowId;     readonly row: Row;     readonly previous: Row;     readonly changedColumnIds: readonly ColumnId[]; }[];` |  |  |
| `deleted` | `readonly deleted: readonly {     readonly rowId: RowId;     readonly row: Row; }[];` |  |  |
| `mode` | `readonly mode: 'row' \| 'dialog' \| 'batch' \| 'cell';` |  |  |
| `signal` | `readonly signal: AbortSignalLike;` |  |  |
| `moved` | `readonly moved?: RowPlacement;` | optional | Row reorder placement hint (row drag and drop): local sources move the rows in their array. |

### WriteResult

Kind: interface

Page: https://salmonui.dev/docs/reference/data-grid/engine/WriteResult

```ts
interface WriteResult<Row> {
    readonly version: number;
    readonly status: 'applied' | 'partial' | 'rejected';
    readonly added?: readonly {
        readonly tempId: RowId;
        readonly row: Row;
    }[];
    readonly changed?: readonly {
        readonly rowId: RowId;
        readonly row: Row;
    }[];
    readonly deleted?: readonly RowId[];
    readonly rowErrors?: Readonly<Record<RowId, readonly string[]>>;
    readonly cellErrors?: Readonly<Record<string, readonly string[]>>;
    readonly conflicts?: readonly ConflictSnapshot<Row>[];
    readonly totalRowCount?: number;
}
```

Members (9):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `version` | `readonly version: number;` |  |  |
| `status` | `readonly status: 'applied' \| 'partial' \| 'rejected';` |  |  |
| `added` | `readonly added?: readonly {     readonly tempId: RowId;     readonly row: Row; }[];` | optional |  |
| `changed` | `readonly changed?: readonly {     readonly rowId: RowId;     readonly row: Row; }[];` | optional |  |
| `deleted` | `readonly deleted?: readonly RowId[];` | optional |  |
| `rowErrors` | `readonly rowErrors?: Readonly<Record<RowId, readonly string[]>>;` | optional |  |
| `cellErrors` | `readonly cellErrors?: Readonly<Record<string, readonly string[]>>;` | optional | Cell errors keyed `${rowId}:${columnId}` (server field errors). |
| `conflicts` | `readonly conflicts?: readonly ConflictSnapshot<Row>[];` | optional | Version conflicts; the rows stay dirty. |
| `totalRowCount` | `readonly totalRowCount?: number;` | optional |  |

## Types

### AggregateInput

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/AggregateInput

```ts
type AggregateInput = {
    readonly columnId: ColumnId;
    readonly type: AggregateType;
    readonly customId?: string;
    readonly placement?: readonly ('footer' | 'groupFooter' | 'groupCaption')[];
    readonly format?: string;
};
```

Serializable aggregate descriptor of `aggregates.set`.

Members (5):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `columnId` | `readonly columnId: ColumnId;` |  |  |
| `type` | `readonly type: AggregateType;` |  |  |
| `customId` | `readonly customId?: string;` | optional | `type: 'custom'`: key of the function in `AggregatesOptions.custom`. |
| `placement` | `readonly placement?: readonly ('footer' \| 'groupFooter' \| 'groupCaption')[];` | optional |  |
| `format` | `readonly format?: string;` | optional |  |

### AggregateScope

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/AggregateScope

```ts
type AggregateScope = 'page' | 'all';
```

### AggregateType

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/AggregateType

```ts
type AggregateType = 'sum' | 'average' | 'min' | 'max' | 'count' | 'trueCount' | 'falseCount' | 'custom';
```

### AggregateValues

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/AggregateValues

```ts
type AggregateValues = Readonly<Record<ColumnId, Readonly<Record<string, unknown>>>>;
```

Aggregate values by column and aggregate type (`{ n0: { sum: 12, average: 3 } }`).

### AggregatesCommand

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/AggregatesCommand

```ts
type AggregatesCommand = AggregatesSetCommand | AggregatesSetScopeCommand;
```

### AggregatesMethods

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/AggregatesMethods

```ts
type AggregatesMethods<Row> = {
    getFooter(ctx: ModuleContext<Row>): AggregateValues;
    format(ctx: ModuleContext<Row>, columnId: ColumnId, type: AggregateType, value: unknown): string;
};
```

Members (2):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `getFooter` | `getFooter(ctx: ModuleContext<Row>): AggregateValues;` |  | Footer (grid-level) aggregate values: server totals when the source performed aggregation, else computed. |
| `format` | `format(ctx: ModuleContext<Row>, columnId: ColumnId, type: AggregateType, value: unknown): string;` |  | Formats an aggregate value with the descriptor's `format`, else the column format. |

### AggregatesModule

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/AggregatesModule

```ts
type AggregatesModule<Row> = DataGridModule<Row, AggregatesState, AggregatesCommand, 'aggregates', AggregatesMethods<Row>>;
```

Members (18):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `name` | `name: "aggregates";` | inherited |  |
| `dependencies` | `dependencies?: readonly string[];` | optional, inherited | Validated at engine creation. |
| `inSnapshot` | `inSnapshot?: boolean;` | optional, inherited | When true (default) the slice lives in `snapshot.modules[name]` and every change replaces the grid snapshot. High-churn modules (focus, selection, drafts) set false and notify through row/cell/header/module channels only. |
| `commands` | `commands: readonly ("aggregates.set" \| "aggregates.setScope")[];` | inherited | Declared, validated, serializable. Every type must start with `${name}.`. |
| `initialState` | `initialState: (options: DataGridOptions<Row>) => AggregatesState;` | inherited |  |
| `reduce` | `reduce?: ((state: AggregatesState, command: AggregatesCommand, ctx: ModuleContext<Row>) => AggregatesState \| CommandRejection);` | optional, inherited |  |
| `extendColumns` | `extendColumns?: ((columns: readonly CompiledColumn<Row>[], ctx: ModuleContext<Row>) => readonly CompiledColumn<Row>[]);` | optional, inherited |  |
| `extendQuery` | `extendQuery?: ((query: DataQuery, state: AggregatesState) => DataQuery);` | optional, inherited |  |
| `pipeline` | `pipeline?: readonly PipelineStage<Row, AggregatesState>[];` | optional, inherited |  |
| `selectors` | `selectors?: Readonly<Record<string, (snapshot: DataGridSnapshot<Row>) => unknown>>;` | optional, inherited |  |
| `methods` | `methods?: AggregatesMethods<Row>;` | optional, inherited | Reads that need more than the snapshot (facets, pager totals). Must not change state; names may not collide with command actions. |
| `notify` | `notify?: ((previous: AggregatesState, next: AggregatesState, ctx: ModuleContext<Row>) => NotificationScope);` | optional, inherited |  |
| `hiddenColumns` | `hiddenColumns?: ((state: AggregatesState) => readonly string[]);` | optional, inherited | Leaf columns this module hides from the visible column set (grouped columns with `showGroupedColumns: false`). |
| `interceptRead` | `interceptRead?: ((query: DataQuery, state: AggregatesState, ctx: ModuleContext<Row>) => boolean);` | optional, inherited | Remote sources only: return true to serve the main read of `query` yourself (lazy grouping loads group levels instead of rows). The engine then shows no source rows and runs only the stages the source did not perform. |
| `onQueryChange` | `onQueryChange?: ((previous: DataQuery, next: DataQuery, ctx: ModuleContext<Row>) => void);` | optional, inherited | Called after the effective query changed (sort, filter, search, page, group). Runs inside the dispatch of the command that changed it; may dispatch commands through `ctx` (selection clears itself here when it does not persist). |
| `onConnect` | `onConnect?: ((ctx: ModuleContext<Row>) => void);` | optional, inherited | `engine.connect()` ran (`deferDataSource`): start loads that were held while disconnected. |
| `onSourceEvent` | `onSourceEvent?: ((event: DataSourceEvent<Row>, state: AggregatesState, ctx: ModuleContext<Row>) => boolean);` | optional, inherited | A data source event (patch or reset). Return true to consume it: the engine then leaves its source rows unchanged (infinite scroll applies write echoes to the blocks it owns). |
| `dispose` | `dispose?: (() => void);` | optional, inherited |  |

### AggregatesSetCommand

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/AggregatesSetCommand

```ts
type AggregatesSetCommand = {
    type: 'aggregates.set';
    aggregates: AggregateInput[];
};
```

Members (2):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `type` | `type: 'aggregates.set';` |  |  |
| `aggregates` | `aggregates: AggregateInput[];` |  |  |

### AggregatesSetScopeCommand

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/AggregatesSetScopeCommand

```ts
type AggregatesSetScopeCommand = {
    type: 'aggregates.setScope';
    scope: AggregateScope;
};
```

Members (2):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `type` | `type: 'aggregates.setScope';` |  |  |
| `scope` | `scope: AggregateScope;` |  |  |

### CellKey

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/CellKey

```ts
type CellKey = {
    readonly rowId: RowId;
    readonly columnId: ColumnId;
};
```

A cell by ids (a type alias of the core `CellKey` shape, so commands stay JSON-typed).

Members (2):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `rowId` | `readonly rowId: RowId;` |  |  |
| `columnId` | `readonly columnId: ColumnId;` |  |  |

### CellRange

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/CellRange

```ts
type CellRange = {
    readonly anchor: CellKey;
    readonly focus: CellKey;
};
```

Members (2):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `anchor` | `readonly anchor: CellKey;` |  |  |
| `focus` | `readonly focus: CellKey;` |  |  |

### CellSelectionMode

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/CellSelectionMode

```ts
type CellSelectionMode = 'flow' | 'box';
```

### CheckboxMode

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/CheckboxMode

```ts
type CheckboxMode = 'default' | 'resetOnRowClick';
```

### ClipboardCommand

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/ClipboardCommand

```ts
type ClipboardCommand = ClipboardPasteCommand | ClipboardFillCommand;
```

### ClipboardFillCommand

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/ClipboardFillCommand

```ts
type ClipboardFillCommand = {
    type: 'clipboard.fill';
    target: CellKey;
    source?: CellRange;
};
```

Autofill: extends the current range (or `source`) to `target`, tiling the source values.

Members (3):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `type` | `type: 'clipboard.fill';` |  |  |
| `target` | `target: CellKey;` |  |  |
| `source` | `source?: CellRange;` | optional |  |

### ClipboardMethods

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/ClipboardMethods

```ts
type ClipboardMethods<Row> = {
    copy(ctx: ModuleContext<Row>, options?: CopyOptions): ClipboardCopy;
    parse(ctx: ModuleContext<Row>, text: string): string[][];
};
```

Members (2):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `copy` | `copy(ctx: ModuleContext<Row>, options?: CopyOptions): ClipboardCopy;` |  |  |
| `parse` | `parse(ctx: ModuleContext<Row>, text: string): string[][];` |  | Parses TSV (quoted fields, CRLF) into rows of cells. |

### ClipboardModule

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/ClipboardModule

```ts
type ClipboardModule<Row = unknown> = DataGridModule<Row, ClipboardState, ClipboardCommand, 'clipboard', ClipboardMethods<Row>>;
```

Members (18):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `name` | `name: "clipboard";` | inherited |  |
| `dependencies` | `dependencies?: readonly string[];` | optional, inherited | Validated at engine creation. |
| `inSnapshot` | `inSnapshot?: boolean;` | optional, inherited | When true (default) the slice lives in `snapshot.modules[name]` and every change replaces the grid snapshot. High-churn modules (focus, selection, drafts) set false and notify through row/cell/header/module channels only. |
| `commands` | `commands: readonly ("clipboard.fill" \| "clipboard.paste")[];` | inherited | Declared, validated, serializable. Every type must start with `${name}.`. |
| `initialState` | `initialState: (options: DataGridOptions<Row>) => ClipboardState;` | inherited |  |
| `reduce` | `reduce?: ((state: ClipboardState, command: ClipboardCommand, ctx: ModuleContext<Row>) => ClipboardState \| CommandRejection);` | optional, inherited |  |
| `extendColumns` | `extendColumns?: ((columns: readonly CompiledColumn<Row>[], ctx: ModuleContext<Row>) => readonly CompiledColumn<Row>[]);` | optional, inherited |  |
| `extendQuery` | `extendQuery?: ((query: DataQuery, state: ClipboardState) => DataQuery);` | optional, inherited |  |
| `pipeline` | `pipeline?: readonly PipelineStage<Row, ClipboardState>[];` | optional, inherited |  |
| `selectors` | `selectors?: Readonly<Record<string, (snapshot: DataGridSnapshot<Row>) => unknown>>;` | optional, inherited |  |
| `methods` | `methods?: ClipboardMethods<Row>;` | optional, inherited | Reads that need more than the snapshot (facets, pager totals). Must not change state; names may not collide with command actions. |
| `notify` | `notify?: ((previous: ClipboardState, next: ClipboardState, ctx: ModuleContext<Row>) => NotificationScope);` | optional, inherited |  |
| `hiddenColumns` | `hiddenColumns?: ((state: ClipboardState) => readonly string[]);` | optional, inherited | Leaf columns this module hides from the visible column set (grouped columns with `showGroupedColumns: false`). |
| `interceptRead` | `interceptRead?: ((query: DataQuery, state: ClipboardState, ctx: ModuleContext<Row>) => boolean);` | optional, inherited | Remote sources only: return true to serve the main read of `query` yourself (lazy grouping loads group levels instead of rows). The engine then shows no source rows and runs only the stages the source did not perform. |
| `onQueryChange` | `onQueryChange?: ((previous: DataQuery, next: DataQuery, ctx: ModuleContext<Row>) => void);` | optional, inherited | Called after the effective query changed (sort, filter, search, page, group). Runs inside the dispatch of the command that changed it; may dispatch commands through `ctx` (selection clears itself here when it does not persist). |
| `onConnect` | `onConnect?: ((ctx: ModuleContext<Row>) => void);` | optional, inherited | `engine.connect()` ran (`deferDataSource`): start loads that were held while disconnected. |
| `onSourceEvent` | `onSourceEvent?: ((event: DataSourceEvent<Row>, state: ClipboardState, ctx: ModuleContext<Row>) => boolean);` | optional, inherited | A data source event (patch or reset). Return true to consume it: the engine then leaves its source rows unchanged (infinite scroll applies write echoes to the blocks it owns). |
| `dispose` | `dispose?: (() => void);` | optional, inherited |  |

### ClipboardPasteCommand

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/ClipboardPasteCommand

```ts
type ClipboardPasteCommand = {
    type: 'clipboard.paste';
    text: string;
};
```

Members (2):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `type` | `type: 'clipboard.paste';` |  |  |
| `text` | `text: string;` |  |  |

### ColumnFreeze

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/ColumnFreeze

```ts
type ColumnFreeze = 'left' | 'right' | 'fixed';
```

`fixed` keeps the leaf in the `center` zone, sticky at its scroll-start position.

### ColumnId

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/ColumnId

```ts
type ColumnId = string;
```

### ColumnKeyKind

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/ColumnKeyKind

```ts
type ColumnKeyKind = 'columnId' | 'field' | 'headerText';
```

### ColumnType

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/ColumnType

```ts
type ColumnType = 'string' | 'number' | 'boolean' | 'date' | 'datetime' | 'selection' | 'rowNumber';
```

`selection`: the row selection checkbox column; `rowNumber`: the 1-based row number column (no value, rendered from the row position).

### ColumnTypeSource

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/ColumnTypeSource

```ts
type ColumnTypeSource = 'definition' | 'inferred' | 'fallback' | 'pending';
```

### ColumnWidth

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/ColumnWidth

```ts
type ColumnWidth = number | `${number}%` | 'auto';
```

### ColumnZone

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/ColumnZone-type

```ts
type ColumnZone = 'left' | 'center' | 'right';
```

### ColumnsCommand

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/ColumnsCommand

```ts
type ColumnsCommand = ColumnsSetPinningCommand | ColumnsShowCommand | ColumnsHideCommand | ColumnsSetVisibilityCommand | ColumnsSetWidthCommand | ColumnsSetWidthsCommand | ColumnsMoveCommand | ColumnsSetOrderCommand | ColumnsSetFreezeCommand | ColumnsSetFrozenCountCommand;
```

### ColumnsHideCommand

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/ColumnsHideCommand

```ts
type ColumnsHideCommand = {
    readonly type: 'columns.hide';
    readonly keys: readonly string[];
    readonly by?: ColumnKeyKind;
};
```

Members (3):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `type` | `readonly type: 'columns.hide';` |  |  |
| `keys` | `readonly keys: readonly string[];` |  |  |
| `by` | `readonly by?: ColumnKeyKind;` | optional |  |

### ColumnsModule

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/ColumnsModule

```ts
type ColumnsModule<Row = unknown> = DataGridModule<Row, ColumnsState, ColumnsCommand, 'columns'>;
```

Members (18):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `name` | `name: "columns";` | inherited |  |
| `dependencies` | `dependencies?: readonly string[];` | optional, inherited | Validated at engine creation. |
| `inSnapshot` | `inSnapshot?: boolean;` | optional, inherited | When true (default) the slice lives in `snapshot.modules[name]` and every change replaces the grid snapshot. High-churn modules (focus, selection, drafts) set false and notify through row/cell/header/module channels only. |
| `commands` | `commands: readonly ("columns.hide" \| "columns.move" \| "columns.setFreeze" \| "columns.setFrozenCount" \| "columns.setOrder" \| "columns.setPinning" \| "columns.setVisibility" \| "columns.setWidth" \| "columns.setWidths" \| "columns.show")[];` | inherited | Declared, validated, serializable. Every type must start with `${name}.`. |
| `initialState` | `initialState: (options: DataGridOptions<Row>) => ColumnsState;` | inherited |  |
| `reduce` | `reduce?: ((state: ColumnsState, command: ColumnsCommand, ctx: ModuleContext<Row>) => ColumnsState \| CommandRejection);` | optional, inherited |  |
| `extendColumns` | `extendColumns?: ((columns: readonly CompiledColumn<Row>[], ctx: ModuleContext<Row>) => readonly CompiledColumn<Row>[]);` | optional, inherited |  |
| `extendQuery` | `extendQuery?: ((query: DataQuery, state: ColumnsState) => DataQuery);` | optional, inherited |  |
| `pipeline` | `pipeline?: readonly PipelineStage<Row, ColumnsState>[];` | optional, inherited |  |
| `selectors` | `selectors?: Readonly<Record<string, (snapshot: DataGridSnapshot<Row>) => unknown>>;` | optional, inherited |  |
| `methods` | `methods?: {};` | optional, inherited | Reads that need more than the snapshot (facets, pager totals). Must not change state; names may not collide with command actions. |
| `notify` | `notify?: ((previous: ColumnsState, next: ColumnsState, ctx: ModuleContext<Row>) => NotificationScope);` | optional, inherited |  |
| `hiddenColumns` | `hiddenColumns?: ((state: ColumnsState) => readonly string[]);` | optional, inherited | Leaf columns this module hides from the visible column set (grouped columns with `showGroupedColumns: false`). |
| `interceptRead` | `interceptRead?: ((query: DataQuery, state: ColumnsState, ctx: ModuleContext<Row>) => boolean);` | optional, inherited | Remote sources only: return true to serve the main read of `query` yourself (lazy grouping loads group levels instead of rows). The engine then shows no source rows and runs only the stages the source did not perform. |
| `onQueryChange` | `onQueryChange?: ((previous: DataQuery, next: DataQuery, ctx: ModuleContext<Row>) => void);` | optional, inherited | Called after the effective query changed (sort, filter, search, page, group). Runs inside the dispatch of the command that changed it; may dispatch commands through `ctx` (selection clears itself here when it does not persist). |
| `onConnect` | `onConnect?: ((ctx: ModuleContext<Row>) => void);` | optional, inherited | `engine.connect()` ran (`deferDataSource`): start loads that were held while disconnected. |
| `onSourceEvent` | `onSourceEvent?: ((event: DataSourceEvent<Row>, state: ColumnsState, ctx: ModuleContext<Row>) => boolean);` | optional, inherited | A data source event (patch or reset). Return true to consume it: the engine then leaves its source rows unchanged (infinite scroll applies write echoes to the blocks it owns). |
| `dispose` | `dispose?: (() => void);` | optional, inherited |  |

### ColumnsMoveCommand

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/ColumnsMoveCommand

```ts
type ColumnsMoveCommand = {
    readonly type: 'columns.move';
    readonly columnId: ColumnId;
    readonly toIndex: number;
};
```

Moves a leaf so that its index among the visible leaves becomes `toIndex`.
Rejected when the move crosses a freeze zone (`crossesFreezeZone`), moves a
`lockColumn` column, or places a column before a locked one (`columnLocked`).

Members (3):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `type` | `readonly type: 'columns.move';` |  |  |
| `columnId` | `readonly columnId: ColumnId;` |  |  |
| `toIndex` | `readonly toIndex: number;` |  |  |

### ColumnsSetFreezeCommand

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/ColumnsSetFreezeCommand

```ts
type ColumnsSetFreezeCommand = {
    readonly type: 'columns.setFreeze';
    readonly columnId: ColumnId;
    readonly freeze: ColumnFreeze | null;
};
```

Pins (`'left'`, `'right'`) or unpins (`null`) a leaf at runtime.
The column moves to the inner edge of its new zone: the end of the left
zone, the start of the right zone, or the matching edge of the center.

Members (3):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `type` | `readonly type: 'columns.setFreeze';` |  |  |
| `columnId` | `readonly columnId: ColumnId;` |  |  |
| `freeze` | `readonly freeze: ColumnFreeze \| null;` |  |  |

### ColumnsSetFrozenCountCommand

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/ColumnsSetFrozenCountCommand

```ts
type ColumnsSetFrozenCountCommand = {
    readonly type: 'columns.setFrozenCount';
    readonly left?: number;
    readonly right?: number;
};
```

Frozen column count shorthand: the first `left` / last `right` visible leaves are frozen.

Members (3):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `type` | `readonly type: 'columns.setFrozenCount';` |  |  |
| `left` | `readonly left?: number;` | optional |  |
| `right` | `readonly right?: number;` | optional |  |

### ColumnsSetOrderCommand

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/ColumnsSetOrderCommand

```ts
type ColumnsSetOrderCommand = {
    readonly type: 'columns.setOrder';
    readonly order: readonly ColumnId[];
};
```

Replaces the runtime leaf order. Unknown ids are ignored; missing leaves follow in definition order.

Members (2):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `type` | `readonly type: 'columns.setOrder';` |  |  |
| `order` | `readonly order: readonly ColumnId[];` |  |  |

### ColumnsSetPinningCommand

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/ColumnsSetPinningCommand

```ts
type ColumnsSetPinningCommand = {
    readonly type: 'columns.setPinning';
    readonly freeze: Readonly<Record<ColumnId, ColumnFreeze | null>>;
    readonly frozenCount: {
        readonly left?: number;
        readonly right?: number;
    };
};
```

Replaces the runtime pin state as a whole (freeze overrides and counts)
without moving columns; state restore uses it. Unknown ids are
dropped.

Members (3):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `type` | `readonly type: 'columns.setPinning';` |  |  |
| `freeze` | `readonly freeze: Readonly<Record<ColumnId, ColumnFreeze \| null>>;` |  |  |
| `frozenCount` | `readonly frozenCount: {     readonly left?: number;     readonly right?: number; };` |  |  |

### ColumnsSetVisibilityCommand

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/ColumnsSetVisibilityCommand

```ts
type ColumnsSetVisibilityCommand = {
    readonly type: 'columns.setVisibility';
    readonly visibility: Readonly<Record<ColumnId, boolean>>;
};
```

Members (2):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `type` | `readonly type: 'columns.setVisibility';` |  |  |
| `visibility` | `readonly visibility: Readonly<Record<ColumnId, boolean>>;` |  |  |

### ColumnsSetWidthCommand

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/ColumnsSetWidthCommand

```ts
type ColumnsSetWidthCommand = {
    readonly type: 'columns.setWidth';
    readonly columnId: ColumnId;
    readonly width: number;
};
```

Sets one leaf width in px, clamped to `minWidth`/`maxWidth`.

Members (3):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `type` | `readonly type: 'columns.setWidth';` |  |  |
| `columnId` | `readonly columnId: ColumnId;` |  |  |
| `width` | `readonly width: number;` |  |  |

### ColumnsSetWidthsCommand

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/ColumnsSetWidthsCommand

```ts
type ColumnsSetWidthsCommand = {
    readonly type: 'columns.setWidths';
    readonly widths: Readonly<Record<ColumnId, number>>;
    readonly replace?: boolean;
};
```

Merges widths (px) into the runtime widths; `replace: true` drops widths that are not listed.

Members (3):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `type` | `readonly type: 'columns.setWidths';` |  |  |
| `widths` | `readonly widths: Readonly<Record<ColumnId, number>>;` |  |  |
| `replace` | `readonly replace?: boolean;` | optional |  |

### ColumnsShowCommand

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/ColumnsShowCommand

```ts
type ColumnsShowCommand = {
    readonly type: 'columns.show';
    readonly keys: readonly string[];
    readonly by?: ColumnKeyKind;
};
```

Members (3):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `type` | `readonly type: 'columns.show';` |  |  |
| `keys` | `readonly keys: readonly string[];` |  |  |
| `by` | `readonly by?: ColumnKeyKind;` | optional |  |

### CommandResult

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/CommandResult

```ts
type CommandResult = {
    readonly status: 'applied';
} | {
    readonly status: 'rejected';
    readonly reason: string;
} | {
    readonly status: 'async';
    readonly promise: Promise<void>;
};
```

### CommandType

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/CommandType

```ts
type CommandType = `${string}.${string}`;
```

### CoreCommand

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/CoreCommand

```ts
type CoreCommand = ColumnsCommand | SortCommand | FilterCommand | SearchCommand | PagingCommand | SelectionCommand | FocusCommand | GroupingCommand | AggregatesCommand | EditCommand | ClipboardCommand;
```

Union of the commands declared by the modules shipped with the core.

### CustomAggregate

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/CustomAggregate

```ts
type CustomAggregate = (rows: readonly unknown[], column: CompiledColumn<unknown>) => unknown;
```

A custom aggregate (`type: 'custom'`): receives the group's (or the grid's) rows.

### CustomFilterOperator

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/CustomFilterOperator

```ts
type CustomFilterOperator<Row = unknown> = (value: unknown, filterValue: Json, ctx: CustomOperatorContext<Row>) => boolean;
```

Custom operator: a pure function of one cell value. It runs once per
distinct value of the column, not once per row, so it must not depend on
other fields of the row.

### CustomValidator

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/CustomValidator

```ts
type CustomValidator<Row = unknown, Ctx = ValidatorContext<Row>> = (value: unknown, row: Row, ctx: Ctx) => string | boolean | null | undefined | PromiseLike<string | boolean | null | undefined>;
```

Custom validator: returns an error message, or null / undefined / true when
the value is valid (false uses the rule message). May return a promise
(async validation): commit waits for it.

### DataGridActionResult

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/DataGridActionResult

```ts
type DataGridActionResult = CommandResult;
```

Result of a mutating DataGrid action (public name of `CommandResult`).

### DataGridCommand

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/DataGridCommand

```ts
type DataGridCommand = {
    readonly type: CommandType;
    readonly [key: string]: Json | undefined;
};
```

Members (1):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `type` | `readonly type: CommandType;` |  |  |

### DataGridEngineWithModules

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/DataGridEngineWithModules

```ts
type DataGridEngineWithModules<Row, Modules extends readonly unknown[]> = DataGridEngine<Row> & UnionToIntersection<ModuleFacade<ColumnsModule<Row>> | ModuleFacade<Modules[number]>>;
```

Engine plus the generated command façade of the built-in `columns` module and every registered module.

Members (35):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `id` | `id: string;` | inherited |  |
| `getSnapshot` | `getSnapshot: () => DataGridSnapshot<Row>;` | inherited |  |
| `getServerSnapshot` | `getServerSnapshot: () => DataGridSnapshot<Row>;` | inherited |  |
| `subscribe` | `subscribe: (listener: () => void) => () => void;` | inherited |  |
| `select` | `select: <T>(selector: (snapshot: DataGridSnapshot<Row>) => T) => T;` | inherited |  |
| `subscribeSelector` | `subscribeSelector: <T>(selector: (snapshot: DataGridSnapshot<Row>) => T, listener: (value: T) => void, isEqual?: ((a: T, b: T) => boolean) \| undefined) => () => void;` | inherited |  |
| `subscribeCell` | `subscribeCell: (rowId: string, columnId: string, listener: () => void) => () => void;` | inherited |  |
| `subscribeRow` | `subscribeRow: (rowId: string, listener: () => void) => () => void;` | inherited |  |
| `subscribeHeader` | `subscribeHeader: (columnId: string, listener: () => void) => () => void;` | inherited |  |
| `subscribeModule` | `subscribeModule: (name: string, listener: () => void) => () => void;` | inherited |  |
| `getCellSnapshot` | `getCellSnapshot: (rowId: string, columnId: string) => CellSnapshot \| undefined;` | inherited |  |
| `getRowSnapshot` | `getRowSnapshot: (rowId: string) => RowSnapshot<Row> \| undefined;` | inherited |  |
| `getHeaderSnapshot` | `getHeaderSnapshot: (columnId: string) => HeaderSnapshot \| undefined;` | inherited |  |
| `getModuleState` | `getModuleState: <T = unknown>(name: string) => T \| undefined;` | inherited |  |
| `getSelector` | `getSelector: (moduleName: string, selectorName: string) => ((snapshot: DataGridSnapshot<Row>) => unknown) \| undefined;` | inherited |  |
| `getRow` | `getRow: (rowId: string) => Row \| undefined;` | inherited | Raw row by id (source rows, including rows filtered out of the view). |
| `getRowIndex` | `getRowIndex: (rowId: string) => number;` | inherited | Visible index of a row, or -1. |
| `getRowAt` | `getRowAt: (index: number) => Row \| undefined;` | inherited |  |
| `getRowIdAt` | `getRowIdAt: (index: number) => string \| undefined;` | inherited |  |
| `getCellValue` | `getCellValue: (rowId: string, columnId: string) => unknown;` | inherited |  |
| `getDataSource` | `getDataSource: () => DataSource<Row>;` | inherited |  |
| `setColumns` | `setColumns: (columns: readonly ColumnDef<Row>[]) => void;` | inherited | Recompiles only when the array identity or a definition identity changes. |
| `setLocale` | `setLocale: (next: { readonly locale?: string; readonly currency?: string; readonly timeZone?: string \| undefined; readonly direction?: "ltr" \| "rtl"; }) => boolean;` | inherited | Changes the locale, currency, time zone, or direction at runtime. A format change recompiles the column formatters once and re-runs the pipeline (collation follows the locale); a direction change updates `snapshot.direction` and the focus module. Omitted fields keep their value (`timeZone: undefined` given explicitly resets to the runtime zone). Returns false when nothing changed. |
| `dispatch` | `dispatch: (command: DataGridCommand) => CommandResult;` | inherited |  |
| `hasCommand` | `hasCommand: (type: string) => boolean;` | inherited | Whether a registered module declares the command type (UI commands probe it before dispatching). |
| `batch` | `batch: (run: () => void) => void;` | inherited |  |
| `onBeforeCommand` | `onBeforeCommand: (listener: (event: BeforeCommandEvent) => void \| string \| boolean) => () => void;` | inherited |  |
| `onCommand` | `onCommand: (listener: (event: CommandEvent) => void) => () => void;` | inherited |  |
| `getCommandLog` | `getCommandLog: () => readonly DataGridCommand[];` | inherited |  |
| `getInstrumentation` | `getInstrumentation: () => DataGridInstrumentation \| null;` | inherited |  |
| `connect` | `connect: () => () => void;` | inherited | With `deferDataSource`: subscribes to the source and issues the pending read. Returns the disconnect (unsubscribes, aborts the in-flight read, which the next `connect()` re-issues). A no-op when already connected. |
| `reload` | `reload: () => void;` | inherited | Re-reads the data source with the current query (retry after a data error). Before `connect()` the read waits for it. |
| `refresh` | `refresh: () => void;` | inherited | Refresh: drops the row and cell snapshot caches, invalidates the source cache (`DataSource.invalidate`), aborts and re-issues the current read, and keeps every module state (sort, filter, group, page, selection, expansion). Rows mutated in place render their new values. |
| `disposed` | `disposed: boolean;` | inherited |  |
| `dispose` | `dispose: () => void;` | inherited |  |

### DataGridState

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/DataGridState

```ts
type DataGridState = {
    readonly version: 1;
    readonly columns?: readonly PersistedColumn[];
    readonly pinning?: PersistedPinning;
    readonly sorting?: readonly {
        readonly field: string;
        readonly direction: 'asc' | 'desc';
    }[];
    readonly filters?: readonly PersistedFilter[];
    readonly grouping?: readonly string[];
    readonly paging?: {
        readonly page: number;
        readonly pageSize: number;
    };
    readonly search?: {
        readonly text: string;
        readonly fields: readonly string[];
        readonly operator: SearchOperator;
        readonly matchCase: boolean;
        readonly ignoreAccents: boolean;
    } | null;
    readonly pinnedRows?: {
        readonly rowIds: readonly RowId[];
        readonly unpinnedRowIds: readonly RowId[];
    };
    readonly tree?: {
        readonly expandedRows: Readonly<Record<RowId, boolean>>;
        readonly defaultExpanded: boolean | number;
    };
    readonly selection?: SerializedSelection;
    readonly scroll?: {
        readonly top: number;
        readonly left: number;
    };
};
```

Versioned, JSON-serializable grid state. Columns are referenced by `field`
(falling back to the column id when a column has no field). Every part is
optional on input: a partial state restores what it has.

Members (12):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `version` | `readonly version: 1;` |  |  |
| `columns` | `readonly columns?: readonly PersistedColumn[];` | optional |  |
| `pinning` | `readonly pinning?: PersistedPinning;` | optional |  |
| `sorting` | `readonly sorting?: readonly {     readonly field: string;     readonly direction: 'asc' \| 'desc'; }[];` | optional |  |
| `filters` | `readonly filters?: readonly PersistedFilter[];` | optional |  |
| `grouping` | `readonly grouping?: readonly string[];` | optional |  |
| `paging` | `readonly paging?: {     readonly page: number;     readonly pageSize: number; };` | optional |  |
| `search` | `readonly search?: {     readonly text: string;     readonly fields: readonly string[];     readonly operator: SearchOperator;     readonly matchCase: boolean;     readonly ignoreAccents: boolean; } \| null;` | optional |  |
| `pinnedRows` | `readonly pinnedRows?: {     readonly rowIds: readonly RowId[];     readonly unpinnedRowIds: readonly RowId[]; };` | optional | Pinned rows (`rowPinning` module): rows pinned explicitly and rows unpinned although `isRowPinned` matches them. Rows the predicate pins are not listed (the predicate pins them again). |
| `tree` | `readonly tree?: {     readonly expandedRows: Readonly<Record<RowId, boolean>>;     readonly defaultExpanded: boolean \| number; };` | optional | Tree mode expansion (`tree` module): per-row overrides over the default (`true`, `false`, or a depth n: rows of depth < n expanded). Present only through the tree entry's state wrappers. |
| `selection` | `readonly selection?: SerializedSelection;` | optional |  |
| `scroll` | `readonly scroll?: {     readonly top: number;     readonly left: number; };` | optional | Scroll offset in px, applied by the renderer. |

### DataGridStatePart

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/DataGridStatePart

```ts
type DataGridStatePart = 'columns' | 'pinning' | 'sorting' | 'filters' | 'grouping' | 'paging' | 'search' | 'pinnedRows' | 'tree' | 'selection' | 'scroll';
```

Persisted parts. `tree` is read and restored by the tree entry's
wrappers (`withTreeState`, `withTreePersistence` in
`./tree.js`), so grids without tree mode carry none of
it; it is not in `DATA_GRID_STATE_PARTS`.

### DataSourceEvent

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/DataSourceEvent

```ts
type DataSourceEvent<Row> = {
    readonly type: 'reset';
    readonly rows: readonly Row[];
    readonly totalRowCount?: number;
} | {
    readonly type: 'patch';
    readonly rows: readonly Row[];
    readonly updated: readonly RowId[];
    readonly added: readonly RowId[];
    readonly removed: readonly RowId[];
    readonly totalRowCount?: number;
};
```

Change notification from a data source. `rows` is always the complete new
row array; the id lists let the engine update incrementally.

### DataSourceMode

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/DataSourceMode

```ts
type DataSourceMode = 'local' | 'remote' | 'live';
```

### DetailCommand

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/DetailCommand

```ts
type DetailCommand = DetailExpandCommand | DetailCollapseCommand | DetailToggleCommand | DetailExpandAllCommand | DetailCollapseAllCommand | DetailSetExpandedCommand | DetailLoadCommand | DetailRetryCommand | DetailSetEnabledCommand | DetailLoadedCommand;
```

### DetailMethods

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/DetailMethods

```ts
type DetailMethods<Row> = {
    isExpanded(ctx: ModuleContext<Row>, rowId: RowId): boolean;
    getLoad(ctx: ModuleContext<Row>, rowId: RowId): DetailLoadSnapshot;
    getExpandedIds(ctx: ModuleContext<Row>): readonly RowId[];
    getInfo(ctx: ModuleContext<Row>): DetailInfo;
};
```

Members (4):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `isExpanded` | `isExpanded(ctx: ModuleContext<Row>, rowId: RowId): boolean;` |  |  |
| `getLoad` | `getLoad(ctx: ModuleContext<Row>, rowId: RowId): DetailLoadSnapshot;` |  | Async load state of a row's detail; stable identity while unchanged. `idle` once the row object was replaced. |
| `getExpandedIds` | `getExpandedIds(ctx: ModuleContext<Row>): readonly RowId[];` |  | Ids expanded explicitly (expand-all mode: ids collapsed explicitly are excluded by `isExpanded`). |
| `getInfo` | `getInfo(ctx: ModuleContext<Row>): DetailInfo;` |  |  |

### DetailModule

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/DetailModule

```ts
type DetailModule<Row> = DataGridModule<Row, DetailState, DetailCommand, 'detail', DetailMethods<Row>>;
```

Members (18):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `name` | `name: "detail";` | inherited |  |
| `dependencies` | `dependencies?: readonly string[];` | optional, inherited | Validated at engine creation. |
| `inSnapshot` | `inSnapshot?: boolean;` | optional, inherited | When true (default) the slice lives in `snapshot.modules[name]` and every change replaces the grid snapshot. High-churn modules (focus, selection, drafts) set false and notify through row/cell/header/module channels only. |
| `commands` | `commands: readonly ("detail.collapse" \| "detail.collapseAll" \| "detail.expand" \| "detail.expandAll" \| "detail.load" \| "detail.loaded" \| "detail.retry" \| "detail.setEnabled" \| "detail.setExpanded" \| "detail.toggle")[];` | inherited | Declared, validated, serializable. Every type must start with `${name}.`. |
| `initialState` | `initialState: (options: DataGridOptions<Row>) => DetailState;` | inherited |  |
| `reduce` | `reduce?: ((state: DetailState, command: DetailCommand, ctx: ModuleContext<Row>) => CommandRejection \| DetailState);` | optional, inherited |  |
| `extendColumns` | `extendColumns?: ((columns: readonly CompiledColumn<Row>[], ctx: ModuleContext<Row>) => readonly CompiledColumn<Row>[]);` | optional, inherited |  |
| `extendQuery` | `extendQuery?: ((query: DataQuery, state: DetailState) => DataQuery);` | optional, inherited |  |
| `pipeline` | `pipeline?: readonly PipelineStage<Row, DetailState>[];` | optional, inherited |  |
| `selectors` | `selectors?: Readonly<Record<string, (snapshot: DataGridSnapshot<Row>) => unknown>>;` | optional, inherited |  |
| `methods` | `methods?: DetailMethods<Row>;` | optional, inherited | Reads that need more than the snapshot (facets, pager totals). Must not change state; names may not collide with command actions. |
| `notify` | `notify?: ((previous: DetailState, next: DetailState, ctx: ModuleContext<Row>) => NotificationScope);` | optional, inherited |  |
| `hiddenColumns` | `hiddenColumns?: ((state: DetailState) => readonly string[]);` | optional, inherited | Leaf columns this module hides from the visible column set (grouped columns with `showGroupedColumns: false`). |
| `interceptRead` | `interceptRead?: ((query: DataQuery, state: DetailState, ctx: ModuleContext<Row>) => boolean);` | optional, inherited | Remote sources only: return true to serve the main read of `query` yourself (lazy grouping loads group levels instead of rows). The engine then shows no source rows and runs only the stages the source did not perform. |
| `onQueryChange` | `onQueryChange?: ((previous: DataQuery, next: DataQuery, ctx: ModuleContext<Row>) => void);` | optional, inherited | Called after the effective query changed (sort, filter, search, page, group). Runs inside the dispatch of the command that changed it; may dispatch commands through `ctx` (selection clears itself here when it does not persist). |
| `onConnect` | `onConnect?: ((ctx: ModuleContext<Row>) => void);` | optional, inherited | `engine.connect()` ran (`deferDataSource`): start loads that were held while disconnected. |
| `onSourceEvent` | `onSourceEvent?: ((event: DataSourceEvent<Row>, state: DetailState, ctx: ModuleContext<Row>) => boolean);` | optional, inherited | A data source event (patch or reset). Return true to consume it: the engine then leaves its source rows unchanged (infinite scroll applies write echoes to the blocks it owns). |
| `dispose` | `dispose?: (() => void);` | optional, inherited |  |

### DropPosition

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/DropPosition

```ts
type DropPosition = 'before' | 'after' | 'into';
```

### EditAddRecordCommand

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/EditAddRecordCommand

```ts
type EditAddRecordCommand = {
    type: 'edit.addRecord';
    values?: JsonObject;
    position?: NewRowPosition;
    relativeTo?: RowId;
};
```

`relativeTo` (tree positions): the anchor row; default the focused row.

Members (4):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `type` | `type: 'edit.addRecord';` |  |  |
| `values` | `values?: JsonObject;` | optional |  |
| `position` | `position?: NewRowPosition;` | optional |  |
| `relativeTo` | `relativeTo?: RowId;` | optional |  |

### EditCancelBatchCommand

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/EditCancelBatchCommand

```ts
type EditCancelBatchCommand = {
    type: 'edit.cancelBatch';
};
```

Members (1):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `type` | `type: 'edit.cancelBatch';` |  |  |

### EditCancelCommand

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/EditCancelCommand

```ts
type EditCancelCommand = {
    type: 'edit.cancel';
};
```

Members (1):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `type` | `type: 'edit.cancel';` |  |  |

### EditCommand

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/EditCommand

```ts
type EditCommand = EditStartCommand | EditSetValueCommand | EditSetValuesCommand | EditCommitCommand | EditCancelCommand | EditCommitAndMoveCommand | EditAddRecordCommand | EditDeleteRecordsCommand | EditUpdateRowCommand | EditUpdateCellCommand | EditSaveBatchCommand | EditCancelBatchCommand | EditRestoreRecordsCommand | EditSetOptionsCommand | EditValidateBatchCommand | EditUndoCommand | EditRedoCommand | EditSettleCommand;
```

### EditCommitAndMoveCommand

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/EditCommitAndMoveCommand

```ts
type EditCommitAndMoveCommand = {
    type: 'edit.commitAndMove';
    direction: 'next' | 'previous' | 'down' | 'up';
};
```

Members (2):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `type` | `type: 'edit.commitAndMove';` |  |  |
| `direction` | `direction: 'next' \| 'previous' \| 'down' \| 'up';` |  |  |

### EditCommitCommand

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/EditCommitCommand

```ts
type EditCommitCommand = {
    type: 'edit.commit';
};
```

Members (1):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `type` | `type: 'edit.commit';` |  |  |

### EditDeleteRecordsCommand

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/EditDeleteRecordsCommand

```ts
type EditDeleteRecordsCommand = {
    type: 'edit.deleteRecords';
    rowIds: RowId[];
};
```

Members (2):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `type` | `type: 'edit.deleteRecords';` |  |  |
| `rowIds` | `rowIds: RowId[];` |  |  |

### EditMessageTable

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/EditMessageTable

```ts
type EditMessageTable = ValidationMessages & EditMessages;
```

Every message key the edit module reads (`EditOptions.messages`).

Members (21):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `required` | `required: string;` | inherited |  |
| `min` | `min: string;` | inherited |  |
| `max` | `max: string;` | inherited |  |
| `range` | `range: string;` | inherited |  |
| `minLength` | `minLength: string;` | inherited |  |
| `maxLength` | `maxLength: string;` | inherited |  |
| `rangeLength` | `rangeLength: string;` | inherited |  |
| `number` | `number: string;` | inherited |  |
| `digits` | `digits: string;` | inherited |  |
| `email` | `email: string;` | inherited |  |
| `url` | `url: string;` | inherited |  |
| `date` | `date: string;` | inherited |  |
| `dateIso` | `dateIso: string;` | inherited |  |
| `creditcard` | `creditcard: string;` | inherited |  |
| `tel` | `tel: string;` | inherited |  |
| `pattern` | `pattern: string;` | inherited |  |
| `validate` | `validate: string;` | inherited |  |
| `saveFailed` | `saveFailed: string;` | inherited | A write failed without a message (also a write that never settled). |
| `saveRejected` | `saveRejected: string;` | inherited | The data source rejected the whole write without row or cell errors. |
| `partialSave` | `partialSave: string;` | inherited | Some rows of a write failed (`lastError`). |
| `conflict` | `conflict: string;` | inherited | Row error of a write conflict. |

### EditMethods

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/EditMethods

```ts
type EditMethods<Row> = {
    getDraft(ctx: ModuleContext<Row>, rowId: RowId, columnId: ColumnId): EditDraft | undefined;
    cellFlags(ctx: ModuleContext<Row>, rowId: RowId, columnId: ColumnId): number;
    rowFlags(ctx: ModuleContext<Row>, rowId: RowId): number;
    getValue(ctx: ModuleContext<Row>, rowId: RowId, columnId: ColumnId): unknown;
    getDisplay(ctx: ModuleContext<Row>, rowId: RowId, columnId: ColumnId): EditDisplay | undefined;
    getEditedRow(ctx: ModuleContext<Row>, rowId: RowId): Row | undefined;
    getErrors(ctx: ModuleContext<Row>, rowId: RowId, columnId: ColumnId): readonly string[];
    getRowErrors(ctx: ModuleContext<Row>, rowId: RowId): readonly string[];
    isCellEditable(ctx: ModuleContext<Row>, rowId: RowId, columnId: ColumnId): boolean;
    getEditableColumnIds(ctx: ModuleContext<Row>, rowId: RowId): readonly ColumnId[];
    getAddedRowPosition(ctx: ModuleContext<Row>, rowId: RowId): 'top' | 'bottom' | undefined;
    nextEditableCell(ctx: ModuleContext<Row>, rowId: RowId, columnId: ColumnId, direction: 'next' | 'previous' | 'down' | 'up'): CellRef | null;
    isRequired(ctx: ModuleContext<Row>, rowId: RowId, columnId: ColumnId): boolean;
    getBatchChanges(ctx: ModuleContext<Row>): EditBatchChanges<Row>;
    getBatchPreview(ctx: ModuleContext<Row>): EditPreview;
    previewWrite(ctx: ModuleContext<Row>, scope: 'active' | 'batch'): {
        added: readonly RowId[];
        changed: readonly {
            rowId: RowId;
            columnIds: readonly ColumnId[];
        }[];
        deleted: readonly RowId[];
    };
    hasUnsavedChanges(ctx: ModuleContext<Row>): boolean;
    getSnapshot(ctx: ModuleContext<Row>): EditSnapshot;
    whenSettled(ctx: ModuleContext<Row>): Promise<void>;
    getLastWrite(ctx: ModuleContext<Row>): EditWriteOutcome<Row> | null;
    getSubmittedWrite(ctx: ModuleContext<Row>): number;
};
```

Members (21):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `getDraft` | `getDraft(ctx: ModuleContext<Row>, rowId: RowId, columnId: ColumnId): EditDraft \| undefined;` |  |  |
| `cellFlags` | `cellFlags(ctx: ModuleContext<Row>, rowId: RowId, columnId: ColumnId): number;` |  | `EDIT_*` bits of a cell. |
| `rowFlags` | `rowFlags(ctx: ModuleContext<Row>, rowId: RowId): number;` |  | `EDIT_NEW \| EDIT_DELETED \| EDIT_ROW_EDITING \| EDIT_DIRTY \| EDIT_INVALID` of a row. |
| `getValue` | `getValue(ctx: ModuleContext<Row>, rowId: RowId, columnId: ColumnId): unknown;` |  | Draft value, else the row value (added rows included). |
| `getDisplay` | `getDisplay(ctx: ModuleContext<Row>, rowId: RowId, columnId: ColumnId): EditDisplay \| undefined;` |  | Value and text of a draft-backed cell (dirty cells, added rows); stable identity. |
| `getEditedRow` | `getEditedRow(ctx: ModuleContext<Row>, rowId: RowId): Row \| undefined;` |  | The row with its drafts applied (added rows included), or undefined. |
| `getErrors` | `getErrors(ctx: ModuleContext<Row>, rowId: RowId, columnId: ColumnId): readonly string[];` |  |  |
| `getRowErrors` | `getRowErrors(ctx: ModuleContext<Row>, rowId: RowId): readonly string[];` |  |  |
| `isCellEditable` | `isCellEditable(ctx: ModuleContext<Row>, rowId: RowId, columnId: ColumnId): boolean;` |  |  |
| `getEditableColumnIds` | `getEditableColumnIds(ctx: ModuleContext<Row>, rowId: RowId): readonly ColumnId[];` |  | Visible editable columns of a row, in display order. |
| `getAddedRowPosition` | `getAddedRowPosition(ctx: ModuleContext<Row>, rowId: RowId): 'top' \| 'bottom' \| undefined;` |  | Edge an added row renders at: the `position` of its `edit.addRecord` (`addRow` index 0 is `'top'`, an index at or past the end `'bottom'`), else `newRowPosition`; undefined for other rows. |
| `nextEditableCell` | `nextEditableCell(ctx: ModuleContext<Row>, rowId: RowId, columnId: ColumnId, direction: 'next' \| 'previous' \| 'down' \| 'up'): CellRef \| null;` |  | Next editable cell for Tab / Shift+Tab / Enter / Shift+Enter, or null. |
| `isRequired` | `isRequired(ctx: ModuleContext<Row>, rowId: RowId, columnId: ColumnId): boolean;` |  |  |
| `getBatchChanges` | `getBatchChanges(ctx: ModuleContext<Row>): EditBatchChanges<Row>;` |  |  |
| `getBatchPreview` | `getBatchPreview(ctx: ModuleContext<Row>): EditPreview;` |  |  |
| `previewWrite` | `previewWrite(ctx: ModuleContext<Row>, scope: 'active' \| 'batch'): {     added: readonly RowId[];     changed: readonly {         rowId: RowId;         columnIds: readonly ColumnId[];     }[];     deleted: readonly RowId[]; };` |  | Rows the next `edit.commit` / `edit.saveBatch` would write (no validation). |
| `hasUnsavedChanges` | `hasUnsavedChanges(ctx: ModuleContext<Row>): boolean;` |  |  |
| `getSnapshot` | `getSnapshot(ctx: ModuleContext<Row>): EditSnapshot;` |  |  |
| `whenSettled` | `whenSettled(ctx: ModuleContext<Row>): Promise<void>;` |  | Resolves when no write or async validation is pending. |
| `getLastWrite` | `getLastWrite(ctx: ModuleContext<Row>): EditWriteOutcome<Row> \| null;` |  |  |
| `getSubmittedWrite` | `getSubmittedWrite(ctx: ModuleContext<Row>): number;` |  | Token of the last write sent to the source (0 before the first); `getLastWrite().token` matches it once that write settled. |

### EditMode

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/EditMode

```ts
type EditMode = 'row' | 'dialog' | 'batch' | 'cell';
```

### EditModule

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/EditModule

```ts
type EditModule<Row = unknown> = DataGridModule<Row, EditState, EditCommand, 'edit', EditMethods<Row>>;
```

Members (18):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `name` | `name: "edit";` | inherited |  |
| `dependencies` | `dependencies?: readonly string[];` | optional, inherited | Validated at engine creation. |
| `inSnapshot` | `inSnapshot?: boolean;` | optional, inherited | When true (default) the slice lives in `snapshot.modules[name]` and every change replaces the grid snapshot. High-churn modules (focus, selection, drafts) set false and notify through row/cell/header/module channels only. |
| `commands` | `commands: readonly ("edit.addRecord" \| "edit.cancel" \| "edit.cancelBatch" \| "edit.commit" \| "edit.commitAndMove" \| "edit.deleteRecords" \| "edit.redo" \| "edit.restoreRecords" \| "edit.saveBatch" \| ... 8 more ... \| "edit.validateBatch")[];` | inherited | Declared, validated, serializable. Every type must start with `${name}.`. |
| `initialState` | `initialState: (options: DataGridOptions<Row>) => EditState;` | inherited |  |
| `reduce` | `reduce?: ((state: EditState, command: EditCommand, ctx: ModuleContext<Row>) => CommandRejection \| EditState);` | optional, inherited |  |
| `extendColumns` | `extendColumns?: ((columns: readonly CompiledColumn<Row>[], ctx: ModuleContext<Row>) => readonly CompiledColumn<Row>[]);` | optional, inherited |  |
| `extendQuery` | `extendQuery?: ((query: DataQuery, state: EditState) => DataQuery);` | optional, inherited |  |
| `pipeline` | `pipeline?: readonly PipelineStage<Row, EditState>[];` | optional, inherited |  |
| `selectors` | `selectors?: Readonly<Record<string, (snapshot: DataGridSnapshot<Row>) => unknown>>;` | optional, inherited |  |
| `methods` | `methods?: EditMethods<Row>;` | optional, inherited | Reads that need more than the snapshot (facets, pager totals). Must not change state; names may not collide with command actions. |
| `notify` | `notify?: ((previous: EditState, next: EditState, ctx: ModuleContext<Row>) => NotificationScope);` | optional, inherited |  |
| `hiddenColumns` | `hiddenColumns?: ((state: EditState) => readonly string[]);` | optional, inherited | Leaf columns this module hides from the visible column set (grouped columns with `showGroupedColumns: false`). |
| `interceptRead` | `interceptRead?: ((query: DataQuery, state: EditState, ctx: ModuleContext<Row>) => boolean);` | optional, inherited | Remote sources only: return true to serve the main read of `query` yourself (lazy grouping loads group levels instead of rows). The engine then shows no source rows and runs only the stages the source did not perform. |
| `onQueryChange` | `onQueryChange?: ((previous: DataQuery, next: DataQuery, ctx: ModuleContext<Row>) => void);` | optional, inherited | Called after the effective query changed (sort, filter, search, page, group). Runs inside the dispatch of the command that changed it; may dispatch commands through `ctx` (selection clears itself here when it does not persist). |
| `onConnect` | `onConnect?: ((ctx: ModuleContext<Row>) => void);` | optional, inherited | `engine.connect()` ran (`deferDataSource`): start loads that were held while disconnected. |
| `onSourceEvent` | `onSourceEvent?: ((event: DataSourceEvent<Row>, state: EditState, ctx: ModuleContext<Row>) => boolean);` | optional, inherited | A data source event (patch or reset). Return true to consume it: the engine then leaves its source rows unchanged (infinite scroll applies write echoes to the blocks it owns). |
| `dispose` | `dispose?: (() => void);` | optional, inherited |  |

### EditRedoCommand

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/EditRedoCommand

```ts
type EditRedoCommand = {
    type: 'edit.redo';
};
```

Re-applies the last undone entry.

Members (1):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `type` | `type: 'edit.redo';` |  |  |

### EditRestoreRecordsCommand

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/EditRestoreRecordsCommand

```ts
type EditRestoreRecordsCommand = {
    type: 'edit.restoreRecords';
    rowIds: RowId[];
};
```

Restores rows marked deleted in batch mode.

Members (2):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `type` | `type: 'edit.restoreRecords';` |  |  |
| `rowIds` | `rowIds: RowId[];` |  |  |

### EditSaveBatchCommand

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/EditSaveBatchCommand

```ts
type EditSaveBatchCommand = {
    type: 'edit.saveBatch';
};
```

Members (1):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `type` | `type: 'edit.saveBatch';` |  |  |

### EditSetOptionsCommand

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/EditSetOptionsCommand

```ts
type EditSetOptionsCommand = {
    type: 'edit.setOptions';
    options: {
        [K in keyof ResolvedEditOptions]?: ResolvedEditOptions[K];
    } & {
        messages?: {
            [K in keyof EditMessageTable]?: string;
        };
    };
};
```

`messages` (merged over the defaults) replaces the message overrides at runtime (locale text changes).

Members (2):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `type` | `type: 'edit.setOptions';` |  |  |
| `options` | `options: {     [K in keyof ResolvedEditOptions]?: ResolvedEditOptions[K]; } & {     messages?: {         [K in keyof EditMessageTable]?: string;     }; };` |  |  |

### EditSetValueCommand

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/EditSetValueCommand

```ts
type EditSetValueCommand = {
    type: 'edit.setValue';
    rowId: RowId;
    columnId: ColumnId;
    value: Json;
};
```

`value` is the editor input; the column parser converts it (dates as ISO strings).

Members (4):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `type` | `type: 'edit.setValue';` |  |  |
| `rowId` | `rowId: RowId;` |  |  |
| `columnId` | `columnId: ColumnId;` |  |  |
| `value` | `value: Json;` |  |  |

### EditSetValuesCommand

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/EditSetValuesCommand

```ts
type EditSetValuesCommand = {
    type: 'edit.setValues';
    cells: {
        rowId: RowId;
        columnId: ColumnId;
        value?: Json;
        from?: {
            rowId: RowId;
            columnId: ColumnId;
        };
    }[];
    commit?: boolean;
};
```

Paste, autofill, and bulk updates: drafts for many cells; `commit` writes
them at once (any mode but batch). A cell takes `value`, or the current
value (draft included) of the `from` cell (autofill).

Members (3):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `type` | `type: 'edit.setValues';` |  |  |
| `cells` | `cells: {     rowId: RowId;     columnId: ColumnId;     value?: Json;     from?: {         rowId: RowId;         columnId: ColumnId;     }; }[];` |  |  |
| `commit` | `commit?: boolean;` | optional |  |

### EditSettleCommand

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/EditSettleCommand

```ts
type EditSettleCommand = {
    type: 'edit.settle';
    token: number;
};
```

Internal: a write or async validation settled.

Members (2):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `type` | `type: 'edit.settle';` |  |  |
| `token` | `token: number;` |  |  |

### EditStartCommand

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/EditStartCommand

```ts
type EditStartCommand = {
    type: 'edit.start';
    rowId: RowId;
    columnId?: ColumnId;
};
```

Members (3):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `type` | `type: 'edit.start';` |  |  |
| `rowId` | `rowId: RowId;` |  |  |
| `columnId` | `columnId?: ColumnId;` | optional |  |

### EditStatus

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/EditStatus

```ts
type EditStatus = 'idle' | 'editing' | 'validating' | 'submitting' | 'error';
```

### EditUndoCommand

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/EditUndoCommand

```ts
type EditUndoCommand = {
    type: 'edit.undo';
};
```

Reverts the last history entry (needs `undo: true`).

Members (1):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `type` | `type: 'edit.undo';` |  |  |

### EditUpdateCellCommand

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/EditUpdateCellCommand

```ts
type EditUpdateCellCommand = {
    type: 'edit.updateCell';
    rowId: RowId;
    columnId: ColumnId;
    value: Json;
};
```

`updateCell()`: batch mode keeps a draft; other modes write at once.

Members (4):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `type` | `type: 'edit.updateCell';` |  |  |
| `rowId` | `rowId: RowId;` |  |  |
| `columnId` | `columnId: ColumnId;` |  |  |
| `value` | `value: Json;` |  |  |

### EditUpdateRowCommand

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/EditUpdateRowCommand

```ts
type EditUpdateRowCommand = {
    type: 'edit.updateRow';
    rowId: RowId;
    values: JsonObject;
};
```

`updateRow()`: writes the values (by column id) at once, validated.

Members (3):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `type` | `type: 'edit.updateRow';` |  |  |
| `rowId` | `rowId: RowId;` |  |  |
| `values` | `values: JsonObject;` |  |  |

### EditValidateBatchCommand

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/EditValidateBatchCommand

```ts
type EditValidateBatchCommand = {
    type: 'edit.validateBatch';
};
```

Validates every pending change without writing: built-in rules on
every draft and every editable cell of added rows, custom validators and
`validateRow` of every dirty or added row. Rejects `invalid` when errors
exist, `validating` while async validators run.

Members (1):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `type` | `type: 'edit.validateBatch';` |  |  |

### FieldValidation

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/FieldValidation

```ts
type FieldValidation = ColumnValidation<FieldValidatorContext, FieldValidatorContext>;
```

Rules of a form field: the column vocabulary with the field context.

Members (18):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `required` | `required?: RuleValue<boolean>;` | optional, inherited |  |
| `min` | `min?: RuleValue<string \| number>;` | optional, inherited |  |
| `max` | `max?: RuleValue<string \| number>;` | optional, inherited |  |
| `range` | `range?: RuleValue<readonly [string \| number, string \| number]>;` | optional, inherited |  |
| `minLength` | `minLength?: RuleValue<number>;` | optional, inherited |  |
| `maxLength` | `maxLength?: RuleValue<number>;` | optional, inherited |  |
| `rangeLength` | `rangeLength?: RuleValue<readonly [number, number]>;` | optional, inherited |  |
| `number` | `number?: RuleValue<boolean>;` | optional, inherited |  |
| `digits` | `digits?: RuleValue<boolean>;` | optional, inherited |  |
| `email` | `email?: RuleValue<boolean>;` | optional, inherited |  |
| `url` | `url?: RuleValue<boolean>;` | optional, inherited |  |
| `date` | `date?: RuleValue<boolean>;` | optional, inherited |  |
| `dateIso` | `dateIso?: RuleValue<boolean>;` | optional, inherited |  |
| `creditcard` | `creditcard?: RuleValue<boolean>;` | optional, inherited |  |
| `tel` | `tel?: RuleValue<boolean>;` | optional, inherited |  |
| `pattern` | `pattern?: RuleValue<string \| RegExp>;` | optional, inherited | A pattern string or a RegExp, tested as a search: a partial match passes, so anchor the pattern (`^[A-Z]{3}$`) to require the whole value. |
| `validate` | `validate?: CustomValidator<FieldValidatorContext, FieldValidatorContext> \| readonly CustomValidator<FieldValidatorContext, FieldValidatorContext>[] \| readonly [...];` | optional, inherited | One custom validator, `[validator, message]`, or several. |
| `messages` | `messages?: Partial<ValidationMessages>;` | optional, inherited | Message overrides of this column, keyed by rule name; they win over `edit.messages`. |

### FilterAddCommand

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/FilterAddCommand

```ts
type FilterAddCommand = {
    type: 'filter.add';
    filters: FilterEntryInput[];
};
```

Members (2):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `type` | `type: 'filter.add';` |  |  |
| `filters` | `filters: FilterEntryInput[];` |  |  |

### FilterByColumnCommand

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/FilterByColumnCommand

```ts
type FilterByColumnCommand = {
    type: 'filter.byColumn';
    columnId: ColumnId;
    operator: string;
    value?: Json;
    predicate?: 'and' | 'or';
    matchCase?: boolean;
    ignoreAccent?: boolean;
    source?: FilterSource;
};
```

`filterByColumn(columnId, operator, value)`: replaces the column's top-level
conditions. An array `value` with an operator other than `in`, `notIn`, or
`between` becomes one condition per value combined with `or`.

Members (8):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `type` | `type: 'filter.byColumn';` |  |  |
| `columnId` | `columnId: ColumnId;` |  |  |
| `operator` | `operator: string;` |  |  |
| `value` | `value?: Json;` | optional |  |
| `predicate` | `predicate?: 'and' \| 'or';` | optional |  |
| `matchCase` | `matchCase?: boolean;` | optional |  |
| `ignoreAccent` | `ignoreAccent?: boolean;` | optional |  |
| `source` | `source?: FilterSource;` | optional |  |

### FilterClearCommand

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/FilterClearCommand

```ts
type FilterClearCommand = {
    type: 'filter.clear';
    columnIds?: ColumnId[];
};
```

`clearFiltering(columnIds?)`.

Members (2):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `type` | `type: 'filter.clear';` |  |  |
| `columnIds` | `columnIds?: ColumnId[];` | optional |  |

### FilterCommand

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/FilterCommand

```ts
type FilterCommand = FilterSetCommand | FilterByColumnCommand | FilterAddCommand | FilterRemoveCommand | FilterClearCommand | FilterSetOptionsCommand;
```

### FilterConditionInput

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/FilterConditionInput

```ts
type FilterConditionInput = {
    kind?: 'condition';
    columnId: ColumnId;
    operator: string;
    value?: Json;
    predicate?: 'and' | 'or';
    matchCase?: boolean;
    ignoreAccent?: boolean;
    source?: FilterSource;
};
```

JSON form of a filter condition in command payloads; omitted fields take defaults (`predicate: 'and'`, `source: 'api'`).

Members (8):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `kind` | `kind?: 'condition';` | optional |  |
| `columnId` | `columnId: ColumnId;` |  |  |
| `operator` | `operator: string;` |  |  |
| `value` | `value?: Json;` | optional |  |
| `predicate` | `predicate?: 'and' \| 'or';` | optional |  |
| `matchCase` | `matchCase?: boolean;` | optional |  |
| `ignoreAccent` | `ignoreAccent?: boolean;` | optional |  |
| `source` | `source?: FilterSource;` | optional |  |

### FilterEntry

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/FilterEntry

```ts
type FilterEntry = FilterDescriptor | FilterGroupDescriptor;
```

### FilterEntryInput

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/FilterEntryInput

```ts
type FilterEntryInput = FilterConditionInput | FilterGroupInput;
```

### FilterGroupInput

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/FilterGroupInput

```ts
type FilterGroupInput = {
    kind: 'group';
    predicate?: 'and' | 'or';
    not?: boolean;
    filters: FilterEntryInput[];
    source?: FilterSource;
};
```

Members (5):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `kind` | `kind: 'group';` |  |  |
| `predicate` | `predicate?: 'and' \| 'or';` | optional |  |
| `not` | `not?: boolean;` | optional |  |
| `filters` | `filters: FilterEntryInput[];` |  |  |
| `source` | `source?: FilterSource;` | optional |  |

### FilterMethods

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/FilterMethods

```ts
type FilterMethods<Row> = {
    getFacet(ctx: ModuleContext<Row>, columnId: ColumnId, options?: FacetOptions): ColumnFacet | undefined;
    getFilteredRows(ctx: ModuleContext<Row>): readonly Row[];
};
```

Members (2):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `getFacet` | `getFacet(ctx: ModuleContext<Row>, columnId: ColumnId, options?: FacetOptions): ColumnFacet \| undefined;` |  | Distinct values of a column with counts over the rows that pass search and every other column's filter. Computed lazily and cached per (stage input, filter state, column, options). |
| `getFilteredRows` | `getFilteredRows(ctx: ModuleContext<Row>): readonly Row[];` |  | Rows passing search and every filter, in sort order, across every page; grouping, expansion, and paging do not apply. Raw references, cached per row model. With a remote source that filtered, the loaded rows. |

### FilterModule

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/FilterModule

```ts
type FilterModule<Row> = DataGridModule<Row, FilterState, FilterCommand, 'filter', FilterMethods<Row>>;
```

Members (18):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `name` | `name: "filter";` | inherited |  |
| `dependencies` | `dependencies?: readonly string[];` | optional, inherited | Validated at engine creation. |
| `inSnapshot` | `inSnapshot?: boolean;` | optional, inherited | When true (default) the slice lives in `snapshot.modules[name]` and every change replaces the grid snapshot. High-churn modules (focus, selection, drafts) set false and notify through row/cell/header/module channels only. |
| `commands` | `commands: readonly ("filter.add" \| "filter.byColumn" \| "filter.clear" \| "filter.remove" \| "filter.set" \| "filter.setOptions")[];` | inherited | Declared, validated, serializable. Every type must start with `${name}.`. |
| `initialState` | `initialState: (options: DataGridOptions<Row>) => FilterState;` | inherited |  |
| `reduce` | `reduce?: ((state: FilterState, command: FilterCommand, ctx: ModuleContext<Row>) => CommandRejection \| FilterState);` | optional, inherited |  |
| `extendColumns` | `extendColumns?: ((columns: readonly CompiledColumn<Row>[], ctx: ModuleContext<Row>) => readonly CompiledColumn<Row>[]);` | optional, inherited |  |
| `extendQuery` | `extendQuery?: ((query: DataQuery, state: FilterState) => DataQuery);` | optional, inherited |  |
| `pipeline` | `pipeline?: readonly PipelineStage<Row, FilterState>[];` | optional, inherited |  |
| `selectors` | `selectors?: Readonly<Record<string, (snapshot: DataGridSnapshot<Row>) => unknown>>;` | optional, inherited |  |
| `methods` | `methods?: FilterMethods<Row>;` | optional, inherited | Reads that need more than the snapshot (facets, pager totals). Must not change state; names may not collide with command actions. |
| `notify` | `notify?: ((previous: FilterState, next: FilterState, ctx: ModuleContext<Row>) => NotificationScope);` | optional, inherited |  |
| `hiddenColumns` | `hiddenColumns?: ((state: FilterState) => readonly string[]);` | optional, inherited | Leaf columns this module hides from the visible column set (grouped columns with `showGroupedColumns: false`). |
| `interceptRead` | `interceptRead?: ((query: DataQuery, state: FilterState, ctx: ModuleContext<Row>) => boolean);` | optional, inherited | Remote sources only: return true to serve the main read of `query` yourself (lazy grouping loads group levels instead of rows). The engine then shows no source rows and runs only the stages the source did not perform. |
| `onQueryChange` | `onQueryChange?: ((previous: DataQuery, next: DataQuery, ctx: ModuleContext<Row>) => void);` | optional, inherited | Called after the effective query changed (sort, filter, search, page, group). Runs inside the dispatch of the command that changed it; may dispatch commands through `ctx` (selection clears itself here when it does not persist). |
| `onConnect` | `onConnect?: ((ctx: ModuleContext<Row>) => void);` | optional, inherited | `engine.connect()` ran (`deferDataSource`): start loads that were held while disconnected. |
| `onSourceEvent` | `onSourceEvent?: ((event: DataSourceEvent<Row>, state: FilterState, ctx: ModuleContext<Row>) => boolean);` | optional, inherited | A data source event (patch or reset). Return true to consume it: the engine then leaves its source rows unchanged (infinite scroll applies write echoes to the blocks it owns). |
| `dispose` | `dispose?: (() => void);` | optional, inherited |  |

### FilterOperator

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/FilterOperator

```ts
type FilterOperator = 'equal' | 'notEqual' | 'contains' | 'doesNotContain' | 'startsWith' | 'doesNotStartWith' | 'endsWith' | 'doesNotEndWith' | 'isEmpty' | 'isNotEmpty' | 'isNull' | 'isNotNull' | 'greaterThan' | 'greaterThanOrEqual' | 'lessThan' | 'lessThanOrEqual' | 'between' | 'in' | 'notIn' | 'like' | 'wildcard';
```

Built-in filter operators. `like` treats `%` and `*` as "any sequence";
`wildcard` treats `*` as "any sequence" and `?` as "one character". Both
match the whole value. Lowercase names (`startswith`,
`doesnotcontain`, `greaterthanorequal`, ...) are accepted by the filter
commands and normalized to these names.

### FilterRemoveCommand

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/FilterRemoveCommand

```ts
type FilterRemoveCommand = {
    type: 'filter.remove';
    columnId: ColumnId;
};
```

Removes the filters of one column.

Members (2):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `type` | `type: 'filter.remove';` |  |  |
| `columnId` | `columnId: ColumnId;` |  |  |

### FilterSetCommand

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/FilterSetCommand

```ts
type FilterSetCommand = {
    type: 'filter.set';
    filters: FilterEntryInput[];
};
```

Members (2):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `type` | `type: 'filter.set';` |  |  |
| `filters` | `filters: FilterEntryInput[];` |  |  |

### FilterSetOptionsCommand

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/FilterSetOptionsCommand

```ts
type FilterSetOptionsCommand = {
    type: 'filter.setOptions';
    enabled?: boolean;
    caseSensitive?: boolean;
    ignoreAccent?: boolean;
};
```

Changes `enabled` / `caseSensitive` / `ignoreAccent` at runtime (reactive settings props).

Members (4):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `type` | `type: 'filter.setOptions';` |  |  |
| `enabled` | `enabled?: boolean;` | optional |  |
| `caseSensitive` | `caseSensitive?: boolean;` | optional |  |
| `ignoreAccent` | `ignoreAccent?: boolean;` | optional |  |

### FilterSource

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/FilterSource

```ts
type FilterSource = 'bar' | 'menu' | 'checkbox' | 'excel' | 'api';
```

### FocusCommand

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/FocusCommand

```ts
type FocusCommand = FocusSetCommand | FocusMoveCommand | FocusSetModeCommand | FocusSetDirectionCommand;
```

### FocusDirection

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/FocusDirection

```ts
type FocusDirection = 'up' | 'down' | 'left' | 'right' | 'home' | 'end' | 'pageUp' | 'pageDown' | 'firstCell' | 'lastCell' | 'nextRegion' | 'previousRegion';
```

`left`/`right` are visual and flip in RTL; the others are logical.

### FocusIntent

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/FocusIntent

```ts
type FocusIntent = {
    readonly axis: 'column';
    readonly columnId: ColumnId;
} | {
    readonly axis: 'row';
    readonly rowId: RowId;
};
```

### FocusMethods

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/FocusMethods

```ts
type FocusMethods<Row> = {
    getTarget(ctx: ModuleContext<Row>): FocusTarget | null;
    resolveMove(ctx: ModuleContext<Row>, direction: FocusDirection, pageSize?: number): FocusTarget | null;
    getDefaultTarget(ctx: ModuleContext<Row>): FocusTarget | null;
};
```

Members (3):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `getTarget` | `getTarget(ctx: ModuleContext<Row>): FocusTarget \| null;` |  | Current logical target (null before anything was focused). |
| `resolveMove` | `resolveMove(ctx: ModuleContext<Row>, direction: FocusDirection, pageSize?: number): FocusTarget \| null;` |  | Where `focus.move` would go, without moving (keyboard handlers, previews). |
| `getDefaultTarget` | `getDefaultTarget(ctx: ModuleContext<Row>): FocusTarget \| null;` |  | First body cell, or the first header cell when there are no rows. |

### FocusModule

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/FocusModule

```ts
type FocusModule<Row> = DataGridModule<Row, FocusState, FocusCommand, 'focus', FocusMethods<Row>>;
```

Members (18):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `name` | `name: "focus";` | inherited |  |
| `dependencies` | `dependencies?: readonly string[];` | optional, inherited | Validated at engine creation. |
| `inSnapshot` | `inSnapshot?: boolean;` | optional, inherited | When true (default) the slice lives in `snapshot.modules[name]` and every change replaces the grid snapshot. High-churn modules (focus, selection, drafts) set false and notify through row/cell/header/module channels only. |
| `commands` | `commands: readonly ("focus.move" \| "focus.set" \| "focus.setDirection" \| "focus.setMode")[];` | inherited | Declared, validated, serializable. Every type must start with `${name}.`. |
| `initialState` | `initialState: (options: DataGridOptions<Row>) => FocusState;` | inherited |  |
| `reduce` | `reduce?: ((state: FocusState, command: FocusCommand, ctx: ModuleContext<Row>) => CommandRejection \| FocusState);` | optional, inherited |  |
| `extendColumns` | `extendColumns?: ((columns: readonly CompiledColumn<Row>[], ctx: ModuleContext<Row>) => readonly CompiledColumn<Row>[]);` | optional, inherited |  |
| `extendQuery` | `extendQuery?: ((query: DataQuery, state: FocusState) => DataQuery);` | optional, inherited |  |
| `pipeline` | `pipeline?: readonly PipelineStage<Row, FocusState>[];` | optional, inherited |  |
| `selectors` | `selectors?: Readonly<Record<string, (snapshot: DataGridSnapshot<Row>) => unknown>>;` | optional, inherited |  |
| `methods` | `methods?: FocusMethods<Row>;` | optional, inherited | Reads that need more than the snapshot (facets, pager totals). Must not change state; names may not collide with command actions. |
| `notify` | `notify?: ((previous: FocusState, next: FocusState, ctx: ModuleContext<Row>) => NotificationScope);` | optional, inherited |  |
| `hiddenColumns` | `hiddenColumns?: ((state: FocusState) => readonly string[]);` | optional, inherited | Leaf columns this module hides from the visible column set (grouped columns with `showGroupedColumns: false`). |
| `interceptRead` | `interceptRead?: ((query: DataQuery, state: FocusState, ctx: ModuleContext<Row>) => boolean);` | optional, inherited | Remote sources only: return true to serve the main read of `query` yourself (lazy grouping loads group levels instead of rows). The engine then shows no source rows and runs only the stages the source did not perform. |
| `onQueryChange` | `onQueryChange?: ((previous: DataQuery, next: DataQuery, ctx: ModuleContext<Row>) => void);` | optional, inherited | Called after the effective query changed (sort, filter, search, page, group). Runs inside the dispatch of the command that changed it; may dispatch commands through `ctx` (selection clears itself here when it does not persist). |
| `onConnect` | `onConnect?: ((ctx: ModuleContext<Row>) => void);` | optional, inherited | `engine.connect()` ran (`deferDataSource`): start loads that were held while disconnected. |
| `onSourceEvent` | `onSourceEvent?: ((event: DataSourceEvent<Row>, state: FocusState, ctx: ModuleContext<Row>) => boolean);` | optional, inherited | A data source event (patch or reset). Return true to consume it: the engine then leaves its source rows unchanged (infinite scroll applies write echoes to the blocks it owns). |
| `dispose` | `dispose?: (() => void);` | optional, inherited |  |

### FocusMoveCommand

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/FocusMoveCommand

```ts
type FocusMoveCommand = {
    type: 'focus.move';
    direction: FocusDirection;
    pageSize?: number;
};
```

Members (3):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `type` | `type: 'focus.move';` |  |  |
| `direction` | `direction: FocusDirection;` |  |  |
| `pageSize` | `pageSize?: number;` | optional |  |

### FocusSetCommand

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/FocusSetCommand

```ts
type FocusSetCommand = {
    type: 'focus.set';
    target: FocusTarget | null;
};
```

Members (2):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `type` | `type: 'focus.set';` |  |  |
| `target` | `target: FocusTarget \| null;` |  |  |

### FocusSetDirectionCommand

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/FocusSetDirectionCommand

```ts
type FocusSetDirectionCommand = {
    type: 'focus.setDirection';
    direction: 'ltr' | 'rtl';
};
```

Members (2):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `type` | `type: 'focus.setDirection';` |  |  |
| `direction` | `direction: 'ltr' \| 'rtl';` |  |  |

### FocusSetModeCommand

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/FocusSetModeCommand

```ts
type FocusSetModeCommand = {
    type: 'focus.setMode';
    mode: 'navigate' | 'edit';
};
```

Members (2):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `type` | `type: 'focus.setMode';` |  |  |
| `mode` | `mode: 'navigate' \| 'edit';` |  |  |

### FocusTarget

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/FocusTarget

```ts
type FocusTarget = {
    readonly kind: 'cell';
    readonly rowId: RowId;
    readonly columnId: ColumnId;
} | {
    readonly kind: 'header';
    readonly columnId: ColumnId;
    readonly level: number;
};
```

### FormatDescriptor

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/FormatDescriptor

```ts
type FormatDescriptor = {
    readonly kind: 'number';
    readonly style: 'decimal' | 'currency' | 'percent';
    readonly pattern: string | null;
    readonly options: FormatOptions;
} | {
    readonly kind: 'date';
    readonly skeleton: string | null;
    readonly pattern: string | null;
    readonly options: FormatOptions;
};
```

Normalized `column.format`.

### GroupDescriptorInput

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/GroupDescriptorInput

```ts
type GroupDescriptorInput = {
    columnId: ColumnId;
    format?: string;
    direction?: 'asc' | 'desc';
};
```

Members (3):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `columnId` | `columnId: ColumnId;` |  |  |
| `format` | `format?: string;` | optional |  |
| `direction` | `direction?: 'asc' \| 'desc';` | optional |  |

### GroupTarget

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/GroupTarget

```ts
type GroupTarget = string | {
    columnId: ColumnId;
    key: Json;
}[];
```

Groups / group target: a group row id (`__g:...`), a path key, or a path.

### GroupingClearCommand

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/GroupingClearCommand

```ts
type GroupingClearCommand = {
    type: 'grouping.clear';
};
```

`clearGrouping()`.

Members (1):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `type` | `type: 'grouping.clear';` |  |  |

### GroupingCollapseAllCommand

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/GroupingCollapseAllCommand

```ts
type GroupingCollapseAllCommand = {
    type: 'grouping.collapseAll';
};
```

Members (1):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `type` | `type: 'grouping.collapseAll';` |  |  |

### GroupingCommand

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/GroupingCommand

```ts
type GroupingCommand = GroupingSetCommand | GroupingGroupByCommand | GroupingUngroupCommand | GroupingClearCommand | GroupingMoveCommand | GroupingSetDirectionCommand | GroupingToggleCommand | GroupingExpandAllCommand | GroupingCollapseAllCommand | GroupingSetExpandedCommand | GroupingSetEnabledCommand | GroupingSetOptionsCommand | GroupingRetryCommand | GroupingLoadMoreCommand | GroupingLoadedCommand;
```

### GroupingExpandAllCommand

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/GroupingExpandAllCommand

```ts
type GroupingExpandAllCommand = {
    type: 'grouping.expandAll';
};
```

Members (1):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `type` | `type: 'grouping.expandAll';` |  |  |

### GroupingGroupByCommand

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/GroupingGroupByCommand

```ts
type GroupingGroupByCommand = {
    type: 'grouping.groupBy';
    columnId: ColumnId;
    index?: number;
    format?: string;
};
```

`groupColumn()`: appends (or inserts at `index`) a grouped column.

Members (4):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `type` | `type: 'grouping.groupBy';` |  |  |
| `columnId` | `columnId: ColumnId;` |  |  |
| `index` | `index?: number;` | optional |  |
| `format` | `format?: string;` | optional |  |

### GroupingLoadMoreCommand

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/GroupingLoadMoreCommand

```ts
type GroupingLoadMoreCommand = {
    type: 'grouping.loadMore';
    group: GroupTarget;
};
```

Lazy mode: load the next chunk of a group's children.

Members (2):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `type` | `type: 'grouping.loadMore';` |  |  |
| `group` | `group: GroupTarget;` |  |  |

### GroupingMethods

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/GroupingMethods

```ts
type GroupingMethods<Row> = {
    getGroup(ctx: ModuleContext<Row>, rowId: RowId): GroupRowSnapshot | undefined;
    getGroupRows(ctx: ModuleContext<Row>, rowId: RowId): readonly Row[];
    isExpanded(ctx: ModuleContext<Row>, group: GroupTarget): boolean;
    getLazyStatus(ctx: ModuleContext<Row>): {
        readonly status: LazyStatus;
        readonly error: unknown;
    } | null;
};
```

Members (4):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `getGroup` | `getGroup(ctx: ModuleContext<Row>, rowId: RowId): GroupRowSnapshot \| undefined;` |  | Caption or footer snapshot by row id (`__g:` / `__gf:` ids). Identity is stable while nothing about the group changes. |
| `getGroupRows` | `getGroupRows(ctx: ModuleContext<Row>, rowId: RowId): readonly Row[];` |  | Data rows of a group (template `items`), in view order. |
| `isExpanded` | `isExpanded(ctx: ModuleContext<Row>, group: GroupTarget): boolean;` |  | Whether a group (row id, path key, or path) is expanded. |
| `getLazyStatus` | `getLazyStatus(ctx: ModuleContext<Row>): {     readonly status: LazyStatus;     readonly error: unknown; } \| null;` |  | Lazy mode root level status. |

### GroupingModule

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/GroupingModule

```ts
type GroupingModule<Row> = DataGridModule<Row, GroupingState, GroupingCommand, 'grouping', GroupingMethods<Row>>;
```

Members (18):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `name` | `name: "grouping";` | inherited |  |
| `dependencies` | `dependencies?: readonly string[];` | optional, inherited | Validated at engine creation. |
| `inSnapshot` | `inSnapshot?: boolean;` | optional, inherited | When true (default) the slice lives in `snapshot.modules[name]` and every change replaces the grid snapshot. High-churn modules (focus, selection, drafts) set false and notify through row/cell/header/module channels only. |
| `commands` | `commands: readonly ("grouping.clear" \| "grouping.collapseAll" \| "grouping.expandAll" \| "grouping.groupBy" \| "grouping.loadMore" \| "grouping.loaded" \| "grouping.move" \| "grouping.retry" \| "grouping.set" \| ... 5 more ... \| "grouping.ungroup")[];` | inherited | Declared, validated, serializable. Every type must start with `${name}.`. |
| `initialState` | `initialState: (options: DataGridOptions<Row>) => GroupingState;` | inherited |  |
| `reduce` | `reduce?: ((state: GroupingState, command: GroupingCommand, ctx: ModuleContext<Row>) => CommandRejection \| GroupingState);` | optional, inherited |  |
| `extendColumns` | `extendColumns?: ((columns: readonly CompiledColumn<Row>[], ctx: ModuleContext<Row>) => readonly CompiledColumn<Row>[]);` | optional, inherited |  |
| `extendQuery` | `extendQuery?: ((query: DataQuery, state: GroupingState) => DataQuery);` | optional, inherited |  |
| `pipeline` | `pipeline?: readonly PipelineStage<Row, GroupingState>[];` | optional, inherited |  |
| `selectors` | `selectors?: Readonly<Record<string, (snapshot: DataGridSnapshot<Row>) => unknown>>;` | optional, inherited |  |
| `methods` | `methods?: GroupingMethods<Row>;` | optional, inherited | Reads that need more than the snapshot (facets, pager totals). Must not change state; names may not collide with command actions. |
| `notify` | `notify?: ((previous: GroupingState, next: GroupingState, ctx: ModuleContext<Row>) => NotificationScope);` | optional, inherited |  |
| `hiddenColumns` | `hiddenColumns?: ((state: GroupingState) => readonly string[]);` | optional, inherited | Leaf columns this module hides from the visible column set (grouped columns with `showGroupedColumns: false`). |
| `interceptRead` | `interceptRead?: ((query: DataQuery, state: GroupingState, ctx: ModuleContext<Row>) => boolean);` | optional, inherited | Remote sources only: return true to serve the main read of `query` yourself (lazy grouping loads group levels instead of rows). The engine then shows no source rows and runs only the stages the source did not perform. |
| `onQueryChange` | `onQueryChange?: ((previous: DataQuery, next: DataQuery, ctx: ModuleContext<Row>) => void);` | optional, inherited | Called after the effective query changed (sort, filter, search, page, group). Runs inside the dispatch of the command that changed it; may dispatch commands through `ctx` (selection clears itself here when it does not persist). |
| `onConnect` | `onConnect?: ((ctx: ModuleContext<Row>) => void);` | optional, inherited | `engine.connect()` ran (`deferDataSource`): start loads that were held while disconnected. |
| `onSourceEvent` | `onSourceEvent?: ((event: DataSourceEvent<Row>, state: GroupingState, ctx: ModuleContext<Row>) => boolean);` | optional, inherited | A data source event (patch or reset). Return true to consume it: the engine then leaves its source rows unchanged (infinite scroll applies write echoes to the blocks it owns). |
| `dispose` | `dispose?: (() => void);` | optional, inherited |  |

### GroupingMoveCommand

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/GroupingMoveCommand

```ts
type GroupingMoveCommand = {
    type: 'grouping.move';
    columnId: ColumnId;
    toIndex: number;
};
```

Group chip reorder.

Members (3):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `type` | `type: 'grouping.move';` |  |  |
| `columnId` | `columnId: ColumnId;` |  |  |
| `toIndex` | `toIndex: number;` |  |  |

### GroupingRetryCommand

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/GroupingRetryCommand

```ts
type GroupingRetryCommand = {
    type: 'grouping.retry';
    group?: GroupTarget;
};
```

Lazy mode: retry a failed group (or the root level when `group` is omitted).

Members (2):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `type` | `type: 'grouping.retry';` |  |  |
| `group` | `group?: GroupTarget;` | optional |  |

### GroupingSetCommand

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/GroupingSetCommand

```ts
type GroupingSetCommand = {
    type: 'grouping.set';
    grouping: GroupDescriptorInput[];
};
```

Members (2):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `type` | `type: 'grouping.set';` |  |  |
| `grouping` | `grouping: GroupDescriptorInput[];` |  |  |

### GroupingSetDirectionCommand

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/GroupingSetDirectionCommand

```ts
type GroupingSetDirectionCommand = {
    type: 'grouping.setDirection';
    columnId: ColumnId;
    direction: 'asc' | 'desc';
};
```

Members (3):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `type` | `type: 'grouping.setDirection';` |  |  |
| `columnId` | `columnId: ColumnId;` |  |  |
| `direction` | `direction: 'asc' \| 'desc';` |  |  |

### GroupingSetEnabledCommand

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/GroupingSetEnabledCommand

```ts
type GroupingSetEnabledCommand = {
    type: 'grouping.setEnabled';
    enabled: boolean;
};
```

Members (2):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `type` | `type: 'grouping.setEnabled';` |  |  |
| `enabled` | `enabled: boolean;` |  |  |

### GroupingSetExpandedCommand

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/GroupingSetExpandedCommand

```ts
type GroupingSetExpandedCommand = {
    type: 'grouping.setExpanded';
    expanded: Record<string, boolean>;
    defaultExpanded?: boolean;
};
```

Controlled expansion: replaces the per-group overrides (and optionally the default).

Members (3):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `type` | `type: 'grouping.setExpanded';` |  |  |
| `expanded` | `expanded: Record<string, boolean>;` |  |  |
| `defaultExpanded` | `defaultExpanded?: boolean;` | optional |  |

### GroupingSetOptionsCommand

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/GroupingSetOptionsCommand

```ts
type GroupingSetOptionsCommand = {
    type: 'grouping.setOptions';
    showGroupedColumns?: boolean;
};
```

Members (2):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `type` | `type: 'grouping.setOptions';` |  |  |
| `showGroupedColumns` | `showGroupedColumns?: boolean;` | optional |  |

### GroupingToggleCommand

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/GroupingToggleCommand

```ts
type GroupingToggleCommand = {
    type: 'grouping.toggle';
    group: GroupTarget;
    expanded?: boolean;
};
```

Toggles (or sets) one group.

Members (3):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `type` | `type: 'grouping.toggle';` |  |  |
| `group` | `group: GroupTarget;` |  |  |
| `expanded` | `expanded?: boolean;` | optional |  |

### GroupingUngroupCommand

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/GroupingUngroupCommand

```ts
type GroupingUngroupCommand = {
    type: 'grouping.ungroup';
    columnId: ColumnId;
};
```

`ungroupColumn()`.

Members (2):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `type` | `type: 'grouping.ungroup';` |  |  |
| `columnId` | `columnId: ColumnId;` |  |  |

### HierarchyMethods

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/HierarchyMethods

```ts
type HierarchyMethods<Row> = {
    getChildGrid(ctx: ModuleContext<Row>, parentRowId: RowId): ChildGridDescriptor | undefined;
    describeChildGrid(ctx: ModuleContext<Row>, parentRowId: RowId, row: Row): ChildGridDescriptor | undefined;
};
```

Members (2):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `getChildGrid` | `getChildGrid(ctx: ModuleContext<Row>, parentRowId: RowId): ChildGridDescriptor \| undefined;` |  | Child grid of a visible parent row; stable identity while the parent row object is unchanged. |
| `describeChildGrid` | `describeChildGrid(ctx: ModuleContext<Row>, parentRowId: RowId, row: Row): ChildGridDescriptor \| undefined;` |  | Child grid of any parent row, visible or not (export and print of every page, `hierarchy: 'all'`). Not cached: the caller owns the descriptor. |

### HierarchyModule

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/HierarchyModule

```ts
type HierarchyModule<Row> = DataGridModule<Row, HierarchyState, never, 'hierarchy', HierarchyMethods<Row>>;
```

Members (18):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `name` | `name: "hierarchy";` | inherited |  |
| `dependencies` | `dependencies?: readonly string[];` | optional, inherited | Validated at engine creation. |
| `inSnapshot` | `inSnapshot?: boolean;` | optional, inherited | When true (default) the slice lives in `snapshot.modules[name]` and every change replaces the grid snapshot. High-churn modules (focus, selection, drafts) set false and notify through row/cell/header/module channels only. |
| `commands` | `commands: readonly never[];` | inherited | Declared, validated, serializable. Every type must start with `${name}.`. |
| `initialState` | `initialState: (options: DataGridOptions<Row>) => HierarchyState;` | inherited |  |
| `reduce` | `reduce?: ((state: HierarchyState, command: never, ctx: ModuleContext<Row>) => CommandRejection \| HierarchyState);` | optional, inherited |  |
| `extendColumns` | `extendColumns?: ((columns: readonly CompiledColumn<Row>[], ctx: ModuleContext<Row>) => readonly CompiledColumn<Row>[]);` | optional, inherited |  |
| `extendQuery` | `extendQuery?: ((query: DataQuery, state: HierarchyState) => DataQuery);` | optional, inherited |  |
| `pipeline` | `pipeline?: readonly PipelineStage<Row, HierarchyState>[];` | optional, inherited |  |
| `selectors` | `selectors?: Readonly<Record<string, (snapshot: DataGridSnapshot<Row>) => unknown>>;` | optional, inherited |  |
| `methods` | `methods?: HierarchyMethods<Row>;` | optional, inherited | Reads that need more than the snapshot (facets, pager totals). Must not change state; names may not collide with command actions. |
| `notify` | `notify?: ((previous: HierarchyState, next: HierarchyState, ctx: ModuleContext<Row>) => NotificationScope);` | optional, inherited |  |
| `hiddenColumns` | `hiddenColumns?: ((state: HierarchyState) => readonly string[]);` | optional, inherited | Leaf columns this module hides from the visible column set (grouped columns with `showGroupedColumns: false`). |
| `interceptRead` | `interceptRead?: ((query: DataQuery, state: HierarchyState, ctx: ModuleContext<Row>) => boolean);` | optional, inherited | Remote sources only: return true to serve the main read of `query` yourself (lazy grouping loads group levels instead of rows). The engine then shows no source rows and runs only the stages the source did not perform. |
| `onQueryChange` | `onQueryChange?: ((previous: DataQuery, next: DataQuery, ctx: ModuleContext<Row>) => void);` | optional, inherited | Called after the effective query changed (sort, filter, search, page, group). Runs inside the dispatch of the command that changed it; may dispatch commands through `ctx` (selection clears itself here when it does not persist). |
| `onConnect` | `onConnect?: ((ctx: ModuleContext<Row>) => void);` | optional, inherited | `engine.connect()` ran (`deferDataSource`): start loads that were held while disconnected. |
| `onSourceEvent` | `onSourceEvent?: ((event: DataSourceEvent<Row>, state: HierarchyState, ctx: ModuleContext<Row>) => boolean);` | optional, inherited | A data source event (patch or reset). Return true to consume it: the engine then leaves its source rows unchanged (infinite scroll applies write echoes to the blocks it owns). |
| `dispose` | `dispose?: (() => void);` | optional, inherited |  |

### Json

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/Json

```ts
type Json = null | boolean | number | string | readonly Json[] | {
    readonly [key: string]: Json;
};
```

### JsonObject

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/JsonObject

```ts
type JsonObject = {
    readonly [key: string]: Json;
};
```

### KeyBindingOverrides

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/KeyBindingOverrides

```ts
type KeyBindingOverrides = Readonly<Record<string, readonly string[]>>;
```

User overrides: `{ [command]: combos }` (keys for the current platform).

### KeyContext

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/KeyContext

```ts
type KeyContext = 'body' | 'header' | 'pager' | 'groupCaption' | 'groupChip' | 'editor' | 'global';
```

Where focus is when the key is pressed. `global` bindings work from anywhere in the document.

### KeyPlatform

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/KeyPlatform

```ts
type KeyPlatform = 'mac' | 'other';
```

### LazyStatus

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/LazyStatus

```ts
type LazyStatus = 'idle' | 'loading' | 'ready' | 'error';
```

### LocaleMessage

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/LocaleMessage

```ts
type LocaleMessage = string | {
    readonly zero?: string;
    readonly one?: string;
    readonly two?: string;
    readonly few?: string;
    readonly many?: string;
    readonly other: string;
};
```

A message: a `{param}` template, or plural forms chosen by `Intl.PluralRules` for `count` (`other` is required).

### LocaleText

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/LocaleText

```ts
type LocaleText = {
    readonly [K in LocaleTextKey]: LocaleMessage;
} & {
    readonly [key: string]: LocaleMessage;
};
```

Resolved text: every built-in key, plus any extra keys a bundle adds.

Members (243):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `adaptiveApply` | `adaptiveApply: LocaleMessage;` | inherited |  |
| `adaptiveBarLabel` | `adaptiveBarLabel: LocaleMessage;` | inherited |  |
| `adaptiveClose` | `adaptiveClose: LocaleMessage;` | inherited |  |
| `adaptiveFiltered` | `adaptiveFiltered: LocaleMessage;` | inherited |  |
| `adaptiveSortAscending` | `adaptiveSortAscending: LocaleMessage;` | inherited |  |
| `adaptiveSortDescending` | `adaptiveSortDescending: LocaleMessage;` | inherited |  |
| `adaptiveSortNone` | `adaptiveSortNone: LocaleMessage;` | inherited |  |
| `add` | `add: LocaleMessage;` | inherited |  |
| `addCondition` | `addCondition: LocaleMessage;` | inherited |  |
| `addDialogTitle` | `addDialogTitle: LocaleMessage;` | inherited |  |
| `addGroup` | `addGroup: LocaleMessage;` | inherited |  |
| `allRows` | `allRows: LocaleMessage;` | inherited |  |
| `allRowsSelected` | `allRowsSelected: LocaleMessage;` | inherited |  |
| `and` | `and: LocaleMessage;` | inherited |  |
| `ascending` | `ascending: LocaleMessage;` | inherited |  |
| `autoSize` | `autoSize: LocaleMessage;` | inherited |  |
| `autoSizeAll` | `autoSizeAll: LocaleMessage;` | inherited |  |
| `average` | `average: LocaleMessage;` | inherited |  |
| `blank` | `blank: LocaleMessage;` | inherited |  |
| `blankGroup` | `blankGroup: LocaleMessage;` | inherited |  |
| `cancel` | `cancel: LocaleMessage;` | inherited |  |
| `cellChanged` | `cellChanged: LocaleMessage;` | inherited |  |
| `cellInvalid` | `cellInvalid: LocaleMessage;` | inherited |  |
| `childGridLabel` | `childGridLabel: LocaleMessage;` | inherited |  |
| `chooseColumns` | `chooseColumns: LocaleMessage;` | inherited |  |
| `chooseDate` | `chooseDate: LocaleMessage;` | inherited |  |
| `clear` | `clear: LocaleMessage;` | inherited |  |
| `clearSearch` | `clearSearch: LocaleMessage;` | inherited |  |
| `clearSort` | `clearSort: LocaleMessage;` | inherited |  |
| `clipboardCopyHint` | `clipboardCopyHint: LocaleMessage;` | inherited |  |
| `clipboardPasteHint` | `clipboardPasteHint: LocaleMessage;` | inherited |  |
| `clipboardText` | `clipboardText: LocaleMessage;` | inherited |  |
| `closeDialog` | `closeDialog: LocaleMessage;` | inherited |  |
| `collapse` | `collapse: LocaleMessage;` | inherited |  |
| `collapseAll` | `collapseAll: LocaleMessage;` | inherited |  |
| `collapseDetail` | `collapseDetail: LocaleMessage;` | inherited |  |
| `collapseGroup` | `collapseGroup: LocaleMessage;` | inherited |  |
| `columnChooser` | `columnChooser: LocaleMessage;` | inherited |  |
| `columnMenuButton` | `columnMenuButton: LocaleMessage;` | inherited |  |
| `columnMenuLabel` | `columnMenuLabel: LocaleMessage;` | inherited |  |
| `columnPinnedCenter` | `columnPinnedCenter: LocaleMessage;` | inherited |  |
| `columnPinnedEnd` | `columnPinnedEnd: LocaleMessage;` | inherited |  |
| `columnPinnedStart` | `columnPinnedStart: LocaleMessage;` | inherited |  |
| `columnResizer` | `columnResizer: LocaleMessage;` | inherited |  |
| `columnUnpinned` | `columnUnpinned: LocaleMessage;` | inherited |  |
| `columnsShown` | `columnsShown: LocaleMessage;` | inherited |  |
| `confirmDelete` | `confirmDelete: LocaleMessage;` | inherited |  |
| `confirmDiscard` | `confirmDiscard: LocaleMessage;` | inherited |  |
| `confirmSave` | `confirmSave: LocaleMessage;` | inherited |  |
| `confirmTitle` | `confirmTitle: LocaleMessage;` | inherited |  |
| `conflict` | `conflict: LocaleMessage;` | inherited |  |
| `contextMenuLabel` | `contextMenuLabel: LocaleMessage;` | inherited |  |
| `copy` | `copy: LocaleMessage;` | inherited |  |
| `count` | `count: LocaleMessage;` | inherited |  |
| `custom` | `custom: LocaleMessage;` | inherited |  |
| `dataError` | `dataError: LocaleMessage;` | inherited |  |
| `dataErrorTitle` | `dataErrorTitle: LocaleMessage;` | inherited |  |
| `delete` | `delete: LocaleMessage;` | inherited |  |
| `descending` | `descending: LocaleMessage;` | inherited |  |
| `detailColumnHeader` | `detailColumnHeader: LocaleMessage;` | inherited |  |
| `detailLoading` | `detailLoading: LocaleMessage;` | inherited |  |
| `edit` | `edit: LocaleMessage;` | inherited |  |
| `editCancelled` | `editCancelled: LocaleMessage;` | inherited |  |
| `editDialogTitle` | `editDialogTitle: LocaleMessage;` | inherited |  |
| `editSaved` | `editSaved: LocaleMessage;` | inherited |  |
| `editingCell` | `editingCell: LocaleMessage;` | inherited |  |
| `editingRow` | `editingRow: LocaleMessage;` | inherited |  |
| `editorLabel` | `editorLabel: LocaleMessage;` | inherited |  |
| `error` | `error: LocaleMessage;` | inherited |  |
| `expand` | `expand: LocaleMessage;` | inherited |  |
| `expandAll` | `expandAll: LocaleMessage;` | inherited |  |
| `expandDetail` | `expandDetail: LocaleMessage;` | inherited |  |
| `expandGroup` | `expandGroup: LocaleMessage;` | inherited |  |
| `export` | `export: LocaleMessage;` | inherited |  |
| `exportCsv` | `exportCsv: LocaleMessage;` | inherited |  |
| `exportExcel` | `exportExcel: LocaleMessage;` | inherited |  |
| `exportPdf` | `exportPdf: LocaleMessage;` | inherited |  |
| `exporting` | `exporting: LocaleMessage;` | inherited |  |
| `false` | `false: LocaleMessage;` | inherited |  |
| `falseCount` | `falseCount: LocaleMessage;` | inherited |  |
| `featureClipboard` | `featureClipboard: LocaleMessage;` | inherited |  |
| `featureCsvExport` | `featureCsvExport: LocaleMessage;` | inherited |  |
| `featureEditing` | `featureEditing: LocaleMessage;` | inherited |  |
| `featureExcelExport` | `featureExcelExport: LocaleMessage;` | inherited |  |
| `featureGrouping` | `featureGrouping: LocaleMessage;` | inherited |  |
| `featurePdfExport` | `featurePdfExport: LocaleMessage;` | inherited |  |
| `featurePrint` | `featurePrint: LocaleMessage;` | inherited |  |
| `featureSearch` | `featureSearch: LocaleMessage;` | inherited |  |
| `fillHandle` | `fillHandle: LocaleMessage;` | inherited |  |
| `filter` | `filter: LocaleMessage;` | inherited |  |
| `filterBarInput` | `filterBarInput: LocaleMessage;` | inherited |  |
| `filterBarOperator` | `filterBarOperator: LocaleMessage;` | inherited |  |
| `filterBuilder` | `filterBuilder: LocaleMessage;` | inherited |  |
| `filterButton` | `filterButton: LocaleMessage;` | inherited |  |
| `filterDialogTitle` | `filterDialogTitle: LocaleMessage;` | inherited |  |
| `filterField` | `filterField: LocaleMessage;` | inherited |  |
| `filterFrom` | `filterFrom: LocaleMessage;` | inherited |  |
| `filterGroup` | `filterGroup: LocaleMessage;` | inherited |  |
| `filterMenuLabel` | `filterMenuLabel: LocaleMessage;` | inherited |  |
| `filterNot` | `filterNot: LocaleMessage;` | inherited |  |
| `filterOperator` | `filterOperator: LocaleMessage;` | inherited |  |
| `filterStatus` | `filterStatus: LocaleMessage;` | inherited |  |
| `filterStatusCondition` | `filterStatusCondition: LocaleMessage;` | inherited |  |
| `filterStatusSeparator` | `filterStatusSeparator: LocaleMessage;` | inherited |  |
| `filterTo` | `filterTo: LocaleMessage;` | inherited |  |
| `filterValue` | `filterValue: LocaleMessage;` | inherited |  |
| `filtered` | `filtered: LocaleMessage;` | inherited |  |
| `firstPage` | `firstPage: LocaleMessage;` | inherited |  |
| `group` | `group: LocaleMessage;` | inherited |  |
| `groupByColumn` | `groupByColumn: LocaleMessage;` | inherited |  |
| `groupChip` | `groupChip: LocaleMessage;` | inherited |  |
| `groupChipToggle` | `groupChipToggle: LocaleMessage;` | inherited |  |
| `groupItems` | `groupItems: LocaleMessage;` | inherited |  |
| `groupLevel` | `groupLevel: LocaleMessage;` | inherited |  |
| `groupLoadFailed` | `groupLoadFailed: LocaleMessage;` | inherited |  |
| `groupLoading` | `groupLoading: LocaleMessage;` | inherited |  |
| `groupPanel` | `groupPanel: LocaleMessage;` | inherited |  |
| `groupPanelLabel` | `groupPanelLabel: LocaleMessage;` | inherited |  |
| `indent` | `indent: LocaleMessage;` | inherited |  |
| `lastPage` | `lastPage: LocaleMessage;` | inherited |  |
| `loadMore` | `loadMore: LocaleMessage;` | inherited |  |
| `loaded` | `loaded: LocaleMessage;` | inherited |  |
| `loading` | `loading: LocaleMessage;` | inherited |  |
| `lookupError` | `lookupError: LocaleMessage;` | inherited |  |
| `lookupLoading` | `lookupLoading: LocaleMessage;` | inherited |  |
| `matchCase` | `matchCase: LocaleMessage;` | inherited |  |
| `max` | `max: LocaleMessage;` | inherited |  |
| `min` | `min: LocaleMessage;` | inherited |  |
| `more` | `more: LocaleMessage;` | inherited |  |
| `multiSelect` | `multiSelect: LocaleMessage;` | inherited |  |
| `newRowErrors` | `newRowErrors: LocaleMessage;` | inherited |  |
| `newRowLabel` | `newRowLabel: LocaleMessage;` | inherited |  |
| `nextMonth` | `nextMonth: LocaleMessage;` | inherited |  |
| `nextPage` | `nextPage: LocaleMessage;` | inherited |  |
| `nextPages` | `nextPages: LocaleMessage;` | inherited |  |
| `noMatches` | `noMatches: LocaleMessage;` | inherited |  |
| `noRows` | `noRows: LocaleMessage;` | inherited |  |
| `ok` | `ok: LocaleMessage;` | inherited |  |
| `operatorBetween` | `operatorBetween: LocaleMessage;` | inherited |  |
| `operatorContains` | `operatorContains: LocaleMessage;` | inherited |  |
| `operatorDoesNotContain` | `operatorDoesNotContain: LocaleMessage;` | inherited |  |
| `operatorDoesNotEndWith` | `operatorDoesNotEndWith: LocaleMessage;` | inherited |  |
| `operatorDoesNotStartWith` | `operatorDoesNotStartWith: LocaleMessage;` | inherited |  |
| `operatorEndsWith` | `operatorEndsWith: LocaleMessage;` | inherited |  |
| `operatorEqual` | `operatorEqual: LocaleMessage;` | inherited |  |
| `operatorGreaterThan` | `operatorGreaterThan: LocaleMessage;` | inherited |  |
| `operatorGreaterThanOrEqual` | `operatorGreaterThanOrEqual: LocaleMessage;` | inherited |  |
| `operatorIn` | `operatorIn: LocaleMessage;` | inherited |  |
| `operatorIsEmpty` | `operatorIsEmpty: LocaleMessage;` | inherited |  |
| `operatorIsNotEmpty` | `operatorIsNotEmpty: LocaleMessage;` | inherited |  |
| `operatorIsNotNull` | `operatorIsNotNull: LocaleMessage;` | inherited |  |
| `operatorIsNull` | `operatorIsNull: LocaleMessage;` | inherited |  |
| `operatorLessThan` | `operatorLessThan: LocaleMessage;` | inherited |  |
| `operatorLessThanOrEqual` | `operatorLessThanOrEqual: LocaleMessage;` | inherited |  |
| `operatorLike` | `operatorLike: LocaleMessage;` | inherited |  |
| `operatorNotEqual` | `operatorNotEqual: LocaleMessage;` | inherited |  |
| `operatorNotIn` | `operatorNotIn: LocaleMessage;` | inherited |  |
| `operatorStartsWith` | `operatorStartsWith: LocaleMessage;` | inherited |  |
| `operatorWildcard` | `operatorWildcard: LocaleMessage;` | inherited |  |
| `or` | `or: LocaleMessage;` | inherited |  |
| `outdent` | `outdent: LocaleMessage;` | inherited |  |
| `pageButton` | `pageButton: LocaleMessage;` | inherited |  |
| `pageOf` | `pageOf: LocaleMessage;` | inherited |  |
| `pageSize` | `pageSize: LocaleMessage;` | inherited |  |
| `pagerInfo` | `pagerInfo: LocaleMessage;` | inherited |  |
| `pagerItems` | `pagerItems: LocaleMessage;` | inherited |  |
| `pagerLabel` | `pagerLabel: LocaleMessage;` | inherited |  |
| `partialSave` | `partialSave: LocaleMessage;` | inherited |  |
| `paste` | `paste: LocaleMessage;` | inherited |  |
| `pinEnd` | `pinEnd: LocaleMessage;` | inherited |  |
| `pinStart` | `pinStart: LocaleMessage;` | inherited |  |
| `preparingPrint` | `preparingPrint: LocaleMessage;` | inherited |  |
| `previousMonth` | `previousMonth: LocaleMessage;` | inherited |  |
| `previousPage` | `previousPage: LocaleMessage;` | inherited |  |
| `previousPages` | `previousPages: LocaleMessage;` | inherited |  |
| `print` | `print: LocaleMessage;` | inherited |  |
| `removeCondition` | `removeCondition: LocaleMessage;` | inherited |  |
| `removeGroup` | `removeGroup: LocaleMessage;` | inherited |  |
| `resizeColumn` | `resizeColumn: LocaleMessage;` | inherited |  |
| `retry` | `retry: LocaleMessage;` | inherited |  |
| `rowAdded` | `rowAdded: LocaleMessage;` | inherited |  |
| `rowDeleted` | `rowDeleted: LocaleMessage;` | inherited |  |
| `rowDragColumnHeader` | `rowDragColumnHeader: LocaleMessage;` | inherited |  |
| `rowDragHandle` | `rowDragHandle: LocaleMessage;` | inherited |  |
| `rowDragHandleRole` | `rowDragHandleRole: LocaleMessage;` | inherited |  |
| `rowErrors` | `rowErrors: LocaleMessage;` | inherited |  |
| `rowMoved` | `rowMoved: LocaleMessage;` | inherited |  |
| `rowNew` | `rowNew: LocaleMessage;` | inherited |  |
| `rowNumberColumnHeader` | `rowNumberColumnHeader: LocaleMessage;` | inherited |  |
| `rowsDeleted` | `rowsDeleted: LocaleMessage;` | inherited |  |
| `rowsDropped` | `rowsDropped: LocaleMessage;` | inherited |  |
| `rowsGrabbed` | `rowsGrabbed: LocaleMessage;` | inherited |  |
| `rowsSelected` | `rowsSelected: LocaleMessage;` | inherited |  |
| `save` | `save: LocaleMessage;` | inherited |  |
| `saveFailed` | `saveFailed: LocaleMessage;` | inherited |  |
| `saveRejected` | `saveRejected: LocaleMessage;` | inherited |  |
| `search` | `search: LocaleMessage;` | inherited |  |
| `searchColumns` | `searchColumns: LocaleMessage;` | inherited |  |
| `searchLabel` | `searchLabel: LocaleMessage;` | inherited |  |
| `searchMatches` | `searchMatches: LocaleMessage;` | inherited |  |
| `searchValues` | `searchValues: LocaleMessage;` | inherited |  |
| `selectAll` | `selectAll: LocaleMessage;` | inherited |  |
| `selectAllRows` | `selectAllRows: LocaleMessage;` | inherited |  |
| `selectRow` | `selectRow: LocaleMessage;` | inherited |  |
| `selectedCount` | `selectedCount: LocaleMessage;` | inherited |  |
| `selectionCleared` | `selectionCleared: LocaleMessage;` | inherited |  |
| `selectionColumnHeader` | `selectionColumnHeader: LocaleMessage;` | inherited |  |
| `sortAscending` | `sortAscending: LocaleMessage;` | inherited |  |
| `sortCleared` | `sortCleared: LocaleMessage;` | inherited |  |
| `sortDescending` | `sortDescending: LocaleMessage;` | inherited |  |
| `sortDialogTitle` | `sortDialogTitle: LocaleMessage;` | inherited |  |
| `sortedBy` | `sortedBy: LocaleMessage;` | inherited |  |
| `sum` | `sum: LocaleMessage;` | inherited |  |
| `timeLabel` | `timeLabel: LocaleMessage;` | inherited |  |
| `today` | `today: LocaleMessage;` | inherited |  |
| `toolbarLabel` | `toolbarLabel: LocaleMessage;` | inherited |  |
| `touchMultiSort` | `touchMultiSort: LocaleMessage;` | inherited |  |
| `true` | `true: LocaleMessage;` | inherited |  |
| `trueCount` | `trueCount: LocaleMessage;` | inherited |  |
| `unavailable` | `unavailable: LocaleMessage;` | inherited |  |
| `ungroup` | `ungroup: LocaleMessage;` | inherited |  |
| `ungroupByColumn` | `ungroupByColumn: LocaleMessage;` | inherited |  |
| `ungroupColumn` | `ungroupColumn: LocaleMessage;` | inherited |  |
| `unpin` | `unpin: LocaleMessage;` | inherited |  |
| `unsavedChangesLost` | `unsavedChangesLost: LocaleMessage;` | inherited |  |
| `update` | `update: LocaleMessage;` | inherited |  |
| `validationCreditcard` | `validationCreditcard: LocaleMessage;` | inherited |  |
| `validationDate` | `validationDate: LocaleMessage;` | inherited |  |
| `validationDateIso` | `validationDateIso: LocaleMessage;` | inherited |  |
| `validationDigits` | `validationDigits: LocaleMessage;` | inherited |  |
| `validationEmail` | `validationEmail: LocaleMessage;` | inherited |  |
| `validationMax` | `validationMax: LocaleMessage;` | inherited |  |
| `validationMaxLength` | `validationMaxLength: LocaleMessage;` | inherited |  |
| `validationMin` | `validationMin: LocaleMessage;` | inherited |  |
| `validationMinLength` | `validationMinLength: LocaleMessage;` | inherited |  |
| `validationNumber` | `validationNumber: LocaleMessage;` | inherited |  |
| `validationPattern` | `validationPattern: LocaleMessage;` | inherited |  |
| `validationRange` | `validationRange: LocaleMessage;` | inherited |  |
| `validationRangeLength` | `validationRangeLength: LocaleMessage;` | inherited |  |
| `validationRequired` | `validationRequired: LocaleMessage;` | inherited |  |
| `validationTel` | `validationTel: LocaleMessage;` | inherited |  |
| `validationUrl` | `validationUrl: LocaleMessage;` | inherited |  |
| `validationValidate` | `validationValidate: LocaleMessage;` | inherited |  |

### LocaleTextCommand

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/LocaleTextCommand

```ts
type LocaleTextCommand = LocaleTextSetCommand;
```

Members (2):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `type` | `type: "localeText.set";` | inherited |  |
| `text` | `text: Record<string, LocaleMessage>;` | inherited |  |

### LocaleTextKey

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/LocaleTextKey

```ts
type LocaleTextKey = keyof typeof DEFAULT_LOCALE_TEXT;
```

### LocaleTextMethods

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/LocaleTextMethods

```ts
type LocaleTextMethods<Row> = {
    format(ctx: ModuleContext<Row>, key: string, params?: LocaleTextParams): string;
    get(ctx: ModuleContext<Row>): LocaleText;
};
```

Members (2):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `format` | `format(ctx: ModuleContext<Row>, key: string, params?: LocaleTextParams): string;` |  | A message with placeholders filled, in the grid locale. |
| `get` | `get(ctx: ModuleContext<Row>): LocaleText;` |  |  |

### LocaleTextModule

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/LocaleTextModule

```ts
type LocaleTextModule<Row> = DataGridModule<Row, LocaleTextState, LocaleTextCommand, 'localeText', LocaleTextMethods<Row>>;
```

Members (18):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `name` | `name: "localeText";` | inherited |  |
| `dependencies` | `dependencies?: readonly string[];` | optional, inherited | Validated at engine creation. |
| `inSnapshot` | `inSnapshot?: boolean;` | optional, inherited | When true (default) the slice lives in `snapshot.modules[name]` and every change replaces the grid snapshot. High-churn modules (focus, selection, drafts) set false and notify through row/cell/header/module channels only. |
| `commands` | `commands: readonly "localeText.set"[];` | inherited | Declared, validated, serializable. Every type must start with `${name}.`. |
| `initialState` | `initialState: (options: DataGridOptions<Row>) => LocaleTextState;` | inherited |  |
| `reduce` | `reduce?: ((state: LocaleTextState, command: LocaleTextSetCommand, ctx: ModuleContext<Row>) => CommandRejection \| LocaleTextState);` | optional, inherited |  |
| `extendColumns` | `extendColumns?: ((columns: readonly CompiledColumn<Row>[], ctx: ModuleContext<Row>) => readonly CompiledColumn<Row>[]);` | optional, inherited |  |
| `extendQuery` | `extendQuery?: ((query: DataQuery, state: LocaleTextState) => DataQuery);` | optional, inherited |  |
| `pipeline` | `pipeline?: readonly PipelineStage<Row, LocaleTextState>[];` | optional, inherited |  |
| `selectors` | `selectors?: Readonly<Record<string, (snapshot: DataGridSnapshot<Row>) => unknown>>;` | optional, inherited |  |
| `methods` | `methods?: LocaleTextMethods<Row>;` | optional, inherited | Reads that need more than the snapshot (facets, pager totals). Must not change state; names may not collide with command actions. |
| `notify` | `notify?: ((previous: LocaleTextState, next: LocaleTextState, ctx: ModuleContext<Row>) => NotificationScope);` | optional, inherited |  |
| `hiddenColumns` | `hiddenColumns?: ((state: LocaleTextState) => readonly string[]);` | optional, inherited | Leaf columns this module hides from the visible column set (grouped columns with `showGroupedColumns: false`). |
| `interceptRead` | `interceptRead?: ((query: DataQuery, state: LocaleTextState, ctx: ModuleContext<Row>) => boolean);` | optional, inherited | Remote sources only: return true to serve the main read of `query` yourself (lazy grouping loads group levels instead of rows). The engine then shows no source rows and runs only the stages the source did not perform. |
| `onQueryChange` | `onQueryChange?: ((previous: DataQuery, next: DataQuery, ctx: ModuleContext<Row>) => void);` | optional, inherited | Called after the effective query changed (sort, filter, search, page, group). Runs inside the dispatch of the command that changed it; may dispatch commands through `ctx` (selection clears itself here when it does not persist). |
| `onConnect` | `onConnect?: ((ctx: ModuleContext<Row>) => void);` | optional, inherited | `engine.connect()` ran (`deferDataSource`): start loads that were held while disconnected. |
| `onSourceEvent` | `onSourceEvent?: ((event: DataSourceEvent<Row>, state: LocaleTextState, ctx: ModuleContext<Row>) => boolean);` | optional, inherited | A data source event (patch or reset). Return true to consume it: the engine then leaves its source rows unchanged (infinite scroll applies write echoes to the blocks it owns). |
| `dispose` | `dispose?: (() => void);` | optional, inherited |  |

### LocaleTextParams

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/LocaleTextParams

```ts
type LocaleTextParams = Readonly<Record<string, string | number>>;
```

### LocaleTextSetCommand

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/LocaleTextSetCommand

```ts
type LocaleTextSetCommand = {
    type: 'localeText.set';
    text: Record<string, LocaleMessage>;
};
```

Members (2):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `type` | `type: 'localeText.set';` |  |  |
| `text` | `text: Record<string, LocaleMessage>;` |  |  |

### LookupCommand

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/LookupCommand

```ts
type LookupCommand = LookupReloadCommand | LookupLoadedCommand;
```

### LookupLoadedCommand

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/LookupLoadedCommand

```ts
type LookupLoadedCommand = {
    type: 'lookup.loaded';
    version: number;
    columns: Record<ColumnId, {
        status: LookupStatus;
        error: string | null;
        size: number;
    }>;
};
```

A lookup load settled (dispatched by the engine; part of the public command union).

Members (3):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `type` | `type: 'lookup.loaded';` |  |  |
| `version` | `version: number;` |  |  |
| `columns` | `columns: Record<ColumnId, {     status: LookupStatus;     error: string \| null;     size: number; }>;` |  |  |

### LookupMethods

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/LookupMethods

```ts
type LookupMethods<Row> = {
    getColumns(ctx: ModuleContext<Row>): readonly CompiledColumn<Row>[];
    getStatus(ctx: ModuleContext<Row>, columnId: ColumnId): ColumnLookupStatus | undefined;
    getDisplayValue(ctx: ModuleContext<Row>, columnId: ColumnId, key: unknown): unknown;
    getLookupRows(ctx: ModuleContext<Row>, columnId: ColumnId): readonly unknown[];
};
```

Members (4):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `getColumns` | `getColumns(ctx: ModuleContext<Row>): readonly CompiledColumn<Row>[];` |  | Lookup columns (instance `getLookupColumns()`), in definition order. |
| `getStatus` | `getStatus(ctx: ModuleContext<Row>, columnId: ColumnId): ColumnLookupStatus \| undefined;` |  | Load status of a lookup column. |
| `getDisplayValue` | `getDisplayValue(ctx: ModuleContext<Row>, columnId: ColumnId, key: unknown): unknown;` |  | Display value of a key in a column's lookup (null when unknown). |
| `getLookupRows` | `getLookupRows(ctx: ModuleContext<Row>, columnId: ColumnId): readonly unknown[];` |  | Lookup rows loaded for a column (dropdown editor options). |

### LookupModule

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/LookupModule

```ts
type LookupModule<Row> = DataGridModule<Row, LookupState, LookupCommand, 'lookup', LookupMethods<Row>>;
```

Members (18):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `name` | `name: "lookup";` | inherited |  |
| `dependencies` | `dependencies?: readonly string[];` | optional, inherited | Validated at engine creation. |
| `inSnapshot` | `inSnapshot?: boolean;` | optional, inherited | When true (default) the slice lives in `snapshot.modules[name]` and every change replaces the grid snapshot. High-churn modules (focus, selection, drafts) set false and notify through row/cell/header/module channels only. |
| `commands` | `commands: readonly ("lookup.loaded" \| "lookup.reload")[];` | inherited | Declared, validated, serializable. Every type must start with `${name}.`. |
| `initialState` | `initialState: (options: DataGridOptions<Row>) => LookupState;` | inherited |  |
| `reduce` | `reduce?: ((state: LookupState, command: LookupCommand, ctx: ModuleContext<Row>) => CommandRejection \| LookupState);` | optional, inherited |  |
| `extendColumns` | `extendColumns?: ((columns: readonly CompiledColumn<Row>[], ctx: ModuleContext<Row>) => readonly CompiledColumn<Row>[]);` | optional, inherited |  |
| `extendQuery` | `extendQuery?: ((query: DataQuery, state: LookupState) => DataQuery);` | optional, inherited |  |
| `pipeline` | `pipeline?: readonly PipelineStage<Row, LookupState>[];` | optional, inherited |  |
| `selectors` | `selectors?: Readonly<Record<string, (snapshot: DataGridSnapshot<Row>) => unknown>>;` | optional, inherited |  |
| `methods` | `methods?: LookupMethods<Row>;` | optional, inherited | Reads that need more than the snapshot (facets, pager totals). Must not change state; names may not collide with command actions. |
| `notify` | `notify?: ((previous: LookupState, next: LookupState, ctx: ModuleContext<Row>) => NotificationScope);` | optional, inherited |  |
| `hiddenColumns` | `hiddenColumns?: ((state: LookupState) => readonly string[]);` | optional, inherited | Leaf columns this module hides from the visible column set (grouped columns with `showGroupedColumns: false`). |
| `interceptRead` | `interceptRead?: ((query: DataQuery, state: LookupState, ctx: ModuleContext<Row>) => boolean);` | optional, inherited | Remote sources only: return true to serve the main read of `query` yourself (lazy grouping loads group levels instead of rows). The engine then shows no source rows and runs only the stages the source did not perform. |
| `onQueryChange` | `onQueryChange?: ((previous: DataQuery, next: DataQuery, ctx: ModuleContext<Row>) => void);` | optional, inherited | Called after the effective query changed (sort, filter, search, page, group). Runs inside the dispatch of the command that changed it; may dispatch commands through `ctx` (selection clears itself here when it does not persist). |
| `onConnect` | `onConnect?: ((ctx: ModuleContext<Row>) => void);` | optional, inherited | `engine.connect()` ran (`deferDataSource`): start loads that were held while disconnected. |
| `onSourceEvent` | `onSourceEvent?: ((event: DataSourceEvent<Row>, state: LookupState, ctx: ModuleContext<Row>) => boolean);` | optional, inherited | A data source event (patch or reset). Return true to consume it: the engine then leaves its source rows unchanged (infinite scroll applies write echoes to the blocks it owns). |
| `dispose` | `dispose?: (() => void);` | optional, inherited |  |

### LookupReloadCommand

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/LookupReloadCommand

```ts
type LookupReloadCommand = {
    type: 'lookup.reload';
    columnId?: ColumnId;
};
```

Members (2):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `type` | `type: 'lookup.reload';` |  |  |
| `columnId` | `columnId?: ColumnId;` | optional |  |

### LookupStatus

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/LookupStatus

```ts
type LookupStatus = 'idle' | 'loading' | 'ready' | 'error';
```

### ModuleFacade

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/ModuleFacade

```ts
type ModuleFacade<M> = M extends DataGridModule<infer _Row, infer _State, infer C, infer N, infer Ms> ? string extends N ? never : {
    readonly [K in N]: {
        readonly [T in C['type'] as ActionOf<T, N>]: FacadeMethod<Extract<C, {
            type: T;
        }>>;
    } & MethodFacade<Ms>;
} : never;
```

Imperative façade of one module: `engine.<module>.<action>(payload)`
dispatches `<module>.<action>`; `engine.<module>.<method>(...args)` calls a
read-only module method.

### ModuleMethods

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/ModuleMethods

```ts
type ModuleMethods<Row> = Readonly<Record<string, (ctx: ModuleContext<Row>, ...args: never[]) => unknown>>;
```

Read-only module methods exposed on the façade (`engine.<module>.<method>(...args)`); they receive the module context first.

### PagingCommand

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/PagingCommand

```ts
type PagingCommand = PagingGoToPageCommand | PagingSetPageSizeCommand | PagingSetEnabledCommand | PagingSetTotalRowCountCommand | PagingNextCommand | PagingPreviousCommand | PagingFirstCommand | PagingLastCommand;
```

### PagingFirstCommand

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/PagingFirstCommand

```ts
type PagingFirstCommand = {
    type: 'paging.first';
};
```

Members (1):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `type` | `type: 'paging.first';` |  |  |

### PagingGoToPageCommand

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/PagingGoToPageCommand

```ts
type PagingGoToPageCommand = {
    type: 'paging.goToPage';
    page: number;
};
```

Members (2):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `type` | `type: 'paging.goToPage';` |  |  |
| `page` | `page: number;` |  |  |

### PagingLastCommand

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/PagingLastCommand

```ts
type PagingLastCommand = {
    type: 'paging.last';
};
```

Members (1):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `type` | `type: 'paging.last';` |  |  |

### PagingMethods

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/PagingMethods

```ts
type PagingMethods<Row> = {
    getInfo(ctx: ModuleContext<Row>): PageInfo;
};
```

Members (1):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `getInfo` | `getInfo(ctx: ModuleContext<Row>): PageInfo;` |  | Pager model: effective page, page count, totals. Identity is stable while nothing changes. |

### PagingModule

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/PagingModule

```ts
type PagingModule<Row> = DataGridModule<Row, PagingState, PagingCommand, 'paging', PagingMethods<Row>>;
```

Members (18):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `name` | `name: "paging";` | inherited |  |
| `dependencies` | `dependencies?: readonly string[];` | optional, inherited | Validated at engine creation. |
| `inSnapshot` | `inSnapshot?: boolean;` | optional, inherited | When true (default) the slice lives in `snapshot.modules[name]` and every change replaces the grid snapshot. High-churn modules (focus, selection, drafts) set false and notify through row/cell/header/module channels only. |
| `commands` | `commands: readonly ("paging.first" \| "paging.goToPage" \| "paging.last" \| "paging.next" \| "paging.previous" \| "paging.setEnabled" \| "paging.setPageSize" \| "paging.setTotalRowCount")[];` | inherited | Declared, validated, serializable. Every type must start with `${name}.`. |
| `initialState` | `initialState: (options: DataGridOptions<Row>) => PagingState;` | inherited |  |
| `reduce` | `reduce?: ((state: PagingState, command: PagingCommand, ctx: ModuleContext<Row>) => CommandRejection \| PagingState);` | optional, inherited |  |
| `extendColumns` | `extendColumns?: ((columns: readonly CompiledColumn<Row>[], ctx: ModuleContext<Row>) => readonly CompiledColumn<Row>[]);` | optional, inherited |  |
| `extendQuery` | `extendQuery?: ((query: DataQuery, state: PagingState) => DataQuery);` | optional, inherited |  |
| `pipeline` | `pipeline?: readonly PipelineStage<Row, PagingState>[];` | optional, inherited |  |
| `selectors` | `selectors?: Readonly<Record<string, (snapshot: DataGridSnapshot<Row>) => unknown>>;` | optional, inherited |  |
| `methods` | `methods?: PagingMethods<Row>;` | optional, inherited | Reads that need more than the snapshot (facets, pager totals). Must not change state; names may not collide with command actions. |
| `notify` | `notify?: ((previous: PagingState, next: PagingState, ctx: ModuleContext<Row>) => NotificationScope);` | optional, inherited |  |
| `hiddenColumns` | `hiddenColumns?: ((state: PagingState) => readonly string[]);` | optional, inherited | Leaf columns this module hides from the visible column set (grouped columns with `showGroupedColumns: false`). |
| `interceptRead` | `interceptRead?: ((query: DataQuery, state: PagingState, ctx: ModuleContext<Row>) => boolean);` | optional, inherited | Remote sources only: return true to serve the main read of `query` yourself (lazy grouping loads group levels instead of rows). The engine then shows no source rows and runs only the stages the source did not perform. |
| `onQueryChange` | `onQueryChange?: ((previous: DataQuery, next: DataQuery, ctx: ModuleContext<Row>) => void);` | optional, inherited | Called after the effective query changed (sort, filter, search, page, group). Runs inside the dispatch of the command that changed it; may dispatch commands through `ctx` (selection clears itself here when it does not persist). |
| `onConnect` | `onConnect?: ((ctx: ModuleContext<Row>) => void);` | optional, inherited | `engine.connect()` ran (`deferDataSource`): start loads that were held while disconnected. |
| `onSourceEvent` | `onSourceEvent?: ((event: DataSourceEvent<Row>, state: PagingState, ctx: ModuleContext<Row>) => boolean);` | optional, inherited | A data source event (patch or reset). Return true to consume it: the engine then leaves its source rows unchanged (infinite scroll applies write echoes to the blocks it owns). |
| `dispose` | `dispose?: (() => void);` | optional, inherited |  |

### PagingNextCommand

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/PagingNextCommand

```ts
type PagingNextCommand = {
    type: 'paging.next';
};
```

Members (1):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `type` | `type: 'paging.next';` |  |  |

### PagingPreviousCommand

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/PagingPreviousCommand

```ts
type PagingPreviousCommand = {
    type: 'paging.previous';
};
```

Members (1):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `type` | `type: 'paging.previous';` |  |  |

### PagingSetEnabledCommand

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/PagingSetEnabledCommand

```ts
type PagingSetEnabledCommand = {
    type: 'paging.setEnabled';
    enabled: boolean;
};
```

Members (2):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `type` | `type: 'paging.setEnabled';` |  |  |
| `enabled` | `enabled: boolean;` |  |  |

### PagingSetPageSizeCommand

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/PagingSetPageSizeCommand

```ts
type PagingSetPageSizeCommand = {
    type: 'paging.setPageSize';
    pageSize: number;
};
```

Keeps the first row of the current page visible, then clamps.

Members (2):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `type` | `type: 'paging.setPageSize';` |  |  |
| `pageSize` | `pageSize: number;` |  |  |

### PagingSetTotalRowCountCommand

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/PagingSetTotalRowCountCommand

```ts
type PagingSetTotalRowCountCommand = {
    type: 'paging.setTotalRowCount';
    totalRowCount: number | null;
};
```

Sets or clears (`null`) the remote total override (`PagingOptions.totalRowCount`).

Members (2):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `type` | `type: 'paging.setTotalRowCount';` |  |  |
| `totalRowCount` | `totalRowCount: number \| null;` |  |  |

### PerformedStage

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/PerformedStage

```ts
type PerformedStage = 'search' | 'filter' | 'sort' | 'group' | 'aggregate' | 'page';
```

Stages a remote source may declare as already performed.

### PersistedColumn

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/PersistedColumn

```ts
type PersistedColumn = {
    readonly id: ColumnId;
    readonly field: string | null;
    readonly hidden: boolean;
    readonly width?: number;
};
```

A column in runtime order.

Members (4):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `id` | `readonly id: ColumnId;` |  | Stable column id. |
| `field` | `readonly field: string \| null;` |  |  |
| `hidden` | `readonly hidden: boolean;` |  |  |
| `width` | `readonly width?: number;` | optional | Runtime width in px; absent when the definition width applies. |

### PersistedFilter

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/PersistedFilter

```ts
type PersistedFilter = PersistedFilterCondition | PersistedFilterGroup;
```

### PersistedFilterCondition

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/PersistedFilterCondition

```ts
type PersistedFilterCondition = {
    readonly field: string;
    readonly operator: FilterOperator | (string & {});
    readonly value: Json;
    readonly logic: 'and' | 'or';
    readonly matchCase?: boolean;
    readonly ignoreAccents?: boolean;
};
```

Members (6):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `field` | `readonly field: string;` |  |  |
| `operator` | `readonly operator: FilterOperator \| (string & {});` |  |  |
| `value` | `readonly value: Json;` |  |  |
| `logic` | `readonly logic: 'and' \| 'or';` |  | Combination with the previous condition. |
| `matchCase` | `readonly matchCase?: boolean;` | optional |  |
| `ignoreAccents` | `readonly ignoreAccents?: boolean;` | optional |  |

### PersistedFilterGroup

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/PersistedFilterGroup

```ts
type PersistedFilterGroup = {
    readonly kind: 'group';
    readonly logic: 'and' | 'or';
    readonly not?: boolean;
    readonly filters: readonly PersistedFilter[];
};
```

Members (4):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `kind` | `readonly kind: 'group';` |  |  |
| `logic` | `readonly logic: 'and' \| 'or';` |  |  |
| `not` | `readonly not?: boolean;` | optional | Negates the group. |
| `filters` | `readonly filters: readonly PersistedFilter[];` |  |  |

### PersistedPinning

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/PersistedPinning

```ts
type PersistedPinning = {
    readonly start: number;
    readonly end: number;
    readonly columns: Readonly<Record<string, 'start' | 'end' | 'center' | null>>;
};
```

Runtime pin state (the `pinnedColumns` counts and per-column pins made at
runtime, `pinColumn`). Columns are referenced by field (id when there is
none); `null` unpins a column that declares `pinned`.

Members (3):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `start` | `readonly start: number;` |  | Count of leading visible columns pinned to the start. |
| `end` | `readonly end: number;` |  | Count of trailing visible columns pinned to the end. |
| `columns` | `readonly columns: Readonly<Record<string, 'start' \| 'end' \| 'center' \| null>>;` |  |  |

### PipelineStageName

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/PipelineStageName

```ts
type PipelineStageName = 'search' | 'filter' | 'sort' | 'group' | 'aggregate' | 'groupExpansion' | 'treeExpansion' | 'detailExpansion' | 'infinite' | 'page' | 'frozenSplit' | 'pin' | 'pinnedRows';
```

### RowDragCommand

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/RowDragCommand

```ts
type RowDragCommand = RowDragStartCommand | RowDragOverCommand | RowDragOverExternalCommand | RowDragLeaveCommand | RowDragDropCommand | RowDragReceiveCommand | RowDragEndCommand | RowDragCancelCommand | RowDragMoveCommand | RowDragReorderCommand | RowDragMoveByCommand | RowDragSetEnabledCommand | RowDragSetOptionsCommand | RowDragSettledCommand;
```

### RowDragDropMethods

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/RowDragDropMethods

```ts
type RowDragDropMethods<Row> = {
    getPayload(ctx: ModuleContext<Row>): RowDragPayload<Row> | null;
    getSession(ctx: ModuleContext<Row>): RowDragSession | null;
    getEventArgs(ctx: ModuleContext<Row>): RowDragEventInfo<Row> | null;
};
```

Members (3):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `getPayload` | `getPayload(ctx: ModuleContext<Row>): RowDragPayload<Row> \| null;` |  | The dragged rows (for drops on custom elements and `DataTransfer`), or null. |
| `getSession` | `getSession(ctx: ModuleContext<Row>): RowDragSession \| null;` |  |  |
| `getEventArgs` | `getEventArgs(ctx: ModuleContext<Row>): RowDragEventInfo<Row> \| null;` |  | Drag event argument fields for the current session, or null. |

### RowDragDropModule

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/RowDragDropModule

```ts
type RowDragDropModule<Row> = DataGridModule<Row, RowDragDropState, RowDragCommand, 'rowDragDrop', RowDragDropMethods<Row>>;
```

Members (18):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `name` | `name: "rowDragDrop";` | inherited |  |
| `dependencies` | `dependencies?: readonly string[];` | optional, inherited | Validated at engine creation. |
| `inSnapshot` | `inSnapshot?: boolean;` | optional, inherited | When true (default) the slice lives in `snapshot.modules[name]` and every change replaces the grid snapshot. High-churn modules (focus, selection, drafts) set false and notify through row/cell/header/module channels only. |
| `commands` | `commands: readonly ("rowDragDrop.cancel" \| "rowDragDrop.drop" \| "rowDragDrop.end" \| "rowDragDrop.leave" \| "rowDragDrop.move" \| "rowDragDrop.moveBy" \| "rowDragDrop.over" \| "rowDragDrop.overExternal" \| ... 5 more ... \| "rowDragDrop.start")[];` | inherited | Declared, validated, serializable. Every type must start with `${name}.`. |
| `initialState` | `initialState: (options: DataGridOptions<Row>) => RowDragDropState;` | inherited |  |
| `reduce` | `reduce?: ((state: RowDragDropState, command: RowDragCommand, ctx: ModuleContext<Row>) => CommandRejection \| RowDragDropState);` | optional, inherited |  |
| `extendColumns` | `extendColumns?: ((columns: readonly CompiledColumn<Row>[], ctx: ModuleContext<Row>) => readonly CompiledColumn<Row>[]);` | optional, inherited |  |
| `extendQuery` | `extendQuery?: ((query: DataQuery, state: RowDragDropState) => DataQuery);` | optional, inherited |  |
| `pipeline` | `pipeline?: readonly PipelineStage<Row, RowDragDropState>[];` | optional, inherited |  |
| `selectors` | `selectors?: Readonly<Record<string, (snapshot: DataGridSnapshot<Row>) => unknown>>;` | optional, inherited |  |
| `methods` | `methods?: RowDragDropMethods<Row>;` | optional, inherited | Reads that need more than the snapshot (facets, pager totals). Must not change state; names may not collide with command actions. |
| `notify` | `notify?: ((previous: RowDragDropState, next: RowDragDropState, ctx: ModuleContext<Row>) => NotificationScope);` | optional, inherited |  |
| `hiddenColumns` | `hiddenColumns?: ((state: RowDragDropState) => readonly string[]);` | optional, inherited | Leaf columns this module hides from the visible column set (grouped columns with `showGroupedColumns: false`). |
| `interceptRead` | `interceptRead?: ((query: DataQuery, state: RowDragDropState, ctx: ModuleContext<Row>) => boolean);` | optional, inherited | Remote sources only: return true to serve the main read of `query` yourself (lazy grouping loads group levels instead of rows). The engine then shows no source rows and runs only the stages the source did not perform. |
| `onQueryChange` | `onQueryChange?: ((previous: DataQuery, next: DataQuery, ctx: ModuleContext<Row>) => void);` | optional, inherited | Called after the effective query changed (sort, filter, search, page, group). Runs inside the dispatch of the command that changed it; may dispatch commands through `ctx` (selection clears itself here when it does not persist). |
| `onConnect` | `onConnect?: ((ctx: ModuleContext<Row>) => void);` | optional, inherited | `engine.connect()` ran (`deferDataSource`): start loads that were held while disconnected. |
| `onSourceEvent` | `onSourceEvent?: ((event: DataSourceEvent<Row>, state: RowDragDropState, ctx: ModuleContext<Row>) => boolean);` | optional, inherited | A data source event (patch or reset). Return true to consume it: the engine then leaves its source rows unchanged (infinite scroll applies write echoes to the blocks it owns). |
| `dispose` | `dispose?: (() => void);` | optional, inherited |  |

### RowId

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/RowId

```ts
type RowId = string;
```

### RowKind

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/RowKind

```ts
type RowKind = 'data' | 'group' | 'groupFooter' | 'tree' | 'detail' | 'aggregate' | 'frozenTop' | 'frozenBottom' | 'addNew' | 'loading';
```

### RowValidator

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/RowValidator

```ts
type RowValidator<Row> = (row: Row, ctx: RowValidationContext) => string | readonly string[] | null | undefined | PromiseLike<string | readonly string[] | null | undefined>;
```

### RuleValue

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/RuleValue

```ts
type RuleValue<T> = T | readonly [
    T,
    string
];
```

A rule argument, or `[argument, message]` to override the message.

### SearchClearCommand

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/SearchClearCommand

```ts
type SearchClearCommand = {
    type: 'search.clear';
};
```

Members (1):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `type` | `type: 'search.clear';` |  |  |

### SearchCommand

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/SearchCommand

```ts
type SearchCommand = SearchSetCommand | SearchClearCommand;
```

### SearchModule

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/SearchModule

```ts
type SearchModule<Row> = DataGridModule<Row, SearchState, SearchCommand, 'search', {}>;
```

Members (18):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `name` | `name: "search";` | inherited |  |
| `dependencies` | `dependencies?: readonly string[];` | optional, inherited | Validated at engine creation. |
| `inSnapshot` | `inSnapshot?: boolean;` | optional, inherited | When true (default) the slice lives in `snapshot.modules[name]` and every change replaces the grid snapshot. High-churn modules (focus, selection, drafts) set false and notify through row/cell/header/module channels only. |
| `commands` | `commands: readonly ("search.clear" \| "search.set")[];` | inherited | Declared, validated, serializable. Every type must start with `${name}.`. |
| `initialState` | `initialState: (options: DataGridOptions<Row>) => SearchState;` | inherited |  |
| `reduce` | `reduce?: ((state: SearchState, command: SearchCommand, ctx: ModuleContext<Row>) => CommandRejection \| SearchState);` | optional, inherited |  |
| `extendColumns` | `extendColumns?: ((columns: readonly CompiledColumn<Row>[], ctx: ModuleContext<Row>) => readonly CompiledColumn<Row>[]);` | optional, inherited |  |
| `extendQuery` | `extendQuery?: ((query: DataQuery, state: SearchState) => DataQuery);` | optional, inherited |  |
| `pipeline` | `pipeline?: readonly PipelineStage<Row, SearchState>[];` | optional, inherited |  |
| `selectors` | `selectors?: Readonly<Record<string, (snapshot: DataGridSnapshot<Row>) => unknown>>;` | optional, inherited |  |
| `methods` | `methods?: {};` | optional, inherited | Reads that need more than the snapshot (facets, pager totals). Must not change state; names may not collide with command actions. |
| `notify` | `notify?: ((previous: SearchState, next: SearchState, ctx: ModuleContext<Row>) => NotificationScope);` | optional, inherited |  |
| `hiddenColumns` | `hiddenColumns?: ((state: SearchState) => readonly string[]);` | optional, inherited | Leaf columns this module hides from the visible column set (grouped columns with `showGroupedColumns: false`). |
| `interceptRead` | `interceptRead?: ((query: DataQuery, state: SearchState, ctx: ModuleContext<Row>) => boolean);` | optional, inherited | Remote sources only: return true to serve the main read of `query` yourself (lazy grouping loads group levels instead of rows). The engine then shows no source rows and runs only the stages the source did not perform. |
| `onQueryChange` | `onQueryChange?: ((previous: DataQuery, next: DataQuery, ctx: ModuleContext<Row>) => void);` | optional, inherited | Called after the effective query changed (sort, filter, search, page, group). Runs inside the dispatch of the command that changed it; may dispatch commands through `ctx` (selection clears itself here when it does not persist). |
| `onConnect` | `onConnect?: ((ctx: ModuleContext<Row>) => void);` | optional, inherited | `engine.connect()` ran (`deferDataSource`): start loads that were held while disconnected. |
| `onSourceEvent` | `onSourceEvent?: ((event: DataSourceEvent<Row>, state: SearchState, ctx: ModuleContext<Row>) => boolean);` | optional, inherited | A data source event (patch or reset). Return true to consume it: the engine then leaves its source rows unchanged (infinite scroll applies write echoes to the blocks it owns). |
| `dispose` | `dispose?: (() => void);` | optional, inherited |  |

### SearchOperator

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/SearchOperator

```ts
type SearchOperator = 'contains' | 'startsWith' | 'endsWith' | 'equal' | 'notEqual' | 'wildcard' | 'like';
```

`wildcard`: `*` any sequence, `?` one character; `like`: `%` (or `*`) any sequence. Both match the whole value.

### SearchSetCommand

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/SearchSetCommand

```ts
type SearchSetCommand = {
    type: 'search.set';
    text: string;
    columnIds?: ColumnId[] | 'all';
    operator?: SearchOperator;
    ignoreCase?: boolean;
    ignoreAccent?: boolean;
};
```

`search(text)`; omitted settings keep their current values.

Members (6):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `type` | `type: 'search.set';` |  |  |
| `text` | `text: string;` |  |  |
| `columnIds` | `columnIds?: ColumnId[] \| 'all';` | optional |  |
| `operator` | `operator?: SearchOperator;` | optional |  |
| `ignoreCase` | `ignoreCase?: boolean;` | optional |  |
| `ignoreAccent` | `ignoreAccent?: boolean;` | optional |  |

### SelectionClearCommand

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/SelectionClearCommand

```ts
type SelectionClearCommand = {
    type: 'selection.clear';
    rows?: boolean;
    cells?: boolean;
    columns?: boolean;
};
```

Members (4):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `type` | `type: 'selection.clear';` |  |  |
| `rows` | `rows?: boolean;` | optional |  |
| `cells` | `cells?: boolean;` | optional |  |
| `columns` | `columns?: boolean;` | optional |  |

### SelectionCommand

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/SelectionCommand

```ts
type SelectionCommand = SelectionSelectRowsCommand | SelectionToggleRowCommand | SelectionSelectRangeCommand | SelectionSelectAllVisibleCommand | SelectionSelectAllFilteredCommand | SelectionToggleAllCommand | SelectionClearCommand | SelectionSetCellRangeCommand | SelectionSelectCellsCommand | SelectionExtendCellSelectionCommand | SelectionSelectColumnsCommand | SelectionRestoreCommand | SelectionSetOptionsCommand;
```

### SelectionExtendCellSelectionCommand

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/SelectionExtendCellSelectionCommand

```ts
type SelectionExtendCellSelectionCommand = {
    type: 'selection.extendCellSelection';
    focus: CellKey;
};
```

Moves the focus end of the last range (Shift+click, Shift+Arrow in cell mode).

Members (2):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `type` | `type: 'selection.extendCellSelection';` |  |  |
| `focus` | `focus: CellKey;` |  |  |

### SelectionMethods

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/SelectionMethods

```ts
type SelectionMethods<Row> = {
    isRowSelected(ctx: ModuleContext<Row>, rowId: RowId): boolean;
    isCellSelected(ctx: ModuleContext<Row>, rowId: RowId, columnId: ColumnId): boolean;
    isColumnSelected(ctx: ModuleContext<Row>, columnId: ColumnId): boolean;
    getSelectedRowIds(ctx: ModuleContext<Row>): readonly RowId[];
    getSummary(ctx: ModuleContext<Row>): SelectionSummary;
    serialize(ctx: ModuleContext<Row>): SerializedSelection;
    preview(ctx: ModuleContext<Row>, command: SelectionCommand): SelectionPreview | null;
};
```

Members (7):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `isRowSelected` | `isRowSelected(ctx: ModuleContext<Row>, rowId: RowId): boolean;` |  |  |
| `isCellSelected` | `isCellSelected(ctx: ModuleContext<Row>, rowId: RowId, columnId: ColumnId): boolean;` |  |  |
| `isColumnSelected` | `isColumnSelected(ctx: ModuleContext<Row>, columnId: ColumnId): boolean;` |  |  |
| `getSelectedRowIds` | `getSelectedRowIds(ctx: ModuleContext<Row>): readonly RowId[];` |  | Selected row ids in selection order (`allFiltered`: in view order). O(selected). |
| `getSummary` | `getSummary(ctx: ModuleContext<Row>): SelectionSummary;` |  |  |
| `serialize` | `serialize(ctx: ModuleContext<Row>): SerializedSelection;` |  |  |
| `preview` | `preview(ctx: ModuleContext<Row>, command: SelectionCommand): SelectionPreview \| null;` |  | Selection outcome of a command without applying it; null when nothing (rows, cells, columns) would change or the command is rejected. |

### SelectionMode

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/SelectionMode

```ts
type SelectionMode = 'row' | 'cell' | 'both';
```

### SelectionModule

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/SelectionModule

```ts
type SelectionModule<Row> = DataGridModule<Row, SelectionState, SelectionCommand, 'selection', SelectionMethods<Row>>;
```

Members (18):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `name` | `name: "selection";` | inherited |  |
| `dependencies` | `dependencies?: readonly string[];` | optional, inherited | Validated at engine creation. |
| `inSnapshot` | `inSnapshot?: boolean;` | optional, inherited | When true (default) the slice lives in `snapshot.modules[name]` and every change replaces the grid snapshot. High-churn modules (focus, selection, drafts) set false and notify through row/cell/header/module channels only. |
| `commands` | `commands: readonly ("selection.clear" \| "selection.extendCellSelection" \| "selection.restore" \| "selection.selectAllFiltered" \| "selection.selectAllVisible" \| "selection.selectCells" \| "selection.selectColumns" \| ... 5 more ... \| "selection.toggleRow")[];` | inherited | Declared, validated, serializable. Every type must start with `${name}.`. |
| `initialState` | `initialState: (options: DataGridOptions<Row>) => SelectionState;` | inherited |  |
| `reduce` | `reduce?: ((state: SelectionState, command: SelectionCommand, ctx: ModuleContext<Row>) => CommandRejection \| SelectionState);` | optional, inherited |  |
| `extendColumns` | `extendColumns?: ((columns: readonly CompiledColumn<Row>[], ctx: ModuleContext<Row>) => readonly CompiledColumn<Row>[]);` | optional, inherited |  |
| `extendQuery` | `extendQuery?: ((query: DataQuery, state: SelectionState) => DataQuery);` | optional, inherited |  |
| `pipeline` | `pipeline?: readonly PipelineStage<Row, SelectionState>[];` | optional, inherited |  |
| `selectors` | `selectors?: Readonly<Record<string, (snapshot: DataGridSnapshot<Row>) => unknown>>;` | optional, inherited |  |
| `methods` | `methods?: SelectionMethods<Row>;` | optional, inherited | Reads that need more than the snapshot (facets, pager totals). Must not change state; names may not collide with command actions. |
| `notify` | `notify?: ((previous: SelectionState, next: SelectionState, ctx: ModuleContext<Row>) => NotificationScope);` | optional, inherited |  |
| `hiddenColumns` | `hiddenColumns?: ((state: SelectionState) => readonly string[]);` | optional, inherited | Leaf columns this module hides from the visible column set (grouped columns with `showGroupedColumns: false`). |
| `interceptRead` | `interceptRead?: ((query: DataQuery, state: SelectionState, ctx: ModuleContext<Row>) => boolean);` | optional, inherited | Remote sources only: return true to serve the main read of `query` yourself (lazy grouping loads group levels instead of rows). The engine then shows no source rows and runs only the stages the source did not perform. |
| `onQueryChange` | `onQueryChange?: ((previous: DataQuery, next: DataQuery, ctx: ModuleContext<Row>) => void);` | optional, inherited | Called after the effective query changed (sort, filter, search, page, group). Runs inside the dispatch of the command that changed it; may dispatch commands through `ctx` (selection clears itself here when it does not persist). |
| `onConnect` | `onConnect?: ((ctx: ModuleContext<Row>) => void);` | optional, inherited | `engine.connect()` ran (`deferDataSource`): start loads that were held while disconnected. |
| `onSourceEvent` | `onSourceEvent?: ((event: DataSourceEvent<Row>, state: SelectionState, ctx: ModuleContext<Row>) => boolean);` | optional, inherited | A data source event (patch or reset). Return true to consume it: the engine then leaves its source rows unchanged (infinite scroll applies write echoes to the blocks it owns). |
| `dispose` | `dispose?: (() => void);` | optional, inherited |  |

### SelectionRestoreCommand

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/SelectionRestoreCommand

```ts
type SelectionRestoreCommand = {
    type: 'selection.restore';
    selection: SerializedSelection;
};
```

Members (2):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `type` | `type: 'selection.restore';` |  |  |
| `selection` | `selection: SerializedSelection;` |  |  |

### SelectionSelectAllFilteredCommand

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/SelectionSelectAllFilteredCommand

```ts
type SelectionSelectAllFilteredCommand = {
    type: 'selection.selectAllFiltered';
};
```

Members (1):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `type` | `type: 'selection.selectAllFiltered';` |  |  |

### SelectionSelectAllVisibleCommand

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/SelectionSelectAllVisibleCommand

```ts
type SelectionSelectAllVisibleCommand = {
    type: 'selection.selectAllVisible';
};
```

Every row of the current view (current page). Without paging this is `selectAllFiltered`.

Members (1):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `type` | `type: 'selection.selectAllVisible';` |  |  |

### SelectionSelectCellsCommand

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/SelectionSelectCellsCommand

```ts
type SelectionSelectCellsCommand = {
    type: 'selection.selectCells';
    cells: CellKey[];
    mode?: 'replace' | 'add' | 'toggle';
};
```

Members (3):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `type` | `type: 'selection.selectCells';` |  |  |
| `cells` | `cells: CellKey[];` |  |  |
| `mode` | `mode?: 'replace' \| 'add' \| 'toggle';` | optional |  |

### SelectionSelectColumnsCommand

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/SelectionSelectColumnsCommand

```ts
type SelectionSelectColumnsCommand = {
    type: 'selection.selectColumns';
    columnIds: ColumnId[];
    mode?: 'replace' | 'add' | 'toggle';
};
```

Members (3):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `type` | `type: 'selection.selectColumns';` |  |  |
| `columnIds` | `columnIds: ColumnId[];` |  |  |
| `mode` | `mode?: 'replace' \| 'add' \| 'toggle';` | optional |  |

### SelectionSelectRangeCommand

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/SelectionSelectRangeCommand

```ts
type SelectionSelectRangeCommand = {
    type: 'selection.selectRange';
    toId: RowId;
    fromId?: RowId;
    mode?: 'replace' | 'add';
};
```

Rows between `fromId` (default: the anchor) and `toId` in visible order.

Members (4):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `type` | `type: 'selection.selectRange';` |  |  |
| `toId` | `toId: RowId;` |  |  |
| `fromId` | `fromId?: RowId;` | optional |  |
| `mode` | `mode?: 'replace' \| 'add';` | optional |  |

### SelectionSelectRowsCommand

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/SelectionSelectRowsCommand

```ts
type SelectionSelectRowsCommand = {
    type: 'selection.selectRows';
    rowIds: RowId[];
    mode?: RowMode;
};
```

Members (3):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `type` | `type: 'selection.selectRows';` |  |  |
| `rowIds` | `rowIds: RowId[];` |  |  |
| `mode` | `mode?: RowMode;` | optional |  |

### SelectionSetCellRangeCommand

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/SelectionSetCellRangeCommand

```ts
type SelectionSetCellRangeCommand = {
    type: 'selection.setCellRange';
    anchor: CellKey;
    focus: CellKey;
    mode?: 'replace' | 'add';
};
```

Members (4):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `type` | `type: 'selection.setCellRange';` |  |  |
| `anchor` | `anchor: CellKey;` |  |  |
| `focus` | `focus: CellKey;` |  |  |
| `mode` | `mode?: 'replace' \| 'add';` | optional |  |

### SelectionSetOptionsCommand

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/SelectionSetOptionsCommand

```ts
type SelectionSetOptionsCommand = {
    type: 'selection.setOptions';
    options: Omit<SelectionOptions, 'defaultSelectedRowIds'>;
};
```

Members (2):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `type` | `type: 'selection.setOptions';` |  |  |
| `options` | `options: Omit<SelectionOptions, 'defaultSelectedRowIds'>;` |  |  |

### SelectionToggleAllCommand

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/SelectionToggleAllCommand

```ts
type SelectionToggleAllCommand = {
    type: 'selection.toggleAll';
};
```

Header checkbox: all → none, otherwise all filtered.

Members (1):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `type` | `type: 'selection.toggleAll';` |  |  |

### SelectionToggleRowCommand

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/SelectionToggleRowCommand

```ts
type SelectionToggleRowCommand = {
    type: 'selection.toggleRow';
    rowId: RowId;
};
```

Members (2):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `type` | `type: 'selection.toggleRow';` |  |  |
| `rowId` | `rowId: RowId;` |  |  |

### SelectionType

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/SelectionType

```ts
type SelectionType = 'single' | 'multiple';
```

### SerializedSelection

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/SerializedSelection

```ts
type SerializedSelection = {
    readonly scope: 'explicit' | 'allFiltered';
    readonly rowIds: readonly RowId[];
    readonly excludedRowIds: readonly RowId[];
    readonly anchorRowId: RowId | null;
    readonly cellRanges: readonly CellRange[];
    readonly columnIds: readonly ColumnId[];
};
```

JSON form (getState/restore, persistence, server-side select-all).

Members (6):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `scope` | `readonly scope: 'explicit' \| 'allFiltered';` |  |  |
| `rowIds` | `readonly rowIds: readonly RowId[];` |  | `explicit`: selected ids. |
| `excludedRowIds` | `readonly excludedRowIds: readonly RowId[];` |  | `allFiltered`: excluded ids. |
| `anchorRowId` | `readonly anchorRowId: RowId \| null;` |  |  |
| `cellRanges` | `readonly cellRanges: readonly CellRange[];` |  |  |
| `columnIds` | `readonly columnIds: readonly ColumnId[];` |  |  |

### SortClearCommand

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/SortClearCommand

```ts
type SortClearCommand = {
    type: 'sort.clear';
};
```

Members (1):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `type` | `type: 'sort.clear';` |  |  |

### SortColumnCommand

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/SortColumnCommand

```ts
type SortColumnCommand = {
    type: 'sort.column';
    columnId: ColumnId;
    direction: 'asc' | 'desc';
    multi?: boolean;
};
```

Sorts one column; `multi` keeps the other sorted columns.

Members (4):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `type` | `type: 'sort.column';` |  |  |
| `columnId` | `columnId: ColumnId;` |  |  |
| `direction` | `direction: 'asc' \| 'desc';` |  |  |
| `multi` | `multi?: boolean;` | optional |  |

### SortCommand

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/SortCommand

```ts
type SortCommand = SortSetCommand | SortToggleCommand | SortColumnCommand | SortRemoveCommand | SortClearCommand | SortSetOptionsCommand;
```

### SortDescriptorInput

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/SortDescriptorInput

```ts
type SortDescriptorInput = {
    columnId: ColumnId;
    direction: 'asc' | 'desc';
};
```

JSON form of a `SortDescriptor` in command payloads.

Members (2):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `columnId` | `columnId: ColumnId;` |  |  |
| `direction` | `direction: 'asc' \| 'desc';` |  |  |

### SortMode

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/SortMode

```ts
type SortMode = 'single' | 'multiple';
```

### SortModule

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/SortModule

```ts
type SortModule<Row> = DataGridModule<Row, SortState, SortCommand, 'sort', {}>;
```

Members (18):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `name` | `name: "sort";` | inherited |  |
| `dependencies` | `dependencies?: readonly string[];` | optional, inherited | Validated at engine creation. |
| `inSnapshot` | `inSnapshot?: boolean;` | optional, inherited | When true (default) the slice lives in `snapshot.modules[name]` and every change replaces the grid snapshot. High-churn modules (focus, selection, drafts) set false and notify through row/cell/header/module channels only. |
| `commands` | `commands: readonly ("sort.clear" \| "sort.column" \| "sort.remove" \| "sort.set" \| "sort.setOptions" \| "sort.toggle")[];` | inherited | Declared, validated, serializable. Every type must start with `${name}.`. |
| `initialState` | `initialState: (options: DataGridOptions<Row>) => SortState;` | inherited |  |
| `reduce` | `reduce?: ((state: SortState, command: SortCommand, ctx: ModuleContext<Row>) => CommandRejection \| SortState);` | optional, inherited |  |
| `extendColumns` | `extendColumns?: ((columns: readonly CompiledColumn<Row>[], ctx: ModuleContext<Row>) => readonly CompiledColumn<Row>[]);` | optional, inherited |  |
| `extendQuery` | `extendQuery?: ((query: DataQuery, state: SortState) => DataQuery);` | optional, inherited |  |
| `pipeline` | `pipeline?: readonly PipelineStage<Row, SortState>[];` | optional, inherited |  |
| `selectors` | `selectors?: Readonly<Record<string, (snapshot: DataGridSnapshot<Row>) => unknown>>;` | optional, inherited |  |
| `methods` | `methods?: {};` | optional, inherited | Reads that need more than the snapshot (facets, pager totals). Must not change state; names may not collide with command actions. |
| `notify` | `notify?: ((previous: SortState, next: SortState, ctx: ModuleContext<Row>) => NotificationScope);` | optional, inherited |  |
| `hiddenColumns` | `hiddenColumns?: ((state: SortState) => readonly string[]);` | optional, inherited | Leaf columns this module hides from the visible column set (grouped columns with `showGroupedColumns: false`). |
| `interceptRead` | `interceptRead?: ((query: DataQuery, state: SortState, ctx: ModuleContext<Row>) => boolean);` | optional, inherited | Remote sources only: return true to serve the main read of `query` yourself (lazy grouping loads group levels instead of rows). The engine then shows no source rows and runs only the stages the source did not perform. |
| `onQueryChange` | `onQueryChange?: ((previous: DataQuery, next: DataQuery, ctx: ModuleContext<Row>) => void);` | optional, inherited | Called after the effective query changed (sort, filter, search, page, group). Runs inside the dispatch of the command that changed it; may dispatch commands through `ctx` (selection clears itself here when it does not persist). |
| `onConnect` | `onConnect?: ((ctx: ModuleContext<Row>) => void);` | optional, inherited | `engine.connect()` ran (`deferDataSource`): start loads that were held while disconnected. |
| `onSourceEvent` | `onSourceEvent?: ((event: DataSourceEvent<Row>, state: SortState, ctx: ModuleContext<Row>) => boolean);` | optional, inherited | A data source event (patch or reset). Return true to consume it: the engine then leaves its source rows unchanged (infinite scroll applies write echoes to the blocks it owns). |
| `dispose` | `dispose?: (() => void);` | optional, inherited |  |

### SortRemoveCommand

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/SortRemoveCommand

```ts
type SortRemoveCommand = {
    type: 'sort.remove';
    columnId: ColumnId;
};
```

Members (2):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `type` | `type: 'sort.remove';` |  |  |
| `columnId` | `columnId: ColumnId;` |  |  |

### SortSetCommand

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/SortSetCommand

```ts
type SortSetCommand = {
    type: 'sort.set';
    sorting: SortDescriptorInput[];
};
```

Members (2):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `type` | `type: 'sort.set';` |  |  |
| `sorting` | `sorting: SortDescriptorInput[];` |  |  |

### SortSetOptionsCommand

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/SortSetOptionsCommand

```ts
type SortSetOptionsCommand = {
    type: 'sort.setOptions';
    enabled?: boolean;
    mode?: SortMode;
    allowUnsort?: boolean;
};
```

Changes `enabled` / `mode` / `allowUnsort` at runtime (reactive settings props).

Members (4):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `type` | `type: 'sort.setOptions';` |  |  |
| `enabled` | `enabled?: boolean;` | optional |  |
| `mode` | `mode?: SortMode;` | optional |  |
| `allowUnsort` | `allowUnsort?: boolean;` | optional |  |

### SortToggleCommand

Kind: type

Page: https://salmonui.dev/docs/reference/data-grid/engine/SortToggleCommand

```ts
type SortToggleCommand = {
    type: 'sort.toggle';
    columnId: ColumnId;
    multi?: boolean;
};
```

Header click: none -> asc -> desc -> none (or asc when `allowUnsort` is false). `multi` is Ctrl/Meta+click.

Members (3):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `type` | `type: 'sort.toggle';` |  |  |
| `columnId` | `columnId: ColumnId;` |  |  |
| `multi` | `multi?: boolean;` | optional |  |

## Constants

### AGGREGATE_TYPES

Kind: const

Page: https://salmonui.dev/docs/reference/data-grid/engine/AGGREGATE_TYPES

```ts
const AGGREGATE_TYPES: readonly AggregateType[];
```

### BLANK_FACET_KEY

Kind: const

Page: https://salmonui.dev/docs/reference/data-grid/engine/BLANK_FACET_KEY

```ts
const BLANK_FACET_KEY = "__salmon_ui_blank__";
```

Stable key shared by null, undefined, and empty-string values in facets.

### DEFAULT_DEV

Kind: const

Page: https://salmonui.dev/docs/reference/data-grid/engine/DEFAULT_DEV

```ts
const DEFAULT_DEV: boolean;
```

Development default derived from `process.env.NODE_ENV`.

### DEFAULT_KEY_BINDINGS

Kind: const

Page: https://salmonui.dev/docs/reference/data-grid/engine/DEFAULT_KEY_BINDINGS

```ts
const DEFAULT_KEY_BINDINGS: readonly KeyBinding[];
```

The complete default binding table: every core keyboard row (with the
macOS variant where it differs) plus the Salmon UI additions.

### DEFAULT_MAX_SCROLL_HEIGHT

Kind: const

Page: https://salmonui.dev/docs/reference/data-grid/engine/DEFAULT_MAX_SCROLL_HEIGHT

```ts
const DEFAULT_MAX_SCROLL_HEIGHT = 15000000;
```

Default physical cap, below every browser's element height limit.

### EMPTY_GRID_QUERY

Kind: const

Page: https://salmonui.dev/docs/reference/data-grid/engine/EMPTY_GRID_QUERY

```ts
const EMPTY_GRID_QUERY: DataQuery;
```

The empty query: no search, filters, sorting, grouping, aggregates, or paging.

### EMPTY_RANGE

Kind: const

Page: https://salmonui.dev/docs/reference/data-grid/engine/EMPTY_RANGE

```ts
const EMPTY_RANGE: VirtualRange;
```

### GROUP_FOOTER_ID_PREFIX

Kind: const

Page: https://salmonui.dev/docs/reference/data-grid/engine/GROUP_FOOTER_ID_PREFIX

```ts
const GROUP_FOOTER_ID_PREFIX = "__gf:";
```

### GROUP_ID_PREFIX

Kind: const

Page: https://salmonui.dev/docs/reference/data-grid/engine/GROUP_ID_PREFIX

```ts
const GROUP_ID_PREFIX = "__g:";
```

### PIPELINE_STAGE_RANKS

Kind: const

Page: https://salmonui.dev/docs/reference/data-grid/engine/PIPELINE_STAGE_RANKS

```ts
const PIPELINE_STAGE_RANKS: Readonly<Record<PipelineStageName, number>>;
```

Fixed stage ranks of the query pipeline. The viewport range is not a row-model stage; it is computed from
the final model.

### TYPE_INFERENCE_SAMPLE

Kind: const

Page: https://salmonui.dev/docs/reference/data-grid/engine/TYPE_INFERENCE_SAMPLE

```ts
const TYPE_INFERENCE_SAMPLE = 100;
```

Rows scanned for the first non-null value when `type` is omitted.
