MessagePortMain

Constructors

Link copied to clipboard
constructor()

Properties

Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
external fun addListener(type: EventType, listener: EventListener)
Link copied to clipboard
external fun close()

Disconnects the port, so it is no longer active.

Link copied to clipboard
external fun emit(type: EventType, vararg args: Any?): Boolean
Link copied to clipboard
Link copied to clipboard
external fun getMaxListeners(): Double
Link copied to clipboard
external fun listenerCount(type: EventType, listener: EventListener): Double
Link copied to clipboard
Link copied to clipboard
external fun off(type: EventType, listener: EventListener)
Link copied to clipboard
external fun on(type: EventType, listener: EventListener)
Link copied to clipboard
external fun once(type: EventType, listener: EventListener)
Link copied to clipboard
external fun postMessage(message: Any?, transfer: ReadonlyArray<MessagePortMain> = definedExternally)

Sends a message from the port, and optionally, transfers ownership of objects to other browsing contexts.

Link copied to clipboard
external fun prependListener(type: EventType, listener: EventListener)
Link copied to clipboard
external fun prependOnceListener(type: EventType, listener: EventListener)
Link copied to clipboard
Link copied to clipboard
external fun removeAllListeners(type: EventType)
Link copied to clipboard
external fun removeListener(type: EventType, listener: EventListener)
Link copied to clipboard
external fun setMaxListeners(n: Number)
Link copied to clipboard
external fun start()

Starts the sending of messages queued on the port. Messages will be queued until this method is called.