import { MouseEvent, UIEvent, ReactNode, ReactElement } from 'react';
import { AccessorKeyColumnDef, Header, Cell, RowData, Row, RowSelectionState, SortingState, OnChangeFn, ColumnPinningState, ColumnSizingState, PaginationState, VisibilityState, ExpandedState, ColumnOrderState } from '@tanstack/react-table';
import { TableHeaderCellProps } from './components/table-header-cell';
import { TableBodyCellProps } from './components/table-body-cell';
import { TableHeaderProps } from './components/table-header';
import { TableBodyProps } from './components/table-body';
import { SkeletonProps } from '../skeleton';
import { DropdownMenuOption } from '../dropdown-menu';
import { ValueOf } from '../types';
import { ALIGNMENT, TableReactLocalizationPropType, TABLE_SIZE, TableState, TableSettings, Touched, SORTING } from './types';
import './table-react.less';
declare module '@tanstack/table-core' {
    interface ColumnMeta<TData extends RowData, TValue> {
        className?: string;
        hideSeparator?: boolean;
        hideMenu?: boolean;
        truncateText?: boolean;
        align?: ALIGNMENT;
        hideFromSettings?: boolean;
        loader?: SkeletonProps & {
            render?: () => ReactNode;
        };
        ariaHidden?: boolean;
        limitSorting?: ValueOf<SORTING>;
        additionalColumnActions?: DropdownMenuOption[];
        hasCustomCellAction?: boolean;
        headerAriaLabel?: string;
        cellAriaLabel?: string;
    }
    interface TableMeta<TData extends RowData> {
        [key: string]: unknown;
    }
}
export type TableReactPropsType<TData, TMeta> = {
    /** current able state object. Includes state related to sorting, columns visibility, selected/expanded rows, pinned columns, etc  */
    state?: TableState;
    /** Default state to be used during first render and if there is no previously stored config in local storage */
    defaultState?: TableState;
    /** Handlers for different state changes (e.g. RowClick, column size change, pinned columns change, etc) */
    handlers?: {
        onRowClick?: (e: MouseEvent<HTMLTableRowElement>, row: TData) => void;
        onCellClick?: (cell: Partial<Cell<TData, unknown>>, event: MouseEvent<unknown>) => void;
        onTouchedChange?: (data?: Touched) => void;
        onColumnSizingChange?: (data: ColumnSizingState) => void;
        onRowSelectionChange?: (data: RowSelectionState) => void;
        onVisibilityChange?: (data: VisibilityState) => void;
        onPaginationChange?: OnChangeFn<PaginationState>;
        onSortingChange?: OnChangeFn<SortingState>;
        onPinningChange?: (data: ColumnPinningState) => void;
        onScrollEnd?: () => void;
        onScroll?: (e: UIEvent<HTMLElement>) => void;
        onExpandedChange?: (data: ExpandedState) => void;
        onColumnHeaderClick?: (header: Partial<Header<TData, unknown>>, event: MouseEvent<unknown>) => void;
        onColumnOrderChange?: OnChangeFn<ColumnOrderState>;
    };
    /** columns config for tanstack/react-table. Look for AccessorKeyColumnDef in react-table docs */
    columns: AccessorKeyColumnDef<TData>[];
    /** Actual data to be rendered */
    data: TData[];
    /** Custom components for table */
    components?: {
        TableBodyComponent?: (props: TableBodyProps<TData>) => ReactElement;
        TableHeaderComponent?: (props: TableHeaderProps<TData>) => ReactElement;
        ThComponent?: (props: TableHeaderCellProps<TData>) => ReactElement;
        TdComponent?: (props: TableBodyCellProps<TData>) => ReactElement;
        getFilterBody?: () => ReactElement;
        getToolBarActions?: () => ReactElement;
        getToolbarRightActions?: () => ReactElement;
        getEmptyState?: () => ReactElement;
        ExpandedRowComponent?: ({ rowData }: {
            rowData: TData;
        }) => ReactElement;
    };
    /** Custom classes for table */
    classes?: {
        tableClassName?: string;
        trClassName?: string | ((row: Row<TData>) => string);
        thClassName?: string;
        tdClassName?: string;
        expandedContentClassName?: string;
    };
    settings?: TableSettings;
    /** test-id to be applied on table wrapper component */
    tableContainerTestId?: string;
    /** test-id to be applied to <table> tag */
    tableTestId?: string;
    /** test-id to be added to <tr> elements */
    tableRowTestId?: string | ((row: Row<TData>) => string);
    tableHeaderRowTestId?: string;
    /** test-id to be added to <th> elements */
    tableHeaderCellTestId?: string;
    /** test-id to be added to <td> elements */
    tableBodyCellTestId?: string;
    /** meta information to be added to react-table state as tableModel.options.meta. Look for table model in rect-table docs */
    tableMeta?: TMeta;
    /** total count of items. Used for pagination */
    totalCount?: number;
    /** limit for the total number. (If total is gte than total limit "<totalLimit>+" will be rendered in the label e.g. 1-100 of 3000+) */
    totalLimit?: number;
    /** true if total > totalLimit (either obtained from the endpoint or totalCount >= totalLimit), optional */
    isExceededTotalLimit?: boolean;
    /** determines if nextPage is available */
    nextPage?: boolean;
    /** Indicates whether data is loading */
    isLoading?: boolean;
    /** Message to be shown instad of table body in case an error occurred */
    errorMessage?: string | null;
    /** Number of skeleton rows to show during loading state */
    loadingRowCount?: number;
    /** (Optional) Default width of the parent container. Otherwise table will calculate it manually */
    width?: number;
    /** Row id getter. */
    getRowId: (originalRow: TData) => string;
    /** Function that returns a list of actions available for the specific row. Actions will be rendered as a dropdown options in action-cell column */
    getRowActions?: (row: Row<TData>) => DropdownMenuOption[];
    /** Function that returns the footer action available for the specific row. Footer action will be rendered as a last dropdown footer option in action-cell column */
    getRowFooterAction?: (row: Row<TData>) => DropdownMenuOption;
    /** Function to specify custom row content based on row data */
    getCustomRowContent?: (row: Row<TData>, tableContainerWidth: number, centerScrolled: boolean, scrollableRight: boolean) => ReactElement | undefined;
    /** Localization strings to be used in the table's UI */
    localizationProps?: TableReactLocalizationPropType;
    /** Function to determine whether click should be enabled on specific row. If string returned - it will be treated as disability reason and will be shown in the tooltip */
    isRowClickDisabled?: (row: TData) => boolean | string;
    /** Function to determine whether selection should be enabled on specific row. If string returned - it will be treated as disability reason and will be shown in the tooltip */
    isRowSelectionDisabled?: (row: TData) => boolean | string;
    /** Offset to be used with infinite scroll to start loading next chunk of data */
    bottomEndScrollOffset?: number;
    /** An array of page size options */
    pageSizeOptions?: number[];
    /** Flag to indicate whether a chunk of data is loading in case of infinite scroll */
    afterLoading?: boolean;
    /** Density of the table (small/medium/large) */
    size?: TABLE_SIZE;
};
/**
 * New configurable table that uses [@tanstack/react-table](https://tanstack.com/table) under the hood.
 * Also check the full page table demo [Here](/Controlled Table)
 * @midnight-gray-supported
 * @alpine-light-supported
 */
export default function TableReact<IData, IMeta>({ tableContainerTestId, width: defaultWidth, state, handlers, settings, components, classes, ...props }: TableReactPropsType<IData, IMeta>): import("react/jsx-runtime").JSX.Element;
