UNPKG

formularity-zod-adapter

Version:
10 lines (9 loc) 656 B
import { ZodSchema } from 'zod'; import { DeepKeys, DeepValue, FormValues, SingleFieldValidator, ValidationHandler } from 'formularity'; export declare function zodAdapter<TFormValues extends FormValues, TFieldName extends DeepKeys<TFormValues>, TSchemaInput extends DeepValue<TFormValues, TFieldName> = DeepValue<TFormValues, TFieldName>>(schema: ZodSchema<TSchemaInput>, options: { async?: boolean; isField: true; }): SingleFieldValidator<TFormValues, TFieldName>; export declare function zodAdapter<TFormValues extends FormValues = FormValues>(schema: ZodSchema<TFormValues>, options?: { async?: boolean; }): ValidationHandler<TFormValues>;