@@ -8,7 +8,7 @@ import { toString as uint8ArrayToString } from 'uint8arrays'
88import { logger } from '@libp2p/logger'
99import { CodeError } from '@libp2p/interfaces/errors'
1010import { RateLimiterMemory } from 'rate-limiter-flexible'
11- import type { Sink } from 'it-stream-types'
11+ import type { Sink , Source } from 'it-stream-types'
1212import type { StreamMuxer , StreamMuxerInit } from '@libp2p/interface-stream-muxer'
1313import type { Stream } from '@libp2p/interface-connection'
1414import type { MplexInit } from './index.js'
@@ -49,8 +49,8 @@ interface MplexStreamMuxerInit extends MplexInit, StreamMuxerInit {}
4949export class MplexStreamMuxer implements StreamMuxer {
5050 public protocol = '/mplex/6.7.0'
5151
52- public sink : Sink < Uint8Array >
53- public source : AsyncIterable < Uint8Array >
52+ public sink : Sink < Source < Uint8ArrayList | Uint8Array > , Promise < void > >
53+ public source : AsyncGenerator < Uint8Array >
5454
5555 private _streamId : number
5656 private readonly _streams : { initiators : Map < number , MplexStream > , receivers : Map < number , MplexStream > }
@@ -190,8 +190,8 @@ export class MplexStreamMuxer implements StreamMuxer {
190190 * Creates a sink with an abortable source. Incoming messages will
191191 * also have their size restricted. All messages will be varint decoded.
192192 */
193- _createSink ( ) : Sink < Uint8Array > {
194- const sink : Sink < Uint8Array > = async source => {
193+ _createSink ( ) : Sink < Source < Uint8ArrayList | Uint8Array > , Promise < void > > {
194+ const sink : Sink < Source < Uint8ArrayList | Uint8Array > , Promise < void > > = async source => {
195195 const signal = anySignal ( [ this . closeController . signal , this . _init . signal ] )
196196
197197 try {
0 commit comments