itty-router
itty-router copied to clipboard
Router and AutoRouter Request types are not same
Describe the Issue
It would be beneficial to have consistent Router types for the request.
Currently, we have the following types for Router and AutoRouter:
export const Router = <
RequestType = IRequest,
Args extends any[] = any[],
ResponseType = any
>(
export const AutoRouter = <
RequestType extends IRequest = IRequest,
Args extends any[] = any[],
ResponseType = any
>({
The difference is that AutoRouter and IttyRouter require RequestType to be a subtype of IRequest, while Router does not.