import { ComponentFactoryResolver, ComponentRef, ElementRef, EventEmitter, OnChanges, OnDestroy, OnInit, SimpleChanges } from '@angular/core';
import { AbstractControlDirective, ControlContainer, NgControl } from '@angular/forms';
import { I18nInterface, I18nService } from 'ng-devui/i18n';
import { OverlayContainerRef } from 'ng-devui/overlay-container';
import { PopoverComponent } from 'ng-devui/popover';
import { FormItemComponent } from '../form-item.component';
import { DFormControlStatus, DPopConfig, DValidateErrorStatus, DValidateRules } from './validate.type';
import * as i0 from "@angular/core";
export declare abstract class DAbstractControlRuleDirective implements OnChanges {
    readonly _cd: AbstractControlDirective;
    private _parent;
    private _originRules;
    private _rules;
    private _errorStrategy;
    private _messageOpts;
    private _registered;
    readonly errors: {
        [key: string]: any;
    } | null;
    private _errorMessage;
    private _warning;
    i18nFormText: I18nInterface['form'];
    _locale: string;
    set locale(key: string);
    get locale(): string;
    get errorMessage(): string;
    set errorMessage(msg: string);
    dRulesStatusChange: EventEmitter<DValidateErrorStatus>;
    constructor(cd: AbstractControlDirective, parent: DAbstractControlRuleDirective);
    get isReady(): boolean;
    get pending(): boolean;
    get fullRules(): DValidateRules;
    get asyncValidatorDebounceTime(): number;
    ngOnChanges(changes: SimpleChanges): void;
    updateRules(rules: DValidateRules): void;
    setOriginRules(rules: DValidateRules): void;
    setupOrUpdateRules(): void;
    private _transformRulesAndUpdateToModel;
    private _transformValidatorsToFnArray;
    private _translateRulesToObject;
    private _findNgValidatorInDefault;
    private _generateValidatorFnFromDefault;
    private _transformRuleToNgValidator;
    private _transformRuleToNgAsyncValidator;
    private _transValidatorResultToNgError;
    private _autoGetIdFromRule;
    get dClassError(): boolean;
    get showError(): boolean;
    get showStatus(): boolean;
    get dClassSuccess(): boolean;
    get dClassWarning(): boolean;
    get invalid(): boolean;
    private _registerOnStatusChange;
    private _parseErrors;
    private _getDefaultErrorMessage;
    private _getErrorStrategy;
    private _getMessageFormErrorsById;
    private _getARuleByErrors;
    _updateParent(): void;
    private _setUpdateStrategy;
    _updateValueAndValidity(): void;
    private _updateValidators;
    private _updateAsyncValidators;
    abstract updateStatusAndMessageToView(status: any): void;
    static ɵfac: i0.ɵɵFactoryDeclaration<DAbstractControlRuleDirective, never>;
    static ɵdir: i0.ɵɵDirectiveDeclaration<DAbstractControlRuleDirective, never, never, {}, { "dRulesStatusChange": "dRulesStatusChange"; }, never, never, false>;
}
export declare class DFormGroupRuleDirective extends DAbstractControlRuleDirective implements OnInit, OnChanges, OnDestroy {
    private i18n;
    rules: DValidateRules;
    dRulesStatusChange: EventEmitter<any>;
    private destroy$;
    constructor(cd: ControlContainer, parentDir: DFormGroupRuleDirective, i18n: I18nService);
    ngOnInit(): void;
    ngOnDestroy(): void;
    setErrorMessageByChild(msg: string): void;
    updateStatusAndMessageToView(status: any): void;
    static ɵfac: i0.ɵɵFactoryDeclaration<DFormGroupRuleDirective, [{ self: true; }, { optional: true; host: true; skipSelf: true; }, null]>;
    static ɵdir: i0.ɵɵDirectiveDeclaration<DFormGroupRuleDirective, "[dValidateRules][formGroupName],[dValidateRules][formArrayName],[dValidateRules][ngModelGroup],          [dValidateRules][formGroup],[dValidateRules]form:not([ngNoForm]),[dValidateRules][ngForm]", ["dValidateRules"], { "rules": "dValidateRules"; }, { "dRulesStatusChange": "dRulesStatusChange"; }, never, never, false>;
}
export declare class DFormControlRuleDirective extends DAbstractControlRuleDirective implements OnInit, OnChanges, OnDestroy {
    private dFormItem;
    private i18n;
    triggerElementRef: ElementRef;
    private overlayContainerRef;
    private componentFactoryResolver;
    rules: DValidateRules;
    dRulesStatusChange: EventEmitter<any>;
    popConfig: DPopConfig;
    popoverComponentRef: ComponentRef<PopoverComponent>;
    private destroy$;
    popMessage: string;
    get showType(): string;
    get popPosition(): any;
    constructor(cd: NgControl, dFormItem: FormItemComponent, parentDir: DFormGroupRuleDirective, i18n: I18nService, triggerElementRef: ElementRef, overlayContainerRef: OverlayContainerRef, componentFactoryResolver: ComponentFactoryResolver);
    ngOnInit(): void;
    setI18nText(): void;
    _registerFocusChange(): void;
    _updateFormContainer(status: any, message: string): void;
    _updatePopMessage(status: DFormControlStatus, message: string): void;
    updateStatusAndMessageToView(status: any): void;
    getFormControlStatusAndMessage(ngStatus: any): any[];
    createPopover(type: 'error' | 'warning', content: string): void;
    showPopMessage(): void;
    hidePopMessage(): void;
    showPop(type: any, message: any): void;
    hidePop(): void;
    destroyPop(): void;
    ngOnDestroy(): void;
    static ɵfac: i0.ɵɵFactoryDeclaration<DFormControlRuleDirective, [{ self: true; }, { optional: true; host: true; }, { optional: true; host: true; skipSelf: true; }, null, null, null, null]>;
    static ɵdir: i0.ɵɵDirectiveDeclaration<DFormControlRuleDirective, "[dValidateRules][formControlName],[dValidateRules][ngModel],[dValidateRules][formControl]", ["dValidateRules"], { "rules": "dValidateRules"; "popConfig": "dValidatePopConfig"; }, { "dRulesStatusChange": "dRulesStatusChange"; }, never, never, false>;
}
