import { IndexedPredicate } from "../types/IndexedPredicate"; /** * Returns the first element from the source iterable that satisfies an optional predicate. * * @typeParam T - Element type produced by the source iterable. * @param src - Source iterable evaluated sequentially until a match is found. * @param pred - Optional predicate receiving the current value and index; defaults to accepting every value. * @returns The first element that matches the predicate. * @throws Error - Thrown when the iterable is empty or no element satisfies `pred`. * * @example * ```ts * const value = _first(["red", "green", "blue"]); * console.log(value); // "red" * ``` * * or using the curried version: * ```ts * const value = pipeInto( * [1, 2, 3, 4], * first((n) => n > 2) * ); * console.log(value); // 3 * ``` */ export declare function _first(src: Iterable, pred?: IndexedPredicate): T; /** * Curried version of {@link _first}. */ export declare const first: (pred?: IndexedPredicate | undefined) => (src: Iterable) => T;