/** * @short * *Find* a value according to some criteria. * * @categories * static * * @description * Check each value yielded from the iterator against the provided condition. * The first value which happens to satisfy the condition is returned. If the * iterator completes before reaching such value, `undefined` is returned. * * If the provided condition is a type guard, the value of the result will be * scoped accordingly. * * If you expect to find a value, you can use {@link FindOrThrow}. To get * index of the value instead the value itself, check out {@link FindIndex} or * {@link FindIndexOrThrow}. To find multiple yielded values, use operator * {@link filter}. * * @operator * condition * (t: T, i: number) => boolean * The criteria used to find a value. A type guard is accepted as well. * * @returns * T | undefined * * @example * j.Find( * [1, 2, 3, 4], * x => x == 2, * ) * // => 2 * * @example * j.Find( * [1, 2, 3, 4], * x => x == 6, * ) * // => undefined * * @example * j.pipe( * [-2, -1, 0, 1, 2, 3], * j.andFinally(j.Find, x => x > 0), * ) * // => 1 */ export declare function Find(iterable: Iterable, guard: (t: T, i: number) => t is V): V | undefined; export declare function Find(iterable: Iterable, condition: (t: T, i: number) => boolean): T | undefined;