UNPKG

965 BTypeScriptView Raw
1import { MathOptions } from './mathoptions';
2/**
3 * Computes the sum of a sequence of values.
4 *
5 * @export
6 * @param {AsyncIterable<number>} source A sequence of values to calculate the sum.
7 * @param {MathOptions<number>} [options] Optional options for providing a selector, thisArg and abort signal.
8 * @returns {Promise<number>} A promise containing the sum of the sequence of values.
9 */
10export declare function sum(source: Iterable<number>, options?: MathOptions<number>): number;
11/**
12 * Computes the sum of a sequence of values.
13 *
14 * @export
15 * @template T The type of values in the source sequence.
16 * @param {Iterable<T>} source A sequence of values to calculate the sum.
17 * @param {MathOptions<T>} [options] Optional options for providing a selector, thisArg and abort signal.
18 * @returns {Promise<number>} A promise containing the sum of the sequence of values.
19 */
20export declare function sum<T>(source: Iterable<T>, options?: MathOptions<T>): number;