import { HostViewComponent, Generic } from "cmf.core/src/core";
import * as ng from "@angular/core";
import { OnValidate, OnValidateArgs, ValidatorModel } from "./validatorDef";
export { OnValidate, OnValidateArgs, ValidatorModel, ResultMessageBag, ResultMessageType } from "./validatorDef";
/**
* The Validator directive.
* This directive can be added to any component for validation. Each component can have its own rules for validation,
which can differ depending on the context in which the validation
* is being called. A component can set its validation method which will receive a {@link ValidationContext} instance.
The component just needs to inform the directive which host component method
* should be called upon validation.
*
* ## Example
*
* Assume this HTML Template
*
* ```html
*
*
*
* ```
* Here we are telling the application that when a validation is requested up in the hierarchy,
in this case, component `some-parent` will validate passing the `action-id` as the validation context.
* The components can inspect this context to apply the according rules. The context is the `action-id` value `test`.
*/
export declare class Validator extends Generic implements OnValidate, ng.OnDestroy {
private _viewComponent;
parentModel: ValidatorModel;
childModel: ValidatorModel;
/**
* Specifies which host component element method will be called by the directive when validation is triggered.
*/
private _action;
/**
* Specifies which host component element method will be called by the directive when validation is triggered.
*/
private _resetAction;
action: string;
resetAction: string;
private _component;
constructor(_viewComponent: HostViewComponent, parentModel: ValidatorModel, childModel: ValidatorModel);
/**
* The Validation method which will execute the validation method of the host component
*
* @param {any} [context] Event arguments
*/
onValidate(context: OnValidateArgs, model?: ValidatorModel): Promise;
/**
* The Reset method which will clear all the validation persisted state
*
* @param {any} [context] Event arguments
*/
reset(): Promise;
/**
* Remove itself from parent validator(s)
*/
ngOnDestroy(): void;
}
/** Module */
export declare class ValidatorModule {
}