import type React from 'react'; import { type VisibleIndex, type Coordinate } from './GridMetrics'; import type GridMetrics from './GridMetrics'; import type GridModel from './GridModel'; import type GridRange from './GridRange'; import { type GridTheme } from './GridTheme'; import { type DraggingColumn } from './mouse-handlers/GridColumnMoveMouseHandler'; import { type GridSeparator } from './mouse-handlers/GridSeparatorMouseHandler'; import type { CellInputFieldProps } from './CellInputField'; import type { ColumnRestriction } from './GridModel'; export declare const DEFAULT_FONT_WIDTH = 10; /** * Props passed to a cell input renderer, combining the base CellInputField * props with the restrictions that apply to the cell being edited. */ export type CellInputProps = CellInputFieldProps & { restrictions: readonly ColumnRestriction[]; }; /** * A renderer for a single cell input field based on column restriction type. * * Set `preservesExistingValue = true` on the function to signal that * keystroke-initiated edits should open the editor with the existing cell * value rather than replacing it with the typed character. */ export type CellInputRendererFn = ((props: CellInputProps) => React.ReactNode) & { /** * When true, keystroke-initiated edits preserve the existing cell value * instead of replacing it with the typed character. Intended for renderers * like dropdowns where the typed character has no meaning as a new value. */ preservesExistingValue?: boolean; }; /** * A map from column restriction type string to a cell input renderer function. * Grid looks up restrictions[0].type in this registry and falls back to * CellInputField when there is no match. */ export type CellInputRendererRegistry = ReadonlyMap; export type EditingCellTextSelectionRange = [start: number, end: number]; export type EditingCell = { column: VisibleIndex; row: VisibleIndex; selectionRange?: EditingCellTextSelectionRange; value: string; isQuickEdit?: boolean; }; export type GridRenderState = { width: number; height: number; context: CanvasRenderingContext2D; theme: GridTheme; model: GridModel; metrics: GridMetrics; mouseX: Coordinate | null; mouseY: Coordinate | null; cursorColumn: VisibleIndex | null; cursorRow: VisibleIndex | null; selectedRanges: readonly GridRange[]; draggingColumn: DraggingColumn | null; draggingColumnSeparator: GridSeparator | null; draggingRow: VisibleIndex | null; draggingRowOffset: number | null; draggingRowSeparator: GridSeparator | null; editingCell: EditingCell | null; isDraggingHorizontalScrollBar: boolean; isDraggingVerticalScrollBar: boolean; isDragging: boolean; }; //# sourceMappingURL=GridRendererTypes.d.ts.map