canhorn / EventHorizon.Blazor.TypeScript.Interop.Generator

This project is a Blazor Interop C# Generator, has a sample against the BabylonJS library.
https://wonderful-pond-05f7b3b10.azurestaticapps.net/
MIT License
132 stars 19 forks source link

Support for generating `namespace` interop classes #31

Open david-driscoll opened 3 years ago

david-driscoll commented 3 years ago

Hi, this project looks awesome, and I'm super excited someone decided to do it!

Do you have any idea of what might be involved to create interop with namespaces much like classes? Basically take a namespace and produce a static class from the embedded functions?

Basically I'm looking at the monaco.d.ts declarations and wanting to generate off of those.

My Problem: I work on the C# LSP and Blazor is a very compelling use case, to be able to run a server in the users browser, In fact I helped push get the Azure bicep team over their issues, and everything works with the server. [demo]

However the for monaco-languageclient regularly lags behind the vscode language client (which does not support monaco). So I want to investigate what it might take to get interop working with monaco natively through blazor interop. And I really really really don't want to handwrite the interop.

Thanks for the wonderful looking project!

canhorn commented 3 years ago

Hi @david-driscoll! Thanks for the interest in this project. I took a look and I think it should be pretty easy to get this working with namespaced classes. I was able to get a quick poc running, its pretty much just a class with static methods. I have to work out the nested classes, after that I should have a release up. I will also look at adding an example to the sample project.