import type { ColumnDef } from '../types/column.types'; /** * Classification of a change between two consecutive `columns` store values. * * The renderer uses this to pick the cheapest DOM update that is still correct: * a width change needs no DOM work at all (the {@link ColumnStyleManager} * stylesheet already sized every cell), a pure reorder only needs existing * nodes moved, and only a structural change justifies tearing the grid down. */ export declare enum ColumnChangeKind { /** Nothing observable changed — the render can be skipped entirely. */ NONE = "none", /** Only column widths differ. Order, visibility and pinning are identical. */ WIDTH_ONLY = "width-only", /** At least one panel's columns were permuted; every panel holds the same set. */ ORDER_ONLY = "order-only", /** * A column changed panel (pinned, unpinned, or re-pinned to the other side). * The grid's visible column set is unchanged — only the panel each column * belongs to differs. * * Split out from {@link STRUCTURAL} because the two need the same DOM work but * different motion: pinning teleports a column across the grid and freezes it * against a different edge, so FLIPping the survivors reads as the layout * sloshing rather than as the column being pinned. See the columns watcher in * `GridRenderer`. */ PIN = "pin", /** Columns were added, removed, hidden or shown. Full rebuild. */ STRUCTURAL = "structural" } /** * Minimal, comparable description of a column layout. * * Captured once per `columns` store change and diffed against the previous * snapshot. Holds only what distinguishes the {@link ColumnChangeKind} values — * per-panel ordered ids plus the width map — so a capture is O(n) with a single * allocation per panel and never retains `ColumnDef` references. */ export interface ColumnLayoutSnapshot { /** Visible left-pinned column ids, in display order. */ readonly left: readonly string[]; /** Visible unpinned (center) column ids, in display order. */ readonly center: readonly string[]; /** Visible right-pinned column ids, in display order. */ readonly right: readonly string[]; /** Declared width per visible column id (`undefined` width normalises to `-1`). */ readonly widths: ReadonlyMap; } /** Empty snapshot used as the "no previous layout" seed. */ export declare const EMPTY_COLUMN_LAYOUT: ColumnLayoutSnapshot; /** * Builds a {@link ColumnLayoutSnapshot} from the current column definitions. * * Hidden columns are excluded: they contribute no DOM, so a change to one that * leaves the visible layout untouched is correctly reported as * {@link ColumnChangeKind.NONE}. * * @param columns - The raw `columns` store array (may include hidden columns). * @returns A snapshot safe to retain across renders. */ export declare function captureColumnLayout(columns: readonly ColumnDef[]): ColumnLayoutSnapshot; /** * Classifies the difference between two layout snapshots. * * Ordering of the checks matters: membership is tested before permutation so * that an add/remove/hide/pin is never mistaken for a reorder, and widths are * only consulted once the arrangement is known to be identical. A panel-level * membership change is then split once more — same visible ids in different * panels is a {@link ColumnChangeKind.PIN}, anything else is * {@link ColumnChangeKind.STRUCTURAL} — and that second test only runs on the * rare path where the panels already disagree. * * @param prev - Layout captured on the previous `columns` change. * @param next - Layout captured for the incoming `columns` value. * @returns The cheapest change kind that still describes the difference. */ export declare function diffColumnLayout(prev: ColumnLayoutSnapshot, next: ColumnLayoutSnapshot): ColumnChangeKind; //# sourceMappingURL=column-layout-diff.d.ts.map