Explain `keyof`, the `typeof` type operator, and indexed access types. Use them to write a fully type-safe property getter.
Deriving types from other types/values so a getter's return type follows the key you pass.
These three operators let types be DERIVED instead of hand-written. `keyof T` is the union of T's property names (`keyof {a:1;b:2}` is `'a' | 'b'`). The `typeof` type operator (distinct from the runtime JS `typeof`) lifts a value into its type — `typeof config` gives the type TS inferred for the value, so you define data once and derive its type. Indexed access `T[K]` looks up the type of a property: `User['id']` is that field's type, and `T[keyof T]` is the union of all value types. Together they express a type-safe getter: `get<T, K extends keyof T>(obj: T, key: K): T[K]` — the key parameter is constrained to real keys of the object (a typo'd key is a compile error) and the return type `T[K]` is the type of THAT specific property, not a widened union. Pass `'name'` and you get back exactly `string`; pass `'age'` and you get `number`. This is the backbone of typed form libraries, ORMs, and prop utilities. Combine with `typeof`: `type Keys = keyof typeof config` derives the allowed keys straight from a runtime object, keeping type and data in lockstep. And `T[number]` on an array/tuple extracts the element type — the trick behind `typeof ARRAY[number]` unions.
Type-safe get/set/pluck helpers, form field names, deriving key unions from a config object (keyof typeof), extracting array element types.