//#region src/inspector/facet-bar.logic.d.ts /** * Pure overflow policy for `InspectorFacetBar`: given the row's available * width and each chip's natural (measured) width, decides how many chips * stay visible and whether the overflow trigger renders — kept out of the * component so it's unit-testable without a DOM or a `ResizeObserver`. */ export type FacetOverflowInput = { /** Width inside the row available to the chips (the trigger's own * footprint is reserved out of this by the policy, not by the caller). */ availableWidth: number; /** Each chip's natural width, in the same order as the facets they * represent. */ chipWidths: readonly number[]; /** Index into `chipWidths` of the active chip — always kept visible * whenever anything is. */ activeIndex: number; /** The overflow trigger's own footprint, reserved alongside the chips * whenever not every chip fits. */ triggerWidth: number; /** Horizontal gap between adjacent chips, and between the last chip and * the trigger. */ gap?: number; }; export type FacetOverflowPolicy = { /** How many chips are visible. Counts a prefix of `chipWidths` in their * given order when the active chip already falls inside that prefix; * otherwise counts the active chip plus however many others (in order, * skipping the active one) fit alongside it. `0` is the narrow-width * floor: not even the active chip fits, so nothing but the trigger * shows. */ visibleCount: number; /** Whether the overflow trigger renders at all. */ showOverflowTrigger: boolean; }; /** * Decides the facet row's visible/overflow split. * * Narrow-width floor: if even the active chip cannot fit beside the * trigger, showing it anyway would push the trigger past * `availableWidth` — the row clips overflow, so the trigger (the only way * to reach ANY facet from this row) would become unreachable. Rather than * shrink the active chip below its natural width (this policy has no * minimum-width input to shrink to), this drops the active chip from the * visible row too and shows only the trigger: every facet, including the * active one, still reaches through the overflow menu, and the trigger * itself always stays on screen. */ export declare const resolveFacetOverflow: ({ availableWidth, chipWidths, activeIndex, triggerWidth, gap }: FacetOverflowInput) => FacetOverflowPolicy; //#endregion