interface EventSource
extends EventTarget
Properties Jump to heading
Jump to headingonerror: ((this: EventSource,ev: Event,) => any) | nullJump to headingonmessage: ((this: EventSource,ev: MessageEvent,) => any) | nullJump to headingonopen: ((this: EventSource,ev: Event,) => any) | nullreadonly
Jump to headingreadyState: numberReturns the state of this EventSource object's connection. It can have the values described below.
readonly
Jump to headingurl: stringReturns the URL providing the event stream.
readonly
Jump to headingwithCredentials: booleanReturns true if the credentials mode for connection requests to the URL providing the event stream is set to "include", and false otherwise.
readonly
Jump to headingCONNECTING: 0readonly
Jump to headingOPEN: 1readonly
Jump to headingCLOSED: 2Methods Jump to heading
Jump to headingclose(): voidAborts any instances of the fetch algorithm started for this EventSource object, and sets the readyState attribute to CLOSED.
Jump to headingaddEventListener<K extends keyof EventSourceEventMap>(type: K,listener: (this: EventSource,ev: EventSourceEventMap[K],) => any,options?: boolean | AddEventListenerOptions,): voidJump to headingaddEventListener(type: string,listener: (this: EventSource,event: MessageEvent,) => any,options?: boolean | AddEventListenerOptions,): voidJump to headingaddEventListener(type: string,listener: EventListenerOrEventListenerObject,options?: boolean | AddEventListenerOptions,): voidJump to headingremoveEventListener<K extends keyof EventSourceEventMap>(type: K,listener: (this: EventSource,ev: EventSourceEventMap[K],) => any,options?: boolean | EventListenerOptions,): voidJump to headingremoveEventListener(type: string,listener: (this: EventSource,event: MessageEvent,) => any,options?: boolean | EventListenerOptions,): void