import type { Screen } from '../Screen'; /** One hunk in the interactive `/apply --interactive` picker. */ export interface HunkPickerItem { /** File path this hunk belongs to. */ path: string; /** 0-based hunk index within the file diff. */ hunkIndex: number; /** Human-readable hunk header, e.g. `@@ -12,3 +12,5 @@`. */ header: string; /** Pre-formatted diff lines to display. */ lines: string[]; } export interface HunkPickerOptions { title: string; items: HunkPickerItem[]; onComplete: (accepted: Array<{ path: string; hunkIndex: number; }>) => void; } export interface HunkPickerState { open: boolean; options: HunkPickerOptions | null; index: number; accepted: Array<{ path: string; hunkIndex: number; }>; } export declare function createHunkPickerState(): HunkPickerState; /** Minimal key shape App's KeyEvent satisfies. */ export interface HunkPickerKeyEvent { key: string; } /** * Handle one key event for the picker. Returns the (possibly updated) state * and whether the picker consumed the event (always true while open — the * picker is modal). `onComplete` from the options fires exactly once, from * `finish()`; after that the state is reset to closed. */ export declare function handleHunkPickerKey(state: HunkPickerState, event: HunkPickerKeyEvent): HunkPickerState; /** Panel height the layout needs to reserve for the picker. */ export declare function hunkPickerPanelHeight(): number; /** * Paint the picker into the screen. Mirrors the rendering previously inlined * in App.renderInlineHunkPicker. */ export declare function renderHunkPicker(screen: Screen, state: HunkPickerState, startY: number, width: number): void;