how to promote a module to global in typescript?
<p>I have a library contained in a module that I use very often, so I want to promote it as "global" and use without requiring it.</p>

<p>In pure JavaScript it's easy as </p>

<pre><code>window.mylib = require("mylib")
</code></pre>

<p>but I'm finding it difficult to do in TypeScript because apparently you can't mix "module" and "ambient" code. So this doesn't work:</p>

<pre><code>import MyLib = require("mylib"); 
window.mylib = MyLib;  
interface Window {
    mylib: mylib;
}
</code></pre>

<p>because the Window interface is augmented only for one file.</p>

<p>Is there a way to do that (that doesn't include generating a custom  mylib.d.ts) ?</p>