@@ -16,7 +16,7 @@ import type { PeerId } from '@libp2p/interface-peer-id'
16
16
import type { AbortOptions } from '@libp2p/interfaces'
17
17
import type { Startable } from '@libp2p/interfaces/startable'
18
18
import type { Logger } from '@libp2p/logger'
19
- import type { Duplex } from 'it-stream-types'
19
+ import type { Duplex , Source } from 'it-stream-types'
20
20
import type { PeerInfo } from '@libp2p/interface-peer-info'
21
21
import type { Stream } from '@libp2p/interface-connection'
22
22
import { abortableDuplex } from 'abortable-iterator'
@@ -149,7 +149,7 @@ export class Network extends EventEmitter<NetworkEvents> implements Startable {
149
149
/**
150
150
* Write a message to the given stream
151
151
*/
152
- async _writeMessage ( stream : Duplex < Uint8ArrayList , Uint8ArrayList | Uint8Array > , msg : Uint8Array | Uint8ArrayList , options : AbortOptions ) : Promise < void > {
152
+ async _writeMessage ( stream : Duplex < AsyncGenerator < Uint8ArrayList > , Source < Uint8ArrayList | Uint8Array > > , msg : Uint8Array | Uint8ArrayList , options : AbortOptions ) : Promise < void > {
153
153
if ( options . signal != null ) {
154
154
stream = abortableDuplex ( stream , options . signal )
155
155
}
@@ -167,7 +167,7 @@ export class Network extends EventEmitter<NetworkEvents> implements Startable {
167
167
* If no response is received after the specified timeout
168
168
* this will error out.
169
169
*/
170
- async _writeReadMessage ( stream : Duplex < Uint8ArrayList , Uint8ArrayList | Uint8Array > , msg : Uint8Array | Uint8ArrayList , options : AbortOptions ) : Promise < Message > {
170
+ async _writeReadMessage ( stream : Duplex < AsyncGenerator < Uint8ArrayList > , Source < Uint8ArrayList | Uint8Array > > , msg : Uint8Array | Uint8ArrayList , options : AbortOptions ) : Promise < Message > {
171
171
if ( options . signal != null ) {
172
172
stream = abortableDuplex ( stream , options . signal )
173
173
}
0 commit comments