I saw in TypeScript 2.2 the option for "overloading" function by defined Interface call signatures and I spent quite a time to understand how to use it.
so after working on it and "cracking" it I thought it will be worth to post it here.
the issue I started with was, for example:
interface Func1 {
(num1: number, num2: number): number;
(str1: number, str2: string): string;
}
function F1(num1: number, num2: number): number {
return num1 + num2;
}
const f1: Func1 = F1;
console.log(f1(1, 2));
but the compiler did not pass it because the Func1 can't accept the F1 function.
I want to make overloading and I don't know what to do.
see answer below.