import { IRPCProtocol } from '@opensumi/ide-connection';
import { ILogger } from '@opensumi/ide-core-common';
import { ExtensionConnection, IInterProcessConnectionService } from '../../../common/vscode';
export declare class MainThreadConnection implements IInterProcessConnectionService {
    private rpcProtocol;
    private proxy;
    private connections;
    private connectionsReady;
    private readonly toDispose;
    protected readonly logger: ILogger;
    constructor(rpcProtocol: IRPCProtocol);
    dispose(): void;
    /**
     * 通过ID获取Connection并发送对应消息
     * @param id
     * @param message
     */
    $sendMessage(id: string, message: string): Promise<void>;
    /**
     * 创建新的Connection
     * 当链接ID存在时，返回已有Connection
     * @param id
     */
    $createConnection(id: string): Promise<void>;
    /**
     * 根据ID删除Connection
     * @param id
     */
    $deleteConnection(id: string): Promise<void>;
    /**
     * 返回已存在的Connection或创建新的Connection
     * @param id
     */
    ensureConnection(id: string): Promise<ExtensionConnection>;
    /**
     * 执行获取/新建Connection操作
     * @param id
     */
    doEnsureConnection(id: string): Promise<ExtensionConnection>;
    protected doCreateConnection(id: string): Promise<ExtensionConnection>;
}
//# sourceMappingURL=main.thread.connection.d.ts.map