UNPKG

820 BTypeScriptView Raw
1import { FindOptions } from './findoptions';
2/**
3 * Returns the a Promise containing the index of the first element in the array that satisfies the provided testing function.
4 * Otherwise, it returns a Promise with -1, indicating that no element passed the test.
5 *
6 * @export
7 * @template T The type of the elements in the source sequence.
8 * @param {AsyncIterable<T>} source An async-iterable sequence whose elements to apply the predicate to.
9 * @param {FindOptions<T>} options The options for a predicate for filtering, thisArg for binding and AbortSignal for cancellation.
10 * @returns {Promise<number>} A promise containing the index of the first element in the array that passes the test. Otherwise, -1.
11 */
12export declare function findIndex<T>(source: AsyncIterable<T>, options: FindOptions<T>): Promise<number>;