-
Notifications
You must be signed in to change notification settings - Fork 117
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
Incorrect TS types generated from types containing type aliases #70
Comments
The current processing of types with generic parameters breaks with type aliases since the generic parameters are not explicitly named in-place where the type is used. |
A workaround for now is to just avoid type aliases in anything generic* that needs to be exported. Use newtype structs instead:
becomes
In addition you can now export TS bindings to these types as well. Of course you will have to adapt your code somewhat to support (un)wrapping these newtype structs. |
type aliases do work as long as the type they alias is not generic |
I have run across this same issue. Luckily I can workaround the issue by using wrapper types like what has been documented above. I gave fixing the issue a shot and very quickly noticed I was way out of my depth, I have however created some tests which show the specific issue I had on my fork here. I thought I would post them in case they can help anyone. |
Minimal repro:
Generates:
Expected both generated variants/fields to be identical.
The text was updated successfully, but these errors were encountered: