/** * Aggregates a sequence into a single result by iteratively combining elements. * * @typeParam T - Element type produced by the source iterable. * @typeParam TOut - Accumulator result type when a distinct seed is supplied. * @typeParam TT - Effective accumulator type when `seed` is optional. * @param src - Source iterable to be reduced. * @param aggFunc - Combiner invoked with the previous accumulator, current element, and current index. * @param seed - Optional initial accumulator; falls back to the first element when omitted. * @returns The final accumulator produced after the reducer runs over the entire sequence. * @throws {Error} If `seed` is omitted and the source iterable is empty. * @example * ```ts * const total = _reduce([1, 2, 3], (prev, curr) => prev + curr); * console.log(total); // 6 * * const product = _reduce([1, 2, 3], (prev, curr) => prev * curr, 1); * console.log(product); // 6 * ``` */ export declare function _reduce(src: Iterable, aggFunc: (prev: TOut, curr: T, idx: number) => TOut, seed: TOut): TOut; export declare function _reduce(src: Iterable, aggFunc: (prev: T, curr: T, idx: number) => T): T; /** * Curried version of {@link _reduce}. */ export declare function reduce(aggFunc: (prev: TOut, curr: T, idx: number) => TOut, seed: TOut): (source: Iterable) => TOut; export declare function reduce(aggFunc: (prev: T, curr: T, idx: number) => T): (source: Iterable) => T;