WorkerGlobalScope

abstract external class WorkerGlobalScope : 
    EventTarget,
    WindowOrWorkerGlobalScope,
    GlobalPerformance
(source)

Platform and version requirements: JS

Exposes the JavaScript WorkerGlobalScope to Kotlin

Constructors

<init>

WorkerGlobalScope()

Exposes the JavaScript WorkerGlobalScope to Kotlin

Properties

location

open val location: WorkerLocation

navigator

open val navigator: WorkerNavigator

onerror

open var onerror: (dynamic, String, Int, Int, Any?) -> dynamic

onlanguagechange

open var onlanguagechange: (Event) -> dynamic

onoffline

open var onoffline: (Event) -> dynamic

ononline

open var ononline: (Event) -> dynamic

onrejectionhandled

open var onrejectionhandled: (Event) -> dynamic

onunhandledrejection

open var onunhandledrejection: (Event) -> dynamic

self

open val self: WorkerGlobalScope

Inherited Properties

caches

abstract val caches: CacheStorage

origin

abstract val origin: String

performance

abstract val performance: Performance

Functions

importScripts

fun importScripts(vararg urls: String)

Inherited Functions

addEventListener

fun addEventListener(
    type: String,
    callback: EventListener?,
    options: dynamic = definedExternally)
fun addEventListener(
    type: String,
    callback: (Event) -> Unit,
    options: dynamic = definedExternally)

atob

abstract fun atob(data: String): String

btoa

abstract fun btoa(data: String): String

clearInterval

abstract fun clearInterval(handle: Int = definedExternally)

clearTimeout

abstract fun clearTimeout(handle: Int = definedExternally)

createImageBitmap

abstract fun createImageBitmap(
    image: dynamic,
    options: ImageBitmapOptions = definedExternally
): Promise<ImageBitmap>
abstract fun createImageBitmap(
    image: dynamic,
    sx: Int,
    sy: Int,
    sw: Int,
    sh: Int,
    options: ImageBitmapOptions = definedExternally
): Promise<ImageBitmap>

dispatchEvent

fun dispatchEvent(event: Event): Boolean

fetch

abstract fun fetch(
    input: dynamic,
    init: RequestInit = definedExternally
): Promise<Response>

removeEventListener

fun removeEventListener(
    type: String,
    callback: EventListener?,
    options: dynamic = definedExternally)
fun removeEventListener(
    type: String,
    callback: (Event) -> Unit,
    options: dynamic = definedExternally)

setInterval

abstract fun setInterval(
    handler: dynamic,
    timeout: Int = definedExternally,
    vararg arguments: Any?
): Int

setTimeout

abstract fun setTimeout(
    handler: dynamic,
    timeout: Int = definedExternally,
    vararg arguments: Any?
): Int

Inheritors

DedicatedWorkerGlobalScope

abstract external class DedicatedWorkerGlobalScope : 
    WorkerGlobalScope

Exposes the JavaScript DedicatedWorkerGlobalScope to Kotlin

ServiceWorkerGlobalScope

abstract external class ServiceWorkerGlobalScope : 
    WorkerGlobalScope

Exposes the JavaScript ServiceWorkerGlobalScope to Kotlin

SharedWorkerGlobalScope

abstract external class SharedWorkerGlobalScope : 
    WorkerGlobalScope

Exposes the JavaScript SharedWorkerGlobalScope to Kotlin