import type { UmbValidationController } from './validation.controller.js'; import { UmbControllerBase } from '../../../../libs/class-api/index.js'; import type { UmbControllerAlias, UmbControllerHost } from '../../../../libs/controller-api/index.js'; import type { Observable } from '../../../../libs/observable-api/index.js'; /** * A method resolving the validation data path of a given item. * The path must be a stable identity for the item — it must not change while the item is still present, * otherwise it would look like the item was removed and a new one added in its place. * Return undefined for items that should be ignored entirely. */ export type UmbValidationCleanUpByDataPathDataPathResolver = (item: ItemType) => string | undefined; /** * Removes the validation messages of items that disappear from an observed array of items. * * Each item is identified by the validation data path returned for it by `dataPathResolver`. When an item * that was previously present stops being present, the messages at its data path — and at any descendant * path — are removed from the given Validation Context. Meaning anything nested inside a removed item's * data (e.g. a Block nested inside a removed Block) goes away with it. * * Notice the first emission of the observed array only establishes the baseline, as it can not be known * what was removed before this manager began observing. * @example * ```ts * new UmbValidationCleanUpByPathManager( * this, * this.validationContext, * this.properties, * (property) => `$.values[${UmbDataPathPropertyValueQuery(property)}]`, * ); * ``` */ export declare class UmbValidationCleanUpByPathManager extends UmbControllerBase { #private; /** * Creates an instance of UmbValidationCleanUpByPathManager. * @param {UmbControllerHost} host - The host of this controller. * @param {UmbValidationController} validationController - The Validation Context to remove messages from. * @param {Observable | undefined>} items - An Observable of the items to observe for removals. * @param {UmbValidationCleanUpByDataPathDataPathResolver} dataPathResolver - Resolves the validation data path of a given item. * @param {UmbControllerAlias} [controllerAlias] - An optional controller alias, enables replacing this manager with a new one. */ constructor(host: UmbControllerHost, validationController: UmbValidationController, items: Observable | undefined>, dataPathResolver: UmbValidationCleanUpByDataPathDataPathResolver, controllerAlias?: UmbControllerAlias); destroy(): void; }