Fix JSDoc issues

Fix missing documentation for parameters and return types, incorect
config and errors in type definitions.
This commit is contained in:
Hornwitser committed 2020-06-17 20:53:18 +02:00
1 parent 3dba92a03d
commit 703fda43ad
20 files changed
+193 -52

No files matched your search

+12 -2
View File
@@ -94,7 +94,9 @@ class WebSocketBaseConnector extends events.EventEmitter {
/**
* Send a message over the socket
*
* @returns the sequence number of the message sent
* @param {string} type - Message type to send.
* @param {Object} data - Data to send with message.
* @returns {number} the sequence number of the message sent
*/
send(type, data) {
if (!["handshake", "connected", "closing"].includes(this._state)) {
@@ -181,6 +183,9 @@ class WebSocketClientConnector extends WebSocketBaseConnector {
*
* Used in the register function in order to send the register handshake
* message over the WebSocket.
*
* @param {string} type - Message type to send.
* @param {Object} data - Data to send with message.
*/
sendHandshake(type, data) {
this._check(["handshake"]);
@@ -191,6 +196,9 @@ class WebSocketClientConnector extends WebSocketBaseConnector {
* Close the connection with the given reason.
*
* Sends a close frame and disconnects the connector.
*
* @param {number} code - WebSocket close code.
* @param {string} reason - WebSocket close reason.
*/
async close(code, reason) {
if (this._state === "new") {
@@ -449,7 +457,9 @@ class VirtualConnector extends events.EventEmitter {
/**
* Send a message to the other end of the connector
*
* @returns the sequence number of the message sent
* @param {string} type - Message type to send.
* @param {Object} data - Data to send with message.
* @returns {number} the sequence number of the message sent
*/
send(type, data) {
this.other.emit("message", { seq: this._seq, type, data });