Is there a way to utilize the intellisense feature of TypeScript for predefined colors in my component's prop, while still allowing users to input their own hex color codes?
type PREDEFINED_COLORS = 'success' | 'error' | 'info';
type Props = {
color: PREDEFINED_COLORS | string;
}
Although I am aware that PREDEFINED_COLORS is a type of string, I am looking for suggestions on how to make the most of intellisense in this scenario.
Any ideas or suggestions would be greatly appreciated!