import type { Director } from '@wrongstack/core/coordination'; import type { Action, State } from './app-reducer.js'; import type { KeyEvent } from './components/input.js'; import type { MutableCell } from './shared-types.js'; import type { SettingsCapabilities } from './tui-host-capabilities.js'; /** * Terminal geometry for pointer→key mapping. `viewportRows` is the managed * history band height; every selectable overlay renders BELOW it (see * hit-test.ts's layout contract), so a left press only maps to Enter when it * lands in that bottom region. Without this gate a stray click anywhere on * screen — including deep in the chat history — confirmed the focused item * of whatever picker happened to be open (worst case: the project picker, * where confirm triggers an exit-42 respawn). */ export interface PointerOverlayGeometry { termRows: number; viewportRows: number; } export declare function overlayPointerKey(state: State, input: string, key: KeyEvent, geometry: PointerOverlayGeometry): { isEnter: boolean; cancelAction: Action | null; }; export interface BusyInterruptKeyHost { readonly state: State; readonly dismissedAt: MutableCell; readonly streamingText: MutableCell; readonly confirmExit: MutableCell; readonly activeController: MutableCell; dispatch(action: Action): void; clearPendingConfirms(): void; liveDirector(): Director | null; } /** * Handle Esc-to-steer, including optional confirmation and fleet teardown. * Open panels never reach this: `handleKey` routes Esc through * `escCloseAction` / `escSelfOwnedPanelOpen` first, so by the time this * runs an Esc press really means "interrupt the run". */ export declare function routeBusyInterruptKey(host: BusyInterruptKeyHost, key: KeyEvent): boolean; export interface ModalOverlayKeyHost { readonly state: State; readonly enhanceCancelled: MutableCell; readonly enhanceController: MutableCell; dispatch(action: Action): void; } /** Route the modal overlay ladder that has precedence over every composer key. */ export declare function routeModalOverlayKey(host: ModalOverlayKeyHost, input: string, key: KeyEvent): boolean; export interface SettingsOverlayKeyHost { readonly state: State; readonly getSettings: SettingsCapabilities['getSettings']; readonly saveSettings: SettingsCapabilities['saveSettings']; readonly lastEnterAt: MutableCell; dispatch(action: Action): void; } /** Route the settings editor and its Ctrl+S open/close chord. */ export declare function routeSettingsOverlayKey(host: SettingsOverlayKeyHost, input: string, key: KeyEvent, isEnter: boolean): boolean; /** * Close the highest-priority panel on Esc and keep ProcessList modal. * `processListOnBottom` carries the panel-position routing: when the process * list is routed to the sidebar its modal `useInput` never mounts, so * swallowing every key here froze the composer with no visible panel. */ export declare function routePanelEscapeKey(state: State, key: KeyEvent, dispatch: (action: Action) => void, processListOnBottom: boolean): boolean; //# sourceMappingURL=overlay-key-router.d.ts.map