-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Support for named and optional parameters in .d.ts #1129
Comments
Sounds like a good idea to me! I know the typescript generation with |
If you guys don't mind, I will work on this. Just need a little help to figure out the best approach as everything related to optional parameters seems to be scattered across the repository. |
Sure yeah! Optional arguments are all handled roughly around here for TypeScript generation. Currently mostly generate For threading through the actual names of the arguments is a bit trickier. That would start around here to modify the AST that the CLI and macro both use, and then propagating the change outwards from there to fix issues, eventually requiring you to parse the Rust code and learn about the argument names as it goes along. |
Optional arguments are supported since #1201. Can this issue be closed? |
I believe so, thanks @c410-f3r! There may be some follow-up items here and there, but it may be best at this point to have follow-up issues for those. |
This issue is related to #982 which is fixed, but that only makes the return type will be reflected, if we use optional parameters, it still does not work. Another issue is that definitions of method will not keep their original name and use
arg0
... to instead, it may lose the semantic of parameters.will generate dts:
which I expect:
Could we fix those issues for better programming experience?
Thanks.
The text was updated successfully, but these errors were encountered: