<p dir="auto">As a typescript developer, I am building libraries for my client enterprise at work. The libraries has a lot of interfaces, types, clases, enums, variables... that are not intended to be public on the final comiled file, but I'm forced to export them to reuse at the other inner modules (before coupling them into one single file).</p>
<p dir="auto">I would like to be able to generate de .d.ts file of my .js without the <code class="notranslate">internal</code> members. I know they will be really accesible at JavaScript, but not at the definitions file.</p>
<p dir="auto">This is really significant because others could use those definicion files to use the libraries, or to generate automatically public documentation (ie. <a href="http://typedoc.io/" rel="nofollow">http://typedoc.io/</a>).</p>
<p dir="auto">Currently the spec reads: Protected property members can be accessed only within their declaring class and classes derived from their declaring class, and a protected instance property member must be accessed through an instance of the enclosing class.</p>
<p dir="auto">Relaxing the constraint, "member must be accessed through an instance of the enclosing class" to allow all classes derived from the declaring class as long as they are declared in the same module as the declaring class, would make it possible to have module internal access.</p>
<p dir="auto">This is closer to how Java implements protected access, rather than C#. Are there plans to add an <code class="notranslate">internal</code> access modifier? If not, then this may be a way to alleviate the pain of encapsulating internal class state.</p>