Open
Description
Currently to protect integrity of data one can only use classes with private or protected fields. Classes are harder to work with compared to object literals. Being able to specify that certain fields are invisible to outside modules would be a valuable addition to support programming in functional style in TypeScript.
So what I am suggesting is to be able to specify whether a field of an interface is exported from a module or not. This also means that the instance of such interface can only be created within the module it is declared.
The similar features can be found in:
- F# called
signature files
: http://msdn.microsoft.com/en-us/library/dd233196.aspx - Haskell called
export lists
: http://www.haskell.org/onlinereport/modules.html