@libp2p/interfaces
Advanced tools
Comparing version 1.1.0 to 1.1.1
@@ -9,3 +9,3 @@ import type { Duplex } from 'it-stream-types'; | ||
*/ | ||
export interface Muxer { | ||
export interface Muxer extends Duplex<Uint8Array> { | ||
readonly streams: MuxedStream[]; | ||
@@ -17,13 +17,11 @@ /** | ||
newStream: (name?: string) => MuxedStream; | ||
} | ||
export interface MuxerOptions { | ||
/** | ||
* A function called when receiving a new stream from the remote. | ||
*/ | ||
onStream: (stream: MuxedStream) => void; | ||
onStream?: (stream: MuxedStream) => void; | ||
/** | ||
* A function called when a stream ends. | ||
*/ | ||
onStreamEnd: (stream: MuxedStream) => void; | ||
} | ||
export interface MuxerOptions { | ||
onStream?: (stream: MuxedStream) => void; | ||
onStreamEnd?: (stream: MuxedStream) => void; | ||
@@ -38,3 +36,3 @@ maxMsgSize?: number; | ||
close: () => void; | ||
abort: () => void; | ||
abort: (err?: Error) => void; | ||
reset: () => void; | ||
@@ -41,0 +39,0 @@ timeline: MuxedTimeline; |
{ | ||
"name": "@libp2p/interfaces", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"description": "Interfaces for JS Libp2p", | ||
@@ -5,0 +5,0 @@ "license": "Apache-2.0 OR MIT", |
@@ -11,3 +11,3 @@ import type { Duplex } from 'it-stream-types' | ||
*/ | ||
export interface Muxer { | ||
export interface Muxer extends Duplex<Uint8Array> { | ||
readonly streams: MuxedStream[] | ||
@@ -19,7 +19,9 @@ /** | ||
newStream: (name?: string) => MuxedStream | ||
} | ||
export interface MuxerOptions { | ||
/** | ||
* A function called when receiving a new stream from the remote. | ||
*/ | ||
onStream: (stream: MuxedStream) => void | ||
onStream?: (stream: MuxedStream) => void | ||
@@ -29,7 +31,2 @@ /** | ||
*/ | ||
onStreamEnd: (stream: MuxedStream) => void | ||
} | ||
export interface MuxerOptions { | ||
onStream?: (stream: MuxedStream) => void | ||
onStreamEnd?: (stream: MuxedStream) => void | ||
@@ -46,3 +43,3 @@ maxMsgSize?: number | ||
close: () => void | ||
abort: () => void | ||
abort: (err?: Error) => void | ||
reset: () => void | ||
@@ -49,0 +46,0 @@ timeline: MuxedTimeline |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1287055
1665