export type OverflowListPhase = "normal" | "measuring" | "measuring-overflow-indicator"; export interface UseOverflowListOptions { /** Total number of items the consumer wants to render. */ itemCount: number; /** Max rows the items are allowed to occupy. Default 1. */ maxRows?: number; /** Hard cap on visible items. Default 100. */ maxVisibleItems?: number; /** * After the container dimensions change, flush the state immediately (default is true). * If true, using flushSync to update the state immediately - this can affect performance but avoid flickering. * If false, using requestAnimationFrame to update the state - this avoid forced reflow and improve performance. */ flushImmediately?: boolean; } export interface UseOverflowListReturn { /** Attach to the flex-wrap container that holds the items. */ containerRef: React.RefObject; /** Attach to the overflow indicator element so its width is measured. */ overflowIndicatorRef: React.RefObject; /** Final visible count = visibleCount - subtractCount (matches original primitive's `finalVisibleCount`). */ visibleCount: number; /** Number of items hidden by the overflow indicator (items.length - visibleCount). */ hiddenCount: number; /** Current measurement phase — consumers must use this to decide item visibility. */ phase: OverflowListPhase; /** * True when the overflow indicator should be rendered. False during the initial * "measuring" phase so all items can be measured without the indicator interfering. */ showOverflow: boolean; } export declare function useOverflowList({ itemCount, maxRows, maxVisibleItems, flushImmediately, }: UseOverflowListOptions): UseOverflowListReturn;