ramda-generators
Version:
A collection of lazily evaluated generators and functions to work with generators in Javascript and Typescript, following the style of Ramda's functions
9 lines (8 loc) • 384 B
TypeScript
import { GEN } from "./utils";
declare type Find<TYPE extends "sync" | "async"> = {
<T>(cond: (el: T) => boolean, list: GEN<TYPE, T>): TYPE extends "sync" ? T : Promise<T>;
<T>(cond: (el: T) => boolean): (list: GEN<TYPE, T>) => TYPE extends "sync" ? T : Promise<T>;
};
export declare const find: Find<"sync">;
export declare const findAsync: Find<"async">;
export {};