import { CustomEditor, type KeybindingsManager } from "@earendil-works/pi-coding-agent"; import { type EditorOptions, type EditorTheme, type TUI } from "@earendil-works/pi-tui"; import { VimEditor, type VimEditorHost, type VimEditorOptions, type VimSnapshot } from "@thazhemadam/vim-state"; declare class PiEditorHost extends CustomEditor implements VimEditorHost { sendInputToEditor(data: string): void; } declare const VimPiEditor_base: typeof PiEditorHost & (new (...args: any[]) => { readonly vimEditor: VimEditor; }); export declare class VimPiEditor extends VimPiEditor_base { private readonly vim; private cursorStyle; private readonly appKeybindings; private readonly vimHistory; private activeInsertSnapshot; /** * Set while undo/redo restores a snapshot through public setters. Public * setters normally reset history; suppress that reset for history restores. */ private isRestoringHistorySnapshot; constructor(tui: TUI, theme: EditorTheme, keybindings: KeybindingsManager, vimOptions?: VimEditorOptions, options?: EditorOptions); get vimSnapshot(): VimSnapshot; /** Replace the whole prompt and treat the result as the new history baseline. */ setText(text: string): void; /** Insert programmatic text as one undoable linear history edit. */ insertTextAtCursor(text: string): void; /** Restore the previous vim-pi-owned linear history snapshot. */ undoEditor(): void; /** Restore the next vim-pi-owned linear history snapshot. */ redoEditor(): void; handleInput(data: string): void; render(width: number): string[]; restoreCursorStyle(): void; /** Return true for host-handled inputs that replace or clear the prompt. */ private isHostBaselineResetInput; /** Return true when input matches a Pi app-level shortcut that should not edit text. */ private isAppShortcutInput; /** Capture the public editor state needed for vim-pi-owned history. */ private createSnapshot; /** * Clear all linear undo/redo entries and treat the current buffer as the new * starting state. If the editor is currently in Insert/Replace, start a fresh * session snapshot from that state so subsequent typed text remains undoable. */ private resetHistoryBaseline; /** Commit a new linear undo point and discard any abandoned redo path. */ private commitNewEdit; /** Update linear history after one input has been applied to the editor. */ private updateLinearHistory; /** Commit the active Insert/Replace session if it changed buffer text. */ private commitActiveInsertSession; /** Apply simple Normal-mode history keys without routing through host undo. */ private handleNormalHistoryKey; /** Map raw host undo shortcuts onto vim-pi history to avoid host drift. */ private handleHostHistoryShortcut; /** Pop undo history, push the current state to redo, and restore the prior state. */ private undoHistory; /** Pop redo history, push the current state to undo, and restore the next state. */ private redoHistory; /** Restore a history snapshot without treating public setter calls as new edits. */ private restoreHistorySnapshot; /** Keep the hardware cursor visible while this editor owns cursor rendering. */ private ensureHardwareCursorVisible; /** Sync terminal cursor shape with Vim mode, avoiding duplicate escape writes. */ private syncCursorStyle; } export {};