import * as react_jsx_runtime from 'react/jsx-runtime';
import { FC } from 'react';
import { ColumnDef, Row, PaginationState, SortingState } from '@tanstack/react-table';
import { OnChangeFn } from '@tanstack/table-core/src/types';
import { RowSelectionState } from '@tanstack/table-core/src/features/RowSelection';

type DataTableProps<T> = {
    columns: ColumnDef<T>[];
    data: T[];
    size?: 'sm' | 'md';
    showColumnSelector?: boolean;
    enableColumnFilters?: boolean;
    enableColumnResizing?: boolean;
    expandRowByClick?: boolean;
    rowSelection?: RowSelectionState;
    onRowSelectionChange?: OnChangeFn<RowSelectionState>;
    defaultPageSize?: 5 | 10 | 20 | 30 | 40 | 50 | 100;
    selectable?: boolean;
    emptyText?: string;
    rowClassName?: (row: Row<T>) => string;
} & ({
    onRow?: (row: Row<T>) => void;
    subComponent?: never;
    getRowCanExpand?: never;
} | {
    onRow?: never;
    subComponent?: FC<{
        row: Row<T>;
    }>;
    getRowCanExpand?: (row: Row<T>) => boolean;
}) & ({
    pagination?: false;
    onPaginationChange?: never;
} | {
    pagination: true | PaginationState;
    onPaginationChange?: OnChangeFn<PaginationState>;
}) & ({
    sorting?: false;
    onSortingChange?: never;
} | {
    sorting: true | SortingState;
    onSortingChange?: OnChangeFn<SortingState>;
});
declare function DataTable<T>({ columns, data, size, showColumnSelector, enableColumnFilters, enableColumnResizing, subComponent: SubComponent, expandRowByClick, selectable, rowSelection, onRowSelectionChange, defaultPageSize, sorting, onSortingChange, pagination, onPaginationChange, emptyText, onRow, rowClassName, getRowCanExpand, }: DataTableProps<T>): react_jsx_runtime.JSX.Element;

export { DataTableProps, DataTable as default };
