The keyof operator produces the union of an object type's keys as literals. Combined with indexed types (T[K]), it lets you type access to a property whose name is chosen dynamically, and guarantee that the key exists and that the returned type is the right one.
Example
function lire<T, K extends keyof T>(obj: T, cle: K): T[K] {
return obj[cle];
}