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