import { MessageDisplayLocation } from '../../form-field';
import { MessageTypes } from '../../message';
import { Func, ValueOf } from '../../types';
export declare const VALIDATION_EVENTS: {
    readonly ON_CHANGE: 0;
    readonly ON_BLUR: 1;
};
export type ValidationEvent = ValueOf<typeof VALIDATION_EVENTS>;
export type ValidationConfig = {
    displayLocation?: MessageDisplayLocation;
    validationEvent?: ValidationEvent;
    dependentValues?: any[];
    debounceTime?: number;
    validationErrorWarningMessage?: string;
};
export declare const DEFAULT_CONFIG: {
    displayLocation: "inline";
    validationEvent: 0;
    dependentValues: never[];
    debounceTime: number;
};
export type ValidationFunc = (value: string) => string | undefined;
export type AsyncValidationFunc = Func<[
    string | null | undefined
], Promise<string | null | undefined | void>>;
export type Validity = {
    type?: MessageTypes;
    value: string[];
    displayLocation: string;
    isPristine: boolean;
};
/**
 *
 * @param {[any, function]} stateArray Tuple of state value and setValue function.
 * @param {array} validations Array of synchronous validations to run.
 * @param {array} asyncValidations Array of asynchronous validations to run.
 * @param {object} config Options of the inputvalidation.
 * @param {string} config.displayLocation A MESSAGE_DISPLAY_LOCATION option, defaulting to INLINE.
 * @param {string} config.validationEvent Defines event on which validation
 * should be triggered. Default is ON_CHANGE
 * @param {number} config.debounceTime time for debounce async validations
 * @param {array} config.dependentValues used to trigger input validation when these values changed.
 */
export declare function useInputValidation([value, setValue]: [string, (value: string) => void], { validations, asyncValidations, }?: {
    validations?: ValidationFunc[];
    asyncValidations?: AsyncValidationFunc[];
}, config?: ValidationConfig): {
    asyncValidation: {
        isValidating: boolean;
        isRetryShown: boolean;
        onRetry: () => void;
    };
    value: string;
    validity: Validity | null;
    onBlur: (e: {
        currentTarget: {
            value: string;
        };
    }) => Promise<void>;
    onChange: (e: React.ChangeEvent<HTMLInputElement>) => Promise<void>;
};
/**
 * Requires some kind of value.  Does not pass on `null`, `undefined`, `''`, or `' '`.
 * @param {string} errorMessage Error message to show.
 */
export declare function required(errorMessage: string): (value: string) => string | undefined;
/**
 * Requires a float value between 0 and 1, having 4 or less digits of precision.
 * So, `0.1234` is valid, but `0.12345` is not.
 * @param {string} errorMessage Error message to show.
 */
export declare function floatBetween0And1(errorMessage: string): (value: string) => string | undefined;
/**
 * Checks to see if the value is a finite number.
 * @param {string} errorMessage Error message to show.
 */
export declare function isFiniteNumber(errorMessage: string): (value: string) => string | undefined;
/**
 * Checks to see if the value is an URL.
 * @param {string} errorMessage Error message to show.
 * @param {boolean} allowEmpty prop to allow empty value.
 */
export declare function isUrl(errorMessage: string, allowEmpty?: boolean): (value: string) => string | undefined;
/**
 * Checks to see if the value is an email.
 * @param {string} errorMessage Error message to show.
 * @param {boolean} allowEmpty prop to allow empty email.
 */
export declare function isEmail(errorMessage: string, allowEmpty?: boolean): (value: string) => string | undefined;
/**
 * Checks to see if the value is no longer than X.
 * @param {string} errorMessage Error message to show.
 * @param {number} maxLength Max length allowed
 */
export declare function notLongerThanX(errorMessage: string, maxLength?: number): (value: string) => string | undefined;
/**
 * Checks to see if number is less than X
 * @param {string} errorMessage Error message to show.
 * @param {number} number The number
 * @param {boolean} allowEmpty prop to allow empty value
 */
export declare function isNumberLessThan(errorMessage: string, number: number, allowEmpty?: boolean): (value: string) => string | undefined;
/**
 * Checks to see if number is greater than X
 * @param {string} errorMessage Error message to show.
 * @param {number} number The number
 * @param {boolean} allowEmpty prop to allow empty value
 */
export declare function isNumberGreaterThan(errorMessage: string, number: number, allowEmpty?: boolean): (value: string) => string | undefined;
/**
 * Checks if string matches provided regular expression.
 * @param {string} errorMessage Error message to show.
 * @param {RegExp} customPattern RegExp to validate string.
 */
export declare function matchCustomPattern(errorMessage: string, customPattern: {
    test: (v: string) => boolean;
}): (value: string) => string | undefined;
/**
 * Checks to see if the value is an integer.
 * @param {string} errorMessage Error message to show.
 */
export declare function isInteger(errorMessage: string): (value: string) => string | undefined;
/**
 * Checks to see that there no empty values in comma separated string.
 * String itself CAN be empty, "" is allowed, but not "val1,,val2"
 * @param {string} errorMessage Error message to show.
 */
export declare function noEmptyValuesInCommaSeparatedString(errorMessage: string): (value: string) => string | undefined;
