Typescript: infer the type of an Object key from another key in the same Object Let’s say I have an API like this: