I have the following Typescript interface:
type animation = "Grow" | "Fade" | "Slide";
interface ISnackbarProps {
open: boolean;
autoHideDuration?: number;
position?: position;
variant?: variant;
type?: AlertColor;
animation?: animation;
icon?: React.ReactElement;
slideDirection?: slideDirection;
action?: React.ReactElement;
handleClose: () => void;
}
In the above interface, slideDirection is optional. But I want to update it optional to required only when the animation property has the "slide" value.