I have an interface where the c param should only be required when the a one is true.
interface IArgs {
a: boolean,
b: string,
c: string
}
The below seems to work but how do I omit the c param in the first clause? Used type since an interface would return an error.
type TArgs = {
a: true,
b: string,
c?: string
} | {
a: false,
b: string,
c: string
};
c?: neverorc?: undefinedare the closest you can get I think