i'm trying to type a helper function that takes in an object of functions and wrap it in another fn;
const bindFn = (obj, wrapFn) => Object.entries(obj).reduce((carry, [key, fn])=>{
carry[key] = ( ...args ) => wrapFn(fn.apply(null, args))
return carry;
},{})
// example of usage
const n = bindFn( { sum: (x) => x+1 }, console.log);
n.sum(3); // this should console.log 4
problem is i have no clue how to type bindFn to return proper type that contains an object with same keys and return types of supplied object. something like
interface BindFn = {
[name: keysof obj] : () => Returntype<obj[name]> :D !!! no clue.
}

