title: Extending modules with a different name
body: <p>We are in the process of converting some of our javascript to be typescript.  We have some existing functionality that we have pulled out into another javascript library that is maintained by us, for example:</p>
  
  <pre><code>Framework.utils = {
      utilFnOne: function ()...,
      utilFnTwo: function ()...,
      utilFnThree: function ()...,
  }
  </code></pre>
  
  <p>We also have some utilities that we use in our non framework code that is like this:</p>
  
  <pre><code>Current.utils = Framework.utils;  // Extend the framework's utils
  Current.utils.utilFnFour = function()...;
  Current.utils.utilFnFive = function()...;
  </code></pre>
  
  <p><strong>Typescript</strong></p>
  
  <p>We can create definitions for the framework library as follows: </p>
  
  <pre><code>declare module Framework.utils {
      export function utilFnOne();
      export function utilFnTwo();
      export function utilFnThree();
  }
  </code></pre>
  
  <p>And we can create a typescript definition for Current.utils by doing something like:</p>
  
  <pre><code>module Current.utils {
       export function utilFnFour() {}
       export function utilFnFive() {}
       export class StringUtils { }
  }
  </code></pre>
  
  <p>It would be nice if we could do something like this:</p>
  
  <pre><code>module Current.utils extends Framework.utils { .... }
  </code></pre>
  
  <p>So that intellisense would show members from both Framework and Current when we do</p>
  
  <pre><code>Current.utils.  
  </code></pre>
  
  <p><strong>Edit - Resolution</strong></p>
  
  <p>I took the idea that Ryan had and modified it slightly</p>
  
  <p><em>Framework.d.ts</em></p>
  
  <pre><code>declare module Framework {
      export var util: _utilImpl;
      export class _utilImpl {
          utilFnOne(a: string) : string;
      }
  }
  </code></pre>
  
  <p><em>Current.ts</em></p>
  
  <pre><code>module Current {
      export var util = new _utilImpl();
      export class _utilImpl extends Framework._utilImpl {
          utilFnTwo(b: number) : number;
      }
  }
  </code></pre>