import React, { ReactElement } from "react"; import { SortDirection } from "./utils"; export declare type ColumnContentRenderer = React.ComponentType<{ row: T; colKey: keyof T; rowIndex: number; }>; export interface IColumnDescriptor { key: keyof T; header: string | ReactElement | null; isSortable?: boolean; content?: ColumnContentRenderer; } declare class DataTable extends React.PureComponent<{ /** Title of the table */ title?: React.ReactNode; /** How your columns will be rendered. See examples for details. */ columns: Array>; /** The currently sorted column key. */ sortKey?: keyof T; /** The currently sort direction. */ sortDirection?: SortDirection; /** Rows to display. All provided rows will be shown. */ rows: T[]; /** Callback to handle when sort is clicked on some header. */ onSort?: (arg: { colKey: keyof T; sortDirection: SortDirection; }) => void; /** CSS classname */ className?: string; /** How individual rows are identified. It must return something unique for that row. */ getRowIdentifier?: (row: T, rowIndex: number) => string; /** Gives you a chance to add props to each individual row. Eg, click handler. */ getAdditionalRowProps?: (row: T, rowIndex: number) => JSX.IntrinsicElements["tr"]; /** Show alternating colors on rows. Does not effect header. */ zebra?: boolean; /** How to render the toolbar */ renderToolbar?: React.ReactNode; /**Optional props for select functionality */ getSelectAllProps?: () => { ariaLabel: string; checked: boolean; id: string; indeterminate?: boolean; name: string; onSelect: () => void; disabled?: boolean; className?: string; }; /**Optional props for select functionality */ getSelectRowProps?: (row: any) => { ariaLabel: string; checked: boolean; id: string; name: string; onSelect: () => void; disabled?: boolean; radio?: boolean; className?: string; }; }> { onHeaderClick: (colKey: keyof T) => void; render(): JSX.Element; } export default DataTable;