Exporting an imported interface in TypeScript : <p>I have a number of templates in different directories - I define an interface for each so I can be sure that what I am referencing in my TypeScript code will be available in the template.</p>

<p>I would like to define an interface for each of them and then collate all of the interfaces in a single file that can be imported (so I can always just import that file and auto complete will show what interfaces are available).</p>

<p>However, I'm having trouble doing this. What I currently have:</p>

<p><code>login/interface</code>:</p>

<pre><code>export interface Index {
    error: string;
    value: string;
}
</code></pre>

<p><code>interfaces.ts</code>:</p>

<pre><code>import * as login from './login/interface';
export let View = {
    Login: login
};
</code></pre>

<p><code>login.ts</code>:</p>

<pre><code>import * as I from './interface';
...
let viewOutput: I.View.Login.Index = {
   ...
};
</code></pre>

<p>Results in:</p>

<blockquote>
  <p>error TS2694: Namespace '"...interface"' has no exported member 'View'.</p>
</blockquote>

<p>However, if I try to access <code>I.View.Login.Index</code> as a simple variable then I get:</p>

<blockquote>
  <p>Property 'Index' does not exist on type 'typeof "...interface"'.</p>
</blockquote>

<p>Which seems correct since the interface is not really a type, but it has been able to access <code>I.View.Login</code> to get that far.</p>

<p>I don't understand what I'm doing wrong or missing here I'm afraid. Any help would be greatly appreciated!</p>
