import { RefObject } from 'react'; type OutsideClickTarget = RefObject | T | null; type OutsideClickIgnoredTarget = RefObject | Node | null | undefined; type UseOutsideClickOptions = { enabled?: boolean; events?: string[]; capture?: boolean; ignore?: OutsideClickIgnoredTarget[]; ownerDocument?: Document; }; /** * Custom hook that detects clicks outside of a specified element and triggers a callback. * * Useful for implementing dropdown menus, modals, or any component that should close * when the user clicks outside of it. * * @param ref - React ref object pointing to the element to monitor * @param callback - Function to call when a click occurs outside the element * @param isActive - Whether the outside click detection should be active (default: true) * * @example * ```tsx * const ref = useRef(null) * const [isOpen, setIsOpen] = useState(false) * * useOutsideClick(ref, () => setIsOpen(false), isOpen) * * return
...
* ``` */ export declare const useOutsideClick: (ref: OutsideClickTarget | OutsideClickTarget[], callback: (event: Event) => void, isActiveOrOptions?: boolean | UseOutsideClickOptions) => void; export declare const useClickOutside: (ref: OutsideClickTarget | OutsideClickTarget[], callback: (event: Event) => void, isActiveOrOptions?: boolean | UseOutsideClickOptions) => void; export type { UseOutsideClickOptions };