title: How to add Typescript definitions to Express req & res
body: <p>I have a set of controller functions for my REST API and I'm getting lots of the following</p>
  
  <pre><code>error TS7006: Parameter 'req' implicitly has an 'any' type.
  </code></pre>
  
  <p>Likewise for <code>res</code>.  I've been playing around with typeings etc. but with no success. For example the <code>Request</code> type parameter below does NOT work.</p>
  
  <p>Here is an example of the controller files. The reference path is correct.</p>
  
  <pre><code>/// &lt;reference path="../../../typings/tsd.d.ts" /&gt;    
  /* globals require */    
  "use strict";    
  exports.test = (req : Request, res) =&gt; {
  </code></pre>
  
  <p>I tried adding <code>import * as express from "express";</code> into the file - I don't need it normally as these functions are exported and use by index.js which actually implements the routing.</p>
  
  <p>And this is tsd.d.ts</p>
  
  <pre><code>/// &lt;reference path="requirejs/require.d.ts" /&gt;
  /// &lt;reference path="express/express.d.ts" /&gt;
  /// &lt;reference path="mime/mime.d.ts" /&gt;
  /// &lt;reference path="node/node.d.ts" /&gt;
  /// &lt;reference path="serve-static/serve-static.d.ts" /&gt;
  /// &lt;reference path="bluebird/bluebird.d.ts" /&gt;
  /// &lt;reference path="mongoose/mongoose.d.ts" /&gt;
  </code></pre>