I have a union type defined as:
type A = "a" | "b" | "c";
Now, I want to create an interface like this:
interface B {
[index: A]: string
}
However, I need this interface to include all options from the union type, resulting in the following interface:
interface B {
a: string;
b: string;
c: string;
}
Is it possible to achieve this in TypeScript?