import type { IsomorphicIterable } from "@vangware/types"; import type { ReadOnlyAsyncIterable } from "./types/ReadOnlyAsyncIterable.js"; import type { ReadOnlyAsyncIterableIterator } from "./types/ReadOnlyAsyncIterableIterator.js"; import type { ReadOnlyIterableIterator } from "./types/ReadOnlyIterableIterator.js"; /** * Flattens one level of the given iterable or asynchronous iterable. * * @category Generators * @example * ```typescript * flat([1, 2, [3, 4]]); // [1, 2, 3, 4] * ``` * @param iterable Iterable to flatten. * @returns Iterable with flatten items. */ export declare const flat: ( iterable: Iterable_1, ) => Iterable_1 extends IsomorphicIterable ? Item extends IsomorphicIterable ? Item extends { readonly [Symbol.asyncIterator]: () => AsyncIterator< SubItem, any, undefined >; } ? { 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; } : Iterable_1 extends { readonly [Symbol.asyncIterator]: () => AsyncIterator< Item, any, undefined >; } ? { 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; } : never;