How would I write conditional boolean type for this?
i.e
export interface Props {
editable: boolean;
position: { editable: true } ? Sheets.Matrix : never;
value: string;
classNames?: string;
textType?: "bold" | "editing" | "normal";
onChange?: (val: Sheets.SaveData) => void;
}
I use props like this
const SheetsCell: React.FC<MainProps> = ({
editable,
value,
textType = "normal",
classNames = "",
position,
...
Here if something is editable, I want the type of position to be Sheets.Matrix else, position isn't required.