import './Table.css';
import React from 'react';
import { HorizontalAlign, VerticalAlign } from './Cell/TableCell';
import { Filters, onSortBy, SelectedFilters } from './filtering';
import { Header, OrderType, Position } from './helpers';
import { GetTagLabel } from './SelectedOptionsList/TableSelectedOptionsList';
export { TableTextFilter } from './TextFilter/TableTextFilter';
export { TableFilterContainer } from './FilterContainer/TableFilterContainer';
export { TableNumberFilter } from './NumberFilter/TableNumberFilter';
export { TableChoiceGroupFilter } from './ChoiceGroupFilter/TableChoiceGroupFilter';
export declare const sizes: readonly ["s", "m", "l"];
type Size = typeof sizes[number];
export declare const zebraStriped: readonly ["odd", "even"];
type ZebraStriped = typeof zebraStriped[number];
export declare const headerVerticalAligns: readonly ["center", "bottom"];
export type HeaderVerticalAlign = typeof headerVerticalAligns[number];
export type LazyLoad = {
    maxVisibleRows?: number;
    scrollableEl?: HTMLDivElement | Window;
} | undefined;
type ActiveRow = {
    id: string | undefined;
    onChange: ({ id, e, }: {
        id: string | undefined;
        e?: React.SyntheticEvent;
    }) => void;
};
type onRowHover = ({ id, e, }: {
    id: string | undefined;
    e: React.MouseEvent;
}) => void;
type onRowClick = ({ id, e }: {
    id: string;
    e: React.MouseEvent;
}) => void;
type onRowCreate = ({ id, index, e, }: {
    id?: string;
    index: number;
    e: React.MouseEvent;
}) => void;
export type CellClickType = 'click' | 'contextMenu';
export type onCellClick = ({ e, type, rowId, columnIdx, ref, }: {
    e: React.SyntheticEvent;
    type: CellClickType;
    columnIdx: number;
    ref: React.RefObject<HTMLDivElement>;
    rowId?: string;
}) => void;
export type TableRow = {
    id: string;
    defaultExpand?: boolean;
    rows?: TableRow[];
};
export type TableTreeRow<T extends TableRow> = {
    options: {
        level: number;
    };
} & T;
export type TableFilters<T extends TableRow> = Filters<T>;
export type RowField<T extends TableRow> = Exclude<keyof T, symbol | number>;
export type ColumnWidth = number | undefined;
export type ValueOf<T> = T[keyof T];
type ColumnBase<T extends TableRow> = ValueOf<{
    [K in keyof T]: {
        accessor: K extends string ? K : never;
        sortable?: boolean;
        colSpan?: number | ((row: T) => number);
        sortByField?: keyof T;
        order?: OrderType;
        sortFn?(a: T[K], b: T[K]): number;
        renderCell?: (row: T) => React.ReactNode;
        getComparisonValue?: (cell: T[K]) => number | string;
    };
}>;
type SingleColumnAddition<T extends TableRow> = ColumnBase<T> & {
    columns?: never;
};
type GroupColumnAddition<T extends TableRow> = {
    columns: TableColumn<T>[];
} & {
    [K in keyof ColumnBase<T>]?: never;
};
export interface TableControl<T extends TableRow> {
    column: Header<T> & ColumnMetaData;
}
export type SortByProps<T extends TableRow> = {
    sortingBy: keyof T;
    sortOrder: 'asc' | 'desc';
};
export type TableColumn<T extends TableRow> = {
    title: React.ReactNode;
    align?: HorizontalAlign;
    withoutPadding?: boolean;
    width?: ColumnWidth;
    mergeCells?: boolean;
    position?: Position;
    hidden?: boolean;
    control?: ({ column }: TableControl<T>) => React.ReactNode;
} & (GroupColumnAddition<T> | SingleColumnAddition<T>);
export type TableProps<T extends TableRow> = {
    columns: TableColumn<T>[];
    rows: T[];
    isResizable?: boolean;
    filters?: Filters<T>;
    onSortBy?: onSortBy<T>;
    size?: Size;
    stickyHeader?: boolean;
    stickyColumns?: number;
    minColumnWidth?: number;
    activeRow?: ActiveRow;
    verticalAlign?: VerticalAlign;
    headerVerticalAlign?: HeaderVerticalAlign;
    zebraStriped?: ZebraStriped;
    borderBetweenRows?: boolean;
    defaultExpandAll?: boolean;
    borderBetweenColumns?: boolean;
    emptyRowsPlaceholder?: React.ReactNode;
    className?: string;
    onRowHover?: onRowHover;
    onRowClick?: onRowClick;
    onRowCreate?: onRowCreate;
    onCellClick?: onCellClick;
    getAdditionalClassName?: (props: {
        column: TableColumn<T>;
        row: T;
        isActive: boolean;
    }) => string;
    rowCreateText?: string;
    lazyLoad?: LazyLoad;
    onFiltersUpdated?: (filters: SelectedFilters) => void;
    getTagLabel?: GetTagLabel;
    isExpandedRowsByDefault?: boolean;
    getCellWrap?: (row: T) => 'truncate' | 'break';
};
type Table = <T extends TableRow>(props: TableProps<T> & {
    ref?: React.Ref<HTMLDivElement>;
}) => React.ReactElement | null;
export type ColumnMetaData = {
    filterable: boolean;
    isSortingActive: boolean;
    isFilterActive: boolean;
    isResized: boolean;
    isSticky: boolean;
    showResizer: boolean;
    columnWidth: number;
    columnLeftOffset: number;
};
export type SortingState<T extends TableRow> = {
    by: keyof T;
    order: 'asc' | 'desc';
    sortFn?: (a: T[keyof T], b: T[keyof T]) => number;
} | null;
export declare const Table: Table;
