I’m working on a function that accepts two other functions (fn1
and fn2
) as parameters. These functions should have the same number of arguments with the same types, but different return types.
Is there a method to ensure that both functions have identical argument types?
function myFunction(fn1: Function, fn2: (...args: any[]) => string): number {
return 0;
}