How to fix Type parameter for mapped type must be 'in' expression in TypeScript | DevErrors