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

abstract methods in GenBase and generating declaration files #12

Closed
jedwards1211 opened this issue Oct 6, 2020 · 3 comments
Closed

Comments

@jedwards1211
Copy link
Contributor

jedwards1211 commented Oct 6, 2020

This is just a note...
I'm looking at writing a TypeScript declaration file generator.

I noticed that GenBase has a bunch of abstract methods like WriteNewArray, WriteListStorageInit, WriteCall etc. Since TypeScript declaration files don't contain method implementations, a GenTsDecls class would have to implement these methods as no-ops. Not a huge deal, but what do you think, should we extract an interface from GenBase so that GenTsDecls and anything like it (I also use Flowtype for some JS projects 🙃) doesn't have to implement a bunch of irrelevant abstract methods?

@jedwards1211
Copy link
Contributor Author

Actually nevermind. I might as well just leave stubs that throw NotImplementedException in case we decide to implement full TS source code generation in the future.

@pfusik
Copy link
Collaborator

pfusik commented Oct 6, 2020

Yes, throw new NotImplementedException() is the way to go.

@jedwards1211
Copy link
Contributor Author

actually I ended up just inheriting GenJs for now, so that I can share some of the code for identifier case and so that I can output the correct enum value initializers.

@pfusik pfusik closed this as not planned Won't fix, can't repro, duplicate, stale Jul 21, 2022
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