Skip to content

Commit

Permalink
chore: add explicit return types for LocalDiscovery methods (#819)
Browse files Browse the repository at this point in the history
*This is a types-only change.*
  • Loading branch information
EvanHahn authored Sep 12, 2024
1 parent ba1d75d commit 745604a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/discovery/local-discovery.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ export class LocalDiscovery extends TypedEmitter {
return { name: this.#name, port: getAddress(this.#server).port }
}

/** @returns {Promise<void>} */
async #start() {
// Let OS choose port, listen on ip4, all interfaces
this.#server.listen(0, '0.0.0.0')
Expand Down Expand Up @@ -108,6 +109,7 @@ export class LocalDiscovery extends TypedEmitter {
/**
* @param {boolean} isInitiator
* @param {net.Socket} socket
* @returns {void}
*/
#handleTcpConnection(isInitiator, socket) {
socket.off('error', this.#handleSocketError)
Expand Down Expand Up @@ -153,9 +155,9 @@ export class LocalDiscovery extends TypedEmitter {
}

/**
*
* @param {OpenedNetNoiseStream} existing
* @param {OpenedNetNoiseStream} keeping
* @returns {void}
*/
#handleConnectionSwap(existing, keeping) {
let closed = false
Expand All @@ -179,7 +181,6 @@ export class LocalDiscovery extends TypedEmitter {
}

/**
*
* @param {OpenedNetNoiseStream} conn
* @returns {void}
*/
Expand Down

0 comments on commit 745604a

Please sign in to comment.