import type { ServerAction, ClientAction } from '../../common/src/actions';
import type { WebSocket } from 'ws';
export type WebSocketHandlerOptions = {
    onWebsocketError?: (error: WebSocket.ErrorEvent) => void;
    onWebsocketReconnect?: () => void;
    onRequestReconnect?: () => Promise<void>;
    onResponseError?: (error: ServerAction<'action-error'>) => Promise<void>;
    readFiles: (input: {
        filePaths: string[];
    }) => Promise<ClientAction<'read-files-response'>['files']>;
    handleToolCall: (action: ServerAction<'tool-call-request'>) => Promise<Omit<ClientAction<'tool-call-response'>, 'type' | 'requestId'>>;
    onCostResponse?: (action: ServerAction<'message-cost-response'>) => Promise<void>;
    onResponseChunk?: (action: ServerAction<'response-chunk'>) => Promise<void>;
    onSubagentResponseChunk?: (action: ServerAction<'subagent-response-chunk'>) => Promise<void>;
    onPromptResponse?: (action: ServerAction<'prompt-response'>) => Promise<void>;
    onPromptError?: (action: ServerAction<'prompt-error'>) => Promise<void>;
    apiKey: string;
};
export declare class WebSocketHandler {
    private cbWebSocket;
    private onRequestReconnect;
    private onResponseError;
    private readFiles;
    private handleToolCall;
    private onCostResponse;
    private onResponseChunk;
    private onSubagentResponseChunk;
    private onPromptResponse;
    private onPromptError;
    private apiKey;
    private isConnected;
    constructor({ onWebsocketError, onWebsocketReconnect, onRequestReconnect, onResponseError, readFiles, handleToolCall, onCostResponse, onResponseChunk, onSubagentResponseChunk, onPromptResponse, onPromptError, apiKey, }: WebSocketHandlerOptions);
    connect(): Promise<void>;
    reconnect(): void;
    close(): void;
    private setupSubscriptions;
    private getInputDefaultOptions;
    sendInput(action: Omit<ClientAction<'prompt'>, keyof ReturnType<typeof this.getInputDefaultOptions>>): void;
    cancelInput({ promptId }: {
        promptId: string;
    }): void;
}
//# sourceMappingURL=websocket-client.d.ts.map