Skip to content
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

lib.d.ts HTMLTableElement, HTMLTableSectionElement, and HTMLTableRowElement #3583

Closed
kvarekamp opened this issue Jun 20, 2015 · 5 comments
Closed
Labels
Breaking Change Would introduce errors in existing code Bug A bug in TypeScript Domain: lib.d.ts The issue relates to the different libraries shipped with TypeScript Fixed A PR has been merged for this issue

Comments

@kvarekamp
Copy link

A couple of html table related methods in lib.d.ts return HTMLElement, but they could return a more precise type:

  • HTMLTableElement.insertRow should return HTMLTableRowElement instead of HTMLElement
  • HTMLTableElement.createTHead should return HTMLTableSectionElement instead of HTMLElement
  • HTMLTableElement.createTBody should return HTMLTableSectionElement instead of HTMLElement
  • HTMLTableElement.createTFoot should return HTMLTableSectionElement instead of HTMLElement
  • HTMLTableElement.createCaption should return HTMLTableCaptionElement instead of HTMLElement
  • HTMLTableSectionElement.insertRow should return HTMLTableRowElement instead of HTMLElement
  • HTMLTableRowElement.insertCell should return HTMLTableCellElement instead of HTMLElement
@mhegazy mhegazy added Suggestion An idea for TypeScript Revisit An issue worth coming back to Domain: lib.d.ts The issue relates to the different libraries shipped with TypeScript labels Jun 20, 2015
@mhegazy mhegazy self-assigned this Jun 20, 2015
@mhegazy mhegazy added this to the TypeScript 1.6 milestone Jun 20, 2015
@djarekg
Copy link

djarekg commented Jun 24, 2015

How about also HTMLTableElement cells and rows property return a new generic type HTMLCollectionOf where cells is HTMLCollectionOf and rows is HTMLCollectionOf. And the HTMLTableRowElement cells property would be HTMLCollectionOf.

@mhegazy mhegazy modified the milestone: TypeScript 1.6 Jul 1, 2015
@matthewrwilton
Copy link

Seems like this didn't make v1.6. Is it possible to get a milestone update?

@mhegazy mhegazy assigned zhengbli and unassigned mhegazy Sep 30, 2015
@mhegazy mhegazy added this to the TypeScript 1.7 milestone Sep 30, 2015
@mhegazy
Copy link
Contributor

mhegazy commented Sep 30, 2015

@zhengbli is working on releasing the script that generates the typings file. it should come out shortly, and with that we should be able to take PRs for features like this one. putting it on @zhengbli for now.

@mhegazy mhegazy modified the milestones: TypeScript 2.0, TypeScript 1.7 Oct 6, 2015
@mhegazy mhegazy added Bug A bug in TypeScript and removed Suggestion An idea for TypeScript labels Oct 6, 2015
@zhengbli
Copy link
Contributor

The HTMLTableElement.rows is not only HTMLTableRowElement, it also contains headers and other types spec, the same goes for HTMLTableRowElement.cells.

@zhengbli
Copy link
Contributor

I have a PR fixing this at microsoft/TypeScript-DOM-lib-generator#24
If you want to take a look @mhegazy @sockfish

@zhengbli zhengbli added Fixed A PR has been merged for this issue and removed Fixed in TSJS repo labels Dec 1, 2015
@zhengbli zhengbli closed this as completed Dec 1, 2015
@microsoft microsoft locked and limited conversation to collaborators Jun 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Breaking Change Would introduce errors in existing code Bug A bug in TypeScript Domain: lib.d.ts The issue relates to the different libraries shipped with TypeScript Fixed A PR has been merged for this issue
Projects
None yet
Development

No branches or pull requests

5 participants