I have a function that takes in an optional variant and a value. If the variant is multi the user needs to use a tuple, otherwise a number. Is there any way to type this dynamically? Conceptually it should work like this:
interface SomeInterface{
variant?: 'single' | 'multi'
// pseudocode
value: variant === 'multi' ? [number,number] : number
}