import type { default as MetaManagerInstance } from '..'; import type { HotInstance } from '../../../core/types'; import type { CellProperties } from '../../../settings'; /** * @class DynamicCellMetaMod * * The `DynamicCellMetaMod` modifier allows for extending cell meta objects * (returned by `getCellMeta()` from `MetaManager`) * by user-specific properties. * * The user-specific properties can be added and changed dynamically, * either by Handsontable's hooks (`beforeGetCellMeta` and`afterGetCellMeta`), * or by Handsontable's `cells` option. * * The `getCellMeta()` method is used widely throughout the source code. * To boost the method's execution time, * the logic is triggered only once per one Handsontable slow render cycle. */ type MetaManagerWithHot = MetaManagerInstance & { hot: HotInstance; updateCellMeta: (...args: unknown[]) => void; [key: string]: unknown; }; /** * Modifier that extends cell meta objects dynamically through Handsontable hooks and the `cells` option, * memoizing results per render cycle to avoid redundant work. */ export declare class DynamicCellMetaMod { #private; /** * @type {MetaManager} */ metaManager: MetaManagerWithHot; /** * Per-render-cycle memo of cells already extended by `extendCellMeta`, keyed by physical row to a * set of physical columns. * * @type {Map>} */ metaSyncMemo: Map>; /** * Initializes the modifier, registers the `afterGetCellMeta` local hook, subscribes to `beforeRender` * to clear the memo on full renders, and subscribes to `afterScrollVertically` and `afterViewRender` * to evict render-derived cell meta for rows that left the viewport. */ constructor(metaManager: MetaManagerWithHot); /** * Extends the cell meta object by user-specific properties. * * The cell meta object can be extended dynamically, * either by Handsontable's hooks (`beforeGetCellMeta` and`afterGetCellMeta`), * or by Handsontable's `cells` option. * * To boost performance, the extending process is triggered only once per one slow Handsontable render cycle. * * @param {object} cellMeta The cell meta object. */ extendCellMeta(cellMeta: CellProperties): void; /** * Extends a transient (not stored) cell meta object by the same user-specific properties as * `extendCellMeta`, with two deliberate differences. The `cells`/`type` settings are applied * directly on the transient object - never through `updateCellMeta`, which would permanently * materialize the cell. And `metaSyncMemo` is neither read nor written: the memo must reflect only * STORED meta objects, or a stored cell created later would skip its extension (a rendering bug), * and memo growth would defeat the point of a retention-free scan. * * @param {object} cellMeta The transient cell meta object. */ extendTransientCellMeta(cellMeta: Record): void; } export {};