title: Typescript class extending Partial interface
body: <p>I would like to create a class that has all the properties of an interface, but does not actually declare those properties itself.The interface properties are appended during the build process and WILL exist at runtime. </p>
  
  <p>I found <a href="https://stackoverflow.com/questions/36633639/typescript-partial-interface-object">this post</a> that pointed me in the direction of using <code>Partial&lt;T&gt;</code>...but that doesn't seem to work. The following code produces no compile errors.</p>
  
  <pre class="lang-js prettyprint-override"><code>interface Animal {
      name: string;
  }
  
  interface HasConstructor {
      constructor: any;
  }
  //Do this to supress this error: "Type 'Dog' has no properties in common with type 'Partial&lt;Animal&gt;"
  type OptionalAnimal = Partial&lt;Animal&gt; &amp; HasConstructor;
  
  class Dog implements OptionalAnimal {
      public constructor() {
  
      }
      public breed: string;
  }
  </code></pre>
  
  <p>However, the <code>name</code> property is not available on the instance of Dog.</p>
  
  <pre class="lang-js prettyprint-override"><code>var spot = new Dog();
  spot.name = "Spot"; //ERROR: Property 'name' does not exist on type 'Dog'
  </code></pre>
  
  <p>I can get around this issue by creating <em>another</em> type and referencing it like this:</p>
  
  <pre class="lang-js prettyprint-override"><code>type AnimalDog = Dog &amp; Animal;
  
  var spot: Animal = new Dog() as any;
  spot.name = "Spot";
  
  </code></pre>
  
  <p>However, I can't construct a new instance of <code>AnimalDog</code>, and have to cast as <code>any</code> to get the types to line up, so I'm left using both <code>AnimalDog</code> <em>and</em> <code>Dog</code> in my code depending on the scenario. This also produces compile errors inside of Dog when referencing Animal types.</p>
  
  <p>Is there a way to tell typescript that the class implements the interface, without explicitly declaring every interface property? </p>