EventSource

open external class EventSource(url: String, eventSourceInitDict: EventSourceInit) : EventTarget

Exposes the JavaScript EventSource to Kotlin

Constructors

EventSource
Link copied to clipboard
JS
fun EventSource(url: String, eventSourceInitDict: EventSourceInit = definedExternally)

Types

Companion
Link copied to clipboard
JS
object Companion

Functions

addEventListener
Link copied to clipboard
JS
fun addEventListener(type: String, callback: (Event) -> Unit?, options: dynamic = definedExternally)
fun addEventListener(type: String, callback: EventListener?, options: dynamic = definedExternally)
close
Link copied to clipboard
JS
fun close()
dispatchEvent
Link copied to clipboard
JS
fun dispatchEvent(event: Event): Boolean
removeEventListener
Link copied to clipboard
JS
fun removeEventListener(type: String, callback: (Event) -> Unit?, options: dynamic = definedExternally)
fun removeEventListener(type: String, callback: EventListener?, options: dynamic = definedExternally)

Properties

onerror
Link copied to clipboard
JS
var onerror: (Event) -> dynamic?
onmessage
Link copied to clipboard
JS
var onmessage: (MessageEvent) -> dynamic?
onopen
Link copied to clipboard
JS
var onopen: (Event) -> dynamic?
readyState
Link copied to clipboard
JS
open val readyState: Short
url
Link copied to clipboard
JS
open val url: String
withCredentials
Link copied to clipboard
JS
open val withCredentials: Boolean