export type ArrayIterator = (x: T, index: any, collection: T[]) => U; export type RecordIterator = (x: T, prop: string, inputObj: Record) => U; import { Unpack } from './common'; /** * Takes a function and a functor, applies the function to each of the functor's values, and returns a functor of the same shape. * It works for both Arrays and Objects. * * @example * ```typescript * const double = x => x * 2; * * map(double, [1, 2, 3]); //=> [2, 4, 6] * * map(double, {x: 1, y: 2, z: 3}); //=> {x: 2, y: 4, z: 6} * ``` * * @param fn Map function to apply * @param iterable collection to iterate */ export declare function map | Record, Input = Unpack>(mapFunction: Iterable extends Array ? ArrayIterator : RecordIterator): (collection: Iterable) => Iterable extends Array ? Array : Record; export declare function map | Record, Input = Unpack>(mapFunction: Iterable extends Array ? ArrayIterator : RecordIterator, collection: Iterable): Iterable extends Array ? Array : Record; //# sourceMappingURL=map.d.ts.map