export type PriorityOverflowStage = 'full' | 'icons'; export interface PriorityLayoutInput { /** Inline size of the box the strip must fit into. */ containerWidth: number; /** Natural width of each item at the full (icon + label) stage. */ fullWidths: number[]; /** Whole-row natural width at the full stage (captures joins/margins). */ fullRowWidth: number; /** Natural per-item widths at the icon-only stage; omit for single-stage. */ iconWidths?: number[]; /** Whole-row natural width at the icon-only stage. */ iconRowWidth?: number; /** Natural width of the overflow trigger button. */ triggerWidth: number; /** Items kept in the strip ahead of every unpinned item. A pin moves * into the menu only when it is also `movable`. */ pinned?: ReadonlyArray; /** Pinned items that may still move into the menu, trailing first, when * the pinned items alone do not fit beside the trigger. Without this a * pinned item never moves, and the trigger can be pushed out of view. */ movable?: ReadonlyArray; } export interface PriorityLayout { stage: PriorityOverflowStage; /** Per-item: true = rendered in the strip, false = moved to the menu. */ visible: boolean[]; /** True when at least one item moved to the menu (trigger shown). */ overflowing: boolean; } /** * Pure priority+ maths: full row → icon-only row → trailing items into a * menu behind a trigger. Width sums are direction-agnostic, so the result * is identical in RTL. `+1` tolerances absorb sub-pixel rounding. */ export declare function computePriorityLayout(input: PriorityLayoutInput): PriorityLayout; export interface UsePriorityOverflowOptions { /** Master switch — off = everything visible, nothing measured. */ enabled: boolean; /** Number of items in the strip (drives re-measure on child changes). */ count: number; /** Measure a second icon-only stage before spilling into the menu. */ twoStage?: boolean; /** Per-index pin flags: pinned items stay in the strip ahead of the * rest, and move into the menu only when they are also `movable`. */ pinned?: ReadonlyArray; /** Per-index: a pinned item may still move, trailing first, when the pins * alone do not fit beside the trigger. Unpinned items then all move too. */ movable?: ReadonlyArray; } export interface UsePriorityOverflowReturn { /** Attach to the block wrapper whose inline size is the budget. */ containerRef: (node: HTMLElement | null) => void; /** Attach to the hidden row of full-stage clones. */ fullRowRef: (node: HTMLElement | null) => void; /** Attach to the hidden row of icon-stage clones (twoStage only). */ iconRowRef: (node: HTMLElement | null) => void; /** Attach to the hidden overflow-trigger probe. */ triggerProbeRef: (node: HTMLElement | null) => void; stage: PriorityOverflowStage; visible: boolean[]; overflowing: boolean; } /** * Priority+ overflow for a horizontal control strip. The caller renders * hidden measurement rows (always mounted, `aria-hidden` + `inert`, * visibility-hidden — never display:none, they must keep layout) and this * hook compares their natural widths against the container. Because the * rows stay mounted, font swaps and label/locale changes resize them and * the ResizeObserver re-measures — no font or i18n listeners needed. */ export declare function usePriorityOverflow(options: UsePriorityOverflowOptions): UsePriorityOverflowReturn; //# sourceMappingURL=use-priority-overflow.d.ts.map