Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generate types instead of interfaces and enums #280

Open
gustavo-shigueo opened this issue Aug 14, 2024 · 4 comments
Open

Generate types instead of interfaces and enums #280

gustavo-shigueo opened this issue Aug 14, 2024 · 4 comments

Comments

@gustavo-shigueo
Copy link

Is it possible to generate TypeScript ´typedeclarations instead ofinterface`s? If not can it be added to the library similar to this:

[TsType]
class Foo {
    int Bar;
}
type Foo = { Bar: number }
@zolakt
Copy link

zolakt commented Oct 3, 2024

Enums to types would be a great addition.
Maybe someone has an existing workaround for that?

@pavel-b-novikov
Copy link
Member

For types support there should be implemented additional synax nodes. Unfortunately, I don't have time currently for such a change :(

Actually it can be done using exising architecture even without modifying the source code. I would appreciate if someone will do that in a way I could integrate it into the product

@gustavo-shigueo
Copy link
Author

Enums to types would be a great addition. Maybe someone has an existing workaround for that?

Yes! Having type unions instead of TS enums would be very handy, especially given how bad TS enums are sometimes

@gustavo-shigueo
Copy link
Author

For types support there should be implemented additional synax nodes.

At the time I opened the issue I attempted to create an AST node for types but couldn't quite figure out how to properly integrate it with the library

Unfortunately, I don't have time currently for such a change :(

I understand, maintaining OSS is really difficult, especially with all the other stuff we have to deal with

Actually it can be done using exising architecture even without modifying the source code.

How so? Can you give any pointers to how this could be achieved?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants