import { CdsCheckbox } from '../CdsCheckbox';
import { CdsPagination } from '../CdsPagination';
import { CdsTooltip } from '../CdsTooltip';
import { INTERNAL_SELECTION_ITEM } from './composable';
import { TBreakpoint, TBreakpointUpDown } from '../../composable';
import { ComponentProps, VueNode } from '../../utils';
import { CSSProperties, Ref, TdHTMLAttributes } from 'vue';
export declare namespace NTable {
    type TDefaultRecord = any;
    type TKey = string | number;
    type TLayout = 'auto' | 'fixed';
    type TFixed = boolean | 'left' | 'right' | null;
    type TAlign = 'left' | 'center' | 'right';
    type TAction = 'filter' | 'sort' | 'paginate';
    type TSortOrder = 'descend' | 'ascend' | string;
    type TScroll = {
        x?: number | true | string;
        y?: number | string;
    };
    type TDataIndex = string | number | readonly (string | number)[];
    type TCompareFn<RecordType> = (a: RecordType, b: RecordType, sortOrder?: TSortOrder) => number;
    type TFilterKey = TKey[] | null;
    type TFilterValue = (TKey | boolean)[];
    type TFilterMode = 'menu' | 'tree';
    type TFilterSearch = boolean | ((input: string, record: {}) => boolean);
    type TTriggerEventHandler<RecordType> = (record: RecordType, event: MouseEvent) => void;
    interface ICurrentData<RecordType = TDefaultRecord> {
        currentData: RecordType[];
        action: TAction;
    }
    interface ISorterResult<RecordType = TDefaultRecord> {
        column?: NColumn.IColumn<RecordType>;
        order?: TSortOrder;
        field?: TKey | readonly TKey[];
        columnKey?: TKey;
    }
    interface IFilterState<RecordType = TDefaultRecord> {
        column: NColumn.IColumn<RecordType>;
        key: TKey;
        filteredKeys?: TFilterKey;
        forceFiltered?: boolean;
    }
    interface ISortState<RecordType = TDefaultRecord> {
        column: NColumn.IColumn<RecordType>;
        key: TKey;
        sortOrder: TSortOrder;
        multiplePriority: number | false;
    }
    interface IChangeEventInfo<RecordType = TDefaultRecord> {
        pagination: {
            modelValue?: number;
            length?: number;
            total?: number;
        };
        filters: Record<string, TFilterValue | null>;
        sorter: ISorterResult<RecordType> | ISorterResult<RecordType>[];
        filterStates: IFilterState<RecordType>[];
        sorterStates: ISortState<RecordType>[];
        resetPagination: Function;
    }
    interface ILocale {
        filterTitle?: string;
        filterConfirm?: any;
        filterReset?: any;
        filterEmptyText?: any;
        filterCheckAll?: any;
        filterSearchPlaceholder?: any;
        emptyText?: any | (() => any);
        selectAll?: any;
        selectNone?: any;
        selectInvert?: any;
        selectionAll?: any;
        sortTitle?: string;
        expand?: string;
        collapse?: string;
        triggerDesc?: string;
        triggerAsc?: string;
        cancelSort?: string;
        showed?: string;
        from?: string;
        rowOnPage?: string;
    }
    namespace NColumn {
        type TTitle<RecordType> = VueNode | ((props: ITitleProps<RecordType>) => VueNode);
        type TTransformColumns<RecordType> = (columns: TColumns<RecordType>) => TColumns<RecordType>;
        type TColumns<RecordType = TDefaultRecord> = (IColumn<RecordType> | IColumnGroup<RecordType>)[];
        interface ITitleProps<RecordItem> {
            sortColumns?: {
                column: IColumn<RecordItem>;
                order: TSortOrder;
            }[];
            filters?: Record<string, string[]>;
        }
        interface IFilterItem {
            text: VueNode;
            value: string | number | boolean;
            children?: IFilterItem[];
        }
        interface IFilterConfirmProps {
            closeDropdown: boolean;
        }
        interface IFilterDropdownProps<RecordType> {
            prefixCls: string;
            setSelectedKeys: (selectedKeys: TKey[]) => void;
            selectedKeys: TKey[];
            confirm: (param?: IFilterConfirmProps) => void;
            clearFilters: () => void;
            filters?: IFilterItem[];
            visible?: boolean;
            column?: IColumn<RecordType>;
        }
        interface IColumn<RecordType = TDefaultRecord> {
            title?: TTitle<RecordType>;
            key?: TKey;
            class?: string;
            className?: string;
            ellipsis?: NCell.TCellEllipsis;
            align?: TAlign;
            fixed?: TFixed;
            colSpan?: number;
            rowSpan?: number;
            width?: number | string;
            minWidth?: number;
            maxWidth?: number;
            resizable?: boolean;
            dataIndex?: TDataIndex;
            filtered?: boolean;
            filters?: IFilterItem[];
            filterDropdown?: VueNode | ((props: IFilterDropdownProps<RecordType>) => VueNode);
            filterMultiple?: boolean;
            filteredValue?: TFilterValue | null;
            defaultFilteredValue?: TFilterValue | null;
            filterIcon?: VueNode | ((opt: {
                filtered: boolean;
                column: IColumn;
            }) => VueNode);
            filterMode?: TFilterMode;
            filterSearch?: TFilterSearch;
            filterDropdownVisible?: boolean;
            customFilterDropdown?: boolean;
            onFilter?: (value: string | number | boolean, record: RecordType) => boolean;
            onFilterDropdownVisibleChange?: (visible: boolean) => void;
            sorter?: boolean | TCompareFn<RecordType> | {
                compare?: TCompareFn<RecordType>;
                multiple: number;
            };
            sortOrder?: TSortOrder;
            defaultSortOrder?: TSortOrder;
            sortDirections?: TSortOrder[];
            showSorterTooltip?: boolean | ComponentProps<typeof CdsTooltip>;
            responsive?: TBreakpoint[] | TBreakpointUpDown[];
            onCellClick?: (record: RecordType, event: MouseEvent) => void;
            customCell?: NCustomize.TGetComponentProps<RecordType>;
            customHeaderCell?: NCustomize.TGetComponentProps<TColumns<RecordType>[number]>;
            customRender?: (opt: {
                value: any;
                text: any;
                record: RecordType;
                index?: number;
                renderIndex?: number;
                column: IColumn<RecordType>;
            }) => any | NCell.IRenderedCell<RecordType>;
            /**
             * @private Internal usage.
             *
             * !!! DO NOT USE IN PRODUCTION ENVIRONMENT !!!
             */
            __originColumn__?: any;
        }
        interface IColumnGroup<RecordType = TDefaultRecord> extends Omit<IColumn<RecordType>, 'dataIndex'> {
            children: TColumns<RecordType>;
        }
    }
    namespace NRow {
        type TGetRowKey<RecordType> = (record: RecordType, index?: number) => TKey;
        type TClassName<RecordType> = (record: RecordType, index: number, indent: number) => string;
        type TSelection = 'checkbox' | 'radio';
        type TSelectionItemSelectFn = (currentRowKeys: TKey[]) => void;
        type TSelectionSelectFn<RecordType> = (record: RecordType, selected: boolean, selectedRows: RecordType[], nativeEvent: Event) => void;
        interface ISelectionItem {
            key: string;
            text: VueNode;
            onSelect?: TSelectionItemSelectFn;
        }
        interface IRowSelection<RecordType = TDefaultRecord> {
            preserveSelectedRowKeys?: boolean;
            type?: TSelection;
            selectedRowKeys?: TKey[];
            defaultSelectedRowKeys?: TKey[];
            selections?: INTERNAL_SELECTION_ITEM[] | boolean;
            hideSelectAll?: boolean;
            fixed?: TFixed;
            columnWidth?: string | number;
            columnTitle?: string | VueNode;
            checkStrictly?: boolean;
            onChange?: (selectedRowKeys: TKey[], selectedRows: RecordType[]) => void;
            onSelect?: TSelectionSelectFn<RecordType>;
            onSelectMultiple?: (selected: boolean, selectedRows: RecordType[], changeRows: RecordType[]) => void;
            onSelectNone?: () => void;
            getCheckboxProps?: (record: RecordType) => Partial<Omit<ComponentProps<typeof CdsCheckbox>, 'modelValue'>>;
            renderCell?: (value: boolean, record: RecordType, index: number | undefined, originalNode: VueNode) => VueNode | NCell.IRenderedCell<RecordType>;
        }
    }
    namespace NCell {
        type TCellEllipsis = {
            showTitle?: boolean;
        } | boolean | undefined;
        type TTransformCellText<RecordType> = (opt: {
            text: any;
            column: NColumn.IColumn<RecordType>;
            record: any;
            index?: number;
        }) => any;
        interface ICell<RecordType = TDefaultRecord> {
            key?: TKey;
            class?: string;
            style?: CSSProperties;
            column: NColumn.TColumns<RecordType>[number];
            colSpan?: number;
            rowSpan?: number;
            hasSubColumns?: boolean;
            colStart?: number;
            colEnd?: number;
        }
        interface IRenderedCell<RecordType> {
            props?: ICell<RecordType>;
            children?: any;
        }
    }
    namespace NExpand {
        type TExpandableType = false | 'row' | 'nest';
        type TRenderExpandIcon<RecordType> = (props: IRenderExpandIconProps<RecordType>) => any;
        type TExpandedRowRender<RecordType> = (opt: {
            record: RecordType;
            index: number;
            indent: number;
            expanded: boolean;
        }) => any;
        interface IRenderExpandIconProps<RecordType> {
            expanded: boolean;
            record: RecordType;
            expandable: boolean;
            isTree?: boolean;
            onExpand: TTriggerEventHandler<RecordType>;
        }
        interface IExpandable<RecordType = TDefaultRecord> {
            expandedRowKeys?: readonly TKey[];
            defaultExpandedRowKeys?: readonly TKey[];
            defaultExpandAllRows?: boolean;
            expandedRowByClick?: boolean;
            expandIconColumnIndex?: number;
            columnWidth?: string | number;
            showExpandColumn?: boolean;
            childrenColumnName?: string;
            fixed?: TFixed;
            indentSize?: number;
            expandedRowRender?: TExpandedRowRender<RecordType>;
            expandIcon?: TRenderExpandIcon<RecordType>;
            expandedRowClassName?: NRow.TClassName<RecordType>;
            rowExpandable?: (record: RecordType) => boolean;
            onExpand?: (expanded: boolean, record: RecordType) => void;
            onExpandedRowsChange?: (expandedKeys: readonly TKey[]) => void;
        }
    }
    namespace NRender {
        type TPanelRender<RecordType> = (data: readonly RecordType[]) => any;
    }
    namespace NPagination {
        type TPosition = 'topLeft' | 'topCenter' | 'topRight' | 'bottomLeft' | 'bottomCenter' | 'bottomRight';
        interface IProps extends ComponentProps<typeof CdsPagination> {
            total?: number;
            position?: TPosition[];
            counter?: boolean;
            size?: boolean;
            class?: string;
            pageSizeOptions?: number[];
            style?: CSSProperties;
        }
    }
    namespace NSticky {
        interface ISticky {
            offsetHeader?: number;
            offsetSummary?: number;
            offsetScroll?: number;
            getContainer?: () => Window | HTMLElement;
        }
        interface IStickyOffsets {
            left: readonly number[];
            right: readonly number[];
            isSticky?: boolean;
        }
    }
    namespace NCustomize {
        type TCustomizeComponent = any;
        type TAdditionalProps = TdHTMLAttributes & {
            colSpan?: number;
            rowSpan?: number;
        };
        type TGetPopupContainer = (triggerNode: HTMLElement) => HTMLElement;
        type TGetComponentProps<DataType> = (data: DataType, index?: number, column?: NColumn.IColumn) => TAdditionalProps | undefined;
        type TComponent = any;
        type TGetComponent = (path: readonly string[], defaultComponent?: TComponent) => TComponent;
        type TScrollBody<RecordType> = (data: readonly RecordType[], info: {
            scrollbarSize: number;
            ref: Ref<{
                scrollLeft: number;
            }>;
            onScroll: (info: {
                currentTarget?: HTMLElement;
                scrollLeft?: number;
            }) => void;
        }) => any;
        interface TableComponents<RecordType> {
            table?: TComponent;
            header?: {
                wrapper?: TComponent;
                row?: TComponent;
                cell?: TComponent;
            };
            body?: TScrollBody<RecordType> | {
                wrapper?: TComponent;
                row?: TComponent;
                cell?: TComponent;
            };
        }
    }
}
