You need to change the prototype:
interface Date { ConvertToDateFromTS(msg: string): Date; } Date.prototype.ConvertToDateFromTS = function(msg: string): Date {
Although it looks like you want to use the static factory method for the Date object, in which case you better do something like:
interface DateConstructor { ConvertToDateFromTS(msg: string): Date; } Date.ConvertToDateFromTS = function(msg: string): Date {
Nitzan tomer
source share