I want to use the keys of the union type as key of the object in typescript.
type EnumType = 'a1' | 'a2'
const object:{[key in EnumType]: string}= {
a1: 'test'
}
In this case I have to add even a2 as a key in the object. Is there a way to make this optional?