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