I have created following interface for function overloading
interface IRequestObservableDelegate {
(url: string | Request, options?: RequestOptionsArgs): Observable<Response>;
(url: string | Request, body?: string, options?: RequestOptionsArgs): Observable<Response>;
}
My Idea is to pass a function of type above interface to another function
function DoSomething(cb:IRequestObservableDelegate,someCondition:boolean):void;
Following code works
const f1 = (u,o) => obsrevable; // dummy function
DoSomething(f1,somecond);
But this does not work
const f2 = (u,b,o) => obsrevable; // dummy function
DoSomething(f2,somecond);
Any Idea how to define overloaded function type