Worker

open external class Worker(scriptURL: String, options: WorkerOptions) : EventTarget, AbstractWorker

Exposes the JavaScript Worker to Kotlin

Constructors

Worker
Link copied to clipboard
fun Worker(scriptURL: String, options: WorkerOptions = definedExternally)

Functions

addEventListener
Link copied to clipboard
fun addEventListener(type: String, callback: (Event) -> Unit?, options: dynamic = definedExternally)
fun addEventListener(type: String, callback: EventListener?, options: dynamic = definedExternally)
dispatchEvent
Link copied to clipboard
fun dispatchEvent(event: Event): Boolean
postMessage
Link copied to clipboard
fun postMessage(message: Any?, transfer: Array<dynamic> = definedExternally)
removeEventListener
Link copied to clipboard
fun removeEventListener(type: String, callback: (Event) -> Unit?, options: dynamic = definedExternally)
fun removeEventListener(type: String, callback: EventListener?, options: dynamic = definedExternally)
terminate
Link copied to clipboard
fun terminate()

Properties

onerror
Link copied to clipboard
open override var onerror: (Event) -> dynamic?
onmessage
Link copied to clipboard
var onmessage: (MessageEvent) -> dynamic?