export declare const ERROR_WHILE_MAPPING_MESSAGE = "Threw while mapping."; /** * pooledMap transforms values from an (async) iterable into another async * iterable. The transforms are done concurrently, with a max concurrency * defined by the poolLimit. * * If an error is thrown from `iterableFn`, no new transformations will begin. * All currently executing transformations are allowed to finish and still * yielded on success. After that, the rejections among them are gathered and * thrown by the iterator in an `AggregateError`. * * @example * ```typescript * import { pooledMap } from "https://deno.land/std@$STD_VERSION/async/pool.ts"; * * const results = pooledMap( * 2, * [1, 2, 3], * (i) => new Promise((r) => setTimeout(() => r(i), 1000)), * ); * * for await (const value of results) { * // ... * } * ``` * * @param poolLimit The maximum count of items being processed concurrently. * @param array The input array for mapping. * @param iteratorFn The function to call for every item of the array. */ export declare function pooledMap(poolLimit: number, array: Iterable | AsyncIterable, iteratorFn: (data: T) => Promise): AsyncIterableIterator;