Skip to content

Commit

Permalink
docs: Consolidate API types (#9881)
Browse files Browse the repository at this point in the history
docs: deduplicate API types

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
  • Loading branch information
Jiralite and kodiakhq[bot] authored Oct 10, 2023
1 parent 332b624 commit 44a3cbf
Showing 12 changed files with 23 additions and 65 deletions.
Original file line number Diff line number Diff line change
@@ -423,11 +423,6 @@ class ApplicationCommandPermissionsManager extends BaseManager {
module.exports = ApplicationCommandPermissionsManager;

/* eslint-disable max-len */
/**
* @external APIApplicationCommandPermissions
* @see {@link https://discord.com/developers/docs/interactions/application-commands#application-command-permissions-object-application-command-permissions-structure}
*/

/**
* Data that resolves to an id used for an application command permission
* @typedef {UserResolvable|RoleResolvable|GuildChannelResolvable|RolePermissionConstant|ChannelPermissionConstant} ApplicationCommandPermissionIdResolvable
10 changes: 0 additions & 10 deletions packages/discord.js/src/structures/ApplicationCommand.js
Original file line number Diff line number Diff line change
@@ -590,16 +590,6 @@ class ApplicationCommand extends Base {
module.exports = ApplicationCommand;

/* eslint-disable max-len */
/**
* @external APIApplicationCommand
* @see {@link https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-structure}
*/

/**
* @external APIApplicationCommandOption
* @see {@link https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-option-structure}
*/

/**
* @external ApplicationCommandOptionAllowedChannelTypes
* @see {@link https://discord.js.org/docs/packages/builders/stable/ApplicationCommandOptionAllowedChannelTypes:TypeAlias}
5 changes: 0 additions & 5 deletions packages/discord.js/src/structures/AttachmentBuilder.js
Original file line number Diff line number Diff line change
@@ -104,11 +104,6 @@ class AttachmentBuilder {

module.exports = AttachmentBuilder;

/**
* @external APIAttachment
* @see {@link https://discord.com/developers/docs/resources/channel#attachment-object}
*/

/**
* @typedef {Object} AttachmentData
* @property {string} [name] The name of the attachment
8 changes: 1 addition & 7 deletions packages/discord.js/src/structures/ClientPresence.js
Original file line number Diff line number Diff line change
@@ -36,7 +36,7 @@ class ClientPresence extends Presence {
/**
* Parses presence data into a packet ready to be sent to Discord
* @param {PresenceData} presence The data to parse
* @returns {APIPresence}
* @returns {GatewayPresenceUpdateData}
* @private
*/
_parse({ status, since, afk, activities }) {
@@ -82,9 +82,3 @@ class ClientPresence extends Presence {
}

module.exports = ClientPresence;

/* eslint-disable max-len */
/**
* @external APIPresence
* @see {@link https://discord.com/developers/docs/rich-presence/how-to#updating-presence-update-presence-payload-fields}
*/
6 changes: 0 additions & 6 deletions packages/discord.js/src/structures/CommandInteraction.js
Original file line number Diff line number Diff line change
@@ -216,9 +216,3 @@ class CommandInteraction extends BaseInteraction {
InteractionResponses.applyToClass(CommandInteraction, ['deferUpdate', 'update']);

module.exports = CommandInteraction;

/* eslint-disable max-len */
/**
* @external APIInteractionDataResolved
* @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-resolved-data-structure}
*/
5 changes: 0 additions & 5 deletions packages/discord.js/src/structures/Guild.js
Original file line number Diff line number Diff line change
@@ -1373,8 +1373,3 @@ class Guild extends AnonymousGuild {
}

exports.Guild = Guild;

/**
* @external APIGuild
* @see {@link https://discord.com/developers/docs/resources/guild#guild-object}
*/
5 changes: 0 additions & 5 deletions packages/discord.js/src/structures/GuildMember.js
Original file line number Diff line number Diff line change
@@ -513,8 +513,3 @@ class GuildMember extends Base {
TextBasedChannel.applyToClass(GuildMember);

exports.GuildMember = GuildMember;

/**
* @external APIGuildMember
* @see {@link https://discord.com/developers/docs/resources/guild#guild-member-object}
*/
5 changes: 0 additions & 5 deletions packages/discord.js/src/structures/MessagePayload.js
Original file line number Diff line number Diff line change
@@ -290,11 +290,6 @@ module.exports = MessagePayload;
* InteractionReplyOptions|InteractionUpdateOptions} MessagePayloadOption
*/

/**
* @external APIMessage
* @see {@link https://discord.com/developers/docs/resources/channel#message-object}
*/

/**
* @external RawFile
* @see {@link https://discord.js.org/docs/packages/rest/stable/RawFile:Interface}
5 changes: 0 additions & 5 deletions packages/discord.js/src/structures/Role.js
Original file line number Diff line number Diff line change
@@ -464,8 +464,3 @@ class Role extends Base {
}

exports.Role = Role;

/**
* @external APIRole
* @see {@link https://discord.com/developers/docs/topics/permissions#role-object}
*/
5 changes: 0 additions & 5 deletions packages/discord.js/src/structures/Sticker.js
Original file line number Diff line number Diff line change
@@ -265,8 +265,3 @@ class Sticker extends Base {
}

exports.Sticker = Sticker;

/**
* @external APISticker
* @see {@link https://discord.com/developers/docs/resources/sticker#sticker-object}
*/
5 changes: 0 additions & 5 deletions packages/discord.js/src/structures/User.js
Original file line number Diff line number Diff line change
@@ -373,8 +373,3 @@ class User extends Base {
TextBasedChannel.applyToClass(User);

module.exports = User;

/**
* @external APIUser
* @see {@link https://discord.com/developers/docs/resources/user#user-object}
*/
24 changes: 22 additions & 2 deletions packages/discord.js/src/util/APITypes.js
Original file line number Diff line number Diff line change
@@ -85,11 +85,21 @@
* @see {@link https://discord-api-types.dev/api/discord-api-types-v10/interface/APIGuildForumTag}
*/

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

/**
* @external APIInteraction
* @see {@link https://discord-api-types.dev/api/discord-api-types-v10#APIInteraction}
*/

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

/**
* @external APIInteractionDataResolvedChannel
* @see {@link https://discord-api-types.dev/api/discord-api-types-v10/interface/APIInteractionDataResolvedChannel}
@@ -151,8 +161,8 @@
*/

/**
* @external APIPresence
* @see {@link https://discord-api-types.dev/api/discord-api-types-v10/interface/APIPresence}
* @external APIRole
* @see {@link https://discord-api-types.dev/api/discord-api-types-v10/interface/APIRole}
*/

/**
@@ -165,6 +175,11 @@
* @see {@link https://discord-api-types.dev/api/discord-api-types-v10/interface/APISelectMenuOption}
*/

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

/**
* @external APIStringSelectComponent
* @see {@link https://discord-api-types.dev/api/discord-api-types-v10/interface/APIStringSelectComponent}
@@ -285,6 +300,11 @@
* @see {@link https://discord-api-types.dev/api/discord-api-types-v10/enum/GatewayOpcodes}
*/

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

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

0 comments on commit 44a3cbf

Please sign in to comment.