import React from "react"; import { AnchorPosition, PositionSettings } from "@primer/behaviors"; //#region src/hooks/useAnchoredPosition.d.ts interface AnchoredPositionHookSettings extends Partial { floatingElementRef?: React.RefObject; anchorElementRef?: React.RefObject; pinPosition?: boolean; onPositionChange?: (position: AnchorPosition | undefined) => void; enabled?: boolean; } /** * Calculates the top and left values for an absolutely-positioned floating element * to be anchored to some anchor element. Returns refs for the floating element * and the anchor element, along with the position. * @param settings Settings for calculating the anchored position. * @param dependencies Dependencies to determine when to re-calculate the position. * @returns An object of {top: number, left: number} to absolutely-position the * floating element. */ declare function useAnchoredPosition(settings?: AnchoredPositionHookSettings, dependencies?: React.DependencyList): { floatingElementRef: React.RefObject; anchorElementRef: React.RefObject; position: AnchorPosition | undefined; }; //#endregion export { AnchoredPositionHookSettings, useAnchoredPosition };