import { IndexedPredicate } from "../types/IndexedPredicate"; /** * Returns the unique element that satisfies the optional predicate, or `undefined` when no match is found. * * @typeParam T - Element type produced by the source iterable. * @param src - Source iterable to evaluate. * @param pred - Predicate receiving each element and its index; the matching element must be unique when provided. * @returns The sole element accepted by `pred`, or `undefined` when no element matches. * @throws Error Thrown when more than one element satisfies `pred`. * @throws Error Rethrows any error thrown by `pred`. * * @example * ```ts * const value = _singleOrDefault([1, 2, 3], (item) => item > 3); * console.log(value); // undefined * ``` * * or using the curried version: * ```ts * const value = pipeInto( * [1, 2, 3], * singleOrDefault((item) => item > 3) * ); * console.log(value); // undefined * ``` */ export declare function _singleOrDefault(src: Iterable, pred?: IndexedPredicate): T | undefined; /** * Curried version of {@link _singleOrDefault}. */ export declare const singleOrDefault: (pred?: IndexedPredicate | undefined) => (src: Iterable) => T | undefined;