/** * Transformation spec where each value is either a function or nested spec. */ export type Evolver = { [K in keyof T]?: T[K] extends object ? Evolver | ((value: T[K]) => T[K]) : (value: T[K]) => T[K]; }; /** * Recursively transforms an object by applying transformation functions * from a spec object to corresponding properties. Ramda-style evolve. * * @param transformations - Object with transformation functions matching the shape of obj * @param obj - Input object to transform * @returns New object with transformed values * * @example * const spec = { * name: s => s.toUpperCase(), * data: { * count: n => n + 1, * }, * }; * evolveHot(spec, { name: 'foo', data: { count: 5 }, other: true }); * // => { name: 'FOO', data: { count: 6 }, other: true } */ export declare function evolveHot(transformations: Evolver, obj: T): T; //# sourceMappingURL=evolve.d.ts.map