/**
* DevExtreme (ui/validator.d.ts)
* Version: 21.1.0 (build 21016-0316)
* Build date: Sat Jan 16 2021
*
* Copyright (c) 2012 - 2021 Developer Express Inc. ALL RIGHTS RESERVED
* Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/
*/
import '../jquery_augmentation';

import DOMComponent, {
    DOMComponentOptions
} from '../core/dom_component';

import {
    AsyncRule,
    CompareRule,
    CustomRule,
    EmailRule,
    NumericRule,
    PatternRule,
    RangeRule,
    RequiredRule,
    StringLengthRule
} from './validation_rules';

/**
 * Warning! This type is used for internal purposes. Do not import it directly.
 */
export interface dxValidatorOptions extends DOMComponentOptions<dxValidator> {
    /**
     */
    adapter?: {
      /**
       * Warning! This type is used for internal purposes. Do not import it directly.
       */
      applyValidationResults?: Function,
      /**
       * Warning! This type is used for internal purposes. Do not import it directly.
       */
      bypass?: Function,
      /**
       * Warning! This type is used for internal purposes. Do not import it directly.
       */
      focus?: Function,
      /**
       * Warning! This type is used for internal purposes. Do not import it directly.
       */
      getValue?: Function,
      /**
       * Warning! This type is used for internal purposes. Do not import it directly.
       */
      reset?: Function,
      /**
       * Warning! This type is used for internal purposes. Do not import it directly.
       */
      validationRequestsCallbacks?: Array<Function>
    };
    /**
     */
    name?: string;
    /**
     */
    onValidated?: ((validatedInfo: { name?: string, isValid?: boolean, value?: any, validationRules?: Array<RequiredRule | NumericRule | RangeRule | StringLengthRule | CustomRule | CompareRule | PatternRule | EmailRule | AsyncRule>, brokenRule?: RequiredRule | NumericRule | RangeRule | StringLengthRule | CustomRule | CompareRule | PatternRule | EmailRule | AsyncRule, brokenRules?: Array<RequiredRule | NumericRule | RangeRule | StringLengthRule | CustomRule | CompareRule | PatternRule | EmailRule | AsyncRule>, status?: 'valid' | 'invalid' | 'pending' }) => any);
    /**
     */
    validationGroup?: string;
    /**
     */
    validationRules?: Array<RequiredRule | NumericRule | RangeRule | StringLengthRule | CustomRule | CompareRule | PatternRule | EmailRule | AsyncRule>;
}
/**
 */
export default class dxValidator extends DOMComponent {
    constructor(element: Element, options?: dxValidatorOptions)
    constructor(element: JQuery, options?: dxValidatorOptions)
    /**
     */
    focus(): void;
    /**
     */
    reset(): void;
    /**
     */
    validate(): dxValidatorResult;
}

/**
 * Warning! This type is used for internal purposes. Do not import it directly.
 */
export interface dxValidatorResult {
    /**
     */
    brokenRule?: RequiredRule | NumericRule | RangeRule | StringLengthRule | CustomRule | CompareRule | PatternRule | EmailRule | AsyncRule;
    /**
     */
    brokenRules?: Array<RequiredRule | NumericRule | RangeRule | StringLengthRule | CustomRule | CompareRule | PatternRule | EmailRule | AsyncRule>;
    /**
     */
    complete?: Promise<dxValidatorResult> | JQueryPromise<dxValidatorResult>;
    /**
     */
    isValid?: boolean;
    /**
     */
    pendingRules?: Array<AsyncRule>;
    /**
     */
    status?: 'valid' | 'invalid' | 'pending';
    /**
     */
    validationRules?: Array<RequiredRule | NumericRule | RangeRule | StringLengthRule | CustomRule | CompareRule | PatternRule | EmailRule | AsyncRule>;
    /**
     */
    value?: any;
}

declare global {
interface JQuery {
    dxValidator(): JQuery;
    dxValidator(options: "instance"): dxValidator;
    dxValidator(options: string): any;
    dxValidator(options: string, ...params: any[]): any;
    dxValidator(options: dxValidatorOptions): JQuery;
}
}
/**
 * Warning! This type is used for internal purposes. Do not import it directly.
 */
export type Options = dxValidatorOptions;

/** @deprecated use Options instead */
/**
 * Warning! This type is used for internal purposes. Do not import it directly.
 */
export type IOptions = dxValidatorOptions;
