title: Is there a native way or via VS Extension for VS 2017/2019 to auto generate typescript .d files from a C# POCO
body: <p>In my Razor .cshtml file I need to pass a JSON-serialized data from some complex C# POCO model objects that can be used in the Javascript space.  But I want to use type-safe Typescript instead, which VS 2017/2019 now has great support (by auto-transpile during the build).  That way I can also use ES6 features.</p>
  
  <p>I am looking for tips on generating typescript .d files so the typescript scripts I use has the benefit of type checking when operating on the JSON data derived from the C# POCO model.</p>
  
  <p>There is an <a href="https://stackoverflow.com/a/24289610">SO answer</a> recommending <a href="http://vswebessentials.com/features/typescript" rel="nofollow noreferrer">Web Essentials</a> but it has not been updated for VS 2017/2019, and I suspect now that VS 2017/2019 has Roslyn built-in and support Typescript a lot more than VS 2015, I'm hoping it has a way to do this without installing any extensions or requiring any nuget libraries.</p>
  
  <p>I can settle for manually generating it (maybe by right-clicking on the POCO root class from the Solution Explorer tab inside the VS 2017/2019 IDE).  But what is even better if the generation of the .d files are automatic so that whenever the C# POCO class is updated, the syntax helper in the .ts editing window is updated automatically.  I'm hoping that the integrated Rosyln feature somehow makes it work like magic :-).</p>