@ayonli/jsext
Version:
A JavaScript extension package for building strong and modern applications.
11 lines (10 loc) • 593 B
TypeScript
import { Channel } from "../chan.ts";
import { ChannelMessage } from "./types.ts";
export declare function isChannelMessage(msg: any): msg is ChannelMessage;
export declare function handleChannelMessage(msg: ChannelMessage): Promise<void>;
export declare function wrapChannel(channel: Channel<any>, channelWrite: (type: "send" | "close", msg: any, channelId: number) => void): object;
export declare function unwrapChannel(obj: {
"@@type": "Channel";
"@@id": number;
capacity?: number;
}, channelWrite: (type: "send" | "close", msg: any, channelId: number) => void): Channel<any>;