import type { default as Table } from '../table/baseTable'; /** * The two knobs `markOversizedRows` exposes purely for the frozen-column row sync. Grouped so the * shared measurement function keeps a two-argument signature for its ordinary callers. */ interface FrozenPassOptions { /** * Leave a wiped record this table could not re-detect alone, rather than reading it as a row that * shrank back. Only the caller that measures every frozen table can tell the two apart. */ deferShrinkDetection?: boolean; /** * Receives the source index of every row this call records. */ recordedRows?: Set; } /** * Applies the provided column-header heights to the rendered THEAD rows. The provided height comes * from the `columnHeaderHeight` setting funnel (the option, the `modifyColumnHeaderHeight` hook that * AutoRowSize feeds, and the Handsontable-side render-size probe for content-driven headers). It is * written as `min-height`, never `height`, so a header whose real content is taller (a wrapped or * frozen-region header) is not clipped - it still expands to its content, which the frozen-overlay * sync then reads. Runs on the master and every clone so all overlays get the same floor. * * @param {Table} table The table (master or clone) whose THEAD rows receive the heights. */ export declare function adjustColumnHeaderHeights(table: Table): void; /** * Frozen column headers (e.g., with `white-space: normal`) are rendered only in the frozen * overlays, never in the master table's THEAD. When such a header is taller than the headers * of the scrollable columns, the master and top overlay THEADs render shorter than the corner * and inline-start overlays, so the frozen overlay body rows sit shifted against the master. * The gap can be sub-pixel: under browser zoom the frozen header content is a fraction of a * pixel taller than the applied height, and that fraction accumulates into a visible 1px shift. * * This function runs after the frozen overlays have rendered. It reads the corner overlay's * content-driven THEAD row heights with sub-pixel precision and forces the matching master and * top overlay header cells to the same height so every overlay THEAD ends up the same height * and the body rows stay pixel-aligned. * * It deliberately does NOT write to `wtViewport.oversizedColumnHeaders`. That cache is applied * back to the corner overlay on the next render; growing it here would inflate the corner cell, * which would then be re-measured taller, ratcheting the height up every render. Reading the * corner's natural (content-driven) height and only adjusting the master/top side keeps the * synchronization stable and lets the header shrink again when the content allows. * * @param {Table} table The master table. */ export declare function syncOversizedColumnHeadersWithFrozenOverlays(table: Table): void; /** * Whether this draw needs the frozen-column row-height sync at all: only when frozen columns exist * AND the master's rendered band starts past column 0, so at least one frozen column is rendered by * the inline-start overlays and by nothing else. AutoRowSize (`externalRowCalculator`) owns every * row height when it is on, and `markOversizedRows` is a no-op then. * * Called twice per draw, deliberately at two different moments, and they CAN disagree: the draw * cycle asks before the master renders (so `resetOversizedRows` knows whether the frozen-derived * records are still being maintained), which reads the band of the PREVIOUS draw; the sync asks * after, on this draw's band. Each wants the answer as of its own moment, and the disagreement is * the horizontal-scroll transition into or out of the frozen columns, which settles in one draw: * entering, the sync records the frozen heights the master could not; leaving, the released records * are re-measured by a master that now renders those columns itself. * * @param {Table} table The master table. * @returns {boolean} */ export declare function shouldSyncOversizedRowsWithFrozenOverlays(table: Table): boolean; /** * A row whose tallest content sits in a frozen (inline-start) column is rendered at that height only * by the frozen overlays. The master renders a contiguous column band starting at the column under * the horizontal scroll offset, so as soon as that band starts past column 0 the master never renders * the frozen columns — and `markOversizedRows` measures the master. Left alone, the row would be * recorded at its provided height while the frozen overlays render it at its content height, and * every row below it would drift by the difference. * * This runs after the frozen overlays have rendered, and is the row-height twin of * `syncOversizedColumnHeadersWithFrozenOverlays`. It measures all three tables that render frozen * columns — the inline-start clone, which mirrors the master's row band, and the two corners, which * hold the frozen top and bottom rows the inline-start clone does not — then re-applies the resulting * heights to the tables that render those rows WITHOUT the frozen columns. * * Re-measuring cannot ratchet: `resetFrozenOversizedRows` cleared these rows' records moments ago, * after the master rendered but before the frozen overlays did, so they rendered at their natural * content height. A frozen cell that shrank back is measured smaller and recorded smaller. * * @param {Table} table The master table. * @param {Map} [wipedFrozenRows] The heights `resetFrozenOversizedRows` cleared, so * an unchanged row is not mistaken for a new one (which would invalidate the row-height cache on * every draw — a full prefix-sum walk when the row-size source is non-uniform). * @returns {boolean} `true` when this draw's row heights are no longer the ones the viewport * calculators were built from, so the caller must rebuild them. An ordinary oversized row gets * this for free — the master invalidates inside `renderCellBand`, which is BEFORE the calculators * are computed — but a frozen-derived height is only knowable after the frozen overlays have * rendered, which is after. Without the rebuild the frame reports a visible row range measured * against the old heights. */ export declare function syncOversizedRowsWithFrozenOverlays(table: Table, wipedFrozenRows?: Map): boolean; /** * Resets cache of row heights. The cache should be cached for each render cycle in a case * when new cell values have content which increases/decreases cell height. * * Returns the wiped `oversizedRows` records of the rendered band, so `markOversizedRows` can * tell a re-detected UNCHANGED height (no row-height cache invalidation needed) from a genuine * change. Keys are deleted, not set to `undefined`, so the row-height cache's uniform fast path * can re-engage once no oversized records remain. * * @param {Table} table The table (master or bottom clone) whose rendered band is reset. * @returns {Map|undefined} The previous oversized heights of the rendered band, * keyed by source row index, or `undefined` when this table does not measure oversized rows. */ export declare function resetOversizedRows(table: Table): Map | undefined; /** * Clears the frozen-derived oversized-row records that this draw is about to re-measure, and returns * their previous heights so the frozen sync can tell an unchanged row from a changed one. * * Timing is the whole point. This runs in the seam between the master's render and the frozen * overlays' — after the master rendered (so it used the correct, still-recorded heights, and no row * drifts on this frame), after the row-height cache and the viewport calculators were built from * them, and before the inline-start overlays render, so those render at their natural content height * and stay re-measurable rather than being forced to the cached height and ratcheting. * * Only the rows this draw will re-measure are cleared: the master's rendered band (which the * inline-start clone mirrors) plus the frozen top and bottom rows (which the corner overlays hold). * A frozen-derived record for any other row is left alone — nothing would put it back, and the * summed row heights behind the scrollbar need it. * * @param {Table} table The master table. * @returns {Map|undefined} The cleared heights by source row, or `undefined` when * there was nothing recorded. */ export declare function resetFrozenOversizedRows(table: Table): Map | undefined; /** * Check if any of the rendered rows is higher than expected, and if so, cache them. * * The row-height position cache is invalidated only when the measured heights genuinely differ * from the records `resetOversizedRows` wiped before this render: a new oversized row, a changed * height, or a previously oversized row that shrank back. A steady-state redraw of the same tall * rows re-records the same values and keeps the cache intact, avoiding an O(totalRows) prefix-sum * rebuild on every full draw. * * @param {Table} table The table (master or bottom clone) whose rendered rows are measured. * @param {Map} [wipedOversizedRows] The oversized heights recorded before this * render, as returned by `resetOversizedRows`. * @param {object} [frozenPass] Options used only by the frozen-column row sync. * @param {boolean} [frozenPass.deferShrinkDetection=false] When `true`, a wiped record this table could not * re-detect is NOT treated as a shrunk row. The master passes this when the frozen-column row * sync runs later in the same draw: those records belong to rows whose tall content lives only in * the inline-start clone, so only that pass can tell "shrank back" from "the master never renders * it". Without the deferral a steady-state redraw would invalidate the row-height cache twice per * draw — and with a non-uniform row-size source each invalidation costs a full prefix-sum walk. * The caller keeps the map and must settle whatever is left in it. * @param {Set} [frozenPass.recordedRows] Filled with the source index of every row this call recorded. * The frozen sync marks exactly these as frozen-derived — a row that is oversized for a reason the * MASTER can see is not recorded here (the measured height does not exceed what is already known), * and must stay the master's to own. Adopting it would be fatal: the frozen overlays cannot * re-detect a height they never saw, so it would read as "shrank" on the next draw. * @returns {boolean} `true` when this call invalidated the row-height cache. The frozen-column row * sync reads it: an invalidation there lands AFTER `wtOverlays.refresh()` sized the overlay * elements for the draw, so it has to re-size them. */ export declare function markOversizedRows(table: Table, wipedOversizedRows?: Map, { deferShrinkDetection, recordedRows }?: FrozenPassOptions): boolean; export {};