Package-level declarations

Types

Link copied to clipboard
external interface AbstractWorker : EventTarget
Link copied to clipboard

(the Worker global scope) is accessible through the self keyword. Some additional global functions, namespaces objects, and constructors, not typically associated with the worker global scope, but available on it, are listed in the JavaScript Reference. See also: Functions available to workers.

Link copied to clipboard
open external class SharedWorker(scriptURL: String, options: String = definedExternally) : EventTarget, AbstractWorker
Link copied to clipboard
Link copied to clipboard
open external class Worker(scriptURL: String, options: WorkerOptions = definedExternally) : EventTarget, AbstractWorker

This Web Workers API interface represents a background task that can be easily created and can send messages back to its creator. Creating a worker is as simple as calling the Worker() constructor and specifying a script to be run in the worker thread.

Link copied to clipboard
sealed external interface WorkerFactory
Link copied to clipboard
abstract external class WorkerGlobalScope : EventTarget, FontFaceSource

This Web Workers API interface is an interface representing the scope of any worker. Workers have no browsing context; this scope contains the information usually conveyed by Window objects — in this case event handlers, the console or the associated WorkerNavigator object. Each WorkerGlobalScope has its own event loop.

Link copied to clipboard
sealed external class WorkerLocation

The absolute location of the script executed by the Worker. Such an object is initialized for each worker and is available via the WorkerGlobalScope.location property obtained by calling self.location.

Link copied to clipboard

A subset of the Navigator interface allowed to be accessed from a Worker. Such an object is initialized for each worker and is available via the WorkerGlobalScope.navigator property obtained by calling window.self.navigator.

Link copied to clipboard
external interface WorkerOptions
Link copied to clipboard
sealed external interface WorkerType

Properties

Functions

Link copied to clipboard
external fun importScripts(vararg urls: String)

Fetches each URL in urls, executes them one-by-one in the order they are passed, and then returns (or throws if something went amiss).

external fun importScripts(vararg urls: URL)
Link copied to clipboard