import { Fn, KeyValueType, Recordable } from '@maxax/types';
import { DefineVxeComponentApp } from '@vxe-ui/core';
import { VxeGlobalFormatsHandles, VxePagerDefines, VxePagerEvents, VxePagerProps } from 'vxe-pc-ui';
import { VxeColumnProps, VxeColumnPropTypes, VxeColumnSlotTypes, VxeComponentSizeType, VxeGlobalConfig, VxeGlobalInterceptorHandles, VxeGlobalRendererHandles, VxeGlobalThemeName, VxeGridDefines, VxeGridEventProps, VxeGridEvents, VxeGridInstance, VxeGridProps, VxeGridPropTypes, VxeTableDefines, VxeTableEvents, VxeTablePropTypes } from 'vxe-table';
import { FormActionType } from '../basic-form/interface';
export type GridColumns = VxeGridPropTypes.Columns;
export type BasicPagerProps = VxePagerProps;
export type Key = number | string;
export type BasicTableRowKey = number | string;
export type GetRowKey = (record: Record<string, any>, index?: number) => BasicTableRowKey;
export interface FetchSetting {
    pageField: string;
    sizeField: string;
    listField: string;
    totalField: string;
}
export interface TableSetting {
    redo?: boolean;
    size?: boolean;
    setting?: boolean;
    settingCache?: boolean;
    fullScreen?: boolean;
}
export interface GetColumnsParams {
    ignoreIndex?: boolean;
    ignoreAction?: boolean;
}
export type BasicColumn = VxeGridPropTypes.Column & {
    children?: BasicColumn[];
    defaultHidden?: boolean;
    ifShow?: boolean | ((column: BasicColumn) => boolean);
    editDynamicDisabled?: boolean | ((record: Recordable) => boolean);
};
export type RowSelectionType = 'checkbox' | 'radio';
export type SelectionSelectFn<T> = (record: T, selected: boolean, selectedRows: T[], nativeEvent: Event) => void;
export interface TableRowSelection<T = VxeTablePropTypes.Row> {
    onCheckboxChange?: VxeGridEvents.CheckboxChange<T>;
    onCheckboxAll?: VxeGridEvents.CheckboxAll<T>;
}
export interface TableSortFilter<T = VxeTablePropTypes.Row> {
    onSortChange?: VxeGridEvents.SortChange<T>;
    onFilterChange?: VxeGridEvents.FilterChange<T>;
}
export interface GetSelectionReturn {
    selectedRowKeys: Key[];
    selectedRows: any[];
}
export interface BasicTableEventProps extends VxeGridEventProps {
    onSelection?: (params: {
        selectedRowKeys: Key[];
        selectedRows: any[];
    }) => void;
}
export type BasicTableProps = VxeGridProps & BasicTableEventProps & {
    columns: BasicColumn[];
    card?: boolean;
    toolbarFixed?: boolean;
    uid?: string;
    immediate?: boolean;
    api?: (...arg: any) => Promise<any>;
    dynamicApi?: (params?: Recordable) => (...arg: any) => Promise<any>;
    beforeFetch?: Fn;
    afterFetch?: Fn;
    handleSearchInfoFn?: Fn;
    fetchSetting?: Partial<FetchSetting>;
    defSort?: Recordable;
    searchInfo?: Recordable;
    useSearchForm?: boolean;
    sumFields?: string[];
    avgFields?: string[];
    pagination?: BasicPagerProps | boolean;
    autoCreateKey?: boolean;
    rKey?: string | GetRowKey;
    showTableSetting?: boolean;
    tableSetting?: TableSetting;
    showIndexColumn?: boolean;
    showSelection?: boolean;
    showCheckboxColumn?: boolean;
    showRadioColumn?: boolean;
    relationForm?: () => FormActionType | null;
};
export interface GridEmits {
    (e: 'load-data', data: GridLoaderData): void;
}
export interface GridState {
    page?: number;
    pageSize?: number;
    total?: number;
    [index: string]: any;
}
export interface GridLoaderData {
    list: any[];
    total: number;
}
export interface FetchParams {
    searchInfo?: Recordable;
    page?: number;
    sortInfo?: Recordable;
    filterInfo?: Recordable;
}
export interface SelectionChangeEventParams {
    keys: Key[];
    rows: Recordable[];
}
export type PageChangeEventParams = VxePagerDefines.PageChangeEventParams;
export interface BasicTableEmitType {
    (_e: 'fetch-success'): void;
    (_e: 'fetch-error'): void;
    (_e: 'selection-change', params: SelectionChangeEventParams): void;
    (_e: 'page-change', params: PageChangeEventParams): void;
}
export interface TableActionType {
    emit?: BasicTableEmitType;
    reload: (opt?: FetchParams) => Promise<Array<Recordable<any>> | undefined>;
    setLoading: (loading: boolean) => void;
    setProps: (props: Partial<BasicTableProps>) => void;
    getTableProps: () => BasicTableProps;
    setPagination: (info: Partial<BasicPagerProps>) => void;
    getPaginationRef: () => BasicPagerProps | boolean;
    setShowPagination: (show: boolean) => Promise<void>;
    getShowPagination: () => boolean;
    setTableData: <T = Recordable>(values: T[]) => void;
    getTableData: <T = Recordable>() => T[];
    getDataSource: <T = Recordable>() => T[];
    getRawDataSource: <T = Recordable>() => T;
    getSearchInfo: <T = Recordable>() => T;
    updateTableDataRecord: (keyValue: Key, record: Recordable) => Recordable | undefined;
    deleteTableDataRecord: (keyValues: Key | Key[]) => void;
    insertTableDataRecord: (record: Recordable | Recordable[], index?: number) => Recordable[] | undefined;
    findTableDataRecord: (keyValue: Key) => Recordable | undefined;
    updateTableData: (index: number, key: string, value: any) => Recordable;
    getTableRowKey: () => string | GetRowKey | undefined;
    mergeTableDataRecord: (records: Recordable[], key: KeyValueType) => void;
    getColumns: (opt?: GetColumnsParams) => BasicColumn[];
    setColumns: (columns: BasicColumn[] | string[]) => void;
    getCacheColumns: () => BasicColumn[];
    setCacheColumnsByField?: (dataIndex: string | undefined, value: BasicColumn) => void;
    setCacheColumns?: (columns: BasicColumn[]) => void;
    setSelectedRowKeys: (keyValues: BasicTableRowKey[]) => void;
    getRowSelection: () => TableRowSelection<Recordable>;
    setSelectedRows: (rows: Recordable[]) => void;
    getSelectRows: <T = Recordable>() => T[];
    clearSelectedRowKeys: () => void;
    getSelectRowKeys: () => BasicTableRowKey[];
    deleteSelectRowByKey: (keyValue: BasicTableRowKey) => void;
    handleSearchInfoChange: (info?: Recordable) => void;
    handleSearchInfoReload: (info?: Recordable) => void;
    setSelection: () => Promise<void>;
    instance: () => VxeGridInstance | null;
}
export type { DefineVxeComponentApp, VxeColumnProps, VxeColumnPropTypes, VxeColumnSlotTypes, VxeComponentSizeType, VxeGlobalConfig, VxeGlobalInterceptorHandles, VxeGlobalRendererHandles, VxeGlobalThemeName, VxeGridDefines, VxeGridEvents, VxeGridInstance, VxeGridProps, VxeGridPropTypes, VxePagerEvents, VxePagerProps, VxeTableDefines, VxeTableEvents, VxeTablePropTypes };
export interface BasicTableContext {
    name: string;
}
export interface VxeTableFormatter {
    [key: string]: VxeGlobalFormatsHandles.FormatsOptions | ((params: any, ...args: any[]) => string | number);
}
//# sourceMappingURL=interface.d.ts.map