There are lots of projects that do this. Your best bet today will be to assess which option is still actively maintained, and meets your requirements 🌹
The world is strongly going TypeScript for both front and backend. Hence the diverse state of cross language tooling.
Check out the open-source project NSwag: With the GUI, you can select a .NET class from an existing assembly and generate the TypeScript interface for it.
There is also a command line tool and support for T4 templates as well as generation of client code for Web API controllers...
There is a new library called TypeScriptD which will create .d.ts
files for your .NET classes.
This can be run as a command and works for .NET or winmd.
I had a similar need but found the existing projects were too limiting in one way or another (buggy, no generics, no methods, etc.) so I ended up rolling my own (http://cjlpowers.github.io/TypeScripter/). In my case I was dealing with ServiceContract/DataContract types on the server and needed .d.ts files to aid client side development. The solution is extensible should you need to tweak it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With