From 2c6b3a153909fc6658d6de841ca38d51cb17536c Mon Sep 17 00:00:00 2001 From: Almeida Date: Mon, 22 Jan 2024 13:50:43 +0000 Subject: [PATCH] docs: convert comment into private remark --- packages/discord.js/typings/index.d.ts | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/packages/discord.js/typings/index.d.ts b/packages/discord.js/typings/index.d.ts index cef54e1b8b4f..2fc9d76f714c 100644 --- a/packages/discord.js/typings/index.d.ts +++ b/packages/discord.js/typings/index.d.ts @@ -1208,6 +1208,12 @@ export class CommandInteractionOptionResolver` would resolve to `never`. + */ public getChannel( name: string, required: true, @@ -1215,14 +1221,17 @@ export class CommandInteractionOptionResolver['channel']>, { - // The `type` property of the PublicThreadChannel class is typed as `ChannelType.PublicThread | ChannelType.AnnouncementThread` - // If the user only passed one of those channel types, the Extract<> would have resolved to `never` - // Hence the need for this ternary type: Type extends ChannelType.PublicThread | ChannelType.AnnouncementThread ? ChannelType.PublicThread | ChannelType.AnnouncementThread : Type; } >; + /** + * @privateRemarks + * The ternary in the return type is required. + * The `type` property of the {@link PublicThreadChannel} interface is typed as `ChannelType.PublicThread | ChannelType.AnnouncementThread`. + * If the user were to pass only one of those channel types, the `Extract<>` would resolve to `never`. + */ public getChannel( name: string, required?: boolean, @@ -1230,9 +1239,6 @@ export class CommandInteractionOptionResolver['channel']>, { - // The `type` property of the PublicThreadChannel class is typed as `ChannelType.PublicThread | ChannelType.AnnouncementThread` - // If the user only passed one of those channel types, the Extract<> would have resolved to `never` - // Hence the need for this ternary type: Type extends ChannelType.PublicThread | ChannelType.AnnouncementThread ? ChannelType.PublicThread | ChannelType.AnnouncementThread : Type;