// packages/keyboard-shortcuts/src/hooks/use-shortcut-event-match.js
import { useSelect } from "@wordpress/data";
import { isKeyboardEvent } from "@wordpress/keycodes";
import { store as keyboardShortcutsStore } from "../store/index.mjs";
function useShortcutEventMatch() {
  const { getAllShortcutKeyCombinations } = useSelect(
    keyboardShortcutsStore
  );
  function isMatch(name, event) {
    return getAllShortcutKeyCombinations(name).some(
      ({ modifier, character }) => {
        return isKeyboardEvent[modifier](event, character);
      }
    );
  }
  return isMatch;
}
export {
  useShortcutEventMatch as default
};
//# sourceMappingURL=use-shortcut-event-match.mjs.map
