formularity-zod-adapter
Version:
Zod Adapter for the Formularity Library
10 lines (9 loc) • 656 B
TypeScript
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>;