title: How to access a TypeScript definition that is within a module?
body: <p>I'm trying to type something a the 'Url' object that is described within the <a href="https://github.com/borisyankov/DefinitelyTyped/tree/master/node" rel="nofollow">NodeJS definition</a>. But the 'Url' object is described under the 'url' module. Because it's under the module its not recognised by the compiler as a valid type.</p>
  
  <pre><code>///&lt;reference path='../../../Definitions/node.d.ts' /&gt;
  ///&lt;reference path='../../../Definitions/node-webkit.d.ts' /&gt;
  ///&lt;reference path='../../../Definitions/cheerio.d.ts' /&gt;
  
  var NodeUrl = require('url');
  
  function findLinks($cheerio:Cheerio, internalOnly?:boolean, rootUrl?:url.Url):string[] {
      //url.Url is not recognised, neither is Url or NodeUrl.Url
  }
  </code></pre>
  
  <p>The definition file is defining the following module (alongside the rest of NodeJS):</p>
  
  <pre><code>declare module "url" {
      export interface Url {
          href: string;
          protocol: string;
          auth: string;
          hostname: string;
          port: string;
          host: string;
          pathname: string;
          search: string;
          query: any; // string | Object
          slashes: boolean;
          hash?: string;
          path?: string;
      }
  
      export interface UrlOptions {
          protocol?: string;
          auth?: string;
          hostname?: string;
          port?: string;
          host?: string;
          pathname?: string;
          search?: string;
          query?: any;
          hash?: string;
          path?: string;
      }
  
      export function parse(urlStr: string, parseQueryString?: boolean , slashesDenoteHost?: boolean ): Url;
      export function format(url: UrlOptions): string;
      export function resolve(from: string, to: string): string;
  }
  </code></pre>
  
  <p>How do I reference the Url type correctly?</p>
  
  <p>Thanks for any help.</p>