interface EventSource
onerror: ((this: EventSource,ev: Event,) => any) | nullonmessage: ((this: EventSource,ev: MessageEvent,) => any) | nullonopen: ((this: EventSource,ev: Event,) => any) | nullreadonly
readyState: numberReturns the state of this EventSource object's connection. It can have the values described below.
readonly
url: stringReturns the URL providing the event stream.
readonly
withCredentials: booleanReturns true if the credentials mode for connection requests to the URL providing the event stream is set to "include", and false otherwise.
readonly
CONNECTING: 0readonly
OPEN: 1readonly
CLOSED: 2close(): voidAborts any instances of the fetch algorithm started for this EventSource object, and sets the readyState attribute to CLOSED.
addEventListener<K extends keyof EventSourceEventMap>(type: K,listener: (this: EventSource,ev: EventSourceEventMap[K],) => any,options?: boolean | AddEventListenerOptions,): voidaddEventListener(type: string,listener: (this: EventSource,event: MessageEvent,) => any,options?: boolean | AddEventListenerOptions,): voidaddEventListener(type: string,listener: EventListenerOrEventListenerObject,options?: boolean | AddEventListenerOptions,): voidremoveEventListener<K extends keyof EventSourceEventMap>(type: K,listener: (this: EventSource,ev: EventSourceEventMap[K],) => any,options?: boolean | EventListenerOptions,): voidremoveEventListener(type: string,listener: (this: EventSource,event: MessageEvent,) => any,options?: boolean | EventListenerOptions,): voidremoveEventListener(): void