@modular-forms/react
Version:
The modular and type-safe form library for React
11 lines (10 loc) • 382 B
TypeScript
import type { ZodType } from 'zod';
import type { FieldValue, ValidateField } from '../types';
/**
* Creates a validation functions that parses the Zod schema of a field.
*
* @param schema A Zod schema.
*
* @returns A validation function.
*/
export declare function zodField<TFieldValue extends FieldValue>(schema: ZodType<any, any, TFieldValue>): ValidateField<TFieldValue>;