Skip to content

Commit

Permalink
docs: add missing discord-api-types external types (#8001)
Browse files Browse the repository at this point in the history
  • Loading branch information
N1ckPro committed Jun 4, 2022
1 parent f8739bd commit 546d486
Show file tree
Hide file tree
Showing 7 changed files with 87 additions and 33 deletions.
8 changes: 5 additions & 3 deletions packages/discord.js/src/managers/GuildManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
* <warn>This is required if `entityType` is {@link GuildScheduledEventEntityType.External}</warn>
* @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
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions packages/discord.js/src/managers/StageInstanceManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/

Expand Down Expand Up @@ -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
*/

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class AutocompleteInteraction extends Interaction {

/**
* The invoked application command's type
* @type {ApplicationCommandType.ChatInput}
* @type {ApplicationCommandType}
*/
this.commandType = data.data.type;

Expand Down
18 changes: 10 additions & 8 deletions packages/discord.js/src/structures/Guild.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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:
Expand Down Expand Up @@ -882,20 +884,20 @@ 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<Guild>}
*/
setExplicitContentFilter(explicitContentFilter, reason) {
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<Guild>}
*/
Expand Down Expand Up @@ -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<Guild>}
* @example
Expand Down
80 changes: 65 additions & 15 deletions packages/discord.js/src/util/APITypes.js
Original file line number Diff line number Diff line change
@@ -1,31 +1,26 @@
/**
* @external APIActionRowComponent
* @see {@link https://discord-api-types.dev/api/discord-api-types-v10/interface/APIActionRowComponent}
*/

/**
* @external APIApplication
* @see {@link https://discord-api-types.dev/api/discord-api-types-v10/interface/APIApplication}
* @external ActivityFlags
* @see {@link https://discord-api-types.dev/api/discord-api-types-v10/enum/ActivityFlags}
*/

/**
* @external APIApplicationCommand
* @see {@link https://discord-api-types.dev/api/discord-api-types-v10/interface/APIApplicationCommand}
* @external ActivityType
* @see {@link https://discord-api-types.dev/api/discord-api-types-v10/enum/ActivityType}
*/

/**
* @external ApplicationCommandType
* @see {@link https://discord-api-types.dev/api/discord-api-types-v10/enum/ApplicationCommandType}
* @external APIActionRowComponent
* @see {@link https://discord-api-types.dev/api/discord-api-types-v10/interface/APIActionRowComponent}
*/

/**
* @external ApplicationCommandOptionType
* @see {@link https://discord-api-types.dev/api/discord-api-types-v10/enum/ApplicationCommandOptionType}
* @external APIApplication
* @see {@link https://discord-api-types.dev/api/discord-api-types-v10/interface/APIApplication}
*/

/**
* @external ApplicationCommandPermissionType
* @see {@link https://discord-api-types.dev/api/discord-api-types-v10/enum/ApplicationCommandPermissionType}
* @external APIApplicationCommand
* @see {@link https://discord-api-types.dev/api/discord-api-types-v10/interface/APIApplicationCommand}
*/

/**
Expand All @@ -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}
Expand Down Expand Up @@ -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}
Expand All @@ -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}
Expand Down Expand Up @@ -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}
Expand All @@ -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}
Expand Down
4 changes: 2 additions & 2 deletions packages/discord.js/src/util/Components.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand All @@ -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
*/

Expand Down

0 comments on commit 546d486

Please sign in to comment.