import type { Snippet } from "svelte"; export type PopperStrategy = "absolute" | "fixed"; export type PopperPlacement = "top" | "bottom" | "left" | "right" | "top-start" | "top-end" | "bottom-start" | "bottom-end" | "left-start" | "left-end" | "right-start" | "right-end"; export type PopperSide = "top" | "bottom" | "left" | "right"; export type PopperAlign = "start" | "center" | "end"; export type PopperProps = { /** Reference element the panel is positioned against. */ anchor: HTMLElement | null; /** Controlled open state. When false (or no anchor) nothing renders. */ open?: boolean; /** Wanted placement of the panel relative to the anchor. */ placement?: PopperPlacement; /** Main-axis distance (px) between the anchor and the panel. */ offset?: number; /** Flip to the opposite side when the panel would overflow the viewport. */ flip?: boolean; /** Shift along the cross axis to keep the panel within the viewport. */ shift?: boolean; /** Expose a positioned arrow element. */ arrow?: boolean; /** CSS positioning strategy. */ strategy?: PopperStrategy; /** Render the panel into `document.body` via a Portal. */ portal?: boolean; /** Optional class applied to the floating panel. */ class?: string; /** Notified whenever the resolved placement changes (after flip). */ onPlacementChange?: (placement: PopperPlacement) => void; /** * (a11y, opt-in) When true, traps keyboard focus inside the panel while it * is open (Tab cycles through focusable children; Shift+Tab cycles backward). * Intended for modal overlays built on top of Popper. Non-modal usage (menus, * tooltips) should leave this false (default) to keep the natural tab order. */ trapFocus?: boolean; /** * (a11y) When true (default when open), pressing Escape calls `onClose` so * the consumer can set `open = false`. Set to false to suppress this behavior. */ closeOnEscape?: boolean; /** * Called when the panel requests closing (Escape key, or future outside-click). * The consumer is responsible for updating `open` in response. */ onClose?: () => void; children?: Snippet; }; /** Split a placement into its side and (optional) alignment. */ export declare function splitPlacement(placement: PopperPlacement): { side: PopperSide; align: PopperAlign; }; /** Recompose a side + alignment into a placement string. */ export declare function joinPlacement(side: PopperSide, align: PopperAlign): PopperPlacement; export type Rect = { top: number; left: number; right: number; bottom: number; width: number; height: number; }; /** * Pure geometry: compute the panel coordinates (in the chosen strategy's * coordinate space) given the anchor rect, the panel size, and options. * Returns the resolved placement (after flip) and the top/left coordinates, * plus the arrow offset along the main edge. * * Coordinates are viewport-relative; callers add scroll offsets for the * `absolute` strategy. No DOM access here — safe to unit test. */ export declare function computePosition(anchorRect: Rect, panelWidth: number, panelHeight: number, options: { placement: PopperPlacement; offset: number; flip: boolean; shift: boolean; viewportWidth: number; viewportHeight: number; }): { placement: PopperPlacement; top: number; left: number; }; declare const Popper: import("svelte").Component; type Popper = ReturnType; export default Popper; //# sourceMappingURL=Popper.svelte.d.ts.map