interface EventSource
extends EventTarget
Properties Jump to heading
Jump to headingonerror: ((this: EventSource,ev: Event,) => any) | null
Jump to headingonmessage: ((this: EventSource,ev: MessageEvent,) => any) | null
Jump to headingonopen: ((this: EventSource,ev: Event,) => any) | null
readonly
Jump to headingreadyState: number
Returns the state of this EventSource object's connection. It can have the values described below.
readonly
Jump to headingurl: string
Returns the URL providing the event stream.
readonly
Jump to headingwithCredentials: boolean
Returns 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: 0
readonly
Jump to headingOPEN: 1
readonly
Jump to headingCLOSED: 2
Methods Jump to heading
Jump to headingclose(): void
Aborts 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,): void
Jump to headingaddEventListener(type: string,listener: (this: EventSource,event: MessageEvent,) => any,options?: boolean | AddEventListenerOptions,): void
Jump to headingaddEventListener(type: string,listener: EventListenerOrEventListenerObject,options?: boolean | AddEventListenerOptions,): void
Jump to headingremoveEventListener<K extends keyof EventSourceEventMap>(type: K,listener: (this: EventSource,ev: EventSourceEventMap[K],) => any,options?: boolean | EventListenerOptions,): void
Jump to headingremoveEventListener(type: string,listener: (this: EventSource,event: MessageEvent,) => any,options?: boolean | EventListenerOptions,): void