mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-13 01:53:30 +01:00
Make JSDocs follow general conventions (#582)
* Make JSDocs follow usual conventions * Fix StringResolvable name * Make function lowercase
This commit is contained in:
committed by
Amish Shah
parent
44efcf3f52
commit
27652b94af
@@ -23,33 +23,33 @@ class WebSocketManager {
|
||||
this.packetManager = new PacketManager(this);
|
||||
/**
|
||||
* The status of the WebSocketManager, a type of Constants.Status. It defaults to IDLE.
|
||||
* @type {Number}
|
||||
* @type {number}
|
||||
*/
|
||||
this.status = Constants.Status.IDLE;
|
||||
|
||||
/**
|
||||
* The session ID of the connection, null if not yet available.
|
||||
* @type {?String}
|
||||
* @type {?string}
|
||||
*/
|
||||
this.sessionID = null;
|
||||
|
||||
/**
|
||||
* The packet count of the client, null if not yet available.
|
||||
* @type {?Number}
|
||||
* @type {?number}
|
||||
*/
|
||||
this.sequence = -1;
|
||||
|
||||
/**
|
||||
* The gateway address for this WebSocket connection, null if not yet available.
|
||||
* @type {?String}
|
||||
* @type {?string}
|
||||
*/
|
||||
this.gateway = null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Connects the client to a given gateway
|
||||
* @param {String} gateway the gateway to connect to
|
||||
* @returns {null}
|
||||
* @param {string} gateway the gateway to connect to
|
||||
* @returns {void}
|
||||
*/
|
||||
connect(gateway) {
|
||||
this.status = Constants.Status.CONNECTING;
|
||||
@@ -69,7 +69,7 @@ class WebSocketManager {
|
||||
/**
|
||||
* Sends a packet to the gateway
|
||||
* @param {Object} packet An object that can be JSON stringified
|
||||
* @returns {null}
|
||||
* @returns {void}
|
||||
*/
|
||||
send(data) {
|
||||
this._queue.push(JSON.stringify(data));
|
||||
@@ -100,7 +100,7 @@ class WebSocketManager {
|
||||
|
||||
/**
|
||||
* Run whenever the gateway connections opens up
|
||||
* @returns {null}
|
||||
* @returns {void}
|
||||
*/
|
||||
eventOpen() {
|
||||
if (this.reconnecting) {
|
||||
@@ -112,7 +112,7 @@ class WebSocketManager {
|
||||
|
||||
/**
|
||||
* Sends a gatway resume packet, in cases of unexpected disconnections.
|
||||
* @returns {null}
|
||||
* @returns {void}
|
||||
*/
|
||||
_sendResume() {
|
||||
const payload = {
|
||||
@@ -129,7 +129,7 @@ class WebSocketManager {
|
||||
|
||||
/**
|
||||
* Sends a new identification packet, in cases of new connections or failed reconnections.
|
||||
* @returns {null}
|
||||
* @returns {void}
|
||||
*/
|
||||
_sendNewIdentify() {
|
||||
this.reconnecting = false;
|
||||
@@ -147,7 +147,7 @@ class WebSocketManager {
|
||||
|
||||
/**
|
||||
* Run whenever the connection to the gateway is closed, it will try to reconnect the client.
|
||||
* @returns {null}
|
||||
* @returns {void}
|
||||
*/
|
||||
eventClose(event) {
|
||||
if (event.code === 4004) {
|
||||
@@ -162,7 +162,7 @@ class WebSocketManager {
|
||||
* Run whenever a message is received from the WebSocket. Returns `true` if the message
|
||||
* was handled properly.
|
||||
* @param {Object} data the received websocket data
|
||||
* @returns {Boolean}
|
||||
* @returns {boolean}
|
||||
*/
|
||||
eventMessage($event) {
|
||||
let packet;
|
||||
@@ -188,7 +188,7 @@ class WebSocketManager {
|
||||
|
||||
/**
|
||||
* Run whenever an error occurs with the WebSocket connection. Tries to reconnect
|
||||
* @returns {null}
|
||||
* @returns {void}
|
||||
*/
|
||||
eventError(e) {
|
||||
/**
|
||||
@@ -214,7 +214,7 @@ class WebSocketManager {
|
||||
/**
|
||||
* Runs on new packets before `READY` to see if the Client is ready yet, if it is prepares
|
||||
* the `READY` event.
|
||||
* @returns {null}
|
||||
* @returns {void}
|
||||
*/
|
||||
checkIfReady() {
|
||||
if (this.status !== Constants.Status.READY && this.status !== Constants.Status.NEARLY) {
|
||||
@@ -238,7 +238,7 @@ class WebSocketManager {
|
||||
|
||||
/**
|
||||
* Tries to reconnect the client, changing the status to Constants.Status.RECONNECTING.
|
||||
* @returns {null}
|
||||
* @returns {void}
|
||||
*/
|
||||
tryReconnect() {
|
||||
this.status = Constants.Status.RECONNECTING;
|
||||
|
||||
@@ -15,7 +15,7 @@ class MessageDeleteBulkHandler extends AbstractHandler {
|
||||
* Emitted whenever a messages are deleted in bulk
|
||||
*
|
||||
* @event Client#messageDeleteBulk
|
||||
* @param {Collection<String, Message>} messages The deleted messages, mapped by their ID
|
||||
* @param {Collection<string, Message>} messages The deleted messages, mapped by their ID
|
||||
*/
|
||||
|
||||
module.exports = MessageDeleteBulkHandler;
|
||||
|
||||
Reference in New Issue
Block a user