fix(zod-validator): fixed zod-validator hook types (#119)
* fix(zod-validator): fixed zod-validator hook types * changesetpull/120/head
parent
28ff7e4bbd
commit
3b37eb4aef
|
@ -0,0 +1,5 @@
|
||||||
|
---
|
||||||
|
'@hono/zod-validator': patch
|
||||||
|
---
|
||||||
|
|
||||||
|
fix(zod-validator): fixed zod-validator hook types
|
|
@ -5,14 +5,7 @@ import type { z, ZodSchema, ZodError } from 'zod'
|
||||||
export type Hook<T, E extends Env, P extends string, O = {}> = (
|
export type Hook<T, E extends Env, P extends string, O = {}> = (
|
||||||
result: { success: true; data: T } | { success: false; error: ZodError; data: T },
|
result: { success: true; data: T } | { success: false; error: ZodError; data: T },
|
||||||
c: Context<E, P>
|
c: Context<E, P>
|
||||||
) =>
|
) => Response | Promise<Response> | void | Promise<Response | void> | TypedResponse<O>
|
||||||
| Response
|
|
||||||
| Promise<Response>
|
|
||||||
| void
|
|
||||||
| Promise<Response | void>
|
|
||||||
| TypedResponse<O>
|
|
||||||
| Promise<TypedResponse<O>>
|
|
||||||
| Promise<TypedResponse<O> | void>
|
|
||||||
|
|
||||||
export const zValidator = <
|
export const zValidator = <
|
||||||
T extends ZodSchema,
|
T extends ZodSchema,
|
||||||
|
|
Loading…
Reference in New Issue