postMessage

external fun postMessage(message: JsAny?, transfer: ReadonlyArray<Transferable>)(source)

The postMessage() method of the DedicatedWorkerGlobalScope interface sends a message to the main thread that spawned it.

MDN Reference


external fun postMessage(message: String, transfer: ReadonlyArray<Transferable>)(source)
external fun postMessage(message: JsAny?, options: StructuredSerializeOptions = definedExternally)(source)
external fun postMessage(message: String, options: StructuredSerializeOptions = definedExternally)(source)