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.
Go to Latest
class WorkerGlobalScope
extends EventTarget
import { WorkerGlobalScope } from "https://deno.land/x/deno@v1.28.3/cli/tsc/dts/lib.deno.worker.d.ts";

Properties

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

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