title: JSON to TypeScript class instance?
body: <p>I've done quite some research, but I'm not totally satisfied with what I found. Just to be sure here's my question:
  What is actually the most robust and elegant automated solution for deserializing JSON to TypeScript runtime class instances?</p>
  
  <p>Say I got this class:</p>
  
  <pre><code>class Foo {
    name: string;
    GetName(): string { return this.name };
  }
  </code></pre>
  
  <p>And say I got this JSON string for deserialization:</p>
  
  <pre><code>{"name": "John Doe"}
  </code></pre>
  
  <p>What's the best and most maintainable solution for getting an instance of a Foo class with the name set to "John Doe" and the method GetName() to work? I'm asking very specifically because I know it's easy to deserialize to a pure data-object. I'm wondering if it's possible to get a class instance with working methods, without having to do any manual parsing or any manual data copying. If a fully automated solution isn't possible, what's the next best solution?</p>