title: In TypeScript, how do I implement an interface with (a: type, b:type): any?
body: <p>Specifically, I'm trying to setup server sided typescript compilation for express.</p>
  
  <p>One of the interfaces exposed is RequestHandler, with the following structure:</p>
  
  <pre><code>// express-serve-static-core/index.d.ts
  
  declare module "express-serve-static-core" {
    ...
  
    interface RequestHandler {
      (req: Request, res: Response, next: NextFunction): any;
    }
  }
  </code></pre>
  
  <p>I wrote the following class:</p>
  
  <pre><code>import * as express from "express";
  
  class PageNotFound implements express.RequestHandler {
  
    constructor (req: express.Request, res: express.Response, next: express.NextFunction) {
      let viewFilePath: string = "404";
      let statusCode: number = 404;
      let result: Object = {
        status: statusCode,
      };
  
      res.status(statusCode);
      res.render(viewFilePath, {}, function (err: Error, html: string): void {
        if (err) {
          res.status(statusCode).json(result);
        }
        res.send(html);
      });
    }
  }
  </code></pre>
  
  <p>However, this throws the error:</p>
  
  <p><code>error TS2345: Argument of type 'typeof PageNotFound' is not assignable to parameter of type 'RequestHandler'.
    Type 'typeof PageNotFound' provides no match for the signature '(req: Request, res: Response, next: NextFunction): any'
  </code></p>
  
  <p>Any suggestions out there? I'm not sure what I'm doing wrong.</p>