How to define a private property when implementing an interface in Typescript?
<p>I'm using TypeScript in my project and I have come across an issue.
I'm defining an interface like this:</p>

<pre><code>interface IModuleMenuItem {
    name: string;
}
</code></pre>

<p>I want to create a class that implements from this interface but I want the name to be a private property like this:</p>

<pre><code>class ModuleMenuItem implements IModuleMenuItem {
    private name: string;
}
</code></pre>

<p>I'm getting the following error:</p>

<blockquote>
  <p>Class ModuleMenuItem incorrectly implements interface IModuleMenuItem.
  Property name is private in type ModuleMenuItem but not in type
  IModuleMenuItem.</p>
</blockquote>

<p>How can I define a property as private or protected when implementing an interface?</p>