import { type Component, type OverlayHandle, type OverlayOptions } from "@earendil-works/pi-tui";
import { TUI } from "@earendil-works/pi-tui";
import type { KeybindingsManager } from "../../core/keybindings.ts";
import type { Theme } from "../interactive/theme/theme.ts";
interface CustomUiOptions {
    overlay?: boolean;
    deferInlineCustomUiFocus?: boolean;
    overlayOptions?: OverlayOptions | (() => OverlayOptions);
    onHandle?: (handle: OverlayHandle) => void;
    signal?: AbortSignal;
}
export declare class EngineCustomUiService {
    private readonly widgetIds;
    private readonly active;
    private nextId;
    private readonly write;
    private readonly keybindings;
    private readonly stateListeners;
    setWidget(key: string, factory: ((tui: TUI, theme: Theme) => Component & {
        dispose?(): void;
    }) | undefined, placement?: "aboveEditor" | "belowEditor"): void;
    constructor(write: (line: string) => void, keybindings: KeybindingsManager);
    custom<T>(factory: (tui: TUI, theme: Theme, keybindings: KeybindingsManager, done: (result: T) => void) => (Component & {
        dispose?(): void;
    }) | Promise<Component & {
        dispose?(): void;
    }>, options?: CustomUiOptions): Promise<T>;
    getHostCustomUiState(): {
        blockingInlineCustomUiDepth: number;
        blockingInlineCustomUiActive: boolean;
    };
    onHostCustomUiStateChange(listener: (state: {
        blockingInlineCustomUiDepth: number;
        blockingInlineCustomUiActive: boolean;
    }) => void): () => void;
    focusHostInlineCustomUi(): boolean;
    requestRender(): void;
    handleLine(line: string): boolean;
    dispose(): void;
    private disposeComponent;
    private notifyState;
    private remoteHandle;
    private sendDone;
    private send;
}
export {};
//# sourceMappingURL=engine-custom-ui.d.ts.map