import type * as vscode from 'vscode';
import { Event } from '../../../util/vs/base/common/event';
import { Disposable } from '../../../util/vs/base/common/lifecycle';
export declare const ITerminalService: import("../../../util/common/services").ServiceIdentifier<ITerminalService>;
export interface ITerminalService {
    readonly _serviceBrand: undefined;
    readonly terminalBuffer: string;
    readonly terminalLastCommand: vscode.TerminalExecutedCommand | undefined;
    readonly terminalSelection: string;
    readonly terminalShellType: string;
    readonly onDidChangeTerminalShellIntegration: vscode.Event<vscode.TerminalShellIntegrationChangeEvent>;
    readonly onDidEndTerminalShellExecution: vscode.Event<vscode.TerminalShellExecutionEndEvent>;
    readonly onDidCloseTerminal: vscode.Event<vscode.Terminal>;
    readonly onDidWriteTerminalData: vscode.Event<vscode.TerminalDataWriteEvent>;
    /**
     * See {@link vscode.window.createTerminal}.
     */
    createTerminal(name?: string, shellPath?: string, shellArgs?: readonly string[] | string): vscode.Terminal;
    createTerminal(options: vscode.TerminalOptions): vscode.Terminal;
    createTerminal(options: vscode.ExtensionTerminalOptions): vscode.Terminal;
    /**
     * Gets the buffer for a terminal.
     * @param maxChars The maximum number of chars to return from the buffer, defaults to 16k
     */
    getBufferForTerminal(terminal: vscode.Terminal, maxChars?: number): string;
    /**
     * Gets the buffer for a terminal with the given pid.
     * @param maxChars The maximum number of chars to return from the buffer, defaults to 16k
     */
    getBufferWithPid(pid: number, maxChars?: number): Promise<string>;
    /**
     * Gets the last command executed in a terminal.
     * @param terminal The terminal to get the last command for
     */
    getLastCommandForTerminal(terminal: vscode.Terminal): vscode.TerminalExecutedCommand | undefined;
    /**
     * Contributes a path to the terminal PATH environment variable.
     * @param contributor Unique identifier for the contributor
     * @param pathLocation The path to add to PATH
     * @param description Optional description for the PATH contribution
     * @param prepend Whether to prepend (true) or append (false) the path. Defaults to false (append).
    */
    contributePath(contributor: string, pathLocation: string, description?: string, prepend?: boolean): void;
    /**
     * Contributes a path to the terminal PATH environment variable.
     * @param contributor Unique identifier for the contributor
     * @param pathLocation The path to add to PATH
     * @param description Optional command thats contributed in the Terminal.
     * @param prepend Whether to prepend (true) or append (false) the path. Defaults to false (append).
    */
    contributePath(contributor: string, pathLocation: string, description?: {
        command: string;
    }, prepend?: boolean): void;
    /**
     * Removes a path contribution from the terminal PATH environment variable.
     * @param contributor Unique identifier for the contributor
     */
    removePathContribution(contributor: string): void;
    readonly terminals: readonly vscode.Terminal[];
}
export declare const enum ShellIntegrationQuality {
    None = "none",
    Basic = "basic",
    Rich = "rich"
}
export declare class NullTerminalService extends Disposable implements ITerminalService {
    private _onDidWriteTerminalData;
    onDidWriteTerminalData: Event<vscode.TerminalDataWriteEvent>;
    private _onDidChangeTerminalShellIntegration;
    onDidChangeTerminalShellIntegration: Event<vscode.TerminalShellIntegrationChangeEvent>;
    private _onDidEndTerminalShellExecution;
    onDidEndTerminalShellExecution: Event<vscode.TerminalShellExecutionEndEvent>;
    private _onDidCloseTerminal;
    onDidCloseTerminal: Event<vscode.Terminal>;
    readonly _serviceBrand: undefined;
    static readonly Instance: NullTerminalService;
    get terminalBuffer(): string;
    get terminalLastCommand(): vscode.TerminalExecutedCommand | undefined;
    get terminalSelection(): string;
    get terminalShellType(): string;
    getCwdForSession(sessionId: string): Promise<vscode.Uri | undefined>;
    getCopilotTerminals(sessionId: string): Promise<IKnownTerminal[]>;
    getTerminalsWithSessionInfo(): Promise<{
        terminal: IKnownTerminal;
        sessionId: string;
        shellIntegrationQuality: ShellIntegrationQuality;
    }[]>;
    getToolTerminalForSession(sessionId: string): Promise<{
        terminal: IKnownTerminal;
        shellIntegrationQuality: ShellIntegrationQuality;
    } | undefined>;
    associateTerminalWithSession(terminal: vscode.Terminal, sessionId: string, shellIntegrationquality: ShellIntegrationQuality): Promise<void>;
    createTerminal(name?: string, shellPath?: string, shellArgs?: readonly string[] | string): vscode.Terminal;
    createTerminal(options: vscode.TerminalOptions): vscode.Terminal;
    createTerminal(options: vscode.ExtensionTerminalOptions): vscode.Terminal;
    get terminals(): readonly vscode.Terminal[];
    getBufferForTerminal(terminal: vscode.Terminal, maxLines?: number): string;
    getBufferWithPid(pid: number, maxChars?: number): Promise<string>;
    getLastCommandForTerminal(terminal: vscode.Terminal): vscode.TerminalExecutedCommand | undefined;
    contributePath(contributor: string, pathLocation: string, description?: string, prepend?: boolean): void;
    contributePath(contributor: string, pathLocation: string, description?: {
        command: string;
    }, prepend?: boolean): void;
    removePathContribution(contributor: string): void;
}
export declare function isTerminalService(thing: any): thing is ITerminalService;
export declare function isNullTerminalService(thing: any): thing is NullTerminalService;
export interface IKnownTerminal extends vscode.Terminal {
    id: string;
}
//# sourceMappingURL=terminalService.d.ts.map