import type { LucideIcon } from 'lucide-react'; import type { ComponentProps, FC, ReactNode } from 'react'; import type { HintBadgeProps, HintDotProps } from '../Hint'; import type { PaginationProps } from '../Pagination'; import type { Color, Paths, ResolvePath } from '../types'; export type DataTableColumn = Paths> = { className?: string; header: ReactNode; field: Field; noSorting?: boolean; hide?: boolean; align?: ComponentProps<'td'>['align']; render?: (item: T, rowIndex: number) => ReactNode; comparator?: (a: ResolvePath, b: ResolvePath) => number; }; export type DataTableColumns = Partial<{ [Field in Paths]: DataTableColumn; }>; export type DataTableSorting = Paths> = { field: Field; direction: 'asc' | 'desc'; comparator: (a: ResolvePath, b: ResolvePath) => number; }; export type DataTableRowExtraContent = { idGetter: (item: T) => number; singleExpansion?: boolean; component: FC<{ item: T; rowIndex: number; }>; }; declare const possiblePageSize: readonly [5, 10, 25, 50, 100, 500, 1000]; export type DataTablePageSize = (typeof possiblePageSize)[number]; export type DataTableAction = { icon: LucideIcon; label?: string; hasNotification?: (item: T, rowIndex: number) => { type: 'badge'; props: HintBadgeProps; } | { type: 'dot'; props: HintDotProps; } | boolean; color?: Color; hide?: boolean | ((item: T) => boolean); loading?: boolean; onClick: (item: T, rowIndex: number) => void; }; export type DataTableProps = { className?: string; rows: T[]; columns: DataTableColumn[] | DataTableColumns; sorting?: { sorting: DataTableSorting | undefined; onSortingChange: (sorting: DataTableSorting) => void; }; pagination?: PaginationProps & { pageSize?: DataTablePageSize; onPageSizeChange?: (pageSize: DataTablePageSize) => void; }; actions?: DataTableAction[]; isLoading?: boolean; rowExtraContent?: DataTableRowExtraContent; noDataMessage?: ReactNode; onRowClick?: DataTableAction['onClick']; rowClassName?: (item: T, rowIndex: number) => string | undefined; dataTestId?: string; }; export declare function DataTable({ className, columns, rows, sorting, pagination, actions, isLoading, rowExtraContent, noDataMessage, onRowClick, rowClassName, dataTestId, }: DataTableProps): import("react/jsx-runtime").JSX.Element; export {};