UNPKG

ix

Version:

The Interactive Extensions for JavaScript

15 lines (14 loc) 978 B
import { ReduceOptions } from './reduceoptions.js'; /** * Applies an accumulator function over an iterable sequence from the right, returning the result of the aggregation as a * single element in the result sequence. The seed value, if specified, is used as the initial accumulator value. * For aggregation behavior with incremental intermediate results, scan. * * @template T The type of the elements in the source sequence. * @template R The type of the result of the aggregation. * @param {Iterable<T>} source An iterable sequence to aggregate over. * @param {ReduceOptions<T, R>} options The options which contains a callback and optional seed. * @returns {R} The final accumulator value calculated from the right. */ export declare function reduceRight<T, R = T>(source: Iterable<T>, options: ReduceOptions<T, R>): R; export declare function reduceRight<T, R = T>(source: Iterable<T>, accumulator: (accumulator: R, current: T, index: number) => R, seed?: R): R;