Package-level declarations

Types

Link copied to clipboard
open class Worklet<M : WorkletModule>

The Worklet interface is a lightweight version of Web Workers and gives developers access to low-level parts of the rendering pipeline. Available only in secure contexts.

Link copied to clipboard

The WorkletGlobalScope interface is an abstract class that specific worklet scope classes inherit from. Available only in secure contexts.

Link copied to clipboard
interface WorkletModule
Link copied to clipboard
interface WorkletOptions

Functions

Link copied to clipboard
inline suspend fun <M : WorkletModule> Worklet<M>.addModule(module: M)
inline suspend fun <M : WorkletModule> Worklet<M>.addModule(moduleURL: URL)
inline suspend fun <M : WorkletModule> Worklet<M>.addModule(module: M, options: WorkletOptions)
inline suspend fun <M : WorkletModule> Worklet<M>.addModule(moduleURL: URL, options: WorkletOptions)

inline suspend fun <M : WorkletModule> Worklet<M>.addModule(moduleURL: String)
inline suspend fun <M : WorkletModule> Worklet<M>.addModule(moduleURL: String, options: WorkletOptions)

The addModule() method of the Worklet interface loads the module in the given JavaScript file and adds it to the current Worklet.