vkarpov15 / awaitjs-express

Write Express middleware and route handlers using async/await
Apache License 2.0
124 stars 13 forks source link

Add Router to TypeScript declarations #16

Closed saltire closed 4 years ago

saltire commented 4 years ago

I like the new Router() export a lot; it's really useful. However, it seems to be missing from the recently added TypeScript definitions file, so I've added it here. I'm new to TypeScript so I hope I did it correctly!

There's one problem: I think @types/express might need to be installed for this to work. Seems like the options are to install it here as an optional peer dependency, or to move the definitions file out of this project and into a package in the @types org, where it can pull in other types easily. Again, I'm just learning TS so not sure what the preferred choice would be. Let me know if you have feedback.

Thanks for this very convenient little package!