I have a const in a library (blueprintjs).
export const Intent = {
NONE: "none" as "none",
PRIMARY: "primary" as "primary",
SUCCESS: "success" as "success",
WARNING: "warning" as "warning",
DANGER: "danger" as "danger",
};
export type Intent = typeof Intent[keyof typeof Intent];
I want to make sure that my prop which I receive from my parent only has one of the 5 key values of Intent. How do I proceed forward with this? Please advice.
This is what I have done so far.
interface Props {
exportButtonColor?: [keyof typeof Intent];
}
Any help is greatly appreciated.