expressjs / response-time

Response time header for node.js
MIT License
472 stars 73 forks source link

Typescript Support #13

Closed ghost closed 6 years ago

ghost commented 6 years ago

Hi,

When using the responseTime(fn) it throws some errors.

app.use(responseTime((req: Request, res: Response, time: any)

Argument of type '(req: Request, res: Response, time: any) => void' is not assignable to parameter of type 'ResponseTimeFunction'. Types of parameters 'req' and 'request' are incompatible. Type 'IncomingMessage' is not assignable to type 'Request'. Property 'get' is missing in type 'IncomingMessage'.

And you cannot add a nextFunction.

dougwilson commented 6 years ago

Hi! Thanks for reporting the issue. I'm not familiar with TypeScript and have no idea what the action to take here is. Would you be willing to make a pull request with the fix or perhaps walk me through what I would need to change to fix? Thanks!

ghost commented 6 years ago

Sorry, i don't know either. The best we can do now is create as ticket over at https://github.com/DefinitelyTyped/DefinitelyTyped

ghost commented 6 years ago

https://github.com/DefinitelyTyped/DefinitelyTyped/issues/28849

dougwilson commented 6 years ago

Closing issue if there isn't anything to fix in this module.