The TypeScript-ready, minimal router and middleware layer for Next.js, Micro, Vercel, or Node.js http/http2
1.64k
stars
65
forks
source link
Export types `NextHandler`, `Middleware`, `RequestHandler`, `ErrorHandler` #177
Closed
JasonMore closed 2 years ago
Summary
pr: https://github.com/hoangvvo/next-connect/pull/176
When decomposing Typescript functions, its nice when you can use the types the library defines. I wanted to use the middleware as part a toolset with:
But the type
NextHandler
isn't exportedHow I fixed it
Export all the typescript types
Example code