I have this scenario, the file is t.ts:
interface Itest{
(event: any, ...args: any[]):any;
}
var t1: Itest = function (testparam) { return true;};
v
Since rest parameters are optional, you need to make them optional in your functions as well:
interface Itest{
(event: any, ...args: any[]):any;
}
var t1: Itest = function (testparam?) { return true;};
var t2: Itest = function (testparam?, para1?) { return true; };
var t3: Itest = function (testparam?, para1?, para2?) { return true; };
interface Itest2 {
(event: any, para1,...args: any[]): any;
}
var t4: Itest2 = function (testparam, para1) { return true; };
var t5: Itest2 = function (testparam, para1, para2?) { return true; };
This is new in TS0.9.5