import type { ValuesOf } from "./typings.js"; /** * Collision edge values for positioning calculations * @public */ export declare const CollisionEdges: { readonly top: "top"; readonly right: "right"; readonly bottom: "bottom"; readonly left: "left"; }; /** * Collision edge type * @public */ export type CollisionEdge = ValuesOf; /** * Reposition modes for positioned elements * @public */ export declare const RepositionModes: { readonly auto: "auto"; readonly flip: "flip"; readonly none: "none"; }; /** * Reposition mode type * @public */ export type RepositionMode = ValuesOf; /** * Boundary bounds for overflow calculations * @public */ export interface BoundaryBounds { top: number; bottom: number; left: number; right: number; } /** * Options for positioning calculations * @public */ export interface PositioningOptions { /** The element being positioned */ targetReference: HTMLElement; /** The anchor element to position against */ anchorReference: HTMLElement; /** Optional custom overflow boundary element */ overflowBoundaryReference?: HTMLElement | null; /** Margin from the edge of the boundary */ rootMargin?: number; } /** * Result of a collision check * @public */ export interface CollisionCheckResult { hasOverflow: boolean; collisionEdge: CollisionEdge | undefined; } /** * Default root margin for positioning calculations * @internal */ export declare const DEFAULT_ROOT_MARGIN = 15; /** * Gets the boundary bounds for overflow calculations. * Uses custom overflow boundary if provided, otherwise uses viewport. * @param overflowBoundaryReference - Optional custom boundary element * @returns BoundaryBounds object with top, bottom, left, right values * @public */ export declare function getBoundaryBounds(overflowBoundaryReference?: HTMLElement | null): BoundaryBounds; /** * Calculates available space in each direction relative to an anchor element * @param anchorRect - The anchor element's bounding rect * @param boundary - The boundary bounds * @param rootMargin - Margin to subtract from available space * @returns Object with available space in each direction * @public */ export declare function getAvailableSpace(anchorRect: DOMRect, boundary: BoundaryBounds, rootMargin?: number): { above: number; below: number; start: number; end: number; }; /** * Detects which edge(s) of a boundary the target element is colliding with * based on IntersectionObserver entry * @param entry - The intersection observer entry * @returns The collision edge if any * @public */ export declare function detectCollisionEdgeFromIntersection(entry: IntersectionObserverEntry): CollisionEdge | undefined; /** * Detects collision by comparing target rect against boundary bounds directly. * Useful when IntersectionObserver cannot be used (e.g., popovers in top layer) * @param targetRect - The target element's bounding rect * @param boundary - The boundary bounds to check against * @returns CollisionCheckResult with hasOverflow flag and collision edge * @public */ export declare function detectCollisionWithBoundary(targetRect: DOMRect, boundary: BoundaryBounds): CollisionCheckResult; /** * Gets the opposite vertical edge * @param edge - The collision edge * @returns The opposite edge for vertical positions * @public */ export declare function getOppositeVerticalEdge(edge: CollisionEdge): CollisionEdge; /** * Gets the opposite horizontal edge * @param edge - The collision edge * @returns The opposite edge for horizontal positions * @public */ export declare function getOppositeHorizontalEdge(edge: CollisionEdge): CollisionEdge; /** * Checks if a target element fits within the available space * @param targetSize - Width or height of the target element * @param availableSpace - Available space in the direction * @returns Whether the target fits * @public */ export declare function fitsInSpace(targetSize: number, availableSpace: number): boolean; //# sourceMappingURL=positioning.d.ts.map