mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-16 19:43:29 +01:00
docs: convert comment into private remark (#10097)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
This commit is contained in:
18
packages/discord.js/typings/index.d.ts
vendored
18
packages/discord.js/typings/index.d.ts
vendored
@@ -1208,6 +1208,12 @@ export class CommandInteractionOptionResolver<Cached extends CacheType = CacheTy
|
|||||||
public getSubcommandGroup(required?: boolean): string | null;
|
public getSubcommandGroup(required?: boolean): string | null;
|
||||||
public getBoolean(name: string, required: true): boolean;
|
public getBoolean(name: string, required: true): boolean;
|
||||||
public getBoolean(name: string, required?: boolean): boolean | null;
|
public getBoolean(name: string, required?: boolean): boolean | null;
|
||||||
|
/**
|
||||||
|
* @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<const Type extends ChannelType = ChannelType>(
|
public getChannel<const Type extends ChannelType = ChannelType>(
|
||||||
name: string,
|
name: string,
|
||||||
required: true,
|
required: true,
|
||||||
@@ -1215,14 +1221,17 @@ export class CommandInteractionOptionResolver<Cached extends CacheType = CacheTy
|
|||||||
): Extract<
|
): Extract<
|
||||||
NonNullable<CommandInteractionOption<Cached>['channel']>,
|
NonNullable<CommandInteractionOption<Cached>['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
|
type: Type extends ChannelType.PublicThread | ChannelType.AnnouncementThread
|
||||||
? ChannelType.PublicThread | ChannelType.AnnouncementThread
|
? ChannelType.PublicThread | ChannelType.AnnouncementThread
|
||||||
: Type;
|
: 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<const Type extends ChannelType = ChannelType>(
|
public getChannel<const Type extends ChannelType = ChannelType>(
|
||||||
name: string,
|
name: string,
|
||||||
required?: boolean,
|
required?: boolean,
|
||||||
@@ -1230,9 +1239,6 @@ export class CommandInteractionOptionResolver<Cached extends CacheType = CacheTy
|
|||||||
): Extract<
|
): Extract<
|
||||||
NonNullable<CommandInteractionOption<Cached>['channel']>,
|
NonNullable<CommandInteractionOption<Cached>['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
|
type: Type extends ChannelType.PublicThread | ChannelType.AnnouncementThread
|
||||||
? ChannelType.PublicThread | ChannelType.AnnouncementThread
|
? ChannelType.PublicThread | ChannelType.AnnouncementThread
|
||||||
: Type;
|
: Type;
|
||||||
|
|||||||
Reference in New Issue
Block a user