UNPKG

998 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: AsyncIterable<number>, options?: MathOptions<number>): Promise<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 {AsyncIterable<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: AsyncIterable<T>, options?: MathOptions<T>): Promise<number>;