//#region src/fp/iterator/flatMap.d.ts /** * Creates a function that lazily maps each element of an iterator to an iterable * (or iterator) and flattens the results one level, for use with {@link pipe}. * It delegates to the native `Iterator.prototype.flatMap`. * * @template T - The type of elements produced by the source iterator. * @template U - The type of elements produced by the result. * @param callback - Called with `(value, index)`; returns the iterable to flatten in. * @returns A function mapping an `Iterator` to a lazy `IteratorObject`. * * @example * import { pipe } from 'es-toolkit/fp'; * import { flatMap } from 'es-toolkit/fp/iterator'; * * pipe([1, 2].values(), flatMap(x => [x, x * 10])).toArray(); // => [1, 10, 2, 20] */ declare function flatMap(callback: (value: T, index: number) => Iterator | Iterable): (source: Iterator) => IteratorObject; //#endregion export { flatMap };