Skip to content

Types

CellState, CellPosition, GridRow, and related TypeScript types.

Types under grid/types/. Domain-free: safe to copy with the registry item.

type CellStatus = "valid" | "invalid" | "empty"

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
}

Address by row id and column id: not display index: so focus/selection survive filter/sort/reorder.

interface CellPosition {
rowId: string
columnId: string
}

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
}

Inclusive selection rectangle in display space (post filter/sort indices).

interface SelectionBounds {
minRow: number
maxRow: number
minColIndex: number
maxColIndex: number
}
interface GridRow {
id: string
[columnId: string]: CellState<string> | string
}
Helper Role
emptyCell<T>() Blank cell with status: "empty"
isCellInBounds Inclusive membership in selection bounds
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.