StringConstructor
is working in Typescript 1.8:
interface StringConstructor {
trim(msg: string): string;
}
String.trim = function (msg: string) {
if (msg)
return msg.trim();
return msg;
}
String.trim("Url)
but not working in Typescript 2 and I get the error:
Property 'trim' does not exist on type 'StringConstructor'.