/** * Aggregates a sequence from right to left 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 counted from the right. * @param seed - Optional initial accumulator; falls back to the rightmost element when omitted. * @returns The final accumulator after iterating from the last element to the first. * @throws {Error} If `seed` is omitted and the source iterable is empty. * @example * ```ts * const diff = _reduceRight([1, 2, 3], (prev, curr) => prev - curr); * console.log(diff); // 0 => ((3 - 2) - 1) * * const total = _reduceRight([1, 2, 3], (prev, curr) => prev + curr, 0); * console.log(total); // 6 * ``` */ export declare function _reduceRight(src: Iterable, aggFunc: (prev: TOut, curr: T, idx: number) => TOut, seed: TOut): TOut; export declare function _reduceRight(src: Iterable, aggFunc: (prev: T, curr: T, idx: number) => T): T; /** * Curried version of {@link _reduceRight}. */ export declare function reduceRight(aggFunc: (prev: TOut, curr: T, idx: number) => TOut, seed: TOut): (source: Iterable) => TOut; export declare function reduceRight(aggFunc: (prev: T, curr: T, idx: number) => T): (source: Iterable) => T;