export interface ColumnDef { fieldName: string; width: number; } export interface CustomDrawCallbackMetadata { column: ColumnDef; colIndex: number; rowIndex: number; } declare type CustomDrawCallback = (context: CanvasRenderingContext2D, cellBounds: ClientRect, cell: CellDef, metadata: CustomDrawCallbackMetadata) => void; interface CellDefCommon { data: T; renderBackground?: CustomDrawCallback; renderText?: CustomDrawCallback; } interface WithTextFunction { getText: (data: T) => string; } interface WithTextString { text: string; } declare type TextAccessible = WithTextFunction | WithTextString; interface WithTitleFunction { getTitle: (data: T) => string; } interface WithTitleString { title: string; } declare type TitleAccessible = WithTitleFunction | WithTitleString | {}; interface WithSerialisers { editor: { serialise: (data: T) => string; deserialise: (value: string, oldData: T) => T; }; } declare type Serialisable = WithSerialisers | {}; export declare type CellDef = CellDefCommon & TextAccessible & TitleAccessible & Serialisable; export declare type EditableCellDef = CellDef & WithSerialisers; export declare const cellHasTextFunction: (cell: CellDef) => cell is (CellDefCommon & WithTextFunction) | (CellDefCommon & WithTextFunction & WithSerialisers) | (CellDefCommon & WithTextFunction & WithTitleString) | (CellDefCommon & WithTextFunction & WithTitleString & WithSerialisers) | (CellDefCommon & WithTextFunction & WithTitleFunction) | (CellDefCommon & WithTextFunction & WithTitleFunction & WithSerialisers) | (CellDefCommon & WithTextString & WithTextFunction) | (CellDefCommon & WithTextString & WithSerialisers & WithTextFunction) | (CellDefCommon & WithTextString & WithTitleString & WithTextFunction) | (CellDefCommon & WithTextString & WithTitleString & WithSerialisers & WithTextFunction) | (CellDefCommon & WithTextString & WithTitleFunction & WithTextFunction) | (CellDefCommon & WithTextString & WithTitleFunction & WithSerialisers & WithTextFunction); export declare const getCellText: (cell: CellDef) => string; export declare const getTitleText: (cell: CellDef) => string | null; export declare const cellIsEditable: (cell: CellDef) => cell is EditableCellDef; export interface DataRow { [fieldName: string]: CellDef; } export interface Coord { x: number; y: number; } export interface Size { width: number; height: number; } export interface Bounds { top: number; left: number; right: number; bottom: number; } export {};