export interface ShortcutBinding { /** Unique identifier for the shortcut. */ id: string; /** Combo string, e.g. "mod+k", "escape", "shift+?". `mod` = meta on Mac, ctrl otherwise. */ combo: string; /** Direct callback (optional — also fires `native:shortcut` event). */ handler?: (e: KeyboardEvent) => void; /** Conditional guard — skip this binding if returns false. */ when?: () => boolean; /** Prevent default browser action on match. Default true. */ preventDefault?: boolean; /** Stop event propagation on match. Default false. */ stopPropagation?: boolean; /** Allow firing inside inputs, textareas, and contenteditable. Default false. */ allowEditable?: boolean; } export interface ShortcutOptions { /** Initial shortcut bindings. */ shortcuts?: ShortcutBinding[]; /** Listen on document (capture phase) instead of host. Default false. */ global?: boolean; } interface ParsedCombo { key: string; ctrl: boolean; meta: boolean; shift: boolean; alt: boolean; } /** Parse a combo string into key + modifier booleans. */ export declare function parseCombo(combo: string): ParsedCombo; /** * Keyboard shortcut controller. * * Registers keyboard shortcuts on a host element (or globally on `document`). * Fires `native:shortcut` event on the host with `{ id, combo }` detail. * * ```ts * const ctrl = new ShortcutController(host, { * shortcuts: [ * { id: 'search', combo: 'mod+k', handler: () => openSearch() }, * { id: 'help', combo: 'shift+?', handler: () => showHelp() }, * ], * global: true, * }); * ``` */ export declare class ShortcutController { #private; readonly host: HTMLElement; readonly global: boolean; constructor(host: HTMLElement, options?: ShortcutOptions); /** Add a shortcut binding at runtime. */ add(binding: ShortcutBinding): void; /** Remove a shortcut binding by id. */ remove(id: string): void; /** Remove all bindings and detach listeners. */ destroy(): void; } export {}; //# sourceMappingURL=shortcut-controller.d.ts.map