The subset of MessagePort / Worker / BroadcastChannel this package needs.
The listener takes unknown rather than { data: unknown } so that both the
DOM typings (MessageEvent) and @types/node 22's EventListener (a plain
Event, which declares no data) satisfy it; fromPort reads data
defensively.
The subset of MessagePort / Worker / BroadcastChannel this package needs.
The listener takes
unknownrather than{ data: unknown }so that both the DOM typings (MessageEvent) and@types/node22'sEventListener(a plainEvent, which declares nodata) satisfy it; fromPort readsdatadefensively.