UNPKG

625 BTypeScriptView Raw
1import { OptionalFindOptions } from './findoptions';
2/**
3 * Returns the first element of an async-iterable sequence that matches the predicate if provided, or undefined if no such element exists.
4 *
5 * @export
6 * @template T The type of the elements in the source sequence.
7 * @param {AsyncIterable<T>} source Source async-enumerable sequence.
8 * @returns {(Promise<S | undefined>)} A Promise containing the first element in the async-iterable sequence,
9 * or a default value if no such element exists.
10 */
11export declare function first<T>(source: AsyncIterable<T>, options?: OptionalFindOptions<T>): Promise<T | undefined>;