From 67adbd91b14028aa4a1d57b876c7c1d4fe11bebb Mon Sep 17 00:00:00 2001 From: Evan Hahn Date: Tue, 10 Sep 2024 19:28:14 +0000 Subject: [PATCH] chore: add explicit return types for `LocalDiscovery` methods *This is a types-only change.* --- src/discovery/local-discovery.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/discovery/local-discovery.js b/src/discovery/local-discovery.js index fc181a139..23ef4e0f1 100644 --- a/src/discovery/local-discovery.js +++ b/src/discovery/local-discovery.js @@ -72,6 +72,7 @@ export class LocalDiscovery extends TypedEmitter { return { name: this.#name, port: getAddress(this.#server).port } } + /** @returns {Promise} */ async #start() { // Let OS choose port, listen on ip4, all interfaces this.#server.listen(0, '0.0.0.0') @@ -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) @@ -153,9 +155,9 @@ export class LocalDiscovery extends TypedEmitter { } /** - * * @param {OpenedNetNoiseStream} existing * @param {OpenedNetNoiseStream} keeping + * @returns {void} */ #handleConnectionSwap(existing, keeping) { let closed = false @@ -179,7 +181,6 @@ export class LocalDiscovery extends TypedEmitter { } /** - * * @param {OpenedNetNoiseStream} conn * @returns {void} */