export type Task = () => (Promise | T); /** * Processes tasks in the order they were scheduled. */ export declare class TaskQueue { private _runningTask; private _pendingTasks; /** * Waits for the current and pending tasks to finish, then runs and awaits the given task. * If the task is skipped because of clearPending, the promise is rejected with a CancellationError. */ schedule(task: Task): Promise; /** * Waits for the current and pending tasks to finish, then runs and awaits the given task. * If the task is skipped because of clearPending, the promise is resolved with undefined. */ scheduleSkipIfCleared(task: Task): Promise; private _runIfNotRunning; private _processQueue; /** * Clears all pending tasks. Does not cancel the currently running task. */ clearPending(): void; } export declare class BatchedProcessor { private readonly _fn; private readonly _waitingTimeMs; private _queue; private _timeout; constructor(_fn: (args: TArg[]) => Promise, _waitingTimeMs: number); request(arg: TArg): Promise; private _flush; } export declare function raceFilter(promises: Promise[], filter: (result: T) => boolean): Promise; //# sourceMappingURL=async.d.ts.map