How to fix Cannot access protected property 'x' from outside the class in TypeScript | DevErrors