• Version 1.1.15
  • Published
  • 8.14 kB
  • No dependencies
  • MIT license


npm i @types/eventsource
yarn add @types/eventsource
pnpm add @types/eventsource


TypeScript definitions for eventsource



class EventSource

class EventSource {}


    constructor(url: string, eventSourceInitDict?: EventSource.EventSourceInitDict);

      property CLOSED

      static readonly CLOSED: number;

        property CLOSED

        readonly CLOSED: number;

          property CONNECTING

          static readonly CONNECTING: number;

            property CONNECTING

            readonly CONNECTING: number;

              property onerror

              onerror: (evt: MessageEvent) => any;

                property onmessage

                onmessage: (evt: MessageEvent) => any;

                  property onopen

                  onopen: (evt: MessageEvent) => any;

                    property OPEN

                    static readonly OPEN: number;

                      property OPEN

                      readonly OPEN: number;

                        property readyState

                        readonly readyState: number;

                          property url

                          readonly url: string;

                            property withCredentials

                            readonly withCredentials: boolean;

                              method addEventListener

                              addEventListener: (type: string, listener: (evt: MessageEvent) => void) => void;

                                method close

                                close: () => void;

                                  method dispatchEvent

                                  dispatchEvent: (evt: Event) => boolean;

                                    method removeEventListener

                                    removeEventListener: (
                                    type: string,
                                    listener: (evt: MessageEvent) => void
                                    ) => void;


                                      interface EventSourceInitDict

                                      interface EventSourceInitDict {}

                                        property headers

                                        headers?: object | undefined;

                                          property https

                                          https?: object | undefined;

                                            property proxy

                                            proxy?: string | undefined;

                                              property rejectUnauthorized

                                              rejectUnauthorized?: boolean | undefined;

                                                property withCredentials

                                                withCredentials?: boolean | undefined;


                                                  enum ReadyState

                                                  enum ReadyState {
                                                  CONNECTING = 0,
                                                  OPEN = 1,
                                                  CLOSED = 2,

                                                    member CLOSED

                                                    CLOSED = 2

                                                      member CONNECTING

                                                      CONNECTING = 0

                                                        member OPEN

                                                        OPEN = 1

                                                          Package Files (1)

                                                          Dependencies (0)

                                                          No dependencies.

                                                          Dev Dependencies (0)

                                                          No dev dependencies.

                                                          Peer Dependencies (0)

                                                          No peer dependencies.


                                                          To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

                                                          You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/@types/eventsource.

                                                          • Markdown
                                                          • HTML
                                                            <a href="https://www.jsdocs.io/package/@types/eventsource"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>