export interface WorkerPool {
    /**
     * Dispatch items across workers. Items are split into chunks (one per worker),
     * each worker processes its chunk via sub-batches to limit peak memory,
     * and results are concatenated back in order.
     */
    dispatch<TInput, TResult>(items: TInput[], onProgress?: (filesProcessed: number) => void): Promise<TResult[]>;
    /** Terminate all workers. Must be called when done. */
    terminate(): Promise<void>;
    /** Number of workers in the pool */
    readonly size: number;
}
export interface WorkerPoolOptions {
    /**
     * Max files to send to a worker in one postMessage. Lower values reduce
     * structured-clone memory spikes and give the main thread more chances to
     * observe progress on large repos.
     */
    subBatchSize?: number;
    /**
     * Idle timeout while waiting for a worker response. Reset by worker progress
     * so slow-but-moving chunks do not get retried sequentially.
     */
    subBatchIdleTimeoutMs?: number;
}
/**
 * Create a pool of worker threads.
 */
export declare const createWorkerPool: (workerUrl: URL, poolSize?: number, options?: WorkerPoolOptions) => WorkerPool;
