import { useEffect } from "react";
export function useGlobalEditorKeyDown(onKeyDown) {
    useEffect(() => {
        if (typeof window === "undefined")
            return;
        const wrappedHandler = (ev) => {
            onKeyDown(ev);
        };
        window.addEventListener("keydown", wrappedHandler, true);
        return () => {
            window.removeEventListener("keydown", wrappedHandler, true);
        };
    }, [onKeyDown]);
}
//# sourceMappingURL=useGlobalEditorKeyDown.js.map