import { EventHandlers } from "./types"; import { Context, ContextualLoggedClass } from "@decaf-ts/core"; export type ServerEventConnectorHeaders = Record | (() => Record | Promise>); export declare class ServerEventConnector extends ContextualLoggedClass> { private readonly url; private readonly headers?; private static readonly cache; static get(url: string): ServerEventConnector; static open(url: string, headers?: ServerEventConnectorHeaders): ServerEventConnector; static close(url: string): void; private static parseReceivedEvent; /** Shared connection state (cached singleton instance). */ private es?; private controller?; private listeners; constructor(url: string, headers?: ServerEventConnectorHeaders | undefined); isOpen(): boolean; protected getHeaders(): Promise; close(force?: boolean): void; /** * Increments refCount and ensures EventSource is created. * This method must be called only on the shared singleton instance. */ private startListening; addListener(handlers: EventHandlers): () => void; removeListener(handlers: EventHandlers): void; }