export type Results = T[] & { first: T; _firstFlag: boolean; }; export type SimpleCallback = () => any; export interface AsyncParallelIteratorCallback { (err?: E | null, value?: T): void; } export interface AsyncParallelIterator { (item: T, callback: AsyncParallelIteratorCallback): void; } export interface AsyncIterator { (item: T, callback: ErrorCallback): void; } export interface ErrorCallback { (err?: T | null): void; } export type AsyncParallelCallback = (finishedNum: number, values: Results, errors: Results, done: SimpleCallback) => any; export declare function each(targets: T[], handler: AsyncIterator, cb?: ErrorCallback): void;