/** * @file Parallel iteration helpers — `parallelMap()` and the fire-and-forget * `parallelEach()`. Built on top of `streaming-iterables.parallelMap` with * the project's `pRetry` wrapper applied per item. */ import type { IterationOptions } from '../promises/types.js'; /** * Execute a function for each item in an iterable in parallel. * * @example * ;```typescript * const urls = ['https://a.io', 'https://b.io'] * await parallelEach( * urls, * async url => { * await fetch(url) * }, * { concurrency: 4 }, * ) * ``` */ export declare function parallelEach(iterable: Iterable | AsyncIterable, func: (item: T) => Promise, options?: number | IterationOptions | undefined): Promise; /** * Map over an iterable in parallel with concurrency control. * * @example * ;```typescript * const ids = [1, 2, 3] * for await (const result of parallelMap( * ids, * async id => { * return await fetchData(id) * }, * 4, * )) { * console.log(result) * } * ``` */ export declare function parallelMap(iterable: Iterable | AsyncIterable, func: (item: T) => Promise, options?: number | IterationOptions | undefined): AsyncIterable;