type staffKeys = 'name' | 'salary'; function getProperty<T, K extends staffKeys>(obj: T, key: K): T[K] { return obj[key]; }