import { Pred1 } from '../typings/types'; interface When { (pred: Pred1, whenTrueFn: (a: T) => U, x: T): U | T; (pred: Pred1, whenTrueFn: (a: T) => U): (x: T) => U | T; (pred: Pred1): { (whenTrueFn: (a: T) => U, x: T): U | T; (whenTrueFn: (a: T) => U): (x: T) => U | T; }; } /** * Tests the final argument by passing it to the given predicate function. If * the predicate is satisfied, the function will return the result of calling * the `onTrue` function with the same argument. If the predicate is not * satisfied, the argument is returned as is. * * @param {Function} pred A predicate function * @param {Function} onTrue A function to invoke when the `condition` evaluates to a truthy value. * @param {*} x An object to test with the `pred` function and pass to `onTrue` if necessary. * @return {*} Either `x` or the result of applying `x` to `onTrue`. * @example * * // truncate :: String -> String * var truncate = R.when( * x => x.length > 10, * x => x.slice(0, 10) + '...' * ); * truncate('12345'); //=> '12345' * truncate('0123456789ABC'); //=> '0123456789…' */ declare const _default: When; export default _default;