What should be the type of name so that the function getValue only allows for one of Data key types as it argument.
name
getValue
Data
Have you tried keyof Data for the name argument? You can do it like
keyof Data
const getValue = (name: keyof Data) => data[name];