import { IndexedSelector } from "../types/IndexedSelector"; /** * Maps each element to an iterable and yields every item from the flattened results in source order. * * @typeParam T - Element type produced by the source iterable. * @typeParam TOut - Element type emitted by the projected iterables. * @param src - Source iterable enumerated to supply values to `selector`. * @param selector - Projection invoked with the current value and index to produce an iterable of results. * @returns A deferred iterable yielding items from each projected iterable sequentially. * * @example * ```ts * const values = [..._flatMap([1, 2], (n) => [n, n * 10])]; * console.log(values); // [1, 10, 2, 20] * ``` * * or using the curried version: * ```ts * const values = pipeInto( * ["a", "b"], * flatMap((value, index) => [`${value}${index}`, `${value.toUpperCase()}${index}`]) * ); * console.log([...values]); // ["a0", "A0", "b1", "B1"] * ``` */ export declare function _flatMap(src: Iterable, selector: IndexedSelector>): Iterable; /** * Curried version of {@link _flatMap}. */ export declare const flatMap: (selector: IndexedSelector>) => (src: Iterable) => Iterable;