import { InferInput } from "hono/validator"; import { Context, Env, Input, MiddlewareHandler, TypedResponse, ValidationTargets } from "hono"; import * as v3 from "zod/v3"; import { ZodSafeParseResult } from "zod/v4"; import * as v4 from "zod/v4/core"; //#region src/index.d.ts type ZodSchema = v3.ZodType | v4.$ZodType; type ZodError = T extends v4.$ZodType ? v4.$ZodError> : v3.ZodError; type ZodSafeParseResult$1 = T3 extends v4.$ZodType ? ZodSafeParseResult : v3.SafeParseReturnType; type zInput = T extends v3.ZodType ? v3.input : T extends v4.$ZodType ? v4.input : never; type zOutput = T extends v3.ZodType ? v3.output : T extends v4.$ZodType ? v4.output : never; type zInfer = T extends v3.ZodType ? v3.infer : T extends v4.$ZodType ? v4.infer : never; type ZodValidatorFailureBody = T extends v4.$ZodType ? Extract>, { success: false; }> : T extends v3.ZodType ? Extract, v3.output>, { success: false; }> : never; type ZodValidatorFailureResponse = Response & TypedResponse, 400, "json">; type Hook = (result: ({ success: true; data: T; } | { success: false; error: ZodError; data: T; }) & { target: Target; }, c: Context) => Response | void | TypedResponse | Promise>; type HasUndefined = undefined extends T ? true : false; type ExtractValidationResponse = VF extends ((value: any, c: any) => infer R) ? R extends Promise ? PR extends TypedResponse ? Response & TypedResponse : PR extends Response ? PR : PR extends undefined ? never : never : R extends TypedResponse ? Response & TypedResponse : R extends Response ? R : R extends undefined ? never : never : never; type ValidationFunctionOption = { validationFunction: (schema: T, value: ValidationTargets[Target]) => ZodSafeParseResult$1 | Promise>; }; type DefaultInput = { in: HasUndefined extends true ? { [K in Target]?: [In] extends [ValidationTargets[K]] ? In : InferInput; } : { [K in Target]: [In] extends [ValidationTargets[K]] ? In : InferInput; }; out: { [K in Target]: Out; }; }; declare function zValidatorFunction, Out = zOutput, I extends Input = DefaultInput, V extends I = I>(target: Target, schema: T, hook?: undefined, options?: ValidationFunctionOption): MiddlewareHandler>; declare function zValidatorFunction, In = zInput, Out = zOutput, I extends Input = DefaultInput, V extends I = I, InferredValue = zInfer>(target: Target, schema: T, hook?: HookFn, options?: ValidationFunctionOption): MiddlewareHandler>; declare const zValidator: typeof zValidatorFunction; //#endregion export { Hook, zValidator }; //# sourceMappingURL=index.d.mts.map