declare type Callback = (e: KeyboardEvent) => void; /** Maps keyboard shortcuts to actions */ export declare class Keymap { private __bindings; constructor(); /** Given a KeyboardEvent, returns a shortcut sequence matching that event. */ static identify(e: KeyboardEvent): string; /** Returns a canonical form of the shortcut sequence. */ static normalize(seq: string): string; /** * Bind a handler to be called when the shortcut sequence is pressed. * @param seq Shortcut sequence * @param cb Callback function */ bind(seq: string, cb: Callback): void; /** * Unbind a handler from a shortcut sequence. * @param seq Shortcut sequence * @param cb Handler to unbind */ unbind(seq: string, cb: Callback): void; /** Return all shortcut sequences with handlers bound to them. */ getKeys(): string[]; /** Get the list of handlers for a given shortcut sequence. */ getHandlers(seq: string): Callback[]; /** Dispatches all handlers matching the given event. */ handle(e: KeyboardEvent): void; } export {};