import type { TerminalState } from "../shared/messages.js";
export type ClientMessage = {
    type: "input";
    data: string;
} | {
    type: "resize";
    rows: number;
    cols: number;
} | {
    type: "mouse";
    row: number;
    col: number;
    button: number;
    action: "down" | "up" | "move";
};
export type ServerMessage = {
    type: "output";
    data: string;
} | {
    type: "snapshot";
    state: TerminalState;
};
export interface TerminalSession {
    id: string;
    name: string;
    cwd: string;
    send(msg: ClientMessage): void;
    subscribe(listener: (msg: ServerMessage) => void): () => void;
    onExit(listener: () => void): () => void;
    getSize(): {
        rows: number;
        cols: number;
    };
    getState(): TerminalState;
    kill(): void;
}
export interface CreateTerminalOptions {
    cwd: string;
    shell?: string;
    env?: Record<string, string>;
    rows?: number;
    cols?: number;
    name?: string;
}
export interface CaptureTerminalLinesOptions {
    start?: number;
    end?: number;
    stripAnsi?: boolean;
}
export interface CaptureTerminalLinesResult {
    lines: string[];
    totalLines: number;
}
type EnsureNodePtySpawnHelperExecutableOptions = {
    packageRoot?: string;
    platform?: NodeJS.Platform;
    arch?: string;
    force?: boolean;
};
export declare function ensureNodePtySpawnHelperExecutableForCurrentPlatform(options?: EnsureNodePtySpawnHelperExecutableOptions): void;
export declare function resolveDefaultTerminalShell(options?: {
    platform?: NodeJS.Platform;
    env?: NodeJS.ProcessEnv;
}): string;
export declare function captureTerminalLines(terminal: TerminalSession, options?: CaptureTerminalLinesOptions): CaptureTerminalLinesResult;
export declare function createTerminal(options: CreateTerminalOptions): Promise<TerminalSession>;
export {};
//# sourceMappingURL=terminal.d.ts.map