export declare type Task<T = any> = () => Promise<T>;
export declare class WorkerPool<T = any> {
    private concurrency;
    private queuedTasks;
    private runningTasks;
    constructor(concurrency: number);
    task(task: Task<T>): Promise<T>;
    cancelAll(reason?: any): void;
    private flush;
    private completeTask;
    private runTask;
}
