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

ElementTraversal: missing some nulls #12526

Closed
tkrotoff opened this issue Nov 27, 2016 · 5 comments
Closed

ElementTraversal: missing some nulls #12526

tkrotoff opened this issue Nov 27, 2016 · 5 comments
Labels
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 Help Wanted You can do this

Comments

@tkrotoff
Copy link

Inside dom.generated.d.ts:

interface ElementTraversal {
    readonly childElementCount: number;
    readonly firstElementChild: Element;
    readonly lastElementChild: Element;
    readonly nextElementSibling: Element;
    readonly previousElementSibling: Element;
}

should be:

interface ElementTraversal {
    readonly childElementCount: number;
    readonly firstElementChild: Element | null;
    readonly lastElementChild: Element | null;
    readonly nextElementSibling: Element | null;
    readonly previousElementSibling: Element | null;
}

Example: https://jsfiddle.net/tkrotoff/khzbrkpg/

(tested with typescript@2.2.0-dev.20161125 lib.dom.d.ts)

@RyanCavanaugh RyanCavanaugh added Help Wanted You can do this Bug A bug in TypeScript Domain: lib.d.ts The issue relates to the different libraries shipped with TypeScript labels Nov 28, 2016
@mhegazy mhegazy added this to the Community milestone Nov 28, 2016
@mhegazy
Copy link
Contributor

mhegazy commented Nov 28, 2016

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.

@perryjiang
Copy link

Hi, I'm new to OSS. If I understand the issue right, this looks like a relatively simple problem? If so, I'd be glad to tackle it.

@mhegazy
Copy link
Contributor

mhegazy commented Dec 2, 2016

This should be a simple one to change. the change should be done in https://github.com/Microsoft/TSJS-lib-generator, you will need to edit https://github.com/Microsoft/TSJS-lib-generator/blob/master/inputfiles/overridingTypes.json to include the | null.

@perryjiang
Copy link

Thanks! PR submitted.

@mhegazy mhegazy modified the milestones: TypeScript 2.2, Community Dec 5, 2016
@mhegazy mhegazy added the Fixed in TSJS repo Fix merged in https://github.com/Microsoft/TSJS-lib-generator, but not ported yet label Dec 5, 2016
@mhegazy
Copy link
Contributor

mhegazy commented Jan 11, 2017

This still needs to be merged into master from https://github.com/Microsoft/TSJS-lib-generator. Keeping it open until then.

@mhegazy mhegazy reopened this Jan 11, 2017
@mhegazy mhegazy added the Fixed A PR has been merged for this issue label Feb 2, 2017
@zhengbli zhengbli removed the Fixed in TSJS repo Fix merged in https://github.com/Microsoft/TSJS-lib-generator, but not ported yet label Feb 3, 2017
@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
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 Help Wanted You can do this
Projects
None yet
Development

No branches or pull requests

5 participants