I want to use the intellisense of typescript on some predefined colors in my component's prop. But user can also pass any hex color into that prop too.
type PREDEFINED_COLORS = 'success' | 'error' | 'info'; type Props = { color: PREDEFINED_COLORS | string; } I know PREDEFINED_COLORS is also a string but i believe there should be some workarounds to achieve the benefits of intellisense.
Do you have any suggestions?
#->color: PREDEFINED_COLORS | '#${string}'