interface WebWorkerGlobals

The web globals this host needs. Inject fakes to test without spawning real workers.

Properties

readonly
optional
Worker: new (
specifier: string,
options: { type: "module"; }
) => WebWorkerLike

The Worker constructor; absent on runtimes without web workers.

readonly
optional
hardwareConcurrency: number

Reported hardware concurrency (navigator.hardwareConcurrency).

Usage

import { type WebWorkerGlobals } from "runtime/src/index.ts";