export interface WebSocketRequest { method: string; params: any; id?: number; timeoutMs?: number; } export interface WebSocketResponse { result?: any; error?: { code: number; message: string; data?: any; }; id?: number | null; } export interface WebSocketNotification { type: string; data?: any; } export interface WebSocketStreamChunk { id: number; chunk?: any; done?: true; error?: string; } export declare class TimeoutError extends Error { constructor(ms: number); } type Milliseconds = number; type RegisterMethodOptions = { /** Memoize the method's results. */ memoize?: boolean | { ttlMs?: Milliseconds; maxEntries?: number; }; /** Max concurrent executions for this method. Omit or 0 = unlimited. */ concurrency?: number; }; export declare class WebSocketServer { #private; constructor(options?: { port?: number; host?: string; }); cleanup(): void; isReady(timeoutMs?: number): Promise; getPort(): Promise; getId(): string; /** Manually clear memoized results (all methods or one). */ invalidateCache(method?: string): void; registerMethod(method: string, handler: (params: any) => Promise | any, options?: RegisterMethodOptions): void; sendNotification(message: WebSocketNotification): void; } export {};