How to fix Mapped type constraints cannot reference type parameters in TypeScript | DevErrors