import { VNode, ComponentPublicInstance, Ref } from 'vue';
import { TableProps, TableColumnCtx, Column } from 'element-plus';
import { default as ProTable } from '../components/ProTable/index.vue';
export type BreakPoint = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
type DefaultRow = Record<PropertyKey, any>;
export type Responsive = {
    span?: number;
    offset?: number;
};
export interface EnumProps {
    label?: string;
    value?: string | number | boolean | any[];
    disabled?: boolean;
    tagType?: string;
    children?: EnumProps[];
    [key: string]: any;
}
export type TypeProps = 'index' | 'selection' | 'radio' | 'expand' | 'sort' | 'icon' | 'tag' | 'copy' | 'switch' | 'status' | 'tooltip';
export type SearchType = 'input' | 'input-number' | 'select' | 'select-v2' | 'tree-select' | 'cascader' | 'date-picker' | 'time-picker' | 'time-select' | 'switch' | 'slider' | 'agent-select';
export type SearchRenderScope = {
    searchParam: {
        [key: string]: any;
    };
    placeholder: string;
    clearable: boolean;
    options: EnumProps[];
    data: EnumProps[];
};
export type SearchProps = {
    el?: SearchType;
    label?: string;
    props?: any;
    key?: string;
    tooltip?: string;
    order?: number;
    span?: number;
    offset?: number;
    defaultValue?: string | number | boolean | any[] | Ref<any>;
    render?: (scope: SearchRenderScope) => VNode;
} & Partial<Record<BreakPoint, Responsive>>;
export type FieldNamesProps = {
    label: string;
    value: string;
    children?: string;
};
export type RenderScope<T extends DefaultRow = any> = {
    row: T;
    rowData: T;
    $index: number;
    column: TableColumnCtx<T>;
    [key: string]: any;
};
export type HeaderRenderScope<T extends DefaultRow = any> = {
    $index: number;
    column: TableColumnCtx<T>;
    [key: string]: any;
};
export type HeaderScope<T extends DefaultRow = any> = RenderScope<T> & {
    isSelected: boolean;
    selectedList: Array<RenderScope<T>['row']>;
    selectedListIds: any[];
};
export type SwitchColumnProps = {
    api?: string;
    activeValue?: number | string | boolean;
    inactiveValue?: number | string | boolean;
    refresh?: boolean;
    auth?: string[];
    loading?: boolean | Ref<boolean>;
};
export type StatusColumnProps = {
    textProp?: string;
    typeProp?: string;
};
export type TooltipColumnProps = {
    textProp?: string;
    contentProp?: string;
    placement?: string;
    effect?: string;
};
export interface ColumnProps<T extends DefaultRow = any> extends Partial<Omit<TableColumnCtx<T> & Column<T>, 'type' | 'children' | 'renderCell' | 'renderHeader'>> {
    type?: TypeProps;
    isShow?: boolean | Ref<boolean>;
    isSetting?: boolean | Ref<boolean>;
    search?: SearchProps | undefined;
    enum?: EnumProps[] | Ref<EnumProps[]> | ((params?: any) => Promise<any>);
    isFilterEnum?: boolean | Ref<boolean>;
    fieldNames?: FieldNamesProps;
    headerRender?: (scope: HeaderRenderScope<T>) => VNode;
    render?: (scope: RenderScope<T>) => VNode | string;
    _children?: ColumnProps<T>[];
    summary?: boolean | Ref<boolean>;
    props?: SwitchColumnProps | StatusColumnProps | TooltipColumnProps;
    auth?: string[];
}
export type ProTableInstance = Omit<InstanceType<typeof ProTable>, keyof ComponentPublicInstance | keyof BaseTableProps | keyof ProTableListProps | keyof ProTableSummaryProps>;
export interface SummaryMethodProps<T extends DefaultRow = any> {
    columns: TableColumnCtx<T>[];
    data: T[];
}
export interface BaseTableProps {
    columns: ColumnProps[];
    data?: any[];
    url?: string;
    autoSearch?: boolean;
    hasPagination?: boolean;
    initParam?: Record<string, any>;
    searchParam?: Record<string, any>;
    border?: boolean;
    rowKey?: string;
    size?: TableProps<any>['size'];
    pageSize?: number;
    rowH?: number;
    extH?: number;
    loading?: boolean | Ref<boolean>;
    dataCallback?: (data: any) => any;
    requestError?: (err: any) => void;
}
export interface ProTableListProps extends BaseTableProps {
}
export interface ProTableSummaryProps extends BaseTableProps {
    sumUrl?: string;
    sumText?: string;
    sumTextFormat?: string;
}
export interface Pagination {
    page: number;
    size: number;
    total: number;
}
export interface StateProps {
    tableData: any[];
    pagination: Pagination;
    searchParam: {
        [key: string]: any;
    };
    totalParam: {
        [key: string]: any;
    };
    icon?: {
        [key: string]: any;
    };
}
export type SumResult = {
    index: number;
    text: string;
};
export {};
