UNPKG

terminal-chat-ui

Version:

Shared UI components for terminal-based chat interfaces using Theater actors

32 lines (31 loc) 777 B
/** * Centralized input handling types */ export interface KeyEvent { input: string; key: { return?: boolean; escape?: boolean; backspace?: boolean; delete?: boolean; leftArrow?: boolean; rightArrow?: boolean; upArrow?: boolean; downArrow?: boolean; ctrl?: boolean; meta?: boolean; [key: string]: boolean | undefined; }; } export interface InputHandler { handleInput: (event: KeyEvent) => boolean; isActive: boolean; priority: number; } export type FocusTarget = 'input' | 'help' | 'messages' | 'global'; export interface InputState { focusTarget: FocusTarget; inputContent: string; inputCursorPosition: number; inputMode: 'insert' | 'command'; }