import { EventSource } from 'eventsource'; type SubscriptionRequest = { method: string; params: any; onMessage: (event: T) => void; onError?: (error: Error) => void; signal?: AbortSignal; }; /** * Configuration options for the SSE connection */ export type SSEClientOptions = { /** * Milliseconds before timing out while calling an RPC method */ callTimeout?: number; /** * Milliseconds between attempts to connect */ reconnectTimeout?: number; /** * Maximum number of times to try connecting before giving up */ maxReconnects?: number; }; export declare const DEFAULT_CLIENT_OPTIONS: { callTimeout: number; reconnectTimeout: number; maxReconnects: number; }; export declare class SSEClient { #private; endpoint: string; options: Required; constructor(endpoint: string, options?: SSEClientOptions); disconnect(id: number): Promise; getSubscribeId(): number; setupEventSource(request: SubscriptionRequest): Promise; subscribe(input: SubscriptionRequest): Promise<() => Promise>; } export {};