/** * A Task is a nullary function that returns a promise */ export declare type Task = () => Promise; /** * Run tasks with limited concurency. * @param limit - Limit of tasks that run at once. * @param tasks - List of tasks to run. * @returns A promise that fulfills to an array of the results * of the input promises or rejects immediately upon any of * the input tasks rejecting. * @example * ```ts * const task1 = () => new Promise((resolve) => { * setTimeout(resolve, 100, 1); * }); * const task2 = () => Promise.resolve(2); * * throttleAll(1, [task1, task2]) * .then((values) => { console.log(values) }); * // task2 will run after task1 finishes * // logs: `[1, 2]` * ``` */ export declare const throttleAll: (limit: number, tasks: Task[]) => Promise; //# sourceMappingURL=index.d.ts.map