import type { ZodSchema } from "../types/external-types.js"; import type { TResolver } from "../types.js"; /** * Creates a resolver function for validating form values using a Zod schema. * The type of form values is automatically inferred from the schema. * * @template TSchema - The Zod schema type. * @param {TSchema} schema - The Zod schema to validate the form values against. * @returns {TResolver} A resolver function that validates the form values and returns validation errors, if any. * * The resolver supports validating either the entire form or a single field: * - If `fieldName` is provided, only the specified field is validated. * - If `fieldName` is not provided, the entire form is validated. * * The returned resolver function: * - Accepts the form values and an optional field name. * - Returns an object containing an array of validation errors, or an empty array if validation passes. */ export declare function zodResolver(schema: TSchema): TResolver;