Anybody knows how to extend a base class in Typescript 1.7. Something like this example in JS:
String.prototype.foo = function() {
return 'Bar';
}
I found many ways to do this in older versions of Typescript, like:
interface String {
foo(): string;
}
String.prototype.foo= function() {
return 'Bar';
}
or
interface StringConstructor {
foo(): string;
}
String.foo = function() {
return 'Bar';
}
I tried many ways to do this, but I aways get error while TS is compiled!
Thank you
Felipe