import { FormControl, FormGroupDirective, NgControl, NgForm } from '@angular/forms'; import { Subject } from 'rxjs'; import { Constructor } from './constructor'; /** * 提供程序, 用于定义窗体控件在显示错误消息方面的行为方式。 */ export declare class ErrorStateMatcher { isErrorState(control: FormControl | null, form: FormGroupDirective | NgForm | null): boolean; } /** 当控件无效且脏时匹配的错误状态 */ export declare class ShowOnDirtyErrorStateMatcher implements ErrorStateMatcher { isErrorState(control: FormControl | null, form: FormGroupDirective | NgForm | null): boolean; } export interface CanUpdateErrorState { errorState: boolean; errorStateMatcher: ErrorStateMatcher; readonly stateChanges: Subject; updateErrorState(): void; } export declare type CanUpdateErrorStateCtor = Constructor; export interface HasErrorState { _defaultErrorStateMatcher: ErrorStateMatcher; _parentForm: NgForm; _parentFormGroup: FormGroupDirective; ngControl: NgControl; } /** * Mixin 用 updateErrorState 方法增加指令。 对于具有 errorState 的组件, 需要更新 errorState。 */ export declare function mixinErrorState>(base: T): Constructor & T;