import type { EngineTerminalControl } from "./protocol.ts";
/**
 * Host-side terminal-mode arbiter for remote custom components.
 *
 * Remote components (running in the engine child) cannot touch the host TTY —
 * their stdout is the JSONL transport, not a terminal. Instead they send typed
 * {@link EngineTerminalControl} intents; this controller owns the concrete
 * escape sequences and applies them to the real host terminal associated with
 * the mounted component. Never a raw byte channel: only the two allowlisted
 * modes below can ever reach the terminal.
 *
 * Guarantees:
 *  - Controls that arrive before the component mounts are buffered and flushed
 *    on mount (the child enables mouse reporting inside the overlay factory,
 *    which runs before the mount `engine_custom_open` on the wire).
 *  - Every mode a component turns on is reset to its safe default when that
 *    component unmounts, or when the whole controller is reset (engine
 *    crash / restart / generation replacement / host shutdown).
 *  - State is component-scoped: a stale child cannot reset or alter a mode
 *    owned by the currently mounted component.
 */
export declare const HOST_MOUSE_SCROLL_TRACKING_ON = "\u001B[?1000h\u001B[?1002h\u001B[?1006h";
export declare const HOST_MOUSE_SCROLL_TRACKING_OFF = "\u001B[?1006l\u001B[?1002l\u001B[?1000l";
export declare const HOST_TERMINAL_AUTOWRAP_ON = "\u001B[?7h";
export declare const HOST_TERMINAL_AUTOWRAP_OFF = "\u001B[?7l";
export interface HostTerminalWriter {
    write(data: string): void;
}
export declare class TerminalModeController {
    private readonly components;
    /** Apply (or buffer) a typed control for a component. */
    applyControl(componentId: string, control: EngineTerminalControl): void;
    /** Register the host terminal for a component and flush buffered controls. */
    onMount(componentId: string, terminal: HostTerminalWriter): void;
    /** Reset and forget a single component's terminal modes. */
    onUnmount(componentId: string): void;
    /** Reset every component (engine crash/restart/generation swap/shutdown). */
    resetAll(): void;
    private ensure;
    private write;
    private reset;
}
//# sourceMappingURL=terminal-mode-controller.d.ts.map