@@ -15,6 +15,7 @@ const { codes } = require('./errors')
15
15
16
16
/**
17
17
* @typedef {import('libp2p-interfaces/src/transport/types').MultiaddrConnection } MultiaddrConnection
18
+ * @typedef {import('libp2p-interfaces/src/stream-muxer/types').MuxerFactory } MuxerFactory
18
19
* @typedef {import('libp2p-interfaces/src/stream-muxer/types').Muxer } Muxer
19
20
* @typedef {import('libp2p-interfaces/src/stream-muxer/types').MuxedStream } MuxedStream
20
21
* @typedef {import('libp2p-interfaces/src/crypto/types').Crypto } Crypto
@@ -34,7 +35,7 @@ class Upgrader {
34
35
* @param {PeerId } options.localPeer
35
36
* @param {import('./metrics') } [options.metrics]
36
37
* @param {Map<string, Crypto> } [options.cryptos]
37
- * @param {Map<string, Muxer > } [options.muxers]
38
+ * @param {Map<string, MuxerFactory > } [options.muxers]
38
39
* @param {(Connection) => void } options.onConnection - Called when a connection is upgraded
39
40
* @param {(Connection) => void } options.onConnectionEnd
40
41
*/
@@ -203,7 +204,7 @@ class Upgrader {
203
204
* @param {string } options.direction - One of ['inbound', 'outbound']
204
205
* @param {MultiaddrConnection } options.maConn - The transport layer connection
205
206
* @param {MuxedStream | MultiaddrConnection } options.upgradedConn - A duplex connection returned from multiplexer and/or crypto selection
206
- * @param {Muxer } [options.Muxer] - The muxer to be used for muxing
207
+ * @param {MuxerFactory } [options.Muxer] - The muxer to be used for muxing
207
208
* @param {PeerId } options.remotePeer - The peer the connection is with
208
209
* @returns {Connection }
209
210
*/
@@ -405,8 +406,8 @@ class Upgrader {
405
406
* @private
406
407
* @async
407
408
* @param {MultiaddrConnection } connection - A basic duplex connection to multiplex
408
- * @param {Map<string, Muxer > } muxers - The muxers to attempt multiplexing with
409
- * @returns {Promise<{ stream: MuxedStream, Muxer?: Muxer }> } A muxed connection
409
+ * @param {Map<string, MuxerFactory > } muxers - The muxers to attempt multiplexing with
410
+ * @returns {Promise<{ stream: MuxedStream, Muxer?: MuxerFactory }> } A muxed connection
410
411
*/
411
412
async _multiplexOutbound ( connection , muxers ) {
412
413
const dialer = new Multistream . Dialer ( connection )
@@ -429,8 +430,8 @@ class Upgrader {
429
430
* @private
430
431
* @async
431
432
* @param {MultiaddrConnection } connection - A basic duplex connection to multiplex
432
- * @param {Map<string, Muxer > } muxers - The muxers to attempt multiplexing with
433
- * @returns {Promise<{ stream: MuxedStream, Muxer?: Muxer }> } A muxed connection
433
+ * @param {Map<string, MuxerFactory > } muxers - The muxers to attempt multiplexing with
434
+ * @returns {Promise<{ stream: MuxedStream, Muxer?: MuxerFactory }> } A muxed connection
434
435
*/
435
436
async _multiplexInbound ( connection , muxers ) {
436
437
const listener = new Multistream . Listener ( connection )
0 commit comments