Title: Type created with keyof cannot be used to index the type it was created from
Body: I’m trying to write a utility function in TypeScript to access properties inside an object. Specifically, I want the function to: 1. Take an object (of a known structure) as the first argument. 2. Take the name of a property within data (from the object’s type) as the second argument. 3. Return the value of that property, with TypeScript correctly inferring the type of the returned value.