Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/deno/cli/tsc/dts/lib.deno.worker.d.ts>WorkerGlobalScope

A modern runtime for JavaScript and TypeScript.
Latest
interface WorkerGlobalScope
implements EventTarget
import { type WorkerGlobalScope } from "https://deno.land/x/deno@v2.0.4/cli/tsc/dts/lib.deno.worker.d.ts";

Properties

readonly
location: WorkerLocation
readonly
navigator: WorkerNavigator
onerror: ((this: WorkerGlobalScope, ev: ErrorEvent) => any) | null
onunhandledrejection: ((this: WorkerGlobalScope, ev: PromiseRejectionEvent) => any) | null
readonly
self: WorkerGlobalScope & globalThis
Deno: Deno
caches: CacheStorage

Methods

addEventListener<K extends keyof WorkerGlobalScopeEventMap>(
type: K,
listener: (this: WorkerGlobalScope, ev: WorkerGlobalScopeEventMap[K]) => any,
options?: boolean | AddEventListenerOptions,
): void
addEventListener(
type: string,
options?: boolean | AddEventListenerOptions,
): void
removeEventListener<K extends keyof WorkerGlobalScopeEventMap>(
type: K,
listener: (this: WorkerGlobalScope, ev: WorkerGlobalScopeEventMap[K]) => any,
options?: boolean | EventListenerOptions,
): void
removeEventListener(
type: string,
options?: boolean | EventListenerOptions,
): void
variable WorkerGlobalScope
import { WorkerGlobalScope } from "https://deno.land/x/deno@v2.0.4/cli/tsc/dts/lib.deno.worker.d.ts";

type

{ readonly prototype: WorkerGlobalScope; new (): never; }