Types
CellState, CellPosition, GridRow, and related TypeScript types.
Types under grid/types/. Domain-free: safe to copy with the registry item.
CellStatus
Section titled “CellStatus”type CellStatus = "valid" | "invalid" | "empty"CellState
Section titled “CellState”Each editable cell keeps raw, resolved value, and status separate so a pasted-but-unmatched value stays visible (and correctable).
interface CellState<T> { raw: string value: T | null status: CellStatus /** Tooltip when invalid. */ error?: string}CellPosition
Section titled “CellPosition”Address by row id and column id: not display index: so focus/selection survive filter/sort/reorder.
interface CellPosition { rowId: string columnId: string}CopiedRange
Section titled “CopiedRange”Marching-ants copy outline, captured by identity (Set membership + edge ids).
interface CopiedRange { rowIds: Set<string> firstRowId: string lastRowId: string columnIds: Set<string> firstColumnId: string lastColumnId: string}SelectionBounds
Section titled “SelectionBounds”Inclusive selection rectangle in display space (post filter/sort indices).
interface SelectionBounds { minRow: number maxRow: number minColIndex: number maxColIndex: number}GridRow
Section titled “GridRow”interface GridRow { id: string [columnId: string]: CellState<string> | string}Helpers
Section titled “Helpers”| Helper | Role |
|---|---|
emptyCell<T>() |
Blank cell with status: "empty" |
isCellInBounds |
Inclusive membership in selection bounds |
Related types elsewhere
Section titled “Related types elsewhere”| Location | Types |
|---|---|
use-data-grid.ts |
UseDataGrid, UseDataGridConfig, GridCommit |
use-grid-columns.ts |
GridColumnSpec, GridColumnsApi |
use-grid-changes.ts |
GridChangeSet, GridChanges, GridReconcileResult |
data-grid-columns-context.tsx |
GridColumnTypeOption |
cell-props.ts |
CellEditorProps, GridComboboxOption |
See also Niko Table Types for table-level defs.