From 546d48655f36ed9a6c6c5ce3c2eabcca1a86a945 Mon Sep 17 00:00:00 2001
From: n1ck_pro <59617443+N1ckPro@users.noreply.github.com>
Date: Sat, 4 Jun 2022 22:27:01 +0200
Subject: [PATCH] docs: add missing discord-api-types external types (#8001)
---
.../discord.js/src/managers/GuildManager.js | 8 +-
.../managers/GuildScheduledEventManager.js | 4 +-
.../src/managers/StageInstanceManager.js | 4 +-
.../src/structures/AutocompleteInteraction.js | 2 +-
packages/discord.js/src/structures/Guild.js | 18 +++--
packages/discord.js/src/util/APITypes.js | 80 +++++++++++++++----
packages/discord.js/src/util/Components.js | 4 +-
7 files changed, 87 insertions(+), 33 deletions(-)
diff --git a/packages/discord.js/src/managers/GuildManager.js b/packages/discord.js/src/managers/GuildManager.js
index fc7fd6a1d..2feb24826 100644
--- a/packages/discord.js/src/managers/GuildManager.js
+++ b/packages/discord.js/src/managers/GuildManager.js
@@ -137,22 +137,24 @@ class GuildManager extends CachedManager {
return super.resolveId(guild);
}
+ /* eslint-disable max-len */
/**
* Options used to create a guild.
* @typedef {Object} GuildCreateOptions
* @property {Snowflake|number} [afkChannelId] The AFK channel's id
* @property {number} [afkTimeout] The AFK timeout in seconds
* @property {PartialChannelData[]} [channels=[]] The channels for this guild
- * @property {DefaultMessageNotificationLevel|number} [defaultMessageNotifications] The default message notifications
+ * @property {GuildDefaultMessageNotificationLevel|number} [defaultMessageNotifications] The default message notifications
* for the guild
- * @property {ExplicitContentFilterLevel} [explicitContentFilter] The explicit content filter level for the guild
+ * @property {GuildExplicitContentFilterLevel} [explicitContentFilter] The explicit content filter level for the guild
* @property {?(BufferResolvable|Base64Resolvable)} [icon=null] The icon for the guild
* @property {PartialRoleData[]} [roles=[]] The roles for this guild,
* the first element of this array is used to change properties of the guild's everyone role.
* @property {Snowflake|number} [systemChannelId] The system channel's id
* @property {SystemChannelFlagsResolvable} [systemChannelFlags] The flags of the system channel
- * @property {VerificationLevel} [verificationLevel] The verification level for the guild
+ * @property {GuildVerificationLevel} [verificationLevel] The verification level for the guild
*/
+ /* eslint-enable max-len */
/**
* Creates a guild.
diff --git a/packages/discord.js/src/managers/GuildScheduledEventManager.js b/packages/discord.js/src/managers/GuildScheduledEventManager.js
index fb358aefb..5f4e3e624 100644
--- a/packages/discord.js/src/managers/GuildScheduledEventManager.js
+++ b/packages/discord.js/src/managers/GuildScheduledEventManager.js
@@ -43,7 +43,7 @@ class GuildScheduledEventManager extends CachedManager {
* @property {DateResolvable} scheduledStartTime The time to schedule the event at
* @property {DateResolvable} [scheduledEndTime] The time to end the event at
* This is required if `entityType` is {@link GuildScheduledEventEntityType.External}
- * @property {PrivacyLevel|number} privacyLevel The privacy level of the guild scheduled event
+ * @property {GuildScheduledEventPrivacyLevel|number} privacyLevel The privacy level of the guild scheduled event
* @property {GuildScheduledEventEntityType|number} entityType The scheduled entity type of the event
* @property {string} [description] The description of the guild scheduled event
* @property {GuildVoiceChannelResolvable} [channel] The channel of the guild scheduled event
@@ -167,7 +167,7 @@ class GuildScheduledEventManager extends CachedManager {
* @property {string} [name] The name of the guild scheduled event
* @property {DateResolvable} [scheduledStartTime] The time to schedule the event at
* @property {DateResolvable} [scheduledEndTime] The time to end the event at
- * @property {PrivacyLevel|number} [privacyLevel] The privacy level of the guild scheduled event
+ * @property {GuildScheduledEventPrivacyLevel|number} [privacyLevel] The privacy level of the guild scheduled event
* @property {GuildScheduledEventEntityType|number} [entityType] The scheduled entity type of the event
* @property {string} [description] The description of the guild scheduled event
* @property {?GuildVoiceChannelResolvable} [channel] The channel of the guild scheduled event
diff --git a/packages/discord.js/src/managers/StageInstanceManager.js b/packages/discord.js/src/managers/StageInstanceManager.js
index 4d3747b65..8f22ff008 100644
--- a/packages/discord.js/src/managers/StageInstanceManager.js
+++ b/packages/discord.js/src/managers/StageInstanceManager.js
@@ -30,7 +30,7 @@ class StageInstanceManager extends CachedManager {
* Options used to create a stage instance.
* @typedef {Object} StageInstanceCreateOptions
* @property {string} topic The topic of the stage instance
- * @property {PrivacyLevel|number} [privacyLevel] The privacy level of the stage instance
+ * @property {StageInstancePrivacyLevel|number} [privacyLevel] The privacy level of the stage instance
* @property {boolean} [sendStartNotification] Whether to notify `@everyone` that the stage instance has started
*/
@@ -101,7 +101,7 @@ class StageInstanceManager extends CachedManager {
* Options used to edit an existing stage instance.
* @typedef {Object} StageInstanceEditOptions
* @property {string} [topic] The new topic of the stage instance
- * @property {PrivacyLevel|number} [privacyLevel] The new privacy level of the stage instance
+ * @property {StageInstancePrivacyLevel|number} [privacyLevel] The new privacy level of the stage instance
*/
/**
diff --git a/packages/discord.js/src/structures/AutocompleteInteraction.js b/packages/discord.js/src/structures/AutocompleteInteraction.js
index 1fe02d7a1..94bb1353f 100644
--- a/packages/discord.js/src/structures/AutocompleteInteraction.js
+++ b/packages/discord.js/src/structures/AutocompleteInteraction.js
@@ -32,7 +32,7 @@ class AutocompleteInteraction extends Interaction {
/**
* The invoked application command's type
- * @type {ApplicationCommandType.ChatInput}
+ * @type {ApplicationCommandType}
*/
this.commandType = data.data.type;
diff --git a/packages/discord.js/src/structures/Guild.js b/packages/discord.js/src/structures/Guild.js
index 14e79b9f2..244e13df0 100644
--- a/packages/discord.js/src/structures/Guild.js
+++ b/packages/discord.js/src/structures/Guild.js
@@ -237,7 +237,7 @@ class Guild extends AnonymousGuild {
if ('mfa_level' in data) {
/**
* The required MFA level for this guild
- * @type {MFALevel}
+ * @type {GuildMFALevel}
*/
this.mfaLevel = data.mfa_level;
}
@@ -713,12 +713,13 @@ class Guild extends AnonymousGuild {
return new GuildAuditLogs(this, data);
}
+ /* eslint-disable max-len */
/**
* The data for editing a guild.
* @typedef {Object} GuildEditData
* @property {string} [name] The name of the guild
- * @property {?(VerificationLevel|number)} [verificationLevel] The verification level of the guild
- * @property {?(ExplicitContentFilterLevel|number)} [explicitContentFilter] The level of the explicit content filter
+ * @property {?(GuildVerificationLevel|number)} [verificationLevel] The verification level of the guild
+ * @property {?(GuildExplicitContentFilterLevel|number)} [explicitContentFilter] The level of the explicit content filter
* @property {?VoiceChannelResolvable} [afkChannel] The AFK channel of the guild
* @property {?TextChannelResolvable} [systemChannel] The system channel of the guild
* @property {number} [afkTimeout] The AFK timeout of the guild
@@ -727,7 +728,7 @@ class Guild extends AnonymousGuild {
* @property {?(BufferResolvable|Base64Resolvable)} [splash] The invite splash image of the guild
* @property {?(BufferResolvable|Base64Resolvable)} [discoverySplash] The discovery splash image of the guild
* @property {?(BufferResolvable|Base64Resolvable)} [banner] The banner of the guild
- * @property {?(DefaultMessageNotificationLevel|number)} [defaultMessageNotifications] The default message
+ * @property {?(GuildDefaultMessageNotificationLevel|number)} [defaultMessageNotifications] The default message
* notification level of the guild
* @property {SystemChannelFlagsResolvable} [systemChannelFlags] The system channel flags of the guild
* @property {?TextChannelResolvable} [rulesChannel] The rules channel of the guild
@@ -737,6 +738,7 @@ class Guild extends AnonymousGuild {
* @property {?string} [description] The discovery description of the guild
* @property {GuildFeature[]} [features] The features of the guild
*/
+ /* eslint-enable max-len */
/**
* Data that can be resolved to a Text Channel object. This can be:
@@ -882,9 +884,10 @@ class Guild extends AnonymousGuild {
return new WelcomeScreen(this, patchData);
}
+ /* eslint-disable max-len */
/**
* Edits the level of the explicit content filter.
- * @param {?(ExplicitContentFilterLevel|number)} explicitContentFilter The new level of the explicit content filter
+ * @param {?(GuildExplicitContentFilterLevel|number)} explicitContentFilter The new level of the explicit content filter
* @param {string} [reason] Reason for changing the level of the guild's explicit content filter
* @returns {Promise}
*/
@@ -892,10 +895,9 @@ class Guild extends AnonymousGuild {
return this.edit({ explicitContentFilter }, reason);
}
- /* eslint-disable max-len */
/**
* Edits the setting of the default message notifications of the guild.
- * @param {?(DefaultMessageNotificationLevel|number)} defaultMessageNotifications The new default message notification level of the guild
+ * @param {?(GuildDefaultMessageNotificationLevel|number)} defaultMessageNotifications The new default message notification level of the guild
* @param {string} [reason] Reason for changing the setting of the default message notifications
* @returns {Promise}
*/
@@ -931,7 +933,7 @@ class Guild extends AnonymousGuild {
/**
* Edits the verification level of the guild.
- * @param {?VerificationLevel} verificationLevel The new verification level of the guild
+ * @param {?GuildVerificationLevel} verificationLevel The new verification level of the guild
* @param {string} [reason] Reason for changing the guild's verification level
* @returns {Promise}
* @example
diff --git a/packages/discord.js/src/util/APITypes.js b/packages/discord.js/src/util/APITypes.js
index 120196047..0c88f071d 100644
--- a/packages/discord.js/src/util/APITypes.js
+++ b/packages/discord.js/src/util/APITypes.js
@@ -1,3 +1,13 @@
+/**
+ * @external ActivityFlags
+ * @see {@link https://discord-api-types.dev/api/discord-api-types-v10/enum/ActivityFlags}
+ */
+
+/**
+ * @external ActivityType
+ * @see {@link https://discord-api-types.dev/api/discord-api-types-v10/enum/ActivityType}
+ */
+
/**
* @external APIActionRowComponent
* @see {@link https://discord-api-types.dev/api/discord-api-types-v10/interface/APIActionRowComponent}
@@ -13,21 +23,6 @@
* @see {@link https://discord-api-types.dev/api/discord-api-types-v10/interface/APIApplicationCommand}
*/
-/**
- * @external ApplicationCommandType
- * @see {@link https://discord-api-types.dev/api/discord-api-types-v10/enum/ApplicationCommandType}
- */
-
-/**
- * @external ApplicationCommandOptionType
- * @see {@link https://discord-api-types.dev/api/discord-api-types-v10/enum/ApplicationCommandOptionType}
- */
-
-/**
- * @external ApplicationCommandPermissionType
- * @see {@link https://discord-api-types.dev/api/discord-api-types-v10/enum/ApplicationCommandPermissionType}
- */
-
/**
* @external APIApplicationCommandOption
* @see {@link https://discord-api-types.dev/api/discord-api-types-v10#APIApplicationCommandOption}
@@ -48,6 +43,11 @@
* @see {@link https://discord-api-types.dev/api/discord-api-types-v10/interface/APIEmbed}
*/
+/**
+ * @external APIEmbedField
+ * @see {@link https://discord-api-types.dev/api/discord-api-types-v10/interface/APIEmbedField}
+ */
+
/**
* @external APIEmoji
* @see {@link https://discord-api-types.dev/api/discord-api-types-v10/interface/APIEmoji}
@@ -88,11 +88,21 @@
* @see {@link https://discord-api-types.dev/api/discord-api-types-v10#APIMessageComponent}
*/
+/**
+ * @external APIMessageComponentEmoji
+ * @see {@link https://discord-api-types.dev/api/discord-api-types-v10/interface/APIMessageComponentEmoji}
+ */
+
/**
* @external APIModalInteractionResponse
* @see {@link https://discord-api-types.dev/api/discord-api-types-v10/interface/APIModalInteractionResponse}
*/
+/**
+ * @external APIModalComponent
+ * @see {@link https://discord-api-types.dev/api/discord-api-types-v10#APIModalComponent}
+ */
+
/**
* @external APIModalSubmission
* @see {@link https://discord-api-types.dev/api/discord-api-types-v10/interface/APIModalSubmission}
@@ -113,11 +123,36 @@
* @see {@link https://discord-api-types.dev/api/discord-api-types-v10/interface/APISelectMenuOption}
*/
+/**
+ * @external APITextInputComponent
+ * @see {@link https://discord-api-types.dev/api/discord-api-types-v10/interface/APITextInputComponent}
+ */
+
/**
* @external APIUser
* @see {@link https://discord-api-types.dev/api/discord-api-types-v10/interface/APIUser}
*/
+/**
+ * @external ApplicationCommandType
+ * @see {@link https://discord-api-types.dev/api/discord-api-types-v10/enum/ApplicationCommandType}
+ */
+
+/**
+ * @external ApplicationCommandOptionType
+ * @see {@link https://discord-api-types.dev/api/discord-api-types-v10/enum/ApplicationCommandOptionType}
+ */
+
+/**
+ * @external ApplicationCommandPermissionType
+ * @see {@link https://discord-api-types.dev/api/discord-api-types-v10/enum/ApplicationCommandPermissionType}
+ */
+
+/**
+ * @external ApplicationFlags
+ * @see {@link https://discord-api-types.dev/api/discord-api-types-v10/enum/ApplicationFlags}
+ */
+
/**
* @external AuditLogEvent
* @see {@link https://discord-api-types.dev/api/discord-api-types-v10/enum/AuditLogEvent}
@@ -238,6 +273,11 @@
* @see {@link https://discord-api-types.dev/api/discord-api-types-rest/common/enum/Locale}
*/
+/**
+ * @external LocaleString
+ * @see {@link https://discord-api-types.dev/api/discord-api-types-rest/common#LocaleString}
+ */
+
/**
* @external MessageActivityType
* @see {@link https://discord-api-types.dev/api/discord-api-types-v10/enum/MessageActivityType}
@@ -258,6 +298,16 @@
* @see {@link https://discord-api-types.dev/api/discord-api-types-v10/enum/OAuth2Scopes}
*/
+/**
+ * @external OverwriteType
+ * @see {@link https://discord-api-types.dev/api/discord-api-types-v10/enum/OverwriteType}
+ */
+
+/**
+ * @external ChannelType
+ * @see {@link https://discord-api-types.dev/api/discord-api-types-v10/enum/ChannelType}
+ */
+
/**
* @external PermissionFlagsBits
* @see {@link https://discord-api-types.dev/api/discord-api-types-payloads/common#PermissionFlagsBits}
diff --git a/packages/discord.js/src/util/Components.js b/packages/discord.js/src/util/Components.js
index 1d655fe2b..6002c99cf 100644
--- a/packages/discord.js/src/util/Components.js
+++ b/packages/discord.js/src/util/Components.js
@@ -18,7 +18,7 @@ const { ComponentType } = require('discord-api-types/v10');
* @property {ButtonStyle} style The style of the button
* @property {?boolean} disabled Whether this button is disabled
* @property {string} label The label of this button
- * @property {?APIComponentEmoji} emoji The emoji on this button
+ * @property {?APIMessageComponentEmoji} emoji The emoji on this button
* @property {?string} customId The custom id of the button
* @property {?string} url The URL of the button
*/
@@ -28,7 +28,7 @@ const { ComponentType } = require('discord-api-types/v10');
* @property {string} label The label of the option
* @property {string} value The value of the option
* @property {?string} description The description of the option
- * @property {?APIComponentEmoji} emoji The emoji on the option
+ * @property {?APIMessageComponentEmoji} emoji The emoji on the option
* @property {?boolean} default Whether this option is selected by default
*/