import type { Adapter } from "../../types"; /** * Creates a curried function that takes an input value of type T and returns an async iterable based on the provided adapter function. * * @group Adapters * @template T - The type of input value. * @template U - The type of data contained in the resulting async iterable. * @param {Adapter} adapter - The adapter function to transform the input value into an async iterable. * @returns {(input: T) => AsyncIterable} A function that takes an input value of type T and returns an AsyncIterable of U. * * @example * ```ts * const arrayAdapter: Adapter = (array) => { * let index = 0; * return { * next: () => * Promise.resolve( * index < array.length * ? { value: array[index++], done: false } * : { value: undefined, done: true } * ), * }; * }; * const iterable = withCustomAdapter(arrayAdapter)([1, 2, 3]); * * (async () => { * for await (const value of iterable) { * console.log(value); // Logs 1, 2, 3 * } * })(); * ``` */ export declare const withCustomAdapter: (adapter: Adapter) => (input: T) => import("../../types").ExtendedAsyncIterable; /** * A non-currying variant of {@link withCustomAdapter}. Takes an adapter function and returns an async iterable based on the adapter. * * @group Adapters * @template U - The type of data contained in the resulting async iterable. * @param {Adapter} adapter - The adapter function to transform the input value into an async iterable. * @returns {AsyncIterable} An AsyncIterable of U generated from the adapter function. * * @example * ```ts * const arrayAdapter: Adapter = () => { * let index = 0; * const array = [1, 2, 3]; * return { * next: () => * Promise.resolve( * index < array.length * ? { value: array[index++], done: false } * : { value: undefined, done: true } * ), * }; * }; * const iterable = customAdapter(arrayAdapter); * * (async () => { * for await (const value of iterable) { * console.log(value); // Logs 1, 2, 3 * } * })(); * ``` */ export declare const customAdapter: (adapter: Adapter) => import("../../types").ExtendedAsyncIterable;