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

Lack of namespacing in types file output can lead to naming collisions #52

Open
JessHolle opened this issue Jun 28, 2023 · 3 comments
Open

Comments

@JessHolle
Copy link

It is ... unfortunate that we end up having 2 Xxx names for every given Java class for which we want to access contructors (or enum values). So I get that these don't really fall nicely into a single namespace.

Elevating all "exported" classes to the same global namespace does not seem like an appropriate solution, though.

@bsorrentino
Copy link
Owner

Hi @JessHolle thanks for valuable feedback.

This project currently is on hold because I've moved on other scripting solution.

If you have still interest in such project and would like help me on its evolution please take in consideration to submit a PR

@JessHolle
Copy link
Author

I am considering working on a PR. I am also considering adding TypeScript generation to an existing Javadoc doclet that I have been developing to produce stub Java class sources for a filtered subset of our APIs. I currently output annotations to serve as input to this project, but in that environment I already have the information and developed utilities to understand what to generate. It's just a simple matter of adding code to generate TypeScript stubs in addition to Java ones.

On this issue in particular, I am quite curious if there really is no way to use static methods (and fields) and constructors on TypeScript classes (e.g. with implementation) rather than having to introduce a separate "Static" interface for statics. This leads to a lot of issues as I see it -- and indeed in my case there are numerous naming collisions. I want to avoid those with namespaces and I want to avoid awkward naming tricks as well.

@JessHolle
Copy link
Author

After digging into this further I have a bit better understanding of the tradeoffs involved here -- and the impossibility of what I'd really wanted to do.

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

2 participants