import type { Theme } from "@earendil-works/pi-coding-agent"; import type { Component, Focusable } from "@earendil-works/pi-tui"; import { type InitOptions } from "./state.js"; export interface ConfigTuiComponentOptions extends InitOptions { /** Called by the component when the user has quit (with discard or via clean exit). */ onExit: (exitCode: number) => void; /** Called when a write to disk completes successfully — surfaces "saved to X". */ onSaved?: (target: string) => void; /** Called on write failure — surfaces the error to the parent ctx. */ onError?: (message: string) => void; /** Optional invalidate hook supplied by the TUI driver (forces re-render). */ requestRender?: () => void; /** pi TUI theme — drives all colour choices inside the overlay. */ theme: Theme; } export declare class ConfigTuiComponent implements Component, Focusable { private state; private readonly opts; /** Focusable — pi sets this to true when the overlay has keyboard focus. * Without this, arrow keys don't route to handleInput (see commit 07e886f). */ focused: boolean; /** Timer handle for the auto-clearing save banner (guards against unmount). */ private clearStatusTimer?; constructor(opts: ConfigTuiComponentOptions); invalidate(): void; render(width: number): string[]; handleInput(data: string): void; private handleResult; private dispatch; private maybeExit; private maybePersist; /** Schedule save-banner auto-clear. Guards against unmount (Hard Rule 5). */ private scheduleClearStatus; } export declare function createConfigTuiComponent(opts: ConfigTuiComponentOptions): ConfigTuiComponent;