How to write TypeScript definition for a middleware that adds property to the response?
<p>I'd like to use <a href="https://github.com/scottcorgan/express-boom" rel="noreferrer">express-boom</a> for express with TypeScript. It lacks of typings so I'd like to write my own. Just make it compile is trivial.</p>

<p>This middleware decorates the <code>res</code> object with a property <code>boom</code> (derived from the <a href="https://github.com/hapijs/boom" rel="noreferrer">boom module</a>):</p>

<pre><code>var express = require('express');
var boom = require('express-boom');

var app = express();

app.use(boom());

app.use(function (req, res) {
  res.boom.notFound(); // Responsds with a 404 status code
});
</code></pre>

<p>But with typescript I need to cast it because neither <code>http.ServerResponse</code> and <code>Express.Response</code> have the boom property, of course:</p>

<pre><code>return (&lt;any&gt;res).boom.badRequest('bla bla bla');
</code></pre>

<p>Which is the cleanest way to do it? Which are other typed middleware that are doing a similar thing?</p>