Typescript d.ts files to closure externs

392 views
Skip to first unread message

Eric Schneller

unread,
Nov 21, 2015, 11:15:56 AM11/21/15
to Closure Compiler Discuss
Hey,

I recently came across the problem of using three.js within a closure compiler project. I saw a couple of posts regarding the usage of .d.ts files and that at some point the closure compiler might even support .d.ts files. However I wrote a tool which might help some people at this time. It converts .d.ts files to closure compiler externs. It's not 100% tested yet.


Feedback is welcomed!

Cheers

Alan deLespinasse

unread,
Nov 22, 2015, 8:57:43 AM11/22/15
to Closure Compiler Discuss
Do you have it working with three.js? That would be of great interest. I got a toy application working once by using three.min.js as an externs file, but it generated a huge list of warnings, and I wasn't sure it would work under real-world conditions.

Eric Schneller

unread,
Nov 23, 2015, 4:15:22 AM11/23/15
to Closure Compiler Discuss
I have a small three.js project working using the generated externs file. However it's not using that many classes of three.js yet, so I can't promise that all methods are exported properly. So far I'm just seeing one warning which I'm working on.

Michael Zhou

unread,
Dec 2, 2015, 8:00:15 PM12/2/15
to Closure Compiler Discuss
Have you tried the .d.ts file for three.js from the DefinitelyTyped repository?


On Saturday, November 21, 2015 at 11:15:56 AM UTC-5, Eric Schneller wrote:
Reply all
Reply to author
Forward
0 new messages