/**
 * A tiny, dependency-free line-editing model for the prompt input.
 *
 * The renderer owns the terminal; this module owns the *text* — a single
 * logical line plus a caret position — and exposes pure transforms for the
 * common readline-style edits (insert, delete, word/line kill, cursor moves)
 * and a {@link visibleLine} helper that windows a long line around the caret
 * so it stays on screen. Keeping it pure makes the editing rules trivial to
 * unit test without a TTY.
 */
/** One logical input line: its text and the caret's index within it. */
export interface LineState {
    readonly text: string;
    readonly cursor: number;
}
/** The empty line with the caret at column 0. */
export declare const EMPTY_LINE: LineState;
/** Builds a line from `text` with the caret placed at the end. */
export declare function lineOf(text: string): LineState;
/** Inserts `value` at the caret and advances the caret past it. */
export declare function insert(state: LineState, value: string): LineState;
/** Deletes the character before the caret (Backspace). */
export declare function backspace(state: LineState): LineState;
/** Deletes the character at the caret (Delete / Ctrl+D mid-line). */
export declare function deleteForward(state: LineState): LineState;
/** Moves the caret one column left. */
export declare function moveLeft(state: LineState): LineState;
/** Moves the caret one column right. */
export declare function moveRight(state: LineState): LineState;
/** Moves the caret to the start of the line (Home / Ctrl+A). */
export declare function moveHome(state: LineState): LineState;
/** Moves the caret to the end of the line (End / Ctrl+E). */
export declare function moveEnd(state: LineState): LineState;
/** Deletes from the caret to the end of the line (Ctrl+K). */
export declare function killToEnd(state: LineState): LineState;
/** Deletes from the start of the line to the caret (Ctrl+U). */
export declare function killToStart(state: LineState): LineState;
/** Deletes the whitespace-delimited word before the caret (Ctrl+W). */
export declare function deleteWord(state: LineState): LineState;
/**
 * The portion of `state.text` to draw within `budget` columns, split at the
 * caret so the renderer can place its caret glyph between `before` and
 * `after`. When the line is wider than `budget` it is windowed around the
 * caret, marking truncated ends with `…` so the caret is always visible.
 */
export interface VisibleLine {
    readonly before: string;
    readonly after: string;
}
export declare function visibleLine(state: LineState, budget: number, ellipsis?: string): VisibleLine;
/**
 * In-memory, append-only prompt history with shell-style up/down navigation.
 *
 * Navigation is non-destructive: stepping back from the live line stashes the
 * in-progress draft and restores it when the user steps forward past the
 * newest entry. Consecutive duplicate submissions are collapsed.
 */
export declare class PromptHistory {
    #private;
    /** Records a submitted prompt (skips blanks and consecutive duplicates). */
    add(entry: string): void;
    /** Resets navigation to the live line, stashing `draft` as the in-progress text. */
    begin(draft: string): void;
    /** The previous (older) entry, or `undefined` at the oldest entry. */
    previous(currentDraft: string): string | undefined;
    /** The next (newer) entry, or the stashed draft once past the newest entry. */
    next(): string | undefined;
}
