Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Cannot transform any d.ts file successfully, is there anything wrong? #19

Closed
defchen opened this issue Mar 26, 2017 · 8 comments
Closed

Comments

@defchen
Copy link

defchen commented Mar 26, 2017

the error listed below:

       \dts2as\bin\parser.js:1693
            throw new Error("Type " + this.getAS3FullyQualifiedNameFromTSTypeNode(value.type) + " not found for parameter " + parameterName + " in function " + functionName + ".");
@joshtynjala
Copy link
Member

I haven't had a chance to upgrade dts2as to the TypeScript 2.x compiler yet. Type definitions are probably starting to use features that aren't available in the 1.x compiler.

@joshtynjala
Copy link
Member

I started work on updating the TypeScript dependency today. That should help after I release the next update. It's worth mentioning that there will probably be many d.ts files that still won't transform, even after the update. You'd be amazed at how complex people make the definitions, instead of going with a more straightforward approach of simple classes. I'm constantly finding strange edge cases that need special workarounds. Using the --exclude command line option with dts2as is very helpful when a particular API is giving you trouble.

@defchen
Copy link
Author

defchen commented Mar 27, 2017

I see!Really appreciate it for your repling and updating. thanks for your nice work on the NextGenAs.

@ilushaaa
Copy link

Hi Josh, Thanks for your hard work on flexjs and as3 tools.
Is there any progress on this issue?

@joshtynjala
Copy link
Member

The latest commits here on Github include support for newer 2.x versions of TypeScript. However, I have not yet released a build of dts2as that includes these changes. I wanted to improve compatibility with some newer d.ts files from DefinitelyTyped before I made a new release. Some of the libraries that used to work with dts2as now result in errors because their d.ts files have started using more complex syntax.

I've been spending most of my time recently preparing the asconfigc and vscode-nextgenas projects for my talk ApacheCon next week, so dts2as and other things have temporarily fallen by the wayside. After ApacheCon, I'll see what I can do about dts2as.

@ilushaaa
Copy link

Sounds great!
I am trying to build starling project for web with pixi render. May be that pixi definitions file doesn't have complex syntax and you can generate swc on your side before dts2as tool will get public update? It would help a lot.

@joshtynjala
Copy link
Member

I have released dts2as 0.12.0. This version now uses TypeScript 2.3 so it should work with newer type definitions. I have confirmed that it can parse the latest type definitions for pixi.js from DefinitelyTyped. There are many libraries that still won't be compatible, though, so don't be surprised if some still fail.

@ilushaaa
Copy link

ilushaaa commented May 14, 2017

Thanks for great support!
I have generated pixi.swc with small definitions editing.

dts2as tool still can't handle construction:

type InteractionEventTypes = InteractionPointerEvents | InteractionTouchEvents | InteractionMouseEvents;

Because parser can't find type InteractionEventTypes in any method.

Looking forward for new versions of flexjs/as3 tools.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants