Options
All
  • Public
  • Public/Protected
  • All
Menu

This Channel Messaging API interface represents one of the two ports of a MessageChannel, allowing messages to be sent from one port and listening out for them arriving at the other.

Hierarchy

  • EventTarget
    • MessagePort

Index

Properties

onmessage: null | ((this: internal.MessagePort, ev: internal.MessageEvent<any>) => any)
onmessageerror: null | ((this: internal.MessagePort, ev: internal.MessageEvent<any>) => any)

Methods

  • addEventListener<K>(type: K, listener: ((this: internal.MessagePort, ev: MessagePortEventMap[K]) => any), options?: boolean | AddEventListenerOptions): void
  • addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void
  • close(): void
  • Disconnects the port, so that it is no longer active.

    Returns void

  • dispatchEvent(event: Event): boolean
  • Dispatches a synthetic event event to target and returns true if either event's cancelable attribute value is false or its preventDefault() method was not invoked, and false otherwise.

    Parameters

    • event: Event

    Returns boolean

  • Posts a message through the channel. Objects listed in transfer are transferred, not just cloned, meaning that they are no longer usable on the sending side.

    Throws a "DataCloneError" DOMException if transfer contains duplicate objects or port, or if message could not be cloned.

    Parameters

    Returns void

  • Parameters

    Returns void

  • removeEventListener<K>(type: K, listener: ((this: internal.MessagePort, ev: MessagePortEventMap[K]) => any), options?: boolean | EventListenerOptions): void
  • removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void
  • start(): void
  • Begins dispatching messages received on the port.

    Returns void

Generated using TypeDoc