import { ArrayFieldProps, FieldProps } from '../form-builder/types'; export declare const emailRegex: RegExp; export declare type ValidationFunctionResult = void | undefined | string | Promise | T; export declare type ValidationFunction = (value: T, props: FieldProps) => ValidationFunctionResult; export declare type ValidationFunctionArray = (value: T[], props: ArrayFieldProps) => ValidationFunctionResult; export declare const chainArrayValidations: (props: ArrayFieldProps, validations: ValidationFunctionArray[]) => (value: T[]) => ValidationFunctionResult; export declare const chainValidations: (props: FieldProps, validations: ValidationFunction[]) => (value: T) => ValidationFunctionResult; export declare const required: (value: T, props: FieldProps) => ValidationFunctionResult; export declare const maxLength: (value: T[], props: ArrayFieldProps) => ValidationFunctionResult; export declare const minLength: (value: T[], props: ArrayFieldProps) => ValidationFunctionResult; export declare const requiredLength: (value: T[], props: ArrayFieldProps) => ValidationFunctionResult; /** * This function is used to validate an email address, while returning error messages if an email * is invalid. The logic is as follows: * * 1. Ensure the email address is a string. If it's not, return an error message * 2. Ensure that one of the following is true, else output an error message: * 2a. The field is not required -AND- the field has no entered value * 2b. The value in the field matches an email validation regular expression * * @param emailString * @param props */ export declare const isValidEmail: (emailString: T, props: FieldProps) => ValidationFunctionResult; /** * This function is used to validate an date field and make sure it's not in the future * * @param dateString * @param props */ export declare const isValidDate: (dateString: T, props: FieldProps) => ValidationFunctionResult; export declare const isValidPhone: (phoneString: T, props: FieldProps) => ValidationFunctionResult; /** * Conditions for valid SSN from the original 1010ez pdf form: * '123456789' is not a valid SSN * A value where the first 3 digits are 0 is not a valid SSN * A value where the 4th and 5th digits are 0 is not a valid SSN * A value where the last 4 digits are 0 is not a valid SSN * A value with 3 digits, an optional -, 2 digits, an optional -, and 4 digits is a valid SSN * 9 of the same digits (e.g., '111111111') is not a valid SSN */ export declare const isValidSSN: (ssnString: T, props: FieldProps) => ValidationFunctionResult;