/** @module flow.ts */ import { Function1, Function2, FunctionV, Predicate } from './helper-types'; export declare function when(pred: Function1, whenTrueFn: Function1, input: A): A | B; export declare function when(pred: Function1, whenTrueFn: Function1): (input: A) => A | B; export declare function when(pred: Function1): (whenTrueFn: Function1) => (input: A2) => A2 | B; export declare function times(callback: Function1, repeat: number): A[]; export declare function times(callback: Function1): (repeat: number) => A[]; export declare function times_(repeat: number, callback: Function1): A[]; export declare function times_(repeat: number): (callback: Function1) => A[]; export declare function timesWithRepeat(callback: Function2, repeat: number): A[]; export declare function timesWithRepeat(callback: Function2): (repeat: number) => A[]; export declare function timesWithRepeat_(repeat: number, callback: Function2): A[]; export declare function timesWithRepeat_(repeat: number): (callback: Function2) => A[]; /** * Alias to for `times` * :: ( fn -> a ) -> n -> a[] */ export declare const loop: typeof times; export declare function tryCatch(failCallback: Function1, testCallback: FunctionV<(null | undefined), A>): A; export declare function tryCatch(failCallback: Function1): (testCallback: FunctionV<(null | undefined), A>) => A; export declare function tryCatchWithParams(failCallback: Function1, testCallback: FunctionV): (...args: B[]) => A; export declare function tryCatchWithParams(failCallback: Function1): (testCallback: FunctionV) => (...args: B[]) => A; /** * Takes a value v, a glob of predicates, and a test a parameter "a", returns true if any predicate given "a" matches "v" * :: v -> ...((a) -> bool) -> a -> bool */ export declare const logical: (value: boolean) => (...fns: Predicate[]) => (x: A) => boolean; /** * Takes a glob of predicates "p" taking a value "a", then a value "a" and returns true if any of "p" given "a" is true * :: v -> ...((a) -> bool) -> a -> bool */ export declare const either: (...fns: Predicate[]) => (x: A) => boolean; /** * Takes a glob of predicates "p" taking a value "a", then a value "a" and returns true if all of "p" given "a" is true * :: v -> ...((a) -> bool) -> a -> bool */ export declare const and: (...fns: Predicate[]) => (...args: A[]) => boolean; export declare function ifElse(p: Function1, t: Function1, f: Function1, i: A): B; export declare function ifElse(p: Function1, t: Function1, f: Function1): (i: A) => B; export declare function ifElse(p: Function1): (t: Function1) => (f: Function1) => (i: A3) => B2; export declare function gt(a: number): (b: number) => boolean; export declare function gt(a: number, b: number): boolean; export declare function gte(a: number): (b: number) => boolean; export declare function gte(a: number, b: number): boolean; export declare function lt(a: number): (b: number) => boolean; export declare function lt(a: number, b: number): boolean; export declare function lte(a: number): (b: number) => boolean; export declare function lte(a: number, b: number): boolean; export declare function eq(a: T): (b: T) => boolean; export declare function eq(a: T, b: T): boolean; export declare function untypedEq(a: any): (b: any) => boolean; export declare function untypedEq(a: any, b: any): boolean;