import { HotkeyMap } from '../hooks/useHotkeys.js'; import { MenuEntry } from './menu.types.js'; /** * The bindings for a menu's `shortcut` entries, to hand to `useHotkeys` yourself. * * The menu draws a shortcut but never listens for one, because only the app knows what else is * listening: binding it here as well as in an app's own keymap would run the action twice, and * whether a shortcut should work at all times or only while the menu is open is the app's * question, not the menu's. Calling this keeps the answer in one spelling, so the hint the menu * draws cannot drift from what actually fires. * * ```tsx * useHotkeys(menuHotkeys(items, run)); // whenever the page is up * useHotkeys(menuHotkeys(items, run), { enabled: isOpen }); // only while the menu is open * ``` * * Runs each entry the way clicking it does: its own `onClick`, then `onAction`, then its `href`. * A `disabled` entry, and an entry with no `shortcut`, is left out. */ export declare function menuHotkeys(items: MenuEntry[], onAction?: (id: string) => void): HotkeyMap;