Skip to main content
Module

x/enzastdlib/rpc-messageport/mod.ts>MessagePortLike

enzastdlib is a set of TypeScript modules that follow a common design API philosophy aiming at sane defaults and ease-of-use targeting the Deno TypeScript runtime.
Latest
interface MessagePortLike
Re-export
import { type MessagePortLike } from "https://deno.land/x/enzastdlib@v0.0.4/rpc-messageport/mod.ts";

Represents a simplified interface of the JavaScript runtime's MessagePort class.

Only the APIs required by this module are specified. Since some runtime APIs have similar APIs for listening and posting messages but do not have a complete one-to-one API for extraneous things like a .close method. ex. BroadcastChannel vs MessagePort vs Worker.

Properties

readonly
addEventListener: (
event: "message",
listener: (event: MessageEvent) => void,
) => void
readonly
postMessage: ((message: any, transfer?: Transferable) => void) | ((message: any, options?: StructuredSerializeOptions) => void)
readonly
removeEventListener: (
event: "message",
listener: (event: MessageEvent) => void,
) => void