title: Extending `this` in Typescript class by Object.assign
body: <p>I have an object <code>remote</code> which is not a class instance itself. Due to the nature of Angular 2-5 I need to wrap this Object in a service so I can inject it into components. The object has an interface declared '<code>Remote</code>'. </p>
  
  <p>How would I make the following work?</p>
  
  <pre><code>import { Injectable } from '@angular/core';
  import { remote, Remote } from 'electron';
  
  @Injectable()
  export class RemoteService implements Remote {
      constructor() {
          Object.assign(this, remote);
      }
  }
  </code></pre>
  
  <p>I.e., how do I make a service class <code>RemoteService</code> which instances look like <code>Remote</code>, without having to manually wrap all <code>remote</code>'s members? I cannot use extend because <code>remote</code> is not itself an instance of a class, just an object.</p>
  
  <p>In the example above the Typescript compiler will complain that <code>RemoteService</code> incorrectly implements <code>Remote</code> (naturally). Is there any way to coerce the compiler into understand <code>RemoteService</code> as implementing <code>Remote</code>?</p>