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.
Extends
Section titled “Extends”Extended by
Section titled “Extended by”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”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
Returns
Section titled “Returns”WorkerGlobalScope
Inherited from
Section titled “Inherited from”Properties
Section titled “Properties”EventTarget
Section titled “EventTarget”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
Methods
Section titled “Methods”addEventListener()
Section titled “addEventListener()”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.
Type Parameters
Section titled “Type Parameters”Type extends keyof WorkerGlobalScopeEventMap
Parameters
Section titled “Parameters”Type
handler
Section titled “handler”EventListenerOrEventListenerObject<WorkerGlobalScopeEventMap[Type]>
options?
Section titled “options?”boolean | EventTargetAddEventListenerOptions
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”dispatchEvent()
Section titled “dispatchEvent()”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.
Parameters
Section titled “Parameters”FetchEvent | ScheduledEvent | QueueEvent<unknown> | PromiseRejectionEvent
Returns
Section titled “Returns”boolean
Inherited from
Section titled “Inherited from”removeEventListener()
Section titled “removeEventListener()”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.
Type Parameters
Section titled “Type Parameters”Type extends keyof WorkerGlobalScopeEventMap
Parameters
Section titled “Parameters”Type
handler
Section titled “handler”EventListenerOrEventListenerObject<WorkerGlobalScopeEventMap[Type]>
options?
Section titled “options?”boolean | EventTargetEventListenerOptions
Returns
Section titled “Returns”void