chore: add typedefs

This commit is contained in:
Vasco Santos
2020-11-16 11:56:18 +01:00
parent dfcce961bd
commit 26c40c8dfd
30 changed files with 385 additions and 186 deletions

View File

@ -16,6 +16,17 @@ function lpEncodeExchange (exchange) {
return lp.encode.single(pb)
}
/**
* @typedef {import('libp2p-interfaces/src/connection').Connection} Connection
*/
/**
* Encrypt connection.
*
* @param {PeerId} localId
* @param {Connection} conn
* @param {PeerId} remoteId
*/
async function encrypt (localId, conn, remoteId) {
const shake = handshake(conn)