///
export declare const POSITION: {
readonly "top-start": "top-start";
readonly top: "top";
readonly "top-end": "top-end";
readonly "bottom-start": "bottom-start";
readonly bottom: "bottom";
readonly "bottom-end": "bottom-end";
readonly "left-start": "left-start";
readonly left: "left";
readonly "left-end": "left-end";
readonly "right-start": "right-start";
readonly right: "right";
readonly "right-end": "right-end";
};
export declare type Position = keyof typeof POSITION;
interface TargetPosition {
x: number;
y: number;
}
/**
* Will position the floating element (tooltip) relative to the anchor element,
* using `position: fixed` and in such a way that it shouldn't ever appear
* partially offscreen and will move correctly when the parent is scrolled.
*/
export declare const usePosition: ({ key, position, offset, active, flip, clamp, }: {
/** Listen to changes on this value */
key?: string | number | boolean | undefined;
/** Placement relative to anchor */
position: Position;
/** Distance from anchor (default: `0`) */
offset?: number | undefined;
/** Optionally disable for performance (default: `true`) */
active?: boolean | undefined;
/** Optionally disable flipping (default: `true`) */
flip?: boolean | undefined;
/** Optionally disable clamping (default: `true`) */
clamp?: boolean | undefined;
}) => {
tooltipRef: import("react").MutableRefObject;
anchorRef: import("react").MutableRefObject;
state: {
isFlipped: boolean;
};
};
interface PlaceTooltip {
anchor: HTMLElement;
tooltip: HTMLElement;
position: Position;
offset?: number;
boundaryRect?: DOMRect;
flip?: boolean;
clamp?: boolean;
}
export declare const placeTooltip: ({ anchor, tooltip, position, offset, boundaryRect, flip, clamp, }: PlaceTooltip) => {
isFlipped: boolean;
};
export declare const getPosition: (elementRect: Pick, tooltipRect: Pick, position: Position) => TargetPosition;
export declare const translateWithOffset: (targetPosition: TargetPosition, position: Position, offset: number) => string;
export declare const getDocumentBoundingRect: () => DOMRect;
interface ShouldFlip {
targetPosition: TargetPosition;
position: Position;
boundaryRect: Pick;
tooltipRect: Pick;
}
export declare const shouldFlip: ({ targetPosition, position, boundaryRect, tooltipRect, }: ShouldFlip) => boolean;
export {};