Skip to content

Commit 1992609

Browse files
committed
chore: add libp2p modules typedef
1 parent 55910c8 commit 1992609

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/index.js

+9-1
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ const IDENTIFY_PROTOCOLS = IdentifyService.multicodecs
3737
* @typedef {import('multiaddr')} Multiaddr
3838
* @typedef {import('libp2p-interfaces/src/connection').Connection} Connection
3939
* @typedef {import('libp2p-interfaces/src/stream-muxer/types').MuxedStream} MuxedStream
40+
* @typedef {import('libp2p-interfaces/src/transport/types').TransportFactory} TransportFactory
41+
* @typedef {import('libp2p-interfaces/src/stream-muxer/types').MuxerFactory} MuxerFactory
42+
* @typedef {import('libp2p-interfaces/src/crypto/types').Crypto} Crypto
4043
* @typedef {import('libp2p-interfaces/src/pubsub')} Pubsub
4144
*/
4245

@@ -60,8 +63,13 @@ const IDENTIFY_PROTOCOLS = IdentifyService.multicodecs
6063
* @property {RelayOptions} [relay]
6164
* @property {Object} [transport] transport options indexed by transport key
6265
*
66+
* @typedef {Object} Libp2pModules
67+
* @property {TransportFactory[]} transport
68+
* @property {MuxerFactory[]} streamMuxer
69+
* @property {Crypto[]} connEncryption
70+
*
6371
* @typedef {Object} Libp2pOptions
64-
* @property {Object[]} modules libp2p modules to use
72+
* @property {Libp2pModules} modules libp2p modules to use
6573
* @property {import('./address-manager').AddressManagerOptions} [addresses]
6674
* @property {import('./connection-manager').ConnectionManagerOptions} [connectionManager]
6775
* @property {import('./dialer').DialerOptions} [dialer]

0 commit comments

Comments
 (0)