# FilterModule (@salmonui/data-grid/engine)

> The FilterModule type of @salmonui/data-grid/engine.

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

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

Also exported from `@salmonui/data-grid/engine/filter`.

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

## Reference

Kind: type

```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 |  |
