import { type WebSocket as WsWebSocket } from 'ws'; type BrowserEventCallback = (event: 'connect' | 'disconnect' | 'init', data: { connId: string; browserId: string | null; serverId: string | null; url?: string | null; title?: string | null; }) => void; export declare function onBrowserEvent(cb: BrowserEventCallback): () => boolean; type LogEventCallback = (data: { channel: string; payload: any; browserId?: string; }) => void; export declare function onLogEvent(cb: LogEventCallback): () => boolean; export declare function emitLogEvent(data: { channel: string; payload: any; browserId?: string; }): void; /** * Send a command to a specific browser. * Targeting priority: * 1. browserId (exact) — locked session target * 2. serverId (latest) — pick latest browser for this server * 3. global latest — any connected browser */ export declare function browserCommand(opts: { browserId?: string; serverId?: string; }, method: string, params?: any, timeoutMs?: number): Promise; /** Legacy API: send a command by serverId string (backward compat during migration) */ export declare function browserCommandLegacy(serverId: string | undefined, method: string, params?: any, timeoutMs?: number): Promise; export declare function getAllBrowsers(): Array<{ connId: string; browserId: string | null; serverId: string | null; url: string | null; title: string | null; connectedAt: number; }>; /** Get browsers affiliated with a specific server */ export declare function getBrowsersByServer(serverId: string): Array<{ connId: string; browserId: string | null; url: string | null; title: string | null; connectedAt: number; }>; export declare function setupRpcWebSocket(httpServer: { on(event: string, listener: (...args: any[]) => void): void; }, rpcPath: string): import("ws").Server; export {}; //# sourceMappingURL=rpc-server.d.ts.map