import type { AckResponse, EditorConnectionOptions } from './types.js';
import type { EventBuffer } from './event-buffer.js';
/**
 * Manages a WebSocket connection to the Flow Weaver editor via socket.io.
 * Supports sending commands and batches with request/response correlation,
 * and forwards incoming `fw:` and `integration:` events to an {@link EventBuffer}.
 */
export declare class EditorConnection {
    private socket;
    private serverUrl;
    private buffer;
    private ioFactory;
    private ackTimeout;
    /**
     * @param serverUrl - The base URL of the editor WebSocket server.
     * @param buffer - The event buffer to push incoming events into.
     * @param options - Optional connection configuration (custom io factory, ack timeout).
     */
    constructor(serverUrl: string, buffer: EventBuffer, options?: EditorConnectionOptions);
    /**
     * Establishes a WebSocket connection to the editor's `/integrations` namespace.
     * Cleans up any previous connection first. Incoming `fw:` and `integration:` events
     * are automatically forwarded to the event buffer.
     * @param log - Optional logging callback for connection lifecycle events.
     */
    connect(log?: (msg: string) => void): void;
    /** Whether the socket is currently connected to the editor. */
    get isConnected(): boolean;
    /**
     * Sends a single command to the editor and waits for an acknowledgement.
     * Returns an error response if not connected or if the ack times out.
     * @param action - The command action name (e.g. "get-state", "add-node").
     * @param params - Parameters for the command.
     * @returns The editor's acknowledgement response.
     */
    sendCommand(action: string, params: Record<string, unknown>): Promise<AckResponse>;
    /**
     * Sends a batch of commands to the editor as a single request and waits for acknowledgement.
     * Returns an error response if not connected or if the ack times out.
     * @param commands - Array of commands, each with an action name and optional params.
     * @returns The editor's acknowledgement response for the entire batch.
     */
    sendBatch(commands: Array<{
        action: string;
        params?: Record<string, unknown>;
    }>): Promise<AckResponse>;
    /** Disconnects from the editor and releases the socket. */
    disconnect(): void;
}
//# sourceMappingURL=editor-connection.d.ts.map