This is what i am trying to accomplish but for an object with generics. Is there a `valueof` similar to `keyof` in TypeScript?.
// Something on this lines. I know this is not supported but i am trying to convey the idea here.
type payload<T> = <K extends keyof T>{prop: K, value: T[K]};
const someObj = {a: string, b: number};
type someObjType = payload<someObj>;
const someObjPayload: someObjType = { prop: 'a', value: 'some string'} // should work.
const someObjPayload: someObjType = { prop: 'a', value: 200 } // should throw an error.