Add TS JSDoc coverage and improve numeric step controls

This commit is contained in:
Jage9
2026-02-22 17:12:28 -05:00
parent 3e321df56c
commit 5f1f1022fc
13 changed files with 63 additions and 10 deletions

View File

@@ -1,3 +1,6 @@
/**
* Declarative command ids for the primary gameplay input mode.
*/
export type MainModeCommand =
| 'editNickname'
| 'toggleMute'
@@ -28,6 +31,9 @@ export type MainModeCommand =
| 'chatLast'
| 'escape';
/**
* Maps raw key events to a semantic command for main mode handling.
*/
export function resolveMainModeCommand(code: string, shiftKey: boolean): MainModeCommand | null {
if (code === 'KeyN') return 'editNickname';
if (code === 'KeyM') return shiftKey ? 'toggleOutputMode' : 'toggleMute';