title: Typescript: Use class as interface
body: <p>I tried to use an Class as Interface for another class. With this I am trying to accomplish an up-to-date mockClass for Testing.</p>
  
  <p>This should be possible and is an favorable approach, as state in <a href="https://angular.io/guide/styleguide#interfaces" rel="noreferrer">https://angular.io/guide/styleguide#interfaces</a></p>
  
  <p>And is demonstrate here: <a href="https://stackoverflow.com/questions/43572149/export-class-as-interface-in-angular2">Export class as interface in Angular2</a></p>
  
  <p>But strangely I'm getting an Error using Typescript 2.5.3 in VSCode 1.17.2</p>
  
  <p>Error in class SpecialTest</p>
  
  <pre><code>[ts]
  Class 'SpecialTest' incorrectly implements interface 'Test'.
    Types have separate declarations of a private property 'name'.
  </code></pre>
  
  <p>Samplecode:</p>
  
  <pre><code>class Test {
      private name: string;
  
      constructor(name: string) {
          this.name = name;
      }
  
      getName() {
          return this.name;
      }
      setName(name: string): void {
          this.name = name;
      }
  }
  
  class SpecialTest implements Test {
      private name: string;
  
      getName(): string {
          return '';
      }
      setName(name: string): void {
      }
  }
  </code></pre>
  
  <p><strong>What am I missing?</strong></p>
  
  <p>EDIT:
  use <code>string</code> instead of <code>String</code> , as @fenton suggested</p>