Answer the question
In order to leave comments, you need to log in
How to query for a specific type in type union arguments?
How to make it so that in the interface 'B', the function '1' takes an argument of type 'A', whose name has the value '1', and so on?
type A = {
name: '1'
} | {
name: '2'
} | {
name: '3'
}
interface B {
1: (a: A) => void // 'A', где name 1
2: (a: A) => void // 'A', где name 2
3: (a: A) => void // 'A', где name 3
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question