cincheo / jsweet

A Java to JavaScript transpiler.
http://www.jsweet.org
Other
1.46k stars 161 forks source link

document.getElementsByClassName return type definition #649

Closed stephdz closed 3 years ago

stephdz commented 3 years ago

https://github.com/cincheo/jsweet/blob/1b3a4fd5f7d2e33288c5acf4de03a8db63d2e0c0/core-lib/es6/src/main/java/def/dom/Document.java#L665

Using jsweet I get this kinds of errors : type 'HTMLCollectionOf<Element>' is not assignable to type 'NodeListOf<Element>'

As you can see below, getElementsByClassName should return an HTMLCollectionOf : https://github.com/microsoft/TypeScript/blob/9ba45fcaace07510ef259d4cda2bc5ec523cf6d1/lib/lib.dom.d.ts#L4897

lgrignon commented 3 years ago

Thanks @stephdz for reporting. You can enhance jsweet-core definitions any time you want, and PR. We will be glad to review & merge it, then deploy it to the next minor version :)

renaudpawlak commented 3 years ago

I think you can also try to use lib-core 5. If it works, maybe you can check how it is done in core lib 5 and report it on core lib 6 if you have the time :)

lgrignon commented 3 years ago

fixed and deployed in core 6.3.1