import type { INotifyPropertiesChanged } from '../../viewModels'; import { ValidationTrigger } from './ValidationTrigger'; /** * Represents the view model validation trigger configuration. * @template TViewModel The view model type that may trigger validations. */ export interface IViewModelChangedValidationTriggerConfig { /** * The view model that may trigger a validation. */ readonly viewModel: TViewModel; /** * Optional, a guard method which controls when a validation should be triggered. * @param viewModel The view model that has changed. * @param changedProperties The properties that have changed on the view model. */ shouldTriggerValidation?(viewModel: TViewModel, changedProperties: readonly (keyof TViewModel)[]): boolean; } /** * Represents a view model validation trigger, whenever the view model changes a validation should occur. * @template TViewModel The view model type that may trigger validations. */ export declare class ViewModelChangedValidationTrigger extends ValidationTrigger { private readonly _viewModelChangedEventHandler; /** * Initializes a new instance of the {@linkcode ViewModelChangedValidationTrigger} class. * @param config The validation trigger config. */ constructor(config: IViewModelChangedValidationTriggerConfig); /** * Subscribes to view model changes. */ protected subscribeToTarget(): void; /** * Unsubscribes from view model changes. */ protected unsubscribeFromTarget(): void; }