How to fix Property 'x' is private and only accessible within class 'Y' in TypeScript | DevErrors