Added Client#status and Message#type typedefs (#1571)

* typedef for MessageTypes and linked Client#status to Status

* should be singular

* typedef for Voiceconnection#status
This commit is contained in:
SpaceEEC
2017-06-09 16:27:49 +02:00
committed by Crawl
parent 7b3a005b65
commit d6041f9fb3
4 changed files with 15 additions and 3 deletions

View File

@@ -198,7 +198,7 @@ class Client extends EventEmitter {
/**
* Current status of the client's connection to Discord
* @type {?number}
* @type {?Status}
* @readonly
*/
get status() {

View File

@@ -52,7 +52,7 @@ class VoiceConnection extends EventEmitter {
/**
* The current status of the voice connection
* @type {number}
* @type {VoiceStatus}
*/
this.status = Constants.VoiceStatus.AUTHENTICATING;

View File

@@ -40,7 +40,7 @@ class Message {
/**
* The type of the message
* @type {string}
* @type {MessageType}
*/
this.type = Constants.MessageTypes[data.type];

View File

@@ -329,6 +329,18 @@ exports.WSEvents = {
RELATIONSHIP_REMOVE: 'RELATIONSHIP_REMOVE',
};
/**
* The type of a message, e.g. `DEFAULT`. Here are the available types:
* - DEFAULT
* - RECIPIENT_ADD
* - RECIPIENT_REMOVE
* - CALL
* - CHANNEL_NAME_CHANGE
* - CHANNEL_ICON_CHANGE
* - PINS_ADD
* - GUILD_MEMBER_JOIN
* @typedef {string} MessageType
*/
exports.MessageTypes = [
'DEFAULT',
'RECIPIENT_ADD',