Using an import statement breaks other class references?
<p>As a followup to <a href="https://stackoverflow.com/questions/39112501/how-do-you-use-typescript-typings-that-are-modules/39118144">my previous question</a> about using the <code>bowser</code> DefinitelyTyped definition file specifically, I implemented the <code>import</code> statement as directed by the answer in that question and got further. However now the TypeScript compiler is complaining about code that compiled perfectly fine before all the bowser import nonsense.</p>

<p>Let's say I have MyBowserClass.ts:</p>

<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-js lang-js prettyprint-override"><code>import bowser = require('bowser');

namespace MyNamespace {
    export class MyBowserClass {
        constructor() {
            var isIos = (typeof bowser.ios === 'undefined') ? false : bowser.ios;
            alert(isIos);

            var myInstance = new MyNamespaceTwo.MyOtherClass(); // typescript compiler complains: Property 'MyOtherClass' does not exist on type 'typeof MyNamespaceTwo'.
        }
    }
}</code></pre>
</div>
</div>
</p>

<p>And then I have MyOtherClass.ts:</p>

<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-js lang-js prettyprint-override"><code>namespace MyNamespaceTwo {
    export class MyOtherClass {
        constructor() {
            alert('otherclass ctor');
        }
    }
}</code></pre>
</div>
</div>
</p>

<p>The compiler is giving me an error here:</p>

<p><code>var myInstance = new MyNamespaceTwo.MyOtherClass();</code></p>

<p>saying <code>Property 'MyOtherClass' does not exist on type 'typeof MyNamespaceTwo'.</code></p>

<p>So I guess maybe this means I need to also import <code>MyOtherClass</code>?</p>

<p>I got this to work by updating my two files:</p>

<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-js lang-js prettyprint-override"><code>import bowser = require('bowser');
import otherClass = require('MyOtherClass'); // NEW IMPORT

namespace MyNamespace {
    export class MyBowserClass {
        constructor() {
            var isIos = (typeof bowser.ios === 'undefined') ? false : bowser.ios;
            alert(isIos);

            var myInstance = new otherClass.MyNamespaceTwo.MyOtherClass(); // changed this to prefix with 'otherClass'
        }
    }
}</code></pre>
</div>
</div>
</p>

<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-js lang-js prettyprint-override"><code>export namespace MyNamespaceTwo { // made this EXPORT
    export class MyOtherClass {
        constructor() {
            alert('otherclass ctor');
        }
    }
}</code></pre>
</div>
</div>
</p>

<p>This seems like total chaos/craziness. What am I missing here? Why should the <code>bowser</code> definition file be a module anyway (when it consists of a global/essentially static method name??) Any guidance/help would be appreciated.</p>