/** Creates a pipeline. `funcs` are composed left to right ```js const addTwoAndDouble = Pipe(add(2), multiply(2)); addTwoAndDouble(1); // 6 [1, 2].map(addTwoAndDouble); // [6, 8] ``` */ export declare const Pipe: (...funcs: any[]) => (value: any) => any; /** Negates the result of a `predicate` ```js const isNotString = not(isString); isString("hello"); // true isNotString("hello"); // false ``` */ export declare const not: (predicate: any) => (...args: any[]) => boolean; /** Safely access properties of objects and arrays (like `lodash.get`). ```js const person = { name: { last: "a" } }; get("name.last")(person); // "a" get("name.first", "b")(person); // "b" get("[1]")([1, 2]); // 2 ``` */ export declare const get: (path: string, defaultValue?: any) => (obj: any) => any; /** Logs `v` to the console and returns `v`. ```js Pipe( add(2), trace("after add:"), // logs "after add: 3" to the console multiply(2), trace("after multiply:") // Logs "after multilpy: 6" to the console )(1); ``` */ export declare const trace: (label?: string) => (v: any) => any; /** Takes any number of pairs of `[predicate, mapper]`. When a match is found for `x`, returns the result of the associated mapper applied to `x`. `otherwise` can be used as a fallback pattern (must be the last pattern). ```js const matcher = match( [isEven, x => `${x} is even!`], [isOdd, x => `${x} is odd!`], [otherwise, x => `${x} is not a number :/`] ); matcher(1); // "1 is odd!" matcher(2); // "2 is even!" matcher("a"); // "a is not a number :/" ``` If you use `match` recursively you'll get a maximum call stack exceeded error. To avoid this, execute `match` with a value explicitly if you need recursion: ```js // This will always create a maximum call stack exceeded error const badMatch = match([somePredicate, badMatch], [otherwise, n => n]); // This won't const goodMatch = value => match([somePredicate, goodMatch], [otherwise, n => n])(value); ``` */ export declare const match: (...patterns: [(v: any) => boolean, (v: any) => any][]) => (x: any) => any; export declare const otherwise: () => boolean;