import type { CommandRegistry, CommandResult, CommandSpec } from "@pixerate/editor/commands"; type MaybeGetter = T | (() => T); export interface CommandShortcutsOptions { /** Element or window to listen on (default: `window`). */ target?: Window | HTMLElement | null; /** Active scopes, most specific first; a getter is read on every keydown. */ scopes?: MaybeGetter; /** Context for the commands (default: the registry's); a getter is read on every keydown. */ context?: MaybeGetter; /** Fire even while typing in inputs / contenteditable (default: per binding). */ allowInEditable?: boolean; /** Called after a shortcut ran a command. */ onRun?: (result: CommandResult) => void; } /** * Runs the registry's commands from their keyboard shortcuts (`registry.handleKeyDown`). * Typing in inputs and editors is never hijacked, and disabled commands leave the event * alone. Returns `{ destroy }`. */ export declare function createCommandShortcuts(registry: CommandRegistry, options?: CommandShortcutsOptions): { destroy: () => void; }; /** * Registers commands for the lifetime of the calling component (call it during * component initialisation). Pass a getter to react to changes: when it returns a * different array, the old commands are unregistered. */ export declare function useRegisterCommands(registry: MaybeGetter | null | undefined>, specs: MaybeGetter[] | null | undefined>): void; export {};