/**
 * WebSocket Automation Server
 * Zero-latency bidirectional automation with real-time streaming
 */
import { EventEmitter } from 'events';
import { NativeAction } from './native-automation-executor.js';
export interface AutomationCommand {
    id: string;
    type: 'execute' | 'stream' | 'batch' | 'subscribe' | 'unsubscribe';
    action?: NativeAction;
    actions?: NativeAction[];
    event?: string;
    data?: any;
}
export interface AutomationResponse {
    id: string;
    success: boolean;
    duration_ms?: number;
    result?: any;
    error?: string;
    cached?: boolean;
}
export interface StreamEvent {
    type: 'mouse' | 'keyboard' | 'screen' | 'performance';
    data: any;
    timestamp: number;
}
export declare class WebSocketAutomationServer extends EventEmitter {
    private wss;
    private clients;
    private commandQueue;
    private activeStreams;
    private performanceMetrics;
    private readonly PORT;
    private readonly HEARTBEAT_INTERVAL;
    constructor();
    /**
     * Start the WebSocket server
     */
    start(): Promise<void>;
    /**
     * Handle new WebSocket connection
     */
    private handleNewConnection;
    /**
     * Handle automation command
     */
    private handleCommand;
    /**
     * Execute single action with caching
     */
    private executeAction;
    /**
     * Execute batch of actions
     */
    private executeBatch;
    /**
     * Start streaming automation events
     */
    private startStreaming;
    /**
     * Subscribe to automation events
     */
    private subscribeToEvents;
    /**
     * Unsubscribe from events
     */
    private unsubscribeFromEvents;
    /**
     * Handle client disconnection
     */
    private handleDisconnection;
    /**
     * Send response to client
     */
    private sendResponse;
    /**
     * Send stream event to client
     */
    private sendStreamEvent;
    /**
     * Send error to client
     */
    private sendError;
    /**
     * Record latency metrics
     */
    private recordLatency;
    /**
     * Get average latency for client
     */
    private getAverageLatency;
    /**
     * Start heartbeat monitoring
     */
    private startHeartbeat;
    /**
     * Generate unique client ID
     */
    private generateClientId;
    /**
     * Get server status
     */
    getStatus(): any;
    /**
     * Stop the server
     */
    stop(): void;
}
export declare const wsAutomationServer: WebSocketAutomationServer;
//# sourceMappingURL=websocket-automation-server.d.ts.map