Skip to content

CloseEvent

Defined in: node_modules/.pnpm/@cloudflare+workers-types@4.20250923.0/node_modules/@cloudflare/workers-types/index.ts:2786

A CloseEvent is sent to clients using WebSockets when the connection is closed. This is delivered to the listener indicated by the WebSocket object’s onclose attribute.

MDN Reference

new CloseEvent(type, initializer?): CloseEvent

Defined in: node_modules/.pnpm/@cloudflare+workers-types@4.20250923.0/node_modules/@cloudflare/workers-types/index.ts:2787

string

CloseEventInit

CloseEvent

Event.constructor

readonly bubbles: boolean

Defined in: node_modules/.pnpm/@cloudflare+workers-types@4.20250923.0/node_modules/@cloudflare/workers-types/index.ts:685

Returns true or false depending on how event was initialized. True if event goes through its target’s ancestors in reverse tree order, and false otherwise.

MDN Reference

Event.bubbles


readonly cancelable: boolean

Defined in: node_modules/.pnpm/@cloudflare+workers-types@4.20250923.0/node_modules/@cloudflare/workers-types/index.ts:691

Returns true or false depending on how event was initialized. Its return value does not always carry meaning, but true can indicate that part of the operation during which event was dispatched, can be canceled by invoking the preventDefault() method.

MDN Reference

Event.cancelable


cancelBubble: boolean

Defined in: node_modules/.pnpm/@cloudflare+workers-types@4.20250923.0/node_modules/@cloudflare/workers-types/index.ts:739

Event.cancelBubble


readonly code: number

Defined in: node_modules/.pnpm/@cloudflare+workers-types@4.20250923.0/node_modules/@cloudflare/workers-types/index.ts:2793

Returns the WebSocket connection close code provided by the server.

MDN Reference


readonly composed: boolean

Defined in: node_modules/.pnpm/@cloudflare+workers-types@4.20250923.0/node_modules/@cloudflare/workers-types/index.ts:679

Returns true or false depending on how event was initialized. True if event invokes listeners past a ShadowRoot node that is the root of its target, and false otherwise.

MDN Reference

Event.composed


readonly optional currentTarget: EventTarget<Record<string, Event>>

Defined in: node_modules/.pnpm/@cloudflare+workers-types@4.20250923.0/node_modules/@cloudflare/workers-types/index.ts:709

Returns the object whose event listener’s callback is currently being invoked.

MDN Reference

Event.currentTarget


readonly defaultPrevented: boolean

Defined in: node_modules/.pnpm/@cloudflare+workers-types@4.20250923.0/node_modules/@cloudflare/workers-types/index.ts:697

Returns true if preventDefault() was invoked successfully to indicate cancelation, and false otherwise.

MDN Reference

Event.defaultPrevented


readonly eventPhase: number

Defined in: node_modules/.pnpm/@cloudflare+workers-types@4.20250923.0/node_modules/@cloudflare/workers-types/index.ts:673

Returns the event’s phase, which is one of NONE, CAPTURING_PHASE, AT_TARGET, and BUBBLING_PHASE.

MDN Reference

Event.eventPhase


readonly isTrusted: boolean

Defined in: node_modules/.pnpm/@cloudflare+workers-types@4.20250923.0/node_modules/@cloudflare/workers-types/index.ts:733

Returns true if event was dispatched by the user agent, and false otherwise.

MDN Reference

Event.isTrusted


readonly reason: string

Defined in: node_modules/.pnpm/@cloudflare+workers-types@4.20250923.0/node_modules/@cloudflare/workers-types/index.ts:2799

Returns the WebSocket connection close reason provided by the server.

MDN Reference


readonly returnValue: boolean

Defined in: node_modules/.pnpm/@cloudflare+workers-types@4.20250923.0/node_modules/@cloudflare/workers-types/index.ts:703

Event.returnValue


readonly srcElement: null | EventTarget<Record<string, Event>>

Defined in: node_modules/.pnpm/@cloudflare+workers-types@4.20250923.0/node_modules/@cloudflare/workers-types/index.ts:721

Event.srcElement


readonly optional target: EventTarget<Record<string, Event>>

Defined in: node_modules/.pnpm/@cloudflare+workers-types@4.20250923.0/node_modules/@cloudflare/workers-types/index.ts:715

Returns the object to which event is dispatched (its target).

MDN Reference

Event.target


readonly timeStamp: number

Defined in: node_modules/.pnpm/@cloudflare+workers-types@4.20250923.0/node_modules/@cloudflare/workers-types/index.ts:727

Returns the event’s timestamp as the number of milliseconds measured relative to the time origin.

MDN Reference

Event.timeStamp


readonly type: string

Defined in: node_modules/.pnpm/@cloudflare+workers-types@4.20250923.0/node_modules/@cloudflare/workers-types/index.ts:667

Returns the type of event, e.g. “click”, “hashchange”, or “submit”.

MDN Reference

Event.type


readonly wasClean: boolean

Defined in: node_modules/.pnpm/@cloudflare+workers-types@4.20250923.0/node_modules/@cloudflare/workers-types/index.ts:2805

Returns true if the connection closed cleanly; false otherwise.

MDN Reference


readonly static AT_TARGET: number

Defined in: node_modules/.pnpm/@cloudflare+workers-types@4.20250923.0/node_modules/@cloudflare/workers-types/index.ts:766

Event.AT_TARGET


readonly static BUBBLING_PHASE: number

Defined in: node_modules/.pnpm/@cloudflare+workers-types@4.20250923.0/node_modules/@cloudflare/workers-types/index.ts:767

Event.BUBBLING_PHASE


readonly static CAPTURING_PHASE: number

Defined in: node_modules/.pnpm/@cloudflare+workers-types@4.20250923.0/node_modules/@cloudflare/workers-types/index.ts:765

Event.CAPTURING_PHASE


readonly static NONE: number

Defined in: node_modules/.pnpm/@cloudflare+workers-types@4.20250923.0/node_modules/@cloudflare/workers-types/index.ts:764

Event.NONE

composedPath(): EventTarget<Record<string, Event>>[]

Defined in: node_modules/.pnpm/@cloudflare+workers-types@4.20250923.0/node_modules/@cloudflare/workers-types/index.ts:763

Returns the invocation target objects of event’s path (objects on which listeners will be invoked), except for any nodes in shadow trees of which the shadow root’s mode is “closed” that are not reachable from event’s currentTarget.

MDN Reference

EventTarget<Record<string, Event>>[]

Event.composedPath


preventDefault(): void

Defined in: node_modules/.pnpm/@cloudflare+workers-types@4.20250923.0/node_modules/@cloudflare/workers-types/index.ts:751

If invoked when the cancelable attribute value is true, and while executing a listener for the event with passive set to false, signals to the operation that caused event to be dispatched that it needs to be canceled.

MDN Reference

void

Event.preventDefault


stopImmediatePropagation(): void

Defined in: node_modules/.pnpm/@cloudflare+workers-types@4.20250923.0/node_modules/@cloudflare/workers-types/index.ts:745

Invoking this method prevents event from reaching any registered event listeners after the current one finishes running and, when dispatched in a tree, also prevents event from reaching any other objects.

MDN Reference

void

Event.stopImmediatePropagation


stopPropagation(): void

Defined in: node_modules/.pnpm/@cloudflare+workers-types@4.20250923.0/node_modules/@cloudflare/workers-types/index.ts:757

When dispatched in a tree, invoking this method prevents event from reaching any objects other than the current object.

MDN Reference

void

Event.stopPropagation