# DataGridApiEngine (@salmonui/data-grid)

> The DataGridApiEngine type of @salmonui/data-grid: api.engine: the engine plus the façades of optional modules registered by props.

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

```ts
import type { DataGridApiEngine } from '@salmonui/data-grid';
```

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

## Reference

Kind: type

```ts
type DataGridApiEngine<Row = unknown> = DataGridEngine<Row> & {
    readonly infiniteScroll?: DataGridInfiniteScrollFacade<Row>;
};
```

`api.engine`: the engine plus the façades of optional modules registered by props.

Members (36):

| 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 |  |
| `infiniteScroll` | `infiniteScroll?: DataGridInfiniteScrollFacade<Row>;` | optional, inherited | Present with the `infiniteScroll` prop. |
