( config: KeyBindingConfig = defaultKeyBindings, )
| 86 | * Creates key matchers from a key binding configuration |
| 87 | */ |
| 88 | export function createKeyMatchers( |
| 89 | config: KeyBindingConfig = defaultKeyBindings, |
| 90 | ): KeyMatchers { |
| 91 | const matchers = {} as { [C in Command]: KeyMatcher }; |
| 92 | |
| 93 | for (const command of Object.values(Command)) { |
| 94 | matchers[command] = (key: Key) => matchCommand(command, key, config); |
| 95 | } |
| 96 | |
| 97 | return matchers as KeyMatchers; |
| 98 | } |
| 99 | |
| 100 | /** |
| 101 | * Default key binding matchers using the default configuration |
no test coverage detected