Typescript\'s conditional : T extends U ? X : Y syntax is pretty powerful, but I have not found a way to specify the type of a return based on an attribute of a cla
: T extends U ? X : Y