fix: removed another 'ts-expect-error'...? (#326)

This commit is contained in:
JustEvil 2025-01-25 19:37:50 -06:00 committed by GitHub
parent 80b9edf512
commit dda74f7882
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,12 +1,5 @@
import type { EmojiResolvable, RestOrArray } from '../common'; import type { EmojiResolvable, RestOrArray } from '../common';
import { resolvePartialEmoji } from '../common/it/utils'; import { resolvePartialEmoji } from '../common/it/utils';
import type {
ChannelSelectMenuInteraction,
ComponentInteraction,
MentionableSelectMenuInteraction,
RoleSelectMenuInteraction,
UserSelectMenuInteraction,
} from '../structures';
import { import {
type APIChannelSelectComponent, type APIChannelSelectComponent,
type APIMentionableSelectComponent, type APIMentionableSelectComponent,
@ -49,14 +42,12 @@ function mappedDefault<T extends SelectMenuDefaultValueType>(
* @template Select - The type of APISelectMenuComponent. * @template Select - The type of APISelectMenuComponent.
* @template Interaction - The type of interaction. * @template Interaction - The type of interaction.
* @example * @example
* const selectMenu = new SelectMenu<APIUserSelectComponent, UserSelectMenuInteraction>(); * const selectMenu = new SelectMenu<APIUserSelectComponent>();
* selectMenu.setCustomId("user-select-menu"); * selectMenu.setCustomId("user-select-menu");
* selectMenu.setPlaceholder("Select a user"); * selectMenu.setPlaceholder("Select a user");
*/ */
export class SelectMenu< export class SelectMenu<
Select extends APISelectMenuComponent = APISelectMenuComponent, Select extends APISelectMenuComponent = APISelectMenuComponent,
//@ts-expect-error
Interaction = ComponentInteraction,
> extends BaseComponentBuilder<Select> { > extends BaseComponentBuilder<Select> {
/** /**
* Sets the custom ID for the select menu. * Sets the custom ID for the select menu.
@ -107,7 +98,7 @@ export class SelectMenu<
* userSelectMenu.setCustomId("user-select"); * userSelectMenu.setCustomId("user-select");
* userSelectMenu.addDefaultUsers("123456789", "987654321"); * userSelectMenu.addDefaultUsers("123456789", "987654321");
*/ */
export class UserSelectMenu extends SelectMenu<APIUserSelectComponent, UserSelectMenuInteraction> { export class UserSelectMenu extends SelectMenu<APIUserSelectComponent> {
constructor(data: Partial<APIUserSelectComponent> = {}) { constructor(data: Partial<APIUserSelectComponent> = {}) {
super({ ...data, type: ComponentType.UserSelect }); super({ ...data, type: ComponentType.UserSelect });
} }
@ -142,7 +133,7 @@ export class UserSelectMenu extends SelectMenu<APIUserSelectComponent, UserSelec
* roleSelectMenu.setCustomId("role-select"); * roleSelectMenu.setCustomId("role-select");
* roleSelectMenu.addDefaultRoles("123456789", "987654321"); * roleSelectMenu.addDefaultRoles("123456789", "987654321");
*/ */
export class RoleSelectMenu extends SelectMenu<APIRoleSelectComponent, RoleSelectMenuInteraction> { export class RoleSelectMenu extends SelectMenu<APIRoleSelectComponent> {
constructor(data: Partial<APIRoleSelectComponent> = {}) { constructor(data: Partial<APIRoleSelectComponent> = {}) {
super({ ...data, type: ComponentType.RoleSelect }); super({ ...data, type: ComponentType.RoleSelect });
} }
@ -178,7 +169,7 @@ export type MentionableDefaultElement = { id: string; type: keyof Omit<typeof Se
* const mentionableSelectMenu = new MentionableSelectMenu(); * const mentionableSelectMenu = new MentionableSelectMenu();
* mentionableSelectMenu.setCustomId("mentionable-select"); * mentionableSelectMenu.setCustomId("mentionable-select");
*/ */
export class MentionableSelectMenu extends SelectMenu<APIMentionableSelectComponent, MentionableSelectMenuInteraction> { export class MentionableSelectMenu extends SelectMenu<APIMentionableSelectComponent> {
constructor(data: Partial<APIMentionableSelectComponent> = {}) { constructor(data: Partial<APIMentionableSelectComponent> = {}) {
super({ ...data, type: ComponentType.MentionableSelect }); super({ ...data, type: ComponentType.MentionableSelect });
} }
@ -220,7 +211,7 @@ export class MentionableSelectMenu extends SelectMenu<APIMentionableSelectCompon
* channelSelectMenu.addDefaultChannels("123456789", "987654321"); * channelSelectMenu.addDefaultChannels("123456789", "987654321");
* channelSelectMenu.setChannelTypes([ChannelType.GuildText, ChannelType.GuildVoice]); * channelSelectMenu.setChannelTypes([ChannelType.GuildText, ChannelType.GuildVoice]);
*/ */
export class ChannelSelectMenu extends SelectMenu<APIChannelSelectComponent, ChannelSelectMenuInteraction> { export class ChannelSelectMenu extends SelectMenu<APIChannelSelectComponent> {
constructor(data: Partial<APIChannelSelectComponent> = {}) { constructor(data: Partial<APIChannelSelectComponent> = {}) {
super({ ...data, type: ComponentType.ChannelSelect }); super({ ...data, type: ComponentType.ChannelSelect });
} }