import type { MenuPosition, MenuRepositionMode } from "./menu.options.js"; import type { CollisionEdge } from "../../util/positioning.js"; export { CollisionEdges, type CollisionEdge } from "../../util/positioning.js"; /** * Options for the menu positioning manager * @internal */ export interface MenuPositioningOptions { menuReference: HTMLElement; anchorReference: HTMLElement; overflowBoundaryReference?: HTMLElement | null; repositionMode?: MenuRepositionMode; } /** * Positioning manager for menu component * Handles collision detection and repositioning logic * @internal */ export declare class MenuPositioning { private menuReference; private anchorReference; private overflowBoundaryReference; private rootMargin; private minMenuHeight; private _position; private _repositionMode; set position(value: MenuPosition); get position(): MenuPosition; set repositionMode(value: MenuRepositionMode); get repositionMode(): MenuRepositionMode; constructor(options: MenuPositioningOptions); /** * Gets the boundary bounds for overflow calculations. * Uses custom overflow boundary if set, otherwise uses viewport. * @returns BoundaryBounds object */ private getBoundaryBounds; /** * Checks if a position is valid (menu fits within boundary) * @param openPosition - The position to check * @returns Whether the position is valid */ checkPosition: (openPosition: MenuPosition) => boolean; /** * Gets the opposite position for flipping * @param collisionEdge - The edge where collision occurred * @returns The opposite position */ private oppositePosition; /** * Gets open positions based on collision edge * @param collisionEdge - The edge where collision occurred * @returns Array of valid positions */ private getOpenPositionsFromEdge; /** * Gets all currently valid positions * @returns Array of valid positions */ getOpenPositions: () => Array; /** * Finds valid positions based on intersection collision * @param entry - The intersection observer entry * @returns Array of valid positions */ findOpenPositionsFromCollision: (entry: IntersectionObserverEntry) => Array; /** * Calculates available space for the menu in a given position * @param position - The position to calculate space for * @returns Available height in pixels */ getMenuAvailableSpace: (position: MenuPosition) => number; /** * Determines if menu needs to be constrained with max-height * @returns Object with needsConstraint flag and maxHeight value */ calculateConstrainedHeight: () => { needsConstraint: boolean; maxHeight: number | null; }; /** * Checks if the menu overflows the boundary and returns the appropriate position. * This uses direct rect calculations, which is needed for custom boundaries * because popovers render in the top layer (outside the DOM hierarchy) * and IntersectionObserver with a custom root won't work correctly. * @returns Object with hasOverflow flag, collisionEdge, and suggested position */ checkOverflowWithBoundary: () => { hasOverflow: boolean; collisionEdge: CollisionEdge | undefined; suggestedPosition: MenuPosition | undefined; }; } //# sourceMappingURL=menu.positioning.d.ts.map