import type { KeyBinding } from "../../tui/keymap.js"; import { type EditAction } from "./actions.js"; import type { PaneRow, StopView } from "./rows.js"; /** What the UI knows when a key arrives: where the person is looking, * the row under the cursor, the composer, and how many edits wait. */ export type KeyContext = { view: StopView | null; focused: string | undefined; cursorRow: PaneRow | undefined; composer: { open: boolean; draft: string; }; pendingCount: number; }; /** What a key does, for the UI to carry out. */ export type UiAction = { kind: "moveCursor"; by: number; } | { kind: "runAction"; action: EditAction; row: PaneRow; } | { kind: "openComposer"; } | { kind: "closeComposer"; } | { kind: "sendComposer"; } | { kind: "dropEdits"; }; /** The keys on a pane that lists rows: the cursor, and each edit the * row under it offers, from the action table. */ export declare function listPaneBindings(ctx: KeyContext): KeyBinding[]; /** The threads pane keeps its keys; Enter opens the composer. */ export declare function threadsPaneBindings(ctx: KeyContext): KeyBinding[]; /** While the composer is open: Enter sends, Escape keeps the draft. * Every other key goes to the line editor. */ export declare function composerBindings(): KeyBinding[]; /** The table for the pane the person is on. Empty for a pane with no * keys of its own, so the UI's older handling takes the key. */ export declare function bindingsFor(ctx: KeyContext): KeyBinding[]; /** The footer line: each binding's hint, from the same table that * handles the keys, so the two cannot disagree. */ export declare function footerHints(bindings: KeyBinding[]): string;