@launchdarkly/eventsource - v0.2.5
    Preparing search index...

    Interface EventSource

    A W3C-compliant EventSource (server-sent events) client built on a fetch()-shaped transport, ReadableStream, and AbortController. Unlike the native browser EventSource, an event source built by this package supports request headers, a custom method with a request body, and a read timeout.

    The SSE behavior stays as close as possible to the behavior of the original launchdarkly-eventsource package: the same event names and shapes, the same retry and backoff timing, and the same text/event-stream parser algorithm.

    The Node-only options (https, proxy, agent, rejectUnauthorized) do not exist here, because fetch() has no equivalent for them; a caller that needs transport control injects a fetch-shaped function instead.

    There is no onmessage slot. The LaunchDarkly SDKs register their message listeners with addEventListener('message', ...), so this implementation leaves the slot out on purpose.

    interface EventSource {
        onclose: (() => void) | undefined;
        onerror: ((event?: ErrorEvent) => void) | undefined;
        onopen: ((event: OpenEvent) => void) | undefined;
        onretrying: ((event: RetryEvent) => void) | undefined;
        readyState: number;
        reconnectInterval: number;
        url: string;
        addEventListener<K extends keyof EventSourceEventMap>(
            type: K,
            listener: (event: EventSourceEventMap[K]) => void,
        ): void;
        addEventListener(
            type: string,
            listener: (event: MessageEvent) => void,
        ): void;
        close(): void;
        removeEventListener<K extends keyof EventSourceEventMap>(
            type: K,
            listener: (event: EventSourceEventMap[K]) => void,
        ): void;
        removeEventListener(
            type: string,
            listener: (event: MessageEvent) => void,
        ): void;
    }
    Index
    onclose: (() => void) | undefined

    Called once when close() closes the stream, before the listeners registered for the closed event. Only the public close() method invokes it. An internal non-retryable termination dispatches the error and closed events without it, because the errorFilter caller already received that error. A server-sent SSE frame named closed reaches only the addEventListener('closed') listeners. Thus neither can look like a user-initiated close.

    onerror: ((event?: ErrorEvent) => void) | undefined

    Called for a connection-level failure or an HTTP error response. A server-sent SSE frame named error also reaches this slot, with a MessageEvent payload; only that frame carries a string data property.

    An exception this slot throws does not stop the reconnect that follows. The exception rethrows later, on a separate microtask.

    onopen: ((event: OpenEvent) => void) | undefined

    Called when a connection is established, with the HTTP response headers in the event.

    An exception this slot throws does not stop the read loop from starting. The exception rethrows later, on a separate microtask.

    onretrying: ((event: RetryEvent) => void) | undefined

    Called when a reconnect is scheduled, with the delay in the event.

    An exception this slot throws does not stop the reconnect timer from arming. The exception rethrows later, on a separate microtask.

    readyState: number
    reconnectInterval: number

    Mirrors the most recent server retry: field, in milliseconds; starts at 1000 before any retry: field has arrived. A server-directed value is capped at one hour. The retry strategy owns the actual reconnect timing; this slot only supplies the fallback delay for a reconnect whose strategy call throws, validated and capped at one hour at that point.

    url: string