title: Is it possible to export * as foo in typescript
body: <p>I can:</p>
  
  <pre><code>import * as foo from './foo'
  </code></pre>
  
  <p>But can't seem to export the same:</p>
  
  <pre><code>export * as foo from './foo'
  </code></pre>
  
  <p>This doesn't seem to work either...:</p>
  
  <pre><code>import * as fooImport from './foo';
  export const foo = fooImport;
  </code></pre>
  
  <p>Any ideas?</p>
  
  <p>--- UPDATE ---</p>
  
  <blockquote>
    <p>What are you trying to achieve?</p>
  </blockquote>
  
  <p>Basically, I am working on implementing an <code>ngrx/store</code> backend for my app.  I want to organize my code like this:</p>
  
  <pre><code>app/core/
    index.ts
    viewer/
      index.ts
      viewer-actions.ts
      viewer-reducer.ts
    view-data/
      index.ts
      view-data-actions.ts
      view-data-reducer.ts
  </code></pre>
  
  <p>And I want to use my <code>index.ts</code> files to chain up all the exports from each subset (common paradigm).  </p>
  
  <p>However, I want to keep things <em>namespaced</em>.  Each of my <code>xxx-reducer.ts</code> and <code>xxx-actions.ts</code> files have exports of the same name (<code>reducer</code>, <code>ActionTypes</code>, <code>Actions</code>, ...) so normal chaining would result in a name collision.  What I am trying to do is allow for all of the exports from <code>xxx-actions</code> and <code>xxx-reducer</code> to be <em>re-exported</em> as <code>xxx</code>.  This would allow me to:</p>
  
  <pre><code>import { viewer, viewerData } from './core';
  
  ...
      private viewer: Observable&lt;viewer.Viewer&gt;;
      private viewData: Observable&lt;viewData.ViewData&gt;;
  
      ngOnInit() {
          this.viewer = this.store.let(viewer.getViewer());
          this.viewData = this.store.let(viewData.getViewData());
      }
  </code></pre>
  
  <p>Instead of the more verbose:</p>
  
  <pre><code>import * as viewer from './core/viewer';
  import * as viewerData from './core/viewer-data';
  
  ...
  </code></pre>
  
  <p>Thats the gist anyway...</p>