import { Task, TaskExecution, TaskProvider } from 'vscode';
import { IRPCProtocol } from '@opensumi/ide-connection';
import { Event, IDisposable } from '@opensumi/ide-core-common';
import { IExtensionProps } from '../../../../common';
import { IExtHostTerminal, IExtHostWorkspace, IExtensionDescription } from '../../../../common/vscode';
import * as types from '../../../../common/vscode/ext-types';
import { IExtHostTasks, IMainThreadTasks, TaskDTO, TaskExecutionDTO, TaskProcessEndedDTO, TaskProcessStartedDTO, TaskSetDTO } from '../../../../common/vscode/tasks';
import { TaskDto } from './taskTypes';
import type vscode from 'vscode';
declare namespace TaskDTO {
    function fromMany(tasks: vscode.Task[], extension: IExtensionProps): TaskDTO[];
    function from(value: vscode.Task, extension: IExtensionProps): TaskDTO | undefined;
    function to(value: TaskDTO | undefined, extHostWorkspace: IExtHostWorkspace, providedCustomExecutions: Map<string, types.CustomExecution>): Promise<types.Task | undefined>;
}
export declare class ExtHostTasks implements IExtHostTasks {
    private rpcProtocol;
    protected readonly terminalService: IExtHostTerminal;
    protected readonly extHostWorkspace: IExtHostWorkspace;
    private handlerCounter;
    private taskHandlers;
    private providedCustomExecutions2;
    private notProvidedCustomExecutions;
    private _taskExecutions;
    protected readonly proxy: IMainThreadTasks;
    private readonly _onDidExecuteTask;
    private readonly _onDidTerminateTask;
    private readonly _onDidTaskProcessStarted;
    private readonly _onDidTaskProcessEnded;
    constructor(rpcProtocol: IRPCProtocol, terminalService: IExtHostTerminal, extHostWorkspace: IExtHostWorkspace);
    $onDidStartTask(execution: TaskExecutionDTO, terminalId: string): Promise<void>;
    get onDidStartTask(): Event<vscode.TaskStartEvent>;
    $onDidEndTask(execution: TaskExecutionDTO): Promise<void>;
    get onDidEndTask(): Event<vscode.TaskEndEvent>;
    $onDidStartTaskProcess(value: TaskProcessStartedDTO): Promise<void>;
    get onDidStartTaskProcess(): Event<vscode.TaskProcessStartEvent>;
    $onDidEndTaskProcess(value: TaskProcessEndedDTO): Promise<void>;
    get onDidEndTaskProcess(): Event<vscode.TaskProcessEndEvent>;
    get taskExecutions(): ReadonlyArray<vscode.TaskExecution>;
    terminateTask(execution: vscode.TaskExecution): void;
    registerTaskProvider(type: string, provider: TaskProvider, extension: IExtensionProps): IDisposable;
    private getTaskExecution;
    executeTask(task: Task, extension: IExtensionProps): Promise<TaskExecution>;
    fetchTasks(filter?: vscode.TaskFilter | undefined): Promise<Task[]>;
    private addCustomExecution;
    $provideTask(handler: number, validTypes: Record<string, boolean>): Promise<TaskSetDTO>;
    $resolveTask(handle: number, taskDTO: TaskDto): Promise<TaskDTO | undefined>;
}
export declare function createTaskApiFactory(extHostTasks: IExtHostTasks, extension: IExtensionDescription): typeof vscode.tasks;
export {};
//# sourceMappingURL=ext.host.tasks.d.ts.map