let’s say you have a date_ext.js with functions:
Date.prototype.getMyBlaDate = function() {
return // bla bla
};
Date.minutesBetween = function (date1, date2) {
return // obladi-oblada
}
You don’t want to convert entire file into typescript but you still can use the methods from it.
Let’s create a definition for typescript
interface Date{
getMyBlaDate():BlaBlaType;
minutesBetween(date1:Date, date2:Date):ObladiType;
}
it will work for prototyped method but not for the static one.
How do you define static method?
From looking at
lib.d.tsis appears you would use:UPDATE
Looks like it’s not currently supported; see http://typescript.codeplex.com/discussions/403971