UNPKG

@modular-forms/react

Version:

The modular and type-safe form library for React

12 lines (11 loc) 414 B
import type { FieldValue, Maybe } from '../types'; type Value<TFieldValue extends FieldValue> = Maybe<TFieldValue> | number[]; /** * Creates a validation function that checks the existence of an input. * * @param error The error message. * * @returns A validation function. */ export declare function required<TFieldValue extends FieldValue>(error: string): (value: Value<TFieldValue>) => string; export {};