type ValueOf = Obj[keyof Obj]; type OneOnly = { [key in Exclude]: undefined; } & { [key in K]: Obj[K]; }; type OneOfByKey = { [key in keyof Obj]: OneOnly; }; export type OneOf = ValueOf>; export type WithRequired = T & { [P in K]-?: NonNullable; }; export {};