UNPKG

react-waitlist

Version:

A customizable waitlist form component for React applications

31 lines (30 loc) 852 B
import { Field } from './types'; /** * Validate an email address */ export declare const validateEmail: (email: string) => boolean; /** * Validate that a value is not empty */ export declare const validateRequired: (value: any) => boolean; /** * Validate a field value based on its type and requirements */ export declare const validateField: (field: Field, value: string | boolean | undefined) => { valid: boolean; message?: string; }; /** * Validate form data against a set of field definitions */ export declare const validateForm: (values: Record<string, string | boolean>, fields: Field[]) => Record<string, { valid: boolean; message?: string; }>; /** * Check if all form fields are valid */ export declare const isFormValid: (validationResults: Record<string, { valid: boolean; message?: string; }>) => boolean;