fix(zod-openapi): add Promise<void> to Hook (#510)

* fix(zod-openapi): add Promise<void> to Hook

* add changeset
pull/512/head
taku-hatano 2024-05-11 18:21:21 +09:00 committed by GitHub
parent b0c94cd840
commit 88113fae8b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 12 additions and 1 deletions

View File

@ -0,0 +1,5 @@
---
'@hono/zod-openapi': patch
---
Add Promise<void> to Hook

View File

@ -155,7 +155,13 @@ export type Hook<T, E extends Env, P extends string, O> = (
error: ZodError
},
c: Context<E, P>
) => TypedResponse<O> | Promise<TypedResponse<T>> | Response | Promise<Response> | void
) =>
| TypedResponse<O>
| Promise<TypedResponse<T>>
| Response
| Promise<Response>
| void
| Promise<void>
type ConvertPathType<T extends string> = T extends `${infer Start}/{${infer Param}}${infer Rest}`
? `${Start}/:${Param}${ConvertPathType<Rest>}`