Repository URL to install this package:
|
Version:
5.0.0-1 ▾
|
vending-agent-dep
/
usr
/
local
/
lib
/
vending
/
agent
/
node_modules
/
native-promise-util
/
dist
/
each.d.ts
|
|---|
import { IterateFunction, Resolvable } from './types';
export interface EachExecutionOptions {
inflight?: number;
}
/**
* Returns a promise that returns an array of resolved values from `input` iterable.
* Each resolved value are passed to `iterator` function in series for execution.
*
* *The `input` iterable is not modified.*
*
* @param input Iterable of resolvable values to pass to `iterator` function.
* @param iterator A function which will be executed on the resolved value from `input` iterable.
*/
export declare function each<T>(input: Resolvable<Iterable<Resolvable<T>>>, iterator: IterateFunction<T, void>): Promise<T[]>;
/**
* Returns a promise that returns an array of resolved values from `input` iterable.
* Each resolved value are passed to `iterator` function in series for async execution
* with a maximum number of `options.inflight` async execution limit.
*
* *The `input` iterable is not modified.*
*
* @param input Iterable of resolvable values to pass to `iterator` function.
* @param iterator A function which will be executed on the resolved value from `input` iterable.
* @param options.inflight Maximum number of inflight limit that can be executed at the same time. Default is `1`.
*/
export declare function each<T>(input: Resolvable<Iterable<Resolvable<T>>>, iterator: IterateFunction<T, void>, options: EachExecutionOptions): Promise<T[]>;