import { Ref, ComputedRef } from 'vue';
/**
 * Fetcher 返回结果类型
 */
type FetcherResult = {
    /** 展示的数据 table 或 tree  */
    data: any[];
    /** 总页数 */
    totalPage: number;
    /** 总数 */
    totalCount: number;
    /** 高亮索引（支持两种格式） */
    highlightIdx?: HighlightIndex | null;
};
/**
 * 高亮索引类型
 */
type HighlightIndex = {
    index: number[];
} | {
    parent: number;
    child: number;
};
/**
 * Fetcher 函数类型
 * 用于获取表格数据
 */
type FetcherFn = (opts: FetcherOptions) => Promise<FetcherResult>;
/**
 * Fetcher 选项
 */
interface FetcherOptions {
    keyword?: string;
    pageNo: number;
    pageSize: number;
}
/**
 * 初始化参数
 */
interface InitialParams {
    data: any[];
    highlightIdx?: HighlightIndex | null;
    total?: number;
}
/**
 * 分页信息
 */
interface PaginationInfo {
    current: number;
    pageSize: number;
    totalPage: number;
    totalCount: number;
}
/**
 * useSelectTable Hook 返回类型
 */
interface UseSelectTableReturn {
    xTable: Ref<any>;
    loading: Ref<boolean>;
    keyword: Ref<string | undefined>;
    tableData: Ref<any[]>;
    pagination: PaginationInfo;
    xTableRef: any;
    hasData: ComputedRef<boolean>;
    hasNextPage: ComputedRef<boolean>;
    hasPrevPage: ComputedRef<boolean>;
    fetchTableData: (keyword?: string) => Promise<FetcherResult>;
    search: () => Promise<FetcherResult>;
    onSizeChange: (current: number, pageSize: number) => Promise<void>;
    setCurrentRowHighlight: (highlightIdx: HighlightIndex | null) => void;
    refresh: () => Promise<FetcherResult>;
    reset: () => Promise<FetcherResult>;
    clear: () => void;
    clearSelection: () => void;
    handlePagination: (type: 'prev' | 'next') => void;
}
/**
 * 表格数据选择 Hook
 *
 * @param fetcher - 数据获取函数
 * @param initialParams - 初始化参数
 * @returns Hook 返回的对象
 *
 * @example
 * ```typescript
 * const { tableData, pagination, loading } = useSelectTable(
 *   async (opts) => {
 *     const res = await api.getData(opts);
 *     return {
 *       data: res.items,
 *       totalPage: res.totalPage,
 *       totalCount: res.totalCount,
 *     };
 *   },
 *   { data: [], highlightIdx: null }
 * );
 * ```
 */
export declare function useSelectTable(fetcher: FetcherFn, initialParams: InitialParams): UseSelectTableReturn;
export type { FetcherFn, FetcherResult, FetcherOptions, PaginationInfo, HighlightIndex, InitialParams, UseSelectTableReturn, };
