/// import { OverlayTriggerProps } from '@react-types/overlays'; import { PopoverPlacement } from './utils'; export interface UsePopoverProps extends OverlayTriggerProps { placement?: PopoverPlacement; shouldFlip?: boolean; offset?: number; /** Handler that is called when the overlay should close. */ onClose?: () => void; /** * Whether to close the overlay when the user interacts outside it. * @default false */ isDismissable?: boolean; /** * Type of overlay that is opened by the trigger. */ triggerType?: 'dialog' | 'menu' | 'listbox' | 'tree' | 'grid'; /** * Whether the popover is animated. */ disableAnimation?: boolean; /** Whether the overlay should close when focus is lost or moves outside it. */ shouldCloseOnBlur?: boolean; /** * Whether pressing the escape key to close the overlay should be disabled. * @default false */ isKeyboardDismissDisabled?: boolean; /** * When user interacts with the argument element outside of the overlay ref, * return true if onClose should be called. This gives you a chance to filter * out interaction with elements that should not dismiss the overlay. * By default, onClose will always be called on interaction outside the overlay ref. */ shouldCloseOnInteractOutside?: (element: HTMLElement) => boolean; } /** * @internal */ export declare function usePopover(props?: UsePopoverProps): { state: import("@react-stately/overlays").OverlayTriggerState; exited: boolean; overlayRef: import("react").RefObject; triggerRef: import("react").RefObject; placement: PopoverPlacement; disableAnimation: boolean; shouldCloseOnBlur: boolean; isDismissable: boolean; isKeyboardDismissDisabled: boolean; shouldCloseOnInteractOutside: ((element: HTMLElement) => boolean) | undefined; isOpen: boolean; onClose: () => void; onExited: () => void; onEntered: () => void; triggerProps: import("@react-types/button").AriaButtonProps<"button">; overlayProps: import("react").HTMLAttributes; positionProps: import("react").HTMLAttributes; getTriggerProps: (props?: any, _ref?: any) => any; getPopoverProps: (props?: any) => any; }; export declare type UsePopoverReturn = ReturnType;