Table of Contents

Class Worklet

Namespace
CSharpToJavaScript.APIs.JS
Assembly
CSharpToJavaScript.dll

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

[Value("Worklet")]
public class Worklet
Inheritance
Worklet
Derived
Inherited Members

Remarks

With Worklets, you can run JavaScript and WebAssembly code to do graphics rendering or audio processing where high performance is required.

Worklets allow static import of ECMAScript modules, if supported, using import.
Dynamic import is disallowed by the specification — calling import() will throw.

-Houdini: Demystifying CSS on Google Developers (2016)
-AudioWorklet :: What, Why, and How on YouTube (2017)
-Enter AudioWorklet on Google Developers (2017)
-Animation Worklet - HTTP203 Advent on YouTube (2017)

See also on MDN

Constructors

Worklet()

public Worklet()

Methods

AddModule(string, WorkletOptions)

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

[Value("addModule")]
public Task<GlobalObject.Undefined> AddModule(string moduleURL, WorkletOptions options = null)

Parameters

moduleURL string
options WorkletOptions

Returns

Task<GlobalObject.Undefined>

A Promise that resolves once the module from the given URL has been
added. The promise doesn&apos;t return any value.

Remarks