import { Comparer } from "ts-comparer-builder"; import { IndexedSelector } from "../types/IndexedSelector"; /** * Computes the maximum value from the source iterable using an optional projection and comparer. * * @typeParam T - Element type produced by the source iterable. * @typeParam TOut - Element type produced by the selector and consumed by the comparer. * @param src - Source iterable to evaluate. * @param selector - Selector receiving each element and its index, producing the value to compare. * @param comparer - Comparer determining ordering between projected values. * @returns The greatest projected value, or `undefined` when the source is empty. * @throws Error Rethrows any error thrown by `selector` or `comparer`. * * @example * ```ts * const result = _max([3, 1, 5, 2]); * console.log(result); // 5 * ``` * * or using the curried version: * ```ts * const result = pipeInto( * [ * { value: 3 }, * { value: 7 }, * { value: 4 }, * ], * max((item) => item.value) * ); * console.log(result); // 7 * ``` */ export declare function _max(src: Iterable, selector?: IndexedSelector, comparer?: Comparer): TOut | undefined; /** * Curried version of {@link _max}. */ export declare const max: (selector?: IndexedSelector | undefined, comparer?: Comparer | undefined) => (src: Iterable) => TOut | undefined;