import type { RefObject } from "react"; /** * The measuring half of progressive overflow — `chooseVisibleCount` * is the decision, this is the tape measure. * * ## Measured, not breakpointed * * mux-magic collapses at a hardcoded `480px` and plex-channels at a * hardcoded `760px`, and both numbers are wrong the moment a label * gets longer, the density axis changes, or a rail takes half the * row. A measured bar has no number to be wrong: it asks the * elements how wide they actually are, in the font and density they * are actually rendered in. * * ## One instance, and cached widths * * An item that has collapsed is **not in the DOM** — that is the * whole point, against a mechanism that renders every action twice * and hides one with a CSS specificity coin-flip. So its width * cannot be re-read while it is away, and it is remembered from * when it was last in the bar instead. * * The first paint is what seeds the cache: every item starts in the * bar (`chooseVisibleCount` returns all of them for an unmeasured * container), gets measured, and the row collapses **before paint** * because the measuring runs in a layout effect. Any item whose * width is still unknown forces one more all-visible pass rather * than being guessed at — one extra layout pass, and it converges, * because a mounted item always measures. * * ⚠️ **The measured element must not be sized by its own contents.** * If the bar shrink-wraps its items, collapsing one narrows the box, * which collapses another — a loop with no error anywhere. * `Toolbar`'s root is `flex-1 min-w-0` for exactly this reason, the * same trap `useAdaptiveColumns` documents about a container capped * by its own answer. */ export declare const useToolbarOverflow: ({ itemKeys, }: { /** Priority order, highest first. */ itemKeys: readonly string[]; }) => { containerRef: RefObject; /** Callback ref for each item's box. `null` on unmount. */ trackItem: (key: string, element: HTMLElement | null) => void; /** Callback ref for the overflow trigger's box. */ trackTrigger: (element: HTMLElement | null) => void; visibleCount: number; }; //# sourceMappingURL=useToolbarOverflow.d.ts.map