UNPKG

810 BTypeScriptView Raw
1import { OptionalFindOptions } from './findoptions';
2/**
3 * Returns a promise that represents how many elements in the specified async-iterable sequence satisfy a condition
4 * otherwise, the number of items in the sequence.
5 *
6 * @export
7 * @template T The type of elements in the source collection.
8 * @param {AsyncIterable<T>} source An async-iterable sequence that contains elements to be counted.
9 * @param {OptionalFindOptions<T>} [options] The options for a predicate for filtering, thisArg for binding and AbortSignal for cancellation.
10 * @returns {Promise<number>} The number of matching elements for the given condition if provided, otherwise
11 * the number of elements in the sequence.
12 */
13export declare function count<T>(source: AsyncIterable<T>, options?: OptionalFindOptions<T>): Promise<number>;