import { Paths, Prop, ObjBase } from '../typings/types'; interface PathApply { , R>(path: [K], fn: ObjBase, obj: O): R; (path: [K], fn: ObjBase): (obj: any) => R; (path: [K]): { , R>(fn: ObjBase, obj: O): R; (fn: ObjBase): (obj: any) => R; }; (path: Paths, fn: ObjBase, obj: any): R; (path: Paths, fn: ObjBase): (obj: any) => R; (path: Paths): { (fn: ObjBase, obj: any): R; (fn: ObjBase): (obj: any) => R; }; } /** * Returns the result of `fn` with given value at `path`. * * @param {[String]} paths The path to use. * @param {Function} fn function to apply * @param {Object} obj The object to retrieve the nested property from. * @return {*} result of calling fn with nested property. * * @example * * pathApply(['a', 'b'], x => 'is ' + x, {a: {b: 2}}); //=> is 2 * pathApply(['a', 'b'], x => x > 0, {a: {b: 2}}); //=> true */ declare const _default: PathApply; export default _default;