mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-27 08:47:13 +09:00
Fix JSDoc issues
Fix missing documentation for parameters and return types, incorect config and errors in type definitions.
This commit is contained in:
1 parent
3dba92a03d
commit
703fda43ad
20 files changed
+193
-52
No files matched your search
+12
-2
@@ -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 });
|
||||
|
||||
Reference in new issue
Block a user