declare namespace pAll { interface Options { /** Number of concurrent pending promises. Minimum: `1`. @default Infinity */ concurrency?: number; } type PromiseFactory = () => PromiseLike; } /** Run promise-returning & async functions concurrently with optional limited concurrency. @param tasks - Iterable with promise-returning/async functions. @returns A `Promise` that is fulfilled when all promises returned from calling the functions in `tasks` are fulfilled, or rejects if any of the promises reject. The fulfilled value is an `Array` of the fulfilled values in `tasks` order. @example ``` import pAll = require('p-all'); import got = require('got'); (async () => { const actions = [ () => got('https://sindresorhus.com'), () => got('https://ava.li'), () => checkSomething(), () => doSomethingElse() ]; console.log(await pAll(actions, {concurrency: 2})); })(); ``` */ declare const pAll: { < Result1, Result2, Result3, Result4, Result5, Result6, Result7, Result8, Result9, Result10 >( tasks: [ pAll.PromiseFactory, pAll.PromiseFactory, pAll.PromiseFactory, pAll.PromiseFactory, pAll.PromiseFactory, pAll.PromiseFactory, pAll.PromiseFactory, pAll.PromiseFactory, pAll.PromiseFactory, pAll.PromiseFactory ], options?: pAll.Options ): Promise< [ Result1, Result2, Result3, Result4, Result5, Result6, Result7, Result8, Result9, Result10 ] >; < Result1, Result2, Result3, Result4, Result5, Result6, Result7, Result8, Result9 >( tasks: [ pAll.PromiseFactory, pAll.PromiseFactory, pAll.PromiseFactory, pAll.PromiseFactory, pAll.PromiseFactory, pAll.PromiseFactory, pAll.PromiseFactory, pAll.PromiseFactory, pAll.PromiseFactory ], options?: pAll.Options ): Promise< [ Result1, Result2, Result3, Result4, Result5, Result6, Result7, Result8, Result9 ] >; ( tasks: [ pAll.PromiseFactory, pAll.PromiseFactory, pAll.PromiseFactory, pAll.PromiseFactory, pAll.PromiseFactory, pAll.PromiseFactory, pAll.PromiseFactory, pAll.PromiseFactory ], options?: pAll.Options ): Promise< [Result1, Result2, Result3, Result4, Result5, Result6, Result7, Result8] >; ( tasks: [ pAll.PromiseFactory, pAll.PromiseFactory, pAll.PromiseFactory, pAll.PromiseFactory, pAll.PromiseFactory, pAll.PromiseFactory, pAll.PromiseFactory ], options?: pAll.Options ): Promise<[Result1, Result2, Result3, Result4, Result5, Result6, Result7]>; ( tasks: [ pAll.PromiseFactory, pAll.PromiseFactory, pAll.PromiseFactory, pAll.PromiseFactory, pAll.PromiseFactory, pAll.PromiseFactory ], options?: pAll.Options ): Promise<[Result1, Result2, Result3, Result4, Result5, Result6]>; ( tasks: [ pAll.PromiseFactory, pAll.PromiseFactory, pAll.PromiseFactory, pAll.PromiseFactory, pAll.PromiseFactory ], options?: pAll.Options ): Promise<[Result1, Result2, Result3, Result4, Result5]>; ( tasks: [ pAll.PromiseFactory, pAll.PromiseFactory, pAll.PromiseFactory, pAll.PromiseFactory ], options?: pAll.Options ): Promise<[Result1, Result2, Result3, Result4]>; ( tasks: [ pAll.PromiseFactory, pAll.PromiseFactory, pAll.PromiseFactory ], options?: pAll.Options ): Promise<[Result1, Result2, Result3]>; ( tasks: [pAll.PromiseFactory, pAll.PromiseFactory], options?: pAll.Options ): Promise<[Result1, Result2]>; ( tasks: [pAll.PromiseFactory], options?: pAll.Options ): Promise<[Result1]>; ( tasks: Iterable> | pAll.PromiseFactory[], options?: pAll.Options ): Promise; // TODO: Remove this for the next major release, refactor the whole definition back to multiple overloaded functions default: typeof pAll; }; export = pAll;