I wrote it again by summarizing the contents of the article.
I want to know how to apply the interface according to the object property value.
I wrote a simple example code below.
There are a total of three nodes: root, dept, and user.
The type corresponding to each node is specified. Therefore, we want the interface to be designated according to the object type property.
However, you can see that you are manually affirming the type because you have not found a solution.
In order to solve this problem, I think it should be solved with an index type rather than a conditional type.
The reason is that the conditional type is expected to be calculated and returned according to the generic type parameter, but the current problem should be calculated based on the existing type rather than receiving the type parameter.
However, the problem could not be solved even with two methods. Any help would be appreciated
