import { default as React } from 'react'; import { Keymap, ShortcutSpec } from '../utils/keymap'; import { PrimaryModifier } from '../os/contract'; export declare const KeymapProvider: React.FC<{ /** Per-id overrides: a new combo string, or `null` to disable that binding. */ keymap?: Record; /** Disable every `global`-scope binding. */ disableGlobalShortcuts?: boolean; /** OS-package primary modifier used by `Mod` bindings. */ primaryModifier?: PrimaryModifier; children: React.ReactNode; }>; /** Access the instance's {@link Keymap} (or null outside a provider). */ export declare const useKeymapRegistry: () => Keymap | null; /** * Register a keyboard shortcut for the lifetime of the calling component. * * The handler is read through a ref, so it always sees fresh props/state without * re-registering. Pass `spec = null` to register nothing (e.g. a binding gated * on a condition). A no-op when used outside a {@link KeymapProvider}. */ export declare function useShortcut(spec: ShortcutSpec | null, handler: () => unknown): void; export interface ShortcutBinding { spec: ShortcutSpec; handler: () => unknown; } /** * Register a whole set of bindings at once (e.g. all of one app's shortcuts) — * a single hook call, so it satisfies the rules of hooks where a `useShortcut` * loop wouldn't. Handlers are read live through a ref; the set re-registers only * when its shape (`bindingsKey`) changes, so pass a stable key. */ export declare function useShortcuts(bindings: ShortcutBinding[], bindingsKey: string): void;