scala-js/scala-js-dom

Worker.postMessage's second parameter type should be array of Transferables

Closed this issue · 2 comments

As stated in https://developer.mozilla.org/en-US/docs/Web/API/Worker/postMessage

Right now the parameter type is js.Any which of course works, but is not type safe.

The parameter type is correct in DedicatedWorkerGlobalScope.postMessage but I suppose it has not been updated to the Worker trait.

I think js.Any on message is fine since it is described as The data may be any value or JavaScript object handled by the structured clone algorithm.

I think js.Any on message is fine since it is described as The data may be any value or JavaScript object handled by the structured clone algorithm.

I think that's the first parameter, this issue seems to be referring to the second.