"use client"

import { useDocsKeyboardShortcutsStore } from "@/lib/stores/docs-keyboard-shortcuts-store"

/** Read/update user docs keyboard shortcuts (central config + overrides). */
export function useDocsKeyboardShortcuts() {
  const overrides = useDocsKeyboardShortcutsStore((state) => state.overrides)
  const getBinding = useDocsKeyboardShortcutsStore((state) => state.getBinding)
  const getBindings = useDocsKeyboardShortcutsStore((state) => state.getBindings)
  const formatShortcut = useDocsKeyboardShortcutsStore((state) => state.formatShortcut)
  const setBinding = useDocsKeyboardShortcutsStore((state) => state.setBinding)
  const resetBinding = useDocsKeyboardShortcutsStore((state) => state.resetBinding)
  const resetAll = useDocsKeyboardShortcutsStore((state) => state.resetAll)
  const getCatalog = useDocsKeyboardShortcutsStore((state) => state.getCatalog)

  return {
    overrides,
    getBinding,
    getBindings,
    formatShortcut,
    setBinding,
    resetBinding,
    resetAll,
    getCatalog,
  }
}

export {
  DOCS_KEYBOARD_SHORTCUT_DEFINITIONS,
  DOCS_KEYBOARD_SHORTCUTS_BY_ID,
  type DocsKeyboardShortcutsUserConfig,
  type DocsShortcutBinding,
  type DocsShortcutDefinition,
  type DocsShortcutId,
} from "@/lib/drive/docs-keyboard-shortcuts-config"
