title: Create typings for module bundle
body: <p>I'm a bit wondering, why nobody else had this problem or maybe I just don't use the right words to describe it. The problem is, that I have a module that I publish to npm that has to versions. One can be loaded through system-js and use directly from npm, the other version is a selfexecuting bundle that I create with system-js-builder.</p>
  
  <p>Let's asume the module is called <em>@company/foo</em>
  I have a index.ts in the root folder, that simply exports everything from src, where I also have an index.ts where all submodules are exported.
  So the index.ts looks like this.</p>
  
  <pre><code>export * from "./src/";
  </code></pre>
  
  <p>And in my modules I want to use it I can simply use the following.</p>
  
  <pre><code>import { bar } from "@company/foo";
  </code></pre>
  
  <p>So far so easy. No I create a self executing bundle from my index and give it the global name <em>foo</em> so I would be able to call <em>foo.bar()</em> if I add the script into a page or concatenate with others. This also works great. But now I have the problem, that I have no idea how to create typings for this bundle. My idea was to do something like</p>
  
  <pre><code>declare namespace foo {
      export * from "./src/";
  }
  </code></pre>
  
  <p>which I thought describes very well what the bundling does. But typescript doesn't like this. I also tried something with modules but nothing works. How can I describe the fact, that what is exported from my src barrel is prefixed with the namespace foo?</p>
  
  <p>I hope it's clear what I want to achieve.</p>