export interface FetchEventSourceConfiguration { /** custom fetch implementation */ fetch?: typeof fetch; /** custom headers to add to SSE request */ headers?: Headers; /** automatically starts the SSE request */ autoStart?: boolean; /** send cookies to cross-origin URLs */ withCredentials?: boolean; /** initial reconnection delay */ reconnectionDelay?: number; } export default abstract class BaseFetchEventSource extends EventTarget { #private; url: string; withCredentials: boolean; readyState: number; onopen: () => void | undefined; onmessage: (e?: MessageEvent) => void | undefined; onerror: (error?: ErrorEvent) => void | undefined; protected abstract _fetch: typeof fetch | any; protected abstract _decode: (bytes: any) => string; protected abstract _getOrigin: () => string; protected _transformStream: (stream: any) => any; constructor(url: string, config?: FetchEventSourceConfiguration); start(): Promise; private _connect; private _process; close(): void; _error(error: any): void; }