import { ColumnSort, Row } from '@tanstack/react-table'; import { ReactElement } from 'react'; import { TableCaptionSize } from './table-caption'; import { type TableColumn } from './types'; type RowSize = 'small' | 'medium' | 'large'; export type RowSelectionMode = 'single' | 'multiple'; export type TableRowId = string; type RowIdField = { [K in keyof T]: T[K] extends TableRowId ? K : never; }[keyof T]; export interface TableProps { ariaLabelledBy?: string; ariaDescribedBy?: string; ariaLabelledByColumnId?: string; data: T[]; defaultSort?: ColumnSort; caption?: string; captionSize?: TableCaptionSize; columns: TableColumn[]; expandableRows?: 'single' | 'multiple'; expandChildrenOnRowSelection?: boolean; hideSelectAll?: boolean; /** * Field name that will be used to generate the unique ID of each row */ rowIdField: RowIdField; /** * Adds row numbers * @default false */ rowNumbers?: boolean; /** * Sets table rows type * @default medium */ rowSize?: RowSize; rowSelectionMode?: RowSelectionMode; selectedRowIds?: TableRowId[]; /** * Adds striped rows * @default false */ striped?: boolean; className?: string; stickyHeader?: boolean; stickyFooter?: boolean; manualSort?: boolean; onRowClick?(row: Row): void; onSelectedRowIdsChange?(selectedRowIds: TableRowId[]): void; onSort?(sort: ColumnSort | null): void; } type TableComponent = (props: TableProps) => ReactElement; export declare const Table: TableComponent & { displayName?: string | undefined; }; export {};