import type { Interface as ReadlineInterface } from 'readline'; import { type AutocompleteState } from './autocomplete-state.js'; import type { IHistoryRing, ReadWithAutocompleteResult } from './types.js'; import { TerminalCompositor, type CompositorScrollRegionGuard, type SuggestEngine, type SuggestContext } from '../terminal-compositor.js'; export interface InputSurfaceStatusLine { getExtraRows(): number; setExtraRows(n: number): void; withFullScrollRegion?(fn: () => T): T; } export interface InputSurfaceOptions { rl: ReadlineInterface; history: IHistoryRing; statusLine?: InputSurfaceStatusLine; } export interface InputSurfaceReadOpts { promptFn: (buffer: string) => string; onSigint?: () => void; onEscape?: () => void; onShiftTab?: () => void; initialBuffer?: string; compositor?: TerminalCompositor; primePromptSuggestion?: boolean; } export interface InputSurfaceRefs { history?: IHistoryRing; autocompleteState?: AutocompleteState; promptText?: string; } export interface InputSurfaceArmOpts { promptFn: (buffer: string) => string; onCancel: () => void; onShiftTab?: () => void; onOpenEditor?: () => void; scrollRegion?: CompositorScrollRegionGuard; stdout?: NodeJS.WriteStream; stdin?: NodeJS.ReadStream; anchorRow?: number; suggest?: { engine: SuggestEngine; getContext: () => SuggestContext; }; } export declare class InputSurface { readonly history: IHistoryRing; readonly autocompleteState: AutocompleteState; private readonly rl; private readonly statusLine; private compositor; private armedStdout; private backgroundHandler; private softStopHandler; private taskViewHandler; private pauseInterruptHandler; private pendingReadReject; private pendingReadResolve; private readonly slashRegistryView; constructor(opts: InputSurfaceOptions); armCompositor(opts: InputSurfaceArmOpts): Promise; dispose(): Promise; getCompositor(): TerminalCompositor | null; setBackgroundHandler(handler: (() => void) | null): void; setSoftStopHandler(handler: (() => void) | null): void; setTaskViewHandler(handler: (() => boolean) | null): void; setPauseInterruptHandler(handler: (() => void) | null): void; setPausedState(paused: boolean): void; suspendForElicitation(): void; resumeAfterElicitation(): void; readLine(opts: InputSurfaceReadOpts): Promise; isAwaitingInput(): boolean; bufferIsEmpty(): boolean; abortPendingRead(opts?: { clearBuffer?: boolean; }): void; requestRewind(): boolean; toRunTurnRefs(promptText: string): InputSurfaceRefs; }