import type { ICollectionChange, INotifyCollectionChanged } from '../../collections'; import { ValidationTrigger } from './ValidationTrigger'; /** * Represents the collection changed validation trigger configuration. * @template TItem The type of item the collection contains. * @template TCollection The collection type that may trigger validations. */ export interface ICollectionChangedValidationTriggerConfig = INotifyCollectionChanged> { /** * Gets the collection that may trigger a validation. */ readonly collection: TCollection; /** * Optional, a guard method which controls when a validation should be triggered. * @param collection The collection that changed. * @param collectionChange The collection change. */ shouldTriggerValidation?(collection: TCollection, collectionChange: ICollectionChange): boolean; } /** * Represents a collection changed validation trigger. Whenever the collection changes a validation may be triggered. * @template TItem The type of item the collection contains. * @template TCollection The collection type that may trigger validations. */ export declare class CollectionChangedValidationTrigger = INotifyCollectionChanged> extends ValidationTrigger { private readonly _collectionChangedEventHandler; /** * Initializes a new instance of the {@linkcode CollectionChangedValidationTrigger} class. * @param config The validation trigger config. */ constructor(config: ICollectionChangedValidationTriggerConfig); /** * Subscribes to collection changes. */ protected subscribeToTarget(): void; /** * Unsubscribes from collection changes. */ protected unsubscribeFromTarget(): void; }