import { Mapper } from 'augmentative-iterable'; import { Reducer } from '../base'; export interface ToMapFunction { /** * Create a Map from the iterable. This is a resolving operation * @typeparam K The type of the data the element equality is based on. * @param getKey The projection to use to determine element equality. It serves as key of the resulting Map. * @param mapper: Maps the first iterated item to the Map value type * @param reduceValue reduce the following items to the map value type. If not informed, assumes only the first value * @returns The [[FluentIterable]] of the distinct elements. */ (getKey: Mapper, mapper: Mapper, reduceValue?: Reducer): Map; /** * Create a Map from the iterable. This is a resolving operation * @typeparam K The type of the data the element equality is based on. * @param getKey The key of T for element equality. It serves as key of the resulting Map. * @param mapper: Maps the first iterated item to the Map value type * @param reduceValue reduce the following items to the map value type. If not informed, assumes only the first value * @returns The [[FluentIterable]] of the distinct elements. */ (getKey: K, mapper: Mapper, reduceValue?: Reducer): Map; /** * Create a Map from the iterable. This is a resolving operation * @typeparam K The type of the data the element equality is based on. * @param getKey The key of T for element equality. It serves as key of the resulting Map. * @param getValue: The key to be used as value * @param reduceValue reduce the following items to the map value type. If not informed, assumes only the first value * @returns The [[FluentIterable]] of the distinct elements. */ (getKey: K, mapper: V, reduceValue?: Reducer): Map; } export interface AsyncToMapFunction { /** * Create a Map from the iterable. This is a resolving operation * @typeparam K The type of the data the element equality is based on. * @param getKey The projection to use to determine element equality. It serves as key of the resulting Map. * @param mapper: Maps the first iterated item to the Map value type * @param reduceValue reduce the following items to the map value type. If not informed, assumes only the first value * @returns The [[FluentIterable]] of the distinct elements. */ (getKey: Mapper, mapper: Mapper, reduceValue: Reducer): Promise>; /** * Create a Map from the iterable. This is a resolving operation * @typeparam K The type of the data the element equality is based on. * @param getKey The key of T for element equality. It serves as key of the resulting Map. * @param mapper: Maps the first iterated item to the Map value type * @param reduceValue reduce the following items to the map value type. If not informed, assumes only the first value * @returns The [[FluentIterable]] of the distinct elements. */ (getKey: K, mapper: Mapper, reduceValue: Reducer): Promise>; /** * Create a Map from the iterable. This is a resolving operation * @typeparam K The type of the data the element equality is based on. * @param getKey The key of T for element equality. It serves as key of the resulting Map. * @param getValue: The key to be used as value * @param reduceValue reduce the following items to the map value type. If not informed, assumes only the first value * @returns The [[FluentIterable]] of the distinct elements. */ (getKey: K, mapper: V, reduceValue?: Reducer): Promise>; }