UNPKG

@reactivex/ix-esnext-esm

Version:

The Interactive Extensions for JavaScript

12 lines (11 loc) 827 B
/** * Returns the value of the first element in the sequence that satisfies the provided testing function. * Otherwise undefined is returned. * @param {Iterable<T>} source Source sequence. * @param {function(value: T, index: number): boolean} predicate Function to execute for every item in the sequence. * @param {Object} [thisArg] Object to use as this when executing callback. * @return {T | undefined} The value of the first element in the sequence that satisfies the provided testing function. * Otherwise undefined is returned. */ export declare function find<T, S extends T>(source: Iterable<T>, predicate: (value: T, index: number) => value is S, thisArg?: any): S | undefined; export declare function find<T>(source: Iterable<T>, predicate: (value: T, index: number) => boolean, thisArg?: any): T | undefined;