import type { IsomorphicIterable, Predicate, Single, Unary, } from "@vangware/types"; import type { GeneratorOutput } from "./types/GeneratorOutput.js"; /** * Filters items in an iterable or asynchronous iterable against a predicate and * returns items that evaluated to `true`. * * @category Generators * @example * ``` * const filterEven = filter((number: number) => number % 2 === 0); * * iterableToArray(filterEven([1, 2, 3, 4])); // [2, 4] * iterableToArray(filterEven([1, 3, 5, 7])); // [] * ``` * @param predicate Predicate function to evaluate each item. * @returns Curried function with `predicate` set in context. */ export declare const filter: ( predicate: Single extends Single ? Unary : Predicate, ) => >( iterable: Iterable_1, ) => GeneratorOutput;