MessagePort

abstract external class MessagePort : 
    EventTarget,
    UnionMessagePortOrWindow,
    UnionMessagePortOrServiceWorker,
    UnionClientOrMessagePortOrServiceWorker
(source)

Platform and version requirements: JS

Exposes the JavaScript MessagePort to Kotlin

Constructors

<init>

MessagePort()

Exposes the JavaScript MessagePort to Kotlin

Properties

onmessage

open var onmessage: (Event) -> dynamic

Functions

close

fun close()

postMessage

fun postMessage(
    message: Any?,
    transfer: Array<dynamic> = definedExternally)

start

fun start()

Inherited Functions

addEventListener

fun addEventListener(
    type: String,
    callback: EventListener?,
    options: dynamic = definedExternally)
fun addEventListener(
    type: String,
    callback: (Event) -> Unit,
    options: dynamic = definedExternally)

dispatchEvent

fun dispatchEvent(event: Event): Boolean

removeEventListener

fun removeEventListener(
    type: String,
    callback: EventListener?,
    options: dynamic = definedExternally)
fun removeEventListener(
    type: String,
    callback: (Event) -> Unit,
    options: dynamic = definedExternally)