Worklet

open external class Worklet(source)

Available only in secure contexts.

MDN Reference

Inheritors

Functions

Link copied to clipboard
suspend fun addModule(moduleURL: String, options: WorkletOptions = definedExternally)

Loads and executes the module script given by moduleURL into all of worklet's global scopes. It can also create additional global scopes as part of this process, depending on the worklet type. The returned promise will fulfill once the script has been successfully loaded and run in all global scopes.

suspend fun addModule(moduleURL: URL, options: WorkletOptions = definedExternally)
Link copied to clipboard
fun addModuleAsync(moduleURL: String, options: WorkletOptions = definedExternally): Promise<Void>
fun addModuleAsync(moduleURL: URL, options: WorkletOptions = definedExternally): Promise<Void>