API • Docs
API / <internal> / Protomux
• TStream extends Duplex
| NodeDuplex
= Duplex
new Protomux<
TStream
>(stream
):Protomux
<TStream
>
• stream: TStream
Protomux
<TStream
>
isProtomux:
true
stream:
TStream
[iterator]():
IterableIterator
<Channel
,any
,any
>
IterableIterator
<Channel
, any
, any
>
cork():
void
void
createChannel(
opts
):Channel
• opts
• opts.aliases?: string
[]
• opts.handshake?: any
• opts.id?: null
| Buffer
• opts.messages: Partial
<Pick
<Message
, "onmessage"
| "encoding"
>>[]
• opts.protocol: string
• opts.unique?: boolean
• opts.userData?: any
• opts.onclose?
• opts.ondestroy?
• opts.onopen?
destroy(
err
):void
• err: Error
void
opened(
opts
):boolean
• opts
• opts.id?: null
| Buffer
• opts.protocol: string
boolean
pair(
opts
,notify
):void
• opts
• opts.id?: null
| Buffer
• opts.protocol: string
• notify
void
uncork():
void
void
unpair(
opts
):void
• opts
• opts.id?: null
| Buffer
• opts.protocol: string
void
static
from(stream
):Protomux
<TStream
>
• stream: TStream
Protomux
<TStream
>
static
isProtomux(mux
):mux is Protomux<Duplex<any, any, any, any, true, true, DuplexEvents<any, any>>>
• mux: unknown
mux is Protomux<Duplex<any, any, any, any, true, true, DuplexEvents<any, any>>>