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

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

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

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

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

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