-
-
Notifications
You must be signed in to change notification settings - Fork 114
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(APIChannel): correctly type
name
based on channel type (#666)
Co-authored-by: Vlad Frangu <kingdgrizzle@gmail.com>
- Loading branch information
1 parent
549d1da
commit 995126e
Showing
5 changed files
with
90 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { expectType } from 'tsd'; | ||
import type { ChannelType, APIPartialChannel, APIGroupDMChannel, APIDMChannel, APIGuildChannel } from '../../v10'; | ||
|
||
declare const partialChannel: APIPartialChannel; | ||
declare const groupDMChannel: APIGroupDMChannel; | ||
declare const dmChannel: APIDMChannel; | ||
declare const guildChannel: APIGuildChannel<ChannelType>; | ||
|
||
// Test channel names are properly typed | ||
// Always non-null present for non-DM channels, always null for DM channel | ||
expectType<string | null | undefined>(partialChannel.name); | ||
expectType<string | null>(groupDMChannel.name); | ||
expectType<null>(dmChannel.name); | ||
expectType<string>(guildChannel.name); |
995126e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
discord-api-types – ./
discord-api-types.vercel.app
discord-api-types-git-main-discordjs.vercel.app
www.discord-api-types.dev
discord-api-types.dev
discord-api-types-discordjs.vercel.app