Let's say I want to add the following prototype to the String class.
String.prototype.beginsWith = function (string) {
return(this.indexOf(string) === 0);
};
I need to add beginWith to lib.d.ts otherwise it won't complile:
declare var String: {
new (value?: any): String;
(value?: any): string;
prototype: String;
fromCharCode(...codes: number[]): string;
//Here
}
The file is locked and I can't edit it.
I release I can just declare var String: any before the call but can I have it built in?