Skip to content

[typescript] dom definitions not up to date #19040

Closed as not planned
Closed as not planned

Description

@mjbvz

From Clément P (@yukulele) on October 5, 2017 12:7

  • VSCode Version: 1.16.1
  • OS Version: macOS Sierra 10.12.6

Steps to Reproduce:

  • Create this code in typescript file
const elm = document.createElement('main')
  • elm is typed as HTMLElement instead of HTMLMainElement

lib.dom.d.ts is not up to date

how to update it without wait for vscode update ?

Reproduces without extensions: Yes

Copied from original issue: microsoft/vscode#35620

Activity

  1. removed their assignment
    on Oct 9, 2017
  2. added
    Domain: lib.d.ts
    VS Code Tracked
    and removed on Oct 9, 2017
  3. added this to the milestone on Oct 9, 2017
  4. mhegazy commented on Oct 9, 2017

    @mhegazy
    Contributor

    PRs welcomed. You can find more information about contributing lib.d.ts fixes at https://github.com/Microsoft/TypeScript/blob/master/CONTRIBUTING.md#contributing-libdts-fixes.

  5. jamOne- commented on Oct 10, 2017

    @jamOne-

    Can I fix this one as my first contribution to TypeScript?

  6. jamOne- commented on Oct 11, 2017

    @jamOne-

    I already know it, but I don't think this change is that simple.
    As far as I understand this generator code, to generate interface HTMLElementTagNameMap in dom.generated.d.ts only browser.webidl.xml interfaces are used, but HTMLMainElement is in addedTypes.json file so I have to change the generator code, or am I wrong?

  7. SimonSchick commented on Oct 11, 2017

    @SimonSchick
    Contributor

    Pretty sure you can just add overload to addedTypes.json.

  8. jamOne- commented on Oct 11, 2017

    @jamOne-

    I am not sure I understand you. Does generating interface HTMLElementTagNameMap take into account addedTypes.json?

  9. inad9300 commented on Oct 15, 2017

    @inad9300

    Please, have a look at the on-going progress before proceeding: #17828

  10. added
    Effort: Casual
    on Oct 13, 2021
  11. yukulele commented on Dec 15, 2022

    @yukulele

    The following elements are affected: abbr address article aside b bdi bdo cite code dd dfn dt em figcaption figure footer header hgroup i kbd main mark nav noscript rp rt ruby s samp section small strong sub summary sup u var wbr

  12. RyanCavanaugh commented on Aug 31, 2026

    @RyanCavanaugh
    Member

    HTMLMainElement doesn't even exist. I don't think there's anything useful to be done here by pretending that there are nominal types for these elements that don't actually do anything; HTMLELement and HTMLMainElement are identical as far as TS is concerned, and it's less misleading to return the former.

  13. added
    Won't Fix
    on Aug 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugDomain: lib.d.tsEffort: CasualVS Code TrackedWon't Fix

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions