Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface EventSource

Hierarchy

Index

Properties

Readonly CLOSED

CLOSED: number

Readonly CONNECTING

CONNECTING: number

EventTarget

EventTarget: { constructor: any; prototype: EventTarget }

Type declaration

Readonly OPEN

OPEN: number

onerror

onerror: ((this: EventSource, ev: Event) => any) | null

onmessage

onmessage: ((this: EventSource, ev: MessageEvent) => any) | null

onopen

onopen: ((this: EventSource, ev: Event) => any) | null

Readonly readyState

readyState: number

Returns the state of this EventSource object's connection. It can have the values described below.

Readonly url

url: string

Returns the URL providing the event stream.

Readonly withCredentials

withCredentials: boolean

Returns true if the credentials mode for connection requests to the URL providing the event stream is set to "include", and false otherwise.

Methods

addEventListener

close

  • close(): void
  • Aborts any instances of the fetch algorithm started for this EventSource object, and sets the readyState attribute to CLOSED.

    Returns void

dispatchEvent

  • dispatchEvent(event: Event): boolean
  • Dispatches a synthetic event event to target and returns true if either event's cancelable attribute value is false or its preventDefault() method was not invoked, and false otherwise.

    Parameters

    Returns boolean

removeEventListener

Generated using TypeDoc