import { IndexedPredicate } from "../types/IndexedPredicate"; /** * Returns the last element of the source iterable that satisfies the optional predicate, or `undefined` when none match. * * @typeParam T - Element type produced by the source iterable. * @param src - Source iterable to enumerate. * @param pred - Predicate receiving each element and its index; the most recent truthy match is returned. * @returns The last matching element, or `undefined` when no match exists. * @throws Error Rethrows any error thrown by `pred`. * * @example * ```ts * const result = _lastOrDefault([1, 2, 3, 4], (value) => value > 4); * console.log(result); // undefined * ``` * * or using the curried version: * ```ts * const result = pipeInto( * [1, 2, 3, 4], * lastOrDefault((value) => value % 2 === 0) * ); * console.log(result); // 4 * ``` */ export declare function _lastOrDefault(src: Iterable, pred?: IndexedPredicate): T | undefined; /** * Curried version of {@link _lastOrDefault}. */ export declare const lastOrDefault: (pred?: IndexedPredicate | undefined) => (src: Iterable) => T | undefined;