title: Can I create a TypeScript type and use that when AJAX returns JSON data?
body: <p>I have the following C# class:</p>
  
  <pre><code>public class JsonBackup
  {
      public int Added { set; get; }
      public int DEVCount { set; get; }
      public int DS1Count { set; get; }
      public IList&lt;ViewEvent&gt; Events { get; set; }
      public IEnumerable&lt;string&gt; Errors { set; get; }
      public int Rejected { set; get; }
      public bool Success { set; get; }
      public int Updated { set; get; }
  }
  </code></pre>
  
  <p>and this code to return JSON data to my browser:</p>
  
  <pre><code>return Json(new JsonBackup
  {
      Added = added,
      DEVCount = devCount,
      DS1Count = ds1Count,
      Events = t.Events,
      Rejected = rejected,
      Success = true,
      Updated = updated
  });
  </code></pre>
  
  <p>The data is returned here:</p>
  
  <pre><code> $.ajax("/Backup/Data/Backup",
      {
          cache: false,
          dataType: 'json',
          type: 'POST'
      })
   .done(function (data: ) {
       console.log(data);
       backupDone(data, ajaxElapsed);
   });
  </code></pre>
  
  <p>and used in other places and also here:</p>
  
  <pre><code>   $.each(data.Events, function (i, item) {
          $("#stats-list li:eq("+(4+i)+")").after('&lt;li&gt;' + item.Description + ' : ' + item.Elapsed + ' ms&lt;/li&gt;');
      });
  </code></pre>
  
  <p>Is it possible for me to create a TypeScript type and assign data to that type so I could 
  for example get intellisense when selecting such things as </p>
  
  <pre><code>data.Added or data.DEVCount etc?
  </code></pre>