You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With 1.8.0 can now have better typing for query parameters and body content using eventHandler generic.
We also have a proper way to define per event middlewares stack using onRequest
The issue is that it's difficult to type event context.
We can use typescript interface augmentation, but this impact all events in the project:
Describe the feature
With 1.8.0 can now have better typing for query parameters and body content using
eventHandler
generic.We also have a proper way to define per event middlewares stack using
onRequest
The issue is that it's difficult to type event context.
We can use typescript interface augmentation, but this impact all events in the project:
Before
1.8.0
, we could create a customeventHandler
wrapper and use an extended version ofH3Event
:Same wrapper with `1.8.0`
Since usage of generics (and methods overloading), it's harder to wrap.
How about extending context with
EventHandlerRequest
, same asquery
andbody
like:Additional information
The text was updated successfully, but these errors were encountered: