How to fix Type parameter 'T' has conflicting constraints in TypeScript | DevErrors