import { useEffect } from "react";
export const useOnEventOutside = (ref, eventType, callback) => {
    useEffect(() => {
        const handleMouseupOutside = (event) => {
            if (ref.current && !ref.current.contains(event.target)) {
                callback();
            }
        };
        window.addEventListener(eventType, handleMouseupOutside);
        return () => window.removeEventListener(eventType, handleMouseupOutside);
    }, [ref, callback]);
};
//# sourceMappingURL=useOnEventOutside.js.map