'typescript Record<K, boolean> with false initial values

I have the following code:

type Keys = 'A' | 'B' | 'C' | 'XYZ';

const actionIndex:Record<Keys, boolean> = {}

the action index have errors with the typescript asks to give value for 'A' | 'B' and so on. how do I prevent the typescript from asking me to initiate the values? or can i initiate the values in some way? or maybe i use wrong type?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source