/** * Keybinding strings: `"Control+Shift+K"`, `"Mod+S"`, `"F1"`, `"Alt+ArrowUp"`. * * Modifiers are `Control`/`Ctrl`, `Shift`, `Alt`/`Option`, `Meta`/`Cmd`, and * `Mod` — Cmd on macOS, Control everywhere else, which is what most * cross-platform shortcuts mean. The last segment is the key, compared against * `KeyboardEvent.key` case-insensitively. `"Control++"` binds the plus key. */ export interface ParsedKeybinding { ctrl: boolean; shift: boolean; alt: boolean; meta: boolean; key: string; } /** Whether we are on an Apple platform, where `Mod` means Cmd. */ export declare const isMac: () => boolean; /** Parse a binding. `mac` decides what `Mod` means; defaults to this platform. */ export declare const parseKeybinding: (binding: string, mac?: boolean) => ParsedKeybinding; /** Whether a key event matches a binding. */ export declare const matchesKeybinding: (event: KeyboardEvent, binding: string, mac?: boolean) => boolean; /** * Whether a binding includes Control, Alt or Meta. Bindings without one — * bare keys and Shift+key — are text input, and by default do not fire while * the user is typing in a field. */ export declare const hasCommandModifier: (binding: string, mac?: boolean) => boolean; /** * A binding as the user should read it: `⌘⇧K` on macOS, `Ctrl+Shift+K` * elsewhere. Strings that do not parse as a binding (already-formatted hints * such as `"⌘S"`) are returned unchanged. */ export declare const formatKeybinding: (binding: string, mac?: boolean) => string; /** Whether an event target is somewhere the user types. */ export declare const isEditableTarget: (target: EventTarget | null) => boolean;