import type { protocol, IPitcherClient } from "@codesandbox/pitcher-client";
import { Disposable } from "../../utils/disposable";
import { ShellRunOpts } from "./commands";
export type ShellSize = {
    cols: number;
    rows: number;
};
export declare const DEFAULT_SHELL_SIZE: ShellSize;
export declare class Terminals {
    private pitcherClient;
    private env;
    private disposable;
    constructor(sessionDisposable: Disposable, pitcherClient: IPitcherClient, env?: Record<string, string>);
    create(command?: "bash" | "zsh" | "fish" | "ksh" | "dash", opts?: ShellRunOpts): Promise<Terminal>;
    get(shellId: string): Terminal | undefined;
    /**
     * Gets all terminals running in the current sandbox
     */
    getAll(): Terminal[];
}
export declare class Terminal {
    private shell;
    private pitcherClient;
    private disposable;
    private onOutputEmitter;
    readonly onOutput: import("../../utils/event").Event<string>;
    private output;
    /**
     * Gets the ID of the terminal. Can be used to open it again.
     */
    get id(): string;
    /**
     * Gets the name of the terminal.
     */
    get name(): string;
    constructor(shell: protocol.shell.ShellDTO & {
        buffer?: string[];
    }, pitcherClient: IPitcherClient);
    /**
     * Open the terminal and get its current output, subscribes to future output
     */
    open(dimensions?: ShellSize): Promise<string>;
    write(input: string, dimensions?: ShellSize): Promise<void>;
    run(input: string, dimensions?: ShellSize): Promise<void>;
    kill(): Promise<void>;
}
