I have a minesweeper game that I wrote in JS, and am now trying to convert to typescript. In this game I implemented a 'GameFactory', which contains a lot of private functions and only exports what needs to be public. There is something quite basic that I seem to be misunderstanding regarding typescript's approach.
In essence, from what I gather, typescript does not support real private variables inside of a class, unless they're in either the constructor or in a module. By real private I am referring to variables that would not be available on the object, and not to the private keyword.
What is the correct way to achieve encapsulation in TypeScript? What is the best practice to combine this with AngularJS factories/services? Of course, I could just place all of my code inside of the constructor function, thus achieving regular JS function-scoped encapsulation, but this seems wrong to me, because it does not really use TypeScript's powers.
Like I said, I am trying to really understand the TypeScript paradigm regarding these issues, if someone can point me in the right direction that would be great, because I searched and was unable to find a good explanation to these issues