You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.
Thanks for the bug report. Yeah, dts2as isn't always great at using many TypeScript features together when ActionScript doesn't have them too, like this case with type aliases, unions and string literal types. I've gotten most of them to work alone, but edge cases that combine many features at once tend to break.
I see... I was thinking that may be the case, but luckily working a little on the d.ts file does the trick, so that's great. In the end with these kind of things, you can always set the type as 'any' and go ahead with that...
Maybe the dts2as tool, as a last resort option if a type cannot be resolved, set it as 'any' and throw a warning in the console? It can even be an option you can specify when running the tool :)
That's a good idea about falling back to any when the type can't be found (with a warning, of course).
Another thing you can do is specify the -outDir option to have dts2as output uncompiled ActionScript instead of trying to compile the SWC. Then you can make tweaks to the .as files and compile the SWC yourself. It may be easier to tweak the .d.ts files instead of the .as files, though.
Trying to generate the SWC file for the PixiJS library d.ts definition found in:
https://github.com/pixijs/pixi-typescript
I got the error:
Error: Type interaction.InteractionEventTypes not found for parameter event in function on.
The type seems to be correctly defined in the namespace, and VSCode correctly represents it with no error warnings:
I changed all references of this type to string (all located in the DisplayObject class) and the tool correctly generates the SWC file.
The text was updated successfully, but these errors were encountered: