import type { IMapChange, INotifyMapChanged } from '../../collections'; import { ValidationTrigger } from './ValidationTrigger'; /** * Represents the map changed validation trigger configuration. * @template TKey The type of keys the map contains. * @template TItem The type of items the map contains. * @template TMap The map type that may trigger validations. */ export interface IMapChangedValidationTriggerConfig = INotifyMapChanged> { /** * Gets the map that may trigger a validation. */ readonly map: TMap; /** * Optional, a guard method which controls when a validation should be triggered. * @param map The map that changed. * @param mapChange The map change. */ shouldTriggerValidation?(map: TMap, mapChange: IMapChange): boolean; } /** * Represents a map changed validation trigger. Whenever the map changes a validation may be triggered. * @template TKey The type of keys the map contains. * @template TItem The type of items the map contains. * @template TMap The map type that may trigger validations. */ export declare class MapChangedValidationTrigger = INotifyMapChanged> extends ValidationTrigger { private readonly _mapChangedEventHandler; /** * Initializes a new instance of the {@linkcode MapChangedValidationTrigger} class. * @param config The validation trigger config. */ constructor(config: IMapChangedValidationTriggerConfig); /** * Subscribes to map changes. */ protected subscribeToTarget(): void; /** * Unsubscribes from map changes. */ protected unsubscribeFromTarget(): void; }