title: Convert JSON (from Sentry) to HTML with TypeScript
body: <p>I want to learn TypeScript.</p>
  
  <p>I have a JSON dictionary returned by the sentry method <code>event_from_exception()</code> (Python).</p>
  
  <p>I would like to format it as nice HTML with expandable local variables and pre_ and post_context. The result should look roughly like this:</p>
  
  <p><a href="https://i.stack.imgur.com/8swk4.png" rel="noreferrer"><img src="https://i.stack.imgur.com/8swk4.png" alt="traceback-in-django-debug-view"></a></p>
  
  <p>Here is an example json:</p>
  
  <pre><code>{
    "exception": {
      "values": [
        {
          "stacktrace": {
            "frames": [
              {
                "function": "main", 
                "abs_path": "/home/modlink_cok_d/src/sentry-json.py", 
                "pre_context": [
                  "from sentry_sdk.utils import event_from_exception", 
                  "", 
                  "def main():", 
                  "    local_var = 1", 
                  "    try:"
                ], 
                "lineno": 9, 
                "vars": {
                  "exc": "ValueError()", 
                  "local_var": "1"
                }, 
                "context_line": "        raise ValueError()", 
                "post_context": [
                  "    except Exception as exc:", 
                  "        event, info = event_from_exception(sys.exc_info(), with_locals=True)", 
                  "        print(json.dumps(event, indent=2))", 
                  "", 
                  "main()"
                ], 
                "module": "__main__", 
                "filename": "sentry-json.py"
              }
            ]
          }, 
          "type": "ValueError", 
          "value": "", 
          "module": "exceptions", 
          "mechanism": null
        }
      ]
    }, 
    "level": "error"
  }
  </code></pre>
  
  <p>How could this be done with TypeScript?</p>