title: TypeScript: How to bind type declaration to import statement
body: <p>I'm trying to create a type definition for <a href="https://github.com/digitaldesignlabs/es6-promisify" rel="nofollow noreferrer">es6-promisify</a>, a JS package not in the <a href="https://github.com/DefinitelyTyped/" rel="nofollow noreferrer">DefinitelyTyped</a> annotations repository. Looking at examples in DefinitelyTyped and following <a href="https://basarat.gitbooks.io/typescript/content/docs/types/ambient/d.ts.html" rel="nofollow noreferrer">TS Deep Dive / Declaration Files</a>, I created a crude annotation that I saved in my project in a <code>vendor.d.ts</code>:</p>
  
  <pre><code>declare function promisify(original: (...args: any[]) =&gt; any, settings: any): Promise&lt;any&gt;
  
  export = promisify
  // export interface promisify { } // or should I do an interface?
  </code></pre>
  
  <p>Now, considering I import with <code>import promisify = require('es6-promisify')</code>, how do I tell TypeScript that the <code>promisify</code> import is annotated in <code>vendor.d.ts</code>? Currently, <code>tsc</code> keeps returning <code>Could not find a declaration file for module 'es6-promisify'. 'promisify.js' implicitly has an 'any' type.</code> I'm trying to digest <a href="https://www.typescriptlang.org/docs/handbook/module-resolution.html" rel="nofollow noreferrer">TS Docs / Module Resolution</a> but am failing at it so far.</p>
  
  <p>Phrased differently: what's the mechanism used by TypeScript to resolve a declaration file from an import? <a href="https://meta.stackexchange.com/questions/66377/what-is-the-xy-problem">XY problem</a> warning: maybe I'm doing things wrong and shouldn't do a <code>vendor.d.ts</code>? Maybe there's a good reason <code>es6-promisify</code> is not in DT? Feel free to contradict with better ways to reach my goal of making tsc with <code>"noImplicitAny": true</code> happy. Thanks :)</p>