Hi there! Are you looking for the official Deno documentation? Try docs.deno.com for all your Deno learning needs.

MessageEvent

A message received by a target object.

interface MessageEvent <T = any> extends Event {
readonly data: T;
readonly lastEventId: string;
readonly origin: string;
readonly ports: ReadonlyArray<MessagePort>;
readonly source: MessageEventSource | null;
initMessageEvent(
type: string,
bubbles?: boolean,
cancelable?: boolean,
data?: any,
origin?: string,
lastEventId?: string,
source?: MessageEventSource | null,
ports?: MessagePort[],
): void;
initMessageEvent(
type: string,
bubbles?: boolean,
cancelable?: boolean,
data?: any,
origin?: string,
lastEventId?: string,
source?: MessageEventSource | null,
ports?: Iterable<MessagePort>,
): void;
}
var MessageEvent: {
prototype: MessageEvent;
new <T>(type: string, eventInitDict?: MessageEventInit<T>): MessageEvent<T>;
}
;

§Type Parameters

§
T = any
[src]

§Extends

§Properties

§
readonly data: T
[src]

Returns the data of the message.

§
readonly lastEventId: string
[src]

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

§
readonly origin: string
[src]

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

§
readonly ports: ReadonlyArray<MessagePort>
[src]

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

§
readonly source: MessageEventSource | null
[src]

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

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