type Modifier = 'mod' | 'ctrl' | 'alt' | 'shift' | 'meta'; export interface ParsedShortcut { modifiers: Set; key: string; } /** `mod+Shift+P` → `{ modifiers: {mod, shift}, key: 'p' }`. Throws on a shortcut with no key. */ export declare function parseShortcut(shortcut: string): ParsedShortcut; /** * A key as a person finds it on the keyboard. The modifiers resolve to one * per platform — `mod` is `command` on a Mac and `control` elsewhere — so a * translation names each physical key once. */ export type ShortcutKeyId = 'command' | 'control' | 'option' | 'alt' | 'shift' | 'windows' | 'enter' | 'escape' | 'backspace' | 'delete' | 'tab' | 'space' | 'arrowup' | 'arrowdown' | 'arrowleft' | 'arrowright'; /** * What each key is printed as, and what a screen reader says for it. English * defaults: a German keyboard prints `Strg` and `Entf` — pass those through * Kbd's `keyLabels`. * * `symbol` is what is printed off a Mac, and on a Mac too unless the key has * a `macSymbol` — the glyphs ⌘ ⌃ ⌥ ⇧, which are the same in every language * and so are rarely replaced. */ export type ShortcutKeyLabels = Partial>; export interface ShortcutKey { /** What is printed on the key: `⌘`, `Ctrl`, `K`. */ symbol: string; /** What a screen reader should say: `Command`, `Control`, `K`. */ name: string; } /** The keys to draw, in the platform's conventional order. */ export declare function shortcutKeys(shortcut: string, isMac: boolean, labels?: ShortcutKeyLabels): ShortcutKey[]; /** Whether a keydown is this shortcut — modifiers exact, so `mod+k` is not `mod+shift+k`. */ export declare function matchesShortcut(event: Pick, shortcut: ParsedShortcut, isMac: boolean): boolean; export {}; //# sourceMappingURL=shortcut.d.ts.map