I have tried to create an extension method in TypeScript based on this discussion (https://github.com/Microsoft/TypeScript/issues/9), but I couldn't create a working one.
Here is my code,
namespace Mynamespace {
interface Date {
ConvertToDateFromTS(msg: string): Date;
}
Date.ConvertToDateFromTS(msg: string): Date {
//conversion code here
}
export class MyClass {}
}
but its not working.