Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Typescript Support #13

Closed
ghost opened this issue Sep 12, 2018 · 4 comments
Closed

Typescript Support #13

ghost opened this issue Sep 12, 2018 · 4 comments

Comments

@ghost
Copy link

ghost commented Sep 12, 2018

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
Copy link
Contributor

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
Copy link
Author

ghost commented Sep 13, 2018

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

@ghost
Copy link
Author

ghost commented Sep 13, 2018

@dougwilson
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant