Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/yxz/typing/lib.dom.ts>MessageEvent

Deno Standard Extensions
Go to Latest
interface MessageEvent
implements Event
import { type MessageEvent } from "https://deno.land/x/yxz@0.17.0/typing/lib.dom.ts";

A message received by a target object.

Type Parameters

optional
T = any

Properties

readonly
data: T

Returns the data of the message.

readonly
lastEventId: string

Returns the last event ID string, for server-sent events.

readonly
origin: string

Returns the origin of the message, for server-sent events and cross-document messaging.

readonly
ports: ReadonlyArray<MessagePort>

Returns the MessagePort array sent with the message, for cross-document messaging and channel messaging.

readonly
source: MessageEventSource | null

Returns the WindowProxy of the source window, for cross-document messaging, and the MessagePort being attached, in the connect event fired at SharedWorkerGlobalScope objects.

Methods

deprecated
initMessageEvent(
type: string,
bubbles?: boolean,
cancelable?: boolean,
data?: any,
origin?: string,
lastEventId?: string,
source?: MessageEventSource | null,
ports?: MessagePort[],
): void