title: use namespace as type in typescript
body: <p>I have installed type definitions for google maps that declares a namespace like this:</p>
  
  <pre><code>namespace google.maps {
    export class Map {
      // ...
    }
  
    // ...
  }
  </code></pre>
  
  <p>So if i just use the API globally it works beautifully:</p>
  
  <pre><code>const map = new google.maps.Map();
  </code></pre>
  
  <p>For unit testablity I don't want to access the API globally but instead inject it. But it seems I can't type that a variable should by from type <code>google.map</code></p>
  
  <p>So this doesn't work:</p>
  
  <pre><code>function mapFactory(api: google.maps) {
      return new api.Map();
  }
  </code></pre>
  
  <p>Any solution how to use the namespace as a type?</p>