I need to make a function type that tells me what the type must be for the second value based on the first value
type BType = number | string | array
enum AEnum = { number = "number" , string : "string" , array : "array"}
const fc = (a : AEnum , b : BType)=>{
//...
}
What I need is that when a = AEnum.array, then b must be array, or an error should be shown
How can I make something like this ??