Imagine a function that get an object as argument that has two entries with any possible type.
const x = ({a,b}:{a: string, b: string}) => {
// return something
}
x({a: "foo"}) // OK
x({b: "bar"}) // OK
x({a: "foo", b: "bar"}) // get a compile error in this case!
How can we set this function in a way that only one of the entries be passed to function? In other words, I need to get a compile error when both entries are set inside the function? For example, if "a" is already passed, the moment "b" is also passed we get a compilation error and vice versa.