Sunday, March 17, 2013

Real private static class members in Typescript

The default implementation of private in typescript classes is a compiler enforced constraint only. Which means that if it is used from Javascript your members are still available.

If you really really want to prevent this then the following is one solution for private static members:


That is surround your class with a module and declare your private static variables in that module.