title: expressjs: typescript: Argument of type 'typeof <express.Router>' is not assignable to parameter of type 'RequestHandlerParams'
body: <p>I am using expressjs with the latest typescript definition file and typescript 2.3.4 from <a href="https://github.com/DefinitelyTyped/DefinitelyTyped" rel="noreferrer">https://github.com/DefinitelyTyped/DefinitelyTyped</a>.
  I defined a router and would like to use it from a subpath as is stated in the official 4.x documentation (<code>app.use('/calendar', router);</code>), but I get following error
  </p>
  
  <pre><code>Error: /Users/matthias/Documents/private workspace/universal/src/server/server.ts (161,34): Argument of type 'typeof "/Users/matthias/Documents/private workspace/universal/src/server/routes/login.router"' is not assignable to parameter of type 'RequestHandlerParams'.
    Type 'typeof "/Users/matthias/Documents/private workspace/universal/src/server/routes/login.router"' is not assignable to type '(RequestHandler | ErrorRequestHandler)[]'.
      Property 'length' is missing in type 'typeof "/Users/matthias/Documents/private workspace/universal/src/server/routes/login.router"'.
  </code></pre>
  
  <p>This is the router I am using, ommiting the actual code...
  </p>
  
  <pre><code>const router : express.Router = express.Router();
  let loginController = new LoginController();
  
  router.post('/signin', function(req: express.Request, res: express.Response, next: express.NextFunction) {
  
    ...
  
    })(req, res, next);
  });
  
  ...
  
  export default router;
  </code></pre>
  
  <p>... and this is the shortened version of the call to it.</p>
  
  <pre><code>import * as loginRouter from './routes/login.router';
  
  private app = express();
  this.app.use('/api/v1/auth', loginRouter);
  </code></pre>
  
  <p>Am I doing something wrong or is this usecase just not properly defined in the typescript definition files?</p>
  
  <p>Kind Regards</p>