import { Function1, Predicate, Lazy } from 'fp-ts/lib/function'; import { Option } from 'fp-ts/lib/Option'; /** * Curried map on Option types. */ export declare const mapO: (f: Function1) => (x: Option) => Option; /** * Curried map on lists. */ export declare const mapL: (f: Function1) => (xs: A[]) => B[]; /** * Curried map onto es6 Promises. */ export declare const mapP: (f: Function1) => (x: Promise) => Promise; /** * Monadic bind for es6 promises. * * (They handle it internally, but this just helps keep type signatures clear) */ export declare const bindP: (f: Function1>) => (x: Promise) => Promise; /** * Given a collection of objects of the same type, merge them. Duplicate keys * will be overridden such that the right-most is favoured. */ export declare const merge: (...xs: T[]) => T; /** * Given two object create a new (shallow clone) object that combines the * properties of both. Duplicate keys will be overridden in preference of `b`. */ export declare const extend: (a: A, b: B) => A & B; /** * Bind a function to a specific context, preserving the type of the orginal * function. */ export declare const bind: (context: any, f: T) => T; /** * Debounce a lazy execution context such that it won't run until it hasn't * been called for `wait` milliseconds. */ export declare const debounce: (f: Lazy, wait?: number, context?: any) => () => void; /** * Check is a predicate evaluates to true for any elements of a list. */ export declare const anyTrue: (xs: T[], f: Predicate) => boolean; /** * Check is a predicate evaluates to true for all elements of a list. */ export declare const allTrue: (xs: T[], f: Predicate) => boolean; /** * Given a collection of elements of the same type, combine them into a map of * lists of like objects, keyed on the chosen property value. */ export declare const group: (xs: T[], prop: K) => Map; /** * Find the first element in a list that matches a predicate. */ export declare const find: (f: Predicate) => (xs: T[]) => Option; /** * Extract the value from an Option, throwing an exception if it's None. * * Can be used inside Promise chains to either get a value or reject. */ export declare const getOrThrow: (message: string) => (x: Option) => T;