import { Obj, IClearDataType } from '../type';
export declare const MAX_API_PAGE_SIZE = 100;
export declare const BATCH_GROUP_SIZE = 5;
export declare const BATCH_RETRY_CONFIG: {
    readonly maxRetries: 3;
    readonly timeoutMs: 30000;
};
export type BatchRequestResult = {
    success: true;
    data: any;
    batchPage: number;
} | {
    success: false;
    error: Error;
    batchPage: number;
};
export interface BatchRequestOptions {
    fetchSingleBatch: (batchPage: number) => Promise<any>;
    responseTransform: (res: any, originalRes: any) => any;
    mergeBatchResponses: (responses: Obj[], userPageSize: number, userCurrentPage: number) => Obj;
    callback?: (res: Obj, clearDataType: IClearDataType) => void;
    errorHandler: (...args: any[]) => void;
    onFinally?: () => void;
    setLoading: (loading: boolean) => void;
    releaseLock: () => void;
}
export interface BatchRequestParams {
    userPageSize: number;
    userCurrentPage: number;
    clearDataType: IClearDataType;
    paramsData: Record<string, any>;
    /** 列表总条数（首包/回调已写入时传入），用于避免「每页 1000」时仍按 10 个批次拉满而实际只有几百条 */
    totalCount?: number | null;
}
/**
 * 计算需要分批次请求的批次页码范围 [startBatch, endBatch]
 * 例如：每页 1000、第 2 页 → 需要第 11～20 批（每批 100 条）
 * 若传入 totalCount，则按有效行下标截断，避免总条数不足时仍发满「逻辑页」对应的批次数
 */
export declare function calculateBatchRange(userPageSize: number, userCurrentPage: number, totalCount?: number | null): [number, number];
/**
 * 创建批次分组（每5个一批）
 * 组与组串行执行，组内并发请求
 */
export declare function createBatchGroups(startBatch: number, endBatch: number): number[][];
/**
 * 执行分批次请求（主函数）
 */
export declare function executeBatchRequests(params: BatchRequestParams, options: BatchRequestOptions): Promise<any>;
