import type { HotInstance } from '../../core/types'; import ConditionCollection from './conditionCollection'; /** * Class which is designed for observing changes in condition collection. When condition is changed by user at specified * column it's necessary to update all conditions defined after this edited one. * * Object fires `update` hook for every column conditions change. * * @private * @class ConditionUpdateObserver */ declare class ConditionUpdateObserver { #private; /** * Handsontable instance. * * @type {Core} */ hot: HotInstance; /** * Reference to the instance of {@link ConditionCollection}. * * @type {ConditionCollection} */ conditionCollection: ConditionCollection; /** * Function which provide source data factory for specified column. * * @type {Function} */ columnDataFactory: (physicalColumn: number) => Record[]; /** * Collected changes when grouping is enabled. * * @type {Array} * @default [] */ changes: number[]; /** * Flag which determines if grouping events is enabled. * * @type {boolean} */ grouping: boolean; /** * The latest known position of edited conditions at specified column index. * * @type {number} * @default -1 */ latestEditedColumnPosition: number; /** * The latest known order of conditions stack. * * @type {Array} */ latestOrderStack: number[]; /** * Initializes the observer with the Handsontable instance, a condition collection to watch, and an optional factory for column source data. */ constructor(hot: HotInstance, conditionCollection: ConditionCollection, columnDataFactory?: (physicalColumn: number) => Record[]); /** * Enable grouping changes. Grouping is helpful in situations when a lot of conditions is added in one moment. Instead of * trigger `update` hook for every condition by adding/removing you can group this changes and call `flush` method to trigger * it once. */ groupChanges(): void; /** * Flush all collected changes. This trigger `update` hook for every previously collected change from condition collection. */ flush(): void; /** * Update all related states which should be changed after invoking changes applied to current column. * * @param {number} column The column index. * @param {object} conditionArgsChange Object describing condition changes which can be handled by filters on `update` hook. * It contains keys `conditionKey` and `conditionValue` which refers to change specified key of condition to specified value * based on referred keys. */ updateStatesAtColumn(column: number, conditionArgsChange?: unknown): void; /** * Destroy instance. */ destroy(): void; } interface ConditionUpdateObserver { addLocalHook(key: string, callback: Function): this; removeLocalHook(key: string, callback: Function): this; runLocalHooks(key: string, ...args: unknown[]): void; clearLocalHooks(): this; } export default ConditionUpdateObserver;