how to include a prototype in typescript : <p>I am learning angular 2 and I have written a ts definition for a truncate method I want to use in one of my services.</p>

<p>truncate.ts</p>

<pre><code>interface String {
    truncate(max: number, decorator: string): string;
}

String.prototype.truncate = function(max, decorator){
   decorator = decorator || '...';
   return (this.length &gt; max ? this.substring(0,max)+decorator : this);
};
</code></pre>

<p>How do I import this into another typescript module or at least make it available to use globally. </p>
