import type { RequireOnlyOne } from "../typings"; import { type ClientRect } from "../utils"; export declare type Alignment = "start" | "end"; export declare type Side = "top" | "right" | "bottom" | "left"; export declare type AlignedPlacement = `${Side}-${Alignment}`; export declare type Placement = Side | AlignedPlacement; export declare type Strategy = "absolute" | "fixed"; export declare type Coordinates = { x: number; y: number; }; export declare type Dimensions = { width: number; height: number; }; export declare type Rect = Coordinates & Dimensions; export declare type ElementRects = { anchorRect: Rect; popperRect: Rect; }; export declare type VirtualElement = { getBoundingClientRect(): ClientRect; }; export declare type Elements = { anchorElement: HTMLElement | VirtualElement; popperElement: HTMLDivElement; }; export declare type OffsetMiddleware = number | { /** * The axis that runs along the side of the popper element. */ mainAxis?: number; /** * The axis that runs along the alignment of the popper element. */ crossAxis?: number; }; export declare type AutoPlacementMiddleware = boolean | { excludeSides: Side[]; }; declare type MiddlewareResult = RequireOnlyOne<{ coordinates: Partial; placement: Placement; }>; export declare type ComputationMiddlewareArgs = { elementRects: ElementRects; elements: Elements; coordinates: Coordinates; placement: Placement; }; export declare type ComputationMiddlewareResult = MiddlewareResult; export declare type ComputationMiddlewareOrder = "beforeAutoPlacement" | "afterAutoPlacement"; export declare type ComputationMiddleware = (args: ComputationMiddlewareArgs) => ComputationMiddlewareResult; export declare type ComputationResult = Coordinates & { placement: Placement; }; export declare const sides: readonly ["top", "right", "bottom", "left"]; export declare const alignments: readonly ["end", "start"]; export declare const strategies: readonly ["absolute", "fixed"]; /** * Computes the `x` and `y` coordinates that will place the popper element * next to a anchor element when it is given a certain positioning strategy. */ export declare const computePosition: (anchorElement: HTMLElement | VirtualElement, popperElement: HTMLDivElement, config: { placement: Placement; strategy: Strategy; isRtl: boolean; autoPlacement: AutoPlacementMiddleware; offset: OffsetMiddleware; computationMiddleware?: ComputationMiddleware | undefined; computationMiddlewareOrder: ComputationMiddlewareOrder; }) => ComputationResult; export {};