/** * transforms `Iterable` into `Map` and returns the result * * @param iterable - the `Iterable` object * it should yield entries like `[key: any, value: any]` * * @param init - initial `Map` to add values to * if not specified empty `Map` is taken * * @returns the `Map` of entries from the specified `Iterable` object * * @example * function* gen(): Generator> { * yield [{ key: 'foo' }, 1]; * yield [{ key: 'bar' }, 2]; * } * * // Map<[[{ key: 'foo' }, 1], [{ key: 'bar' }, 2]]> * intoMap(gen()); * * // Map<[[{ key: 'zero' }, 0], [{ key: 'foo' }, 1], [{ key: 'bar' }, 2]]> * intoMap(gen(), new Map([[{ key: 'zero' }, 0]])); */ export declare function intoMap(iterable: Iterable>, init?: Map): Map; /** * transforms `AsyncIterable` into `Map` and returns `Promise` with the result * * @param iterable - the `AsyncIterable` object * it should yield entries like `[key: any, value: any]` * * @param init - initial `Map` to add values to * if not specified empty `Map` is taken * * @returns `Promise` with the `Map` of entries from the specified `AsyncIterable` object * * @example * function* gen(): AsyncGenerator> { * yield [{ key: 'foo' }, 1]; * yield [{ key: 'bar' }, 2]; * } * * // Promise> * intoMap(gen()); * * // Promise> * intoMap(gen(), new Map([[{ key: 'zero' }, 0]])); */ export declare function intoMap(iterable: AsyncIterable>, init?: Map): Promise>; /** * service overload */ export declare function intoMap(iterable: AnyIterable>, init?: Map): Promisify>;