title: Merging typescript external global interfaces and inheritance
body: <p>Before exposing the problem, the project I'm referring is here : <a href="https://github.com/abauzac/nightwatch-typescript" rel="nofollow noreferrer">https://github.com/abauzac/nightwatch-typescript</a></p>
  
  <p>My problem is with the Nightwatch definitions, it export a lot of interfaces globally (not inside a namespace or module <a href="https://github.com/DefinitelyTyped/DefinitelyTyped/blob/38bd4efd5dc8c666f70d77b020a0b64a13ce3980/types/nightwatch/index.d.ts" rel="nofollow noreferrer">https://github.com/DefinitelyTyped/DefinitelyTyped/blob/38bd4efd5dc8c666f70d77b020a0b64a13ce3980/types/nightwatch/index.d.ts</a>), including : </p>
  
  <p>./node_modules/@types/nightwatch:</p>
  
  <pre><code>export interface NightwatchCustomCommands { /* empty interface */ }
  export interface NightwatchCustomAssertions { /* empty interface */ }
  
  export interface NightwatchBrowser extends NightwatchCustomCommands, NightwatchCustomAssertions, ... { ... }
  
  export interface NightwatchAssertions extends NightwatchBrowser { ... }
  </code></pre>
  
  <p>I have added custom commands and assertions to Nightwatch and tried to merge NightwatchCustomCommands and NightwatchCustomAssertions:</p>
  
  <p>./types/index.d.ts</p>
  
  <pre><code>import {   NightwatchAssertions, NightwatchBrowser } from "nightwatch";
  
  // merge interfaces with nightwatch types
  
  interface NightwatchCustomAssertions  {
      compareScreenshot(this: NightwatchBrowser, filename: string, expected: number, callback: Function);
  }
  
  interface NightwatchCustomCommands  {
      wplogin(this: NightwatchBrowser, callback?: Function):this;
  
      compareScreenshot(this: NightwatchBrowser, filename: string, expected?: number, callback?: Function)
  }
  </code></pre>
  
  <p>but it seems the interfaces are not merged when compiling :</p>
  
  <pre><code>Property 'wplogin' does not exist on type 'NightwatchBrowser'.
  Property 'compareScreenshot' does not exist on type 'NightwatchAssertions'.
  </code></pre>
  
  <p>both @types and types folder are included in tsconfig "typeRoots". So far I tried adding "export" to the interfaces, namespacing... Don't know what I'm missing.</p>