///
export declare type Validator = (value: any, values: any, props: any) => string | null | undefined;
/**
* Required validator
*
* Returns an error if the value is null, undefined, or empty
*
* @param {string|function} message
*
* @example
*
* const titleValidators = [required('The title is required')];
*
*/
export declare const required: (message?: any) => ((value: any, values: any, props: any) => string) & {
isRequired: boolean;
};
/**
* Minimum length validator
*
* Returns an error if the value has a length less than the parameter
*
* @param {integer} min
* @param {string|function} message
*
* @example
*
* const passwordValidators = [minLength(10, 'Should be at least 10 characters')];
*
*/
export declare const minLength: (min: any, message?: any) => (value: any, values: any, props: any) => string;
/**
* Maximum length validator
*
* Returns an error if the value has a length higher than the parameter
*
* @param {integer} max
* @param {string|function} message
*
* @example
*
* const nameValidators = [maxLength(10, 'Should be at most 10 characters')];
*
*/
export declare const maxLength: (max: any, message?: any) => (value: any, values: any, props: any) => string;
/**
* Minimum validator
*
* Returns an error if the value is less than the parameter
*
* @param {integer} min
* @param {string|function} message
*
* @example
*
* const fooValidators = [minValue(5, 'Should be more than 5')];
*
*/
export declare const minValue: (min: any, message?: any) => (value: any, values: any, props: any) => string;
/**
* Maximum validator
*
* Returns an error if the value is higher than the parameter
*
* @param {integer} max
* @param {string|function} message
*
* @example
*
* const fooValidators = [maxValue(10, 'Should be less than 10')];
*
*/
export declare const maxValue: (max: any, message?: any) => (value: any, values: any, props: any) => string;
/**
* Number validator
*
* Returns an error if the value is not a number
*
* @param {string|function} message
*
* @example
*
* const ageValidators = [number('Must be a number')];
*
*/
export declare const number: (message?: any) => (value: any, values: any, props: any) => string;
/**
* Regular expression validator
*
* Returns an error if the value does not match the pattern given as parameter
*
* @param {RegExp} pattern
* @param {string|function} message
*
* @example
*
* const zipValidators = [regex(/^\d{5}(?:[-\s]\d{4})?$/, 'Must be a zip code')];
*
*/
export declare const regex: ((pattern: any, message?: any) => (value: any, values: any, props: any) => string) & import("lodash").MemoizedFunction;
/**
* Email validator
*
* Returns an error if the value is not a valid email
*
* @param {string|function} message
*
* @example
*
* const emailValidators = [email('Must be an email')];
*
*/
export declare const email: (message?: any) => (value: any, values: any, props: any) => string;
/**
* Choices validator
*
* Returns an error if the value is not among the list passed as parameter
*
* @param {array} list
* @param {string|function} message
*
* @example
*
* const genderValidators = [choices(['male', 'female'], 'Must be either Male or Female')];
*
*/
export declare const choices: (list: any, message?: any) => (value: any, values: any, props: any) => string;