import { Event } from "./Event"; /** * Async validation event which is spawned when some change of state must be validated by third parties and make * it possible to execute any number of validators to it, where first validator that return anything else but true * will be taken as a validation failure. */ export declare class AsyncValidationEvent extends Event { private validators; constructor(type: Event['type'], data?: Event['data']); /** * Add validator in form of function which returns true if validation has passed of anything else that is taken * as an error. * @param validators */ readonly addValidator: (...validators: Validator[]) => number; /** * Launch validators one by one in sequence they've been added to list and halt as any returns error or we run * out of them. */ readonly validate: () => Promise; } declare type Validator = () => Promise; export {};