type SelectData = {
name?: boolean;
address?: boolean;
}
const selectData: SelectData = {
name: true
}
const untypedSelectData = {
name: true
}
I want typescript to throw an error if I try to do something like this:
const selectData: SelectData = {
age: true
}
But I also want the type of selectData to be the same as untypedSelectData (i.e. {name: boolean})?