Skip to content

WorkerGlobalScope

Defined in: .pnpm-home/store/v11/links/@cloudflare/workers-types/4.20251118.0/2891147a4db443bf13ca098dcb7381fb6bac5793758b7fd187ebaf5bc0deb969/node_modules/@cloudflare/workers-types/index.ts:79

The EventTarget interface is implemented by objects that can receive events and may have listeners for them.

MDN Reference

new WorkerGlobalScope(): WorkerGlobalScope

Defined in: .pnpm-home/store/v11/links/@cloudflare/workers-types/4.20251118.0/2891147a4db443bf13ca098dcb7381fb6bac5793758b7fd187ebaf5bc0deb969/node_modules/@cloudflare/workers-types/index.ts:872

WorkerGlobalScope

EventTarget.constructor

EventTarget: typeof EventTarget

Defined in: .pnpm-home/store/v11/links/@cloudflare/workers-types/4.20251118.0/2891147a4db443bf13ca098dcb7381fb6bac5793758b7fd187ebaf5bc0deb969/node_modules/@cloudflare/workers-types/index.ts:80

addEventListener<Type>(type, handler, options?): void

Defined in: .pnpm-home/store/v11/links/@cloudflare/workers-types/4.20251118.0/2891147a4db443bf13ca098dcb7381fb6bac5793758b7fd187ebaf5bc0deb969/node_modules/@cloudflare/workers-types/index.ts:878

The addEventListener() method of the EventTarget interface sets up a function that will be called whenever the specified event is delivered to the target.

MDN Reference

Type extends keyof WorkerGlobalScopeEventMap

Type

EventListenerOrEventListenerObject<WorkerGlobalScopeEventMap[Type]>

boolean | EventTargetAddEventListenerOptions

void

EventTarget.addEventListener


dispatchEvent(event): boolean

Defined in: .pnpm-home/store/v11/links/@cloudflare/workers-types/4.20251118.0/2891147a4db443bf13ca098dcb7381fb6bac5793758b7fd187ebaf5bc0deb969/node_modules/@cloudflare/workers-types/index.ts:898

The dispatchEvent() method of the EventTarget sends an Event to the object, (synchronously) invoking the affected event listeners in the appropriate order.

MDN Reference

FetchEvent | ScheduledEvent | QueueEvent<unknown> | PromiseRejectionEvent

boolean

EventTarget.dispatchEvent


removeEventListener<Type>(type, handler, options?): void

Defined in: .pnpm-home/store/v11/links/@cloudflare/workers-types/4.20251118.0/2891147a4db443bf13ca098dcb7381fb6bac5793758b7fd187ebaf5bc0deb969/node_modules/@cloudflare/workers-types/index.ts:888

The removeEventListener() method of the EventTarget interface removes an event listener previously registered with EventTarget.addEventListener() from the target.

MDN Reference

Type extends keyof WorkerGlobalScopeEventMap

Type

EventListenerOrEventListenerObject<WorkerGlobalScopeEventMap[Type]>

boolean | EventTargetEventListenerOptions

void

EventTarget.removeEventListener