postMessage

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

Clones message and transmits it to the Worker object associated with dedicatedWorkerGlobal. transfer can be passed as a list of objects that are to be transferred rather than cloned.

MDN Reference


fun postMessage(message: Any?, options: StructuredSerializeOptions = definedExternally)(source)