import type { KeyEvent } from "./input/types.js"; export type LineEditAction = { kind: "append"; text: string; } | { kind: "backspace"; } | { kind: "backspaceWord"; } | { kind: "cancel"; } | { kind: "submit"; }; /** What a key does while a line is being edited; null for a key that does * nothing there (a Ctrl chord, an arrow). */ export declare function lineEditAction(event: KeyEvent): LineEditAction | null; /** The draft after an edit. Cancel and submit leave the draft alone: what * they mean belongs to the caller. Backspace removes a whole code point: * an emoji arrives as two UTF-16 halves, and leaving one behind would put * a broken character in the draft. Option+Backspace removes the last word * and the spaces after it, as it does in a shell. */ export declare function applyLineEdit(draft: string, action: LineEditAction): string;