feat: add type-safe KeyId for matchesKey function

- Add KeyId union type covering all valid key combinations
- Add Key helper object for autocomplete (Key.ctrl('c'), Key.escape, etc.)
- Update matchesKey signature to use KeyId instead of string
- Catches typos like 'esacpe' at compile time
This commit is contained in:
Helmut Januschka 2026-01-03 16:03:35 +01:00
parent f79256ac3b
commit 38b7f21e01
3 changed files with 123 additions and 9 deletions

View file

@ -27,11 +27,10 @@ export {
type EditorKeybindingsConfig,
EditorKeybindingsManager,
getEditorKeybindings,
type KeyId,
setEditorKeybindings,
} from "./keybindings.js";
// Keyboard input handling
export { matchesKey, parseKey } from "./keys.js";
export { Key, type KeyId, matchesKey, parseKey } from "./keys.js";
// Terminal interface and implementations
export { ProcessTerminal, type Terminal } from "./terminal.js";
// Terminal image support