import { Event } from '@opensumi/ide-core-common';
import { DebugStreamConnection } from '@opensumi/ide-debug';
import { DebugProtocol } from '@opensumi/vscode-debugprotocol';
import { ExtensionConnection } from '../../../../common/vscode';
import type vscode from 'vscode';
export declare abstract class AbstractDebugAdapter implements vscode.DebugAdapter {
    readonly id: string;
    constructor(id: string);
    onDidSendMessage: Event<vscode.DebugProtocolMessage>;
    handleMessage: (message: vscode.DebugProtocolMessage) => void;
    dispose: () => unknown;
}
export declare class DirectDebugAdapter extends AbstractDebugAdapter {
    id: string;
    readonly implementation: vscode.DebugAdapter;
    private messageReceivedEmitter;
    private closeEmitter;
    onError: Event<Error>;
    constructor(id: string, implementation: vscode.DebugAdapter);
    get onClose(): Event<void>;
    get onMessageReceived(): Event<string>;
    start(): Promise<void>;
    sendMessage(message: DebugProtocol.ProtocolMessage): void;
    stop(): Promise<void>;
}
/**
 * communicate with debug adapter via stream
 */
export declare abstract class StreamDebugAdapter extends AbstractDebugAdapter {
    readonly id: string;
    protected readonly debugStreamConnection: DebugStreamConnection;
    private static TWO_CRLF;
    private static CRLF;
    private static CONTENT_LENGTH;
    private static readonly HEADER_LINE_SEPARATOR;
    private static readonly HEADER_FIELD_SEPARATOR;
    private readonly toDispose;
    private contentLength;
    private buffer;
    private frontendConnection;
    constructor(id: string, debugStreamConnection: DebugStreamConnection);
    start(connection: ExtensionConnection): Promise<void>;
    protected onDebugAdapterExit(exitCode: number, signal: string | undefined): void;
    protected onDebugAdapterError(error: Error): void;
    protected handleData(data: Buffer): void;
    protected sendToFrontend(message: string): void;
    protected write(message: string): void;
    stop(): Promise<void>;
}
//# sourceMappingURL=abstract-debug-adapter-session.d.ts.map