title: TypeScript: how to JSON stringify a class definition?
body: <p>Say we have:</p>
  
  <pre><code>class MyClass {
    myProperty: string
  }
  </code></pre>
  
  <p>Is there any built in function or easy way to get JSON like this?:</p>
  
  <pre><code>{
    "myProperty": "string"
  }
  </code></pre>
  
  <p>EDIT: My end goal is I want to dynamically print typed class definitions to a web view, in some kind of structured object syntax like JSON. I'm trying to make a server API that will return the schema for various custom classes - for example <a href="http://myserver.com/MyClass" rel="nofollow noreferrer">http://myserver.com/MyClass</a> should return MyClass's properties and their types as a JSON string or other structured representation.</p>