“An index signature parameter type cannot be a union type.” – what should I use instead?
A mapped object type operates on a set of singleton types and produces a new object type where each of those singletons is turned into a property name. For example, this: type Foo = { [K in “hello” | “world”]: string }; would be equivalent to type Foo = { “hello”: string; “world”: string; }; …