import { FormComponent } from './types';
/**
As of version 4 the default sort order of enums is the order in which they are defined.
https://github.com/UselessPickles/ts-enum-util/issues/7#issuecomment-475499821
*/
export declare enum ValidatorNames {
  required = "required",
  max = "max",
  maxlength = "maxlength",
  min = "min",
  minlength = "minlength",
  pattern = "pattern"
}
export interface Validator<T> {
  errorMessage?: string;
  validate: (htmlInput: T) => boolean;
}
export interface ValidatorEntry {
  name: string;
  customErrorMessage?: string;
  options?: boolean | string;
}
export declare const defaultErrorMessagesConfig: {
  [k in ValidatorNames]?: (options?: ValidatorEntry['options']) => string;
};
/**  reducer callback: iterates through validators and returns the first one that fails it's validate function  */
export declare const combineValidators: <A>(v1: Validator<A>, v2: Validator<A>) => Validator<A>;
/** creates a list of ValidatorEntry objects from the ValidatorNames enum that exist on the component class
    example: [
      {name: 'required},
      {name: 'min', options: '5'}
    ]
  */
export declare const composeValidatorList: (componentClass: FormComponent) => ValidatorEntry[];
export declare const defaultValidator: () => Validator<HTMLInputElement>;
export declare const getValidator: (list: Array<ValidatorEntry>) => Validator<HTMLInputElement>;
export declare const initializeValidators: (componentClass: FormComponent) => Validator<HTMLInputElement>;
export declare const isRequiredValidator: (customErrorMessage?: string) => Validator<HTMLInputElement>;
export declare const maxlengthValidator: (customErrorMessage: string, options: ValidatorEntry['options']) => Validator<HTMLInputElement>;
export declare const minlengthValidator: (customErrorMessage: string, options: ValidatorEntry['options']) => Validator<HTMLInputElement>;
export declare const patternValidator: (customErrorMessage: string) => Validator<HTMLInputElement>;
export declare const validatorFactory: (validatorEntry: ValidatorEntry) => Validator<HTMLInputElement>;
