import type { PopoverPlacement } from "@trackunit/react-components"; import { type RefObject } from "react"; type UsePopoverPlacementOptions = Readonly<{ skip?: boolean; }>; /** * Compute the ideal popover placement for a trigger element based on its * physical position inside a container (e.g. the map controls overlay). * * The popover opens *toward the center* of the container so it stays inside * the map square: * * | Trigger position | Popover direction | Placement | * |------------------|-------------------|------------------| * | top-left | down-right | `"bottom-start"` | * | top-center | down | `"bottom"` | * | top-right | down-left | `"bottom-end"` | * | bottom-left | up-right | `"top-start"` | * | bottom-center | up | `"top"` | * | bottom-right | up-left | `"top-end"` | * * Recomputes when the container resizes (via ResizeObserver). */ export declare const computePlacement: (triggerEl: HTMLElement, containerEl: HTMLElement) => PopoverPlacement; /** * Returns the ideal `PopoverPlacement` for a trigger element based on its * physical position within a container element. * * Purely position-based — not tied to semantic area names. If the layout * changes or controls move, the placement adapts automatically. */ export declare const usePopoverPlacement: (triggerRef: RefObject, containerRef: RefObject, options?: UsePopoverPlacementOptions) => PopoverPlacement; export {};