/** @jsx jsx */ import { ReactNode, ReactElement } from 'react'; import { BoxProps } from 'theme-ui'; import { Column, Cell, Row, UseExpandedRowProps, SortingRule } from 'react-table'; import { TablePaginationProps } from './TablePagination'; export { Column, Cell, Row, UseExpandedRowProps }; export declare type SelectedRowIds = Record; interface TableOwnProps { /** * the columns object as an array. */ columns: Column[]; /** * array of data rows. */ data?: D[]; /** * show or hide the header element. */ header?: boolean; /** * enable.disable sorting. */ sorting?: boolean; /** * enable/disable filtering. */ filtering?: boolean; /** * string label for 'items' - used in the filter placeholder and grouping header. */ itemsLabel?: string | null; /** * field to be grouped by. */ groupBy?: string[]; /** * list of columns to hide. */ hiddenColumns?: string[]; /** * if true, will enable row selection */ rowSelect?: boolean; /** * initially selected rows */ initialSelected?: SelectedRowIds; /** * callback when selected rows change */ onSelectRowsChange?: (selected: SelectedRowIds) => void; /** * object listing the initially expanded rows. */ expanded?: { [key: string]: boolean; }; /** * reset state update while update table data */ skipPageReset?: boolean; /** * callback to render a SubComponent row */ renderRowSubComponent?: (props: { row: Row; }) => ReactNode; /** * initial sorting */ sortBy?: Array>; /** * enable pagination */ pagination?: TablePaginationProps | boolean; } export declare type TableProps = TableOwnProps & BoxProps; /** * Table component using [react-table](https://github.com/tannerlinsley/react-table) to display the data. * Can be grouped, filtered, sorted. Themed with theme-ui for consistency. */ export declare function Table({ columns, data, header, sorting, filtering, itemsLabel, groupBy, expanded, hiddenColumns, skipPageReset, renderRowSubComponent, initialSelected, onSelectRowsChange, rowSelect, sortBy, pagination, ...rest }: TableProps): ReactElement | null;