I have a task that involves configuring a table and creating objects with key-value pairs for each key.
type KeyValuePair<T> = {/** ... */};
let userKeyValuePair :KeyValuePair<{id:number,userName:string}>;
// => {key:'id',value: number} or {key: 'userName', value: string}
userKeyValuePair = {key: 'id' /** with autocomplete */ , value: 'string'}; // will result in an error
userKeyValuePair = {key: 'id' ,value: 687 /** any number */}; // will work correctly