Action
must include the attributes children
, size?
, and variant?
.
Action
should also feature either Button
or Link
.
How do I accomplish this?
This is my best attempt:
interface Button {
action: () => void;
href?: never;
}
interface Link {
href: string;
action?: never;
}
interface Action extends Button | Link {
children: string;
size?: 'large' | 'small';
variant?: 'secondary';
}
Error:
[tslint] Forbidden bitwise operation
The main functional requirement I have is to create a type or interface with certain properties along with either action
or href
, but not both simultaneously.