import type { YupObjectSchema } from "../types/external-types.js"; import type { TResolver } from "../types.js"; /** * A resolver function for validating form values using a Yup schema. * * @template T - The type of the form values. * @param {ObjectSchema} schema - The Yup schema to validate against. * @returns {TResolver} - A resolver function that validates the form values and returns validation errors, if any. * * The resolver function takes the form values and an optional field name as input. * If a field name is provided, it validates only that field. Otherwise, it validates the entire form. * * The function returns an object containing an array of errors. Each error includes: * - `path`: The path of the field with the error. * - `message`: The error message. * * If no errors are found, the `errors` array will be empty. */ export declare function yupResolver(schema: YupObjectSchema): TResolver;