From d9a053df67b780b85e09657345bfa7c06c9cf41b Mon Sep 17 00:00:00 2001 From: izexi <43889168+izexi@users.noreply.github.com> Date: Mon, 15 Apr 2019 13:41:37 +0100 Subject: [PATCH] docs(Presence): add ClientPresenceStatus typedef (#3208) --- src/structures/Presence.js | 17 ++++++++++++----- typings/index.d.ts | 6 +++--- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/src/structures/Presence.js b/src/structures/Presence.js index 16b4f002c..55937cea4 100644 --- a/src/structures/Presence.js +++ b/src/structures/Presence.js @@ -13,7 +13,6 @@ const { ActivityTypes } = require('../util/Constants'); /** * The status of this presence: - * * * **`online`** - user is online * * **`idle`** - user is AFK * * **`offline`** - user is offline or invisible @@ -21,6 +20,14 @@ const { ActivityTypes } = require('../util/Constants'); * @typedef {string} PresenceStatus */ +/** + * The status of this presence: + * * **`online`** - user is online + * * **`idle`** - user is AFK + * * **`dnd`** - user is in Do Not Disturb + * @typedef {string} ClientPresenceStatus + */ + /** * Represents a user's presence. */ @@ -80,10 +87,10 @@ class Presence { /** * The devices this presence is on - * @type {?object} - * @property {?PresenceStatus} web The current presence in the web application - * @property {?PresenceStatus} mobile The current presence in the mobile application - * @property {?PresenceStatus} desktop The current presence in the desktop application + * @type {?Object} + * @property {?ClientPresenceStatus} web The current presence in the web application + * @property {?ClientPresenceStatus} mobile The current presence in the mobile application + * @property {?ClientPresenceStatus} desktop The current presence in the desktop application */ this.clientStatus = data.client_status || null; diff --git a/typings/index.d.ts b/typings/index.d.ts index 673104f7d..fd680f05a 100644 --- a/typings/index.d.ts +++ b/typings/index.d.ts @@ -2075,9 +2075,9 @@ declare module 'discord.js' { type ClientPresenceStatus = 'online' | 'idle' | 'dnd'; interface ClientPresenceStatusData { - web?: PresenceStatus; - mobile?: PresenceStatus; - desktop?: PresenceStatus; + web?: ClientPresenceStatus; + mobile?: ClientPresenceStatus; + desktop?: ClientPresenceStatus; } type PartialTypes = 'USER'