diff --git a/packages/discord.js/src/util/Components.js b/packages/discord.js/src/util/Components.js index 1a2ccbcd24ad..8c256e173ad8 100644 --- a/packages/discord.js/src/util/Components.js +++ b/packages/discord.js/src/util/Components.js @@ -1,8 +1,8 @@ 'use strict'; -// This file contains the typedefs for camel-cased JSON data const { ComponentBuilder } = require('@discordjs/builders'); const { ComponentType } = require('discord-api-types/v10'); + /** * @typedef {Object} BaseComponentData * @property {ComponentType} type The type of component @@ -71,6 +71,7 @@ const { ComponentType } = require('discord-api-types/v10'); * Transforms API data into a component * @param {APIMessageComponent|Component} data The data to create the component from * @returns {Component} + * @ignore */ function createComponent(data) { if (data instanceof Component) { @@ -103,6 +104,7 @@ function createComponent(data) { * Transforms API data into a component builder * @param {APIMessageComponent|ComponentBuilder} data The data to create the component from * @returns {ComponentBuilder} + * @ignore */ function createComponentBuilder(data) { if (data instanceof ComponentBuilder) { diff --git a/packages/discord.js/typings/index.d.ts b/packages/discord.js/typings/index.d.ts index c1beb5bc1d04..4f3c5b015bd2 100644 --- a/packages/discord.js/typings/index.d.ts +++ b/packages/discord.js/typings/index.d.ts @@ -3562,28 +3562,6 @@ export function transformResolved( ): CommandInteractionResolvedData; export function resolveSKUId(resolvable: SKUResolvable): Snowflake | null; -export interface MappedComponentBuilderTypes { - [ComponentType.Button]: ButtonBuilder; - [ComponentType.StringSelect]: StringSelectMenuBuilder; - [ComponentType.UserSelect]: UserSelectMenuBuilder; - [ComponentType.RoleSelect]: RoleSelectMenuBuilder; - [ComponentType.MentionableSelect]: MentionableSelectMenuBuilder; - [ComponentType.ChannelSelect]: ChannelSelectMenuBuilder; - [ComponentType.ActionRow]: ActionRowBuilder; - [ComponentType.TextInput]: TextInputBuilder; -} - -export interface MappedComponentTypes { - [ComponentType.Button]: ButtonComponent; - [ComponentType.StringSelect]: StringSelectMenuComponent; - [ComponentType.UserSelect]: UserSelectMenuComponent; - [ComponentType.RoleSelect]: RoleSelectMenuComponent; - [ComponentType.MentionableSelect]: MentionableSelectMenuComponent; - [ComponentType.ChannelSelect]: ChannelSelectMenuComponent; - [ComponentType.ActionRow]: ActionRowComponent; - [ComponentType.TextInput]: TextInputComponent; -} - /** @internal */ export interface CreateChannelOptions { allowFromUnknownGuild?: boolean; @@ -3597,17 +3575,6 @@ export function createChannel( extras?: CreateChannelOptions, ): Channel; -export function createComponent( - data: APIMessageComponent & { type: Type }, -): MappedComponentTypes[Type]; -export function createComponent(data: Data): Data; -export function createComponent(data: APIMessageComponent | Component): Component; -export function createComponentBuilder( - data: APIMessageComponent & { type: Type }, -): MappedComponentBuilderTypes[Type]; -export function createComponentBuilder(data: Data): Data; -export function createComponentBuilder(data: APIMessageComponent | ComponentBuilder): ComponentBuilder; - /** @internal */ export function resolveBase64(data: Base64Resolvable): string; /** @internal */