API reference: @salmonui/data-grid/engine
ModuleContextinterface
import type { ModuleContext } from '@salmonui/data-grid/engine';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;
}
| Name | Signature | 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>; | |
isConnectedoptional | isConnected?(): boolean; | False until |
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 |
reject | reject(reason: string, state?: unknown): CommandRejection; | Rejects the command; |
warn | warn(code: string, message: string): void; |