import type { IsomorphicIterable, Unary } from "@vangware/types"; import type { ReadOnlyAsyncIterable } from "./types/ReadOnlyAsyncIterable.js"; import type { ReadOnlyAsyncIterableIterator } from "./types/ReadOnlyAsyncIterableIterator.js"; import type { ReadOnlyIterableIterator } from "./types/ReadOnlyIterableIterator.js"; /** * Map for iterables and asynchronous iterables. * * @category Generators * @example * ``` * const double = value => value * 2; * const mapDouble = map(double); * * mapDouble([1, 2, 3]); // [2, 4, 6] * ``` * @param mapper Mapper function. * @returns Generator function with `mapper` function set in context. */ export declare const map: ( mapper: Unary, ) => >( iterable: Iterable_1, ) => Iterable_1 extends { readonly [Symbol.asyncIterator]: () => AsyncIterator; } ? { readonly [Symbol.asyncIterator]: () => AsyncIterableIterator; readonly next: ( ...args: [] | [undefined] ) => Promise>; readonly return?: | ((value?: any) => Promise>) | undefined; readonly throw?: | ((e?: any) => Promise>) | undefined; } : { readonly [Symbol.iterator]: () => IterableIterator; readonly next: ( ...args: [] | [undefined] ) => IteratorResult; readonly return?: | ((value?: any) => IteratorResult) | undefined; readonly throw?: | ((e?: any) => IteratorResult) | undefined; };