export type WaitNextTaskFn<T> = () => Promise<() => T>;
export type AggregateRunnerTask<T> = (signal: AbortSignal, nextTask: WaitNextTaskFn<T>) => any;
export type AggregateRunner<T> = {
    /**
     * Enqueue this data for the runner.
     *
     * This does not start the task automatically.
     */
    enqueue(signal: AbortSignal, data: T): void;
    /**
     * Is the aggregate runner active?
     */
    active(): boolean;
    /**
     * Are there any pending items to work on?
     * The runner might still be processing something.
     */
    hasPending(): boolean;
    /**
     * Starts the runner, or returns the result of an already active runner.
     */
    start(): Promise<void>;
    /**
     * Returns all pending items here.
     */
    pending(): Iterable<T>;
};
/**
 * Runs an aggregate task based on other signal-bound tasks passed in here.
 */
export declare function buildAggregateRunner<T>(runner: AggregateRunnerTask<T>): AggregateRunner<T>;
