iter-tools
Version:
The iterable toolbox
6 lines • 780 B
TypeScript
import { AsyncWrappable } from '../../types/async-iterable';
declare function asyncFindBestOr<N, T>(notFoundValue: N, comparer: (best: T, value: T) => boolean): (iterable: AsyncWrappable<T>) => Promise<T | N>;
declare function asyncFindBestOr<N, T>(notFoundValue: N, comparer: (best: T, value: T) => boolean, iterable: AsyncWrappable<T>): Promise<T | N>;
declare function asyncFindBestOr<N, T, S>(notFoundValue: N, comparer: (best: S, value: S) => boolean, mapper: (value: T, i: number) => S | Promise<S>): (iterable: AsyncWrappable<T>) => Promise<T | N>;
declare function asyncFindBestOr<N, T, S>(notFoundValue: N, comparer: (best: S, value: S) => boolean, mapper: (value: T, i: number) => S | Promise<S>, iterable: AsyncWrappable<T>): Promise<T | N>;
export { asyncFindBestOr };