Here is the interface I am working with:
interface Address {
street: string
town: string
country: string
}
I am looking to create a function that takes in a specific key parameter which must be one of three strings:
function useKey(key: "street" | "town" | "country") {
}
Is it possible to dynamically generate the type for the key parameter based on the interface?