postMessage

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

Clones message and transmits it to worker's global environment. 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)