import type { ColumnArrangement } from './columnArrangement'; import type { SourceHeaderCell } from './sourceSettings'; /** * Membership overrides re-parent specific columns after a move: `physical column -> header level -> * owner identity`. The owner identity is the destination group's authored owner index (`>= 0`), or a * negative value meaning "standalone" (rendered as its own header). An entry overrides the authored * owner for that column at that level; absence falls back to the authored structure. Only group levels * carry overrides - a leaf always keeps its own label. */ export type MembershipOverrides = Map>; /** * Computes, for one normalized header layer, the index of the header cell that owns each column. * * In the normalized representation a header that spans N columns is one cell at its left edge with * `origColspan = N`, followed by N-1 placeholder cells. The owner index of every column in that span * is the left-edge index. Because the authored configuration is properly nested, this left-edge * index is a stable identity for the group at that level - two distinct groups (even with the same * label) own different columns, so they never merge when a move makes them adjacent. * * @param {SourceHeaderCell[]} layer - A single normalized header layer (one row of the matrix). * @returns {number[]} For each column index, the owning header cell's index within the layer. */ export declare function computeOwnerIndex(layer: SourceHeaderCell[]): number[]; /** * Resolves the group owner key for one physical column at one header level, applying the * standalone-sentinel and override-precedence contract shared by the derive and re-parent logic. * * A membership override (from a column move) wins: a non-negative value is the destination group's * authored owner index, a negative value means standalone. With no override the authored owner index * applies; a physical column with no authored header at this level gets a unique negative key * (`-1 - physical`) so it never coalesces with a real group. * * @param {number} physical - The physical column index. * @param {number[]} ownerIndex - The authored owner index per physical column for this level. * @param {number} [override] - The membership override for this column at this level, if any. * @returns {number} The group owner key (`>= 0` group, `< 0` standalone). */ export declare function resolveOwnerKey(physical: number, ownerIndex: number[], override?: number): number; /** * Derives the visual-order nested-header settings from the authored (physical-order) settings and a * column arrangement. This is the structural counterpart to `syncVisibilityOnTree`: visibility * answers "which columns are hidden", this answers "which header sits over each visual column". * * With an identity arrangement the output equals the authored input, so the legacy build is * reproduced exactly. With a moved arrangement the headers follow their physical columns, and groups * whose columns are no longer adjacent split into several same-label cells (the AG Grid model). * * The output width is the authored column count (every layer is normalized to that width), so the * structure spans exactly the columns the nested-headers definition covers - the same span as the * legacy build. The arrangement supplies only the visual-to-physical mapping. * * @param {SourceHeaderCell[][]} authoredSettings - The normalized header settings in authored order. * @param {ColumnArrangement} arrangement - The current visual-to-physical column arrangement. * @param {MembershipOverrides} [membershipOverrides] - Per-column re-parenting from column moves. * @returns {SourceHeaderCell[][]} The normalized header settings in visual order. */ export declare function deriveVisualSettings(authoredSettings: SourceHeaderCell[][], arrangement: ColumnArrangement, membershipOverrides?: MembershipOverrides): SourceHeaderCell[][];