title: Typescript objects deserialization using classes vs interfaces
body: <p>I'm new to ts and I'm trying to deserialize a json to a statically typed object</p>
  <p>like this</p>
  <pre><code>class Bar {
      x:number;
      y?:string; 
   }
    
  interface IBar{
      x:number;
      y?:string; 
  }
  
  var baz:IBar = JSON.parse(jsonString);
  </code></pre>
  <p>i want to know in this case what the difference between using</p>
  <pre><code>var baz:IBar = JSON.parse(jsonString); 
  </code></pre>
  <p>and</p>
  <pre><code>var baz:Bar = JSON.parse(jsonString);
  </code></pre>
  <p>i have read <a href="https://stackoverflow.com/questions/37233735/interfaces-vs-types-in-typescript">Interfaces vs Types in TypeScript</a>
  but it did not help</p>