Skip to content

Commit 2261a10

Browse files
NicolasBonetCopilot
andcommitted
feat: update BotAvatar type definition for improved type safety
Co-authored-by: Copilot <copilot@github.com>
1 parent 545eec4 commit 2261a10

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/components/Icon/DefaultBotAvatars.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import type {TupleToUnion} from 'type-fest';
12
import BotAvatarBlue from '@assets/images/avatars/bots/bot-avatar--blue.svg';
23
import BotAvatarGreen from '@assets/images/avatars/bots/bot-avatar--green.svg';
34
import BotAvatarIce from '@assets/images/avatars/bots/bot-avatar--ice.svg';
@@ -7,7 +8,7 @@ import BotAvatarYellow from '@assets/images/avatars/bots/bot-avatar--yellow.svg'
78

89
const botAvatars = [BotAvatarBlue, BotAvatarGreen, BotAvatarIce, BotAvatarPink, BotAvatarTangerine, BotAvatarYellow] as const;
910

10-
type BotAvatar = (typeof botAvatars)[number];
11+
type BotAvatar = TupleToUnion<typeof botAvatars>;
1112

1213
const botAvatarIDs = new Map<BotAvatar, string>([
1314
[BotAvatarBlue, 'bot-avatar--blue'],

0 commit comments

Comments
 (0)