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

Node.cloneNode returns the wrong type #17818

Closed
kkapsner opened this issue Aug 15, 2017 · 5 comments
Closed

Node.cloneNode returns the wrong type #17818

kkapsner opened this issue Aug 15, 2017 · 5 comments
Labels
Duplicate An existing issue was already created

Comments

@kkapsner
Copy link

Node.cloneNode should return the type of "this". Therefore this line
https://github.com/Microsoft/TypeScript/blob/93abebc04af5d443a930ad84258cf2d6101d8513/lib/lib.es6.d.ts#L14166

should be
cloneNode(deep?: boolean): this;

@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 Aug 15, 2017
@divyamamgai
Copy link

divyamamgai commented Aug 28, 2017

Can I take this up as a starting point? Seems straight forward if the issue creator is correct about the change.

@mhegazy
Copy link
Contributor

mhegazy commented Aug 28, 2017

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.

@mhegazy
Copy link
Contributor

mhegazy commented Aug 28, 2017

One thing to note, we do not want to add cloneNode(deep?: boolean): this as this will turn all HTMLElement* interfaces into generic interfaces and increase the cost of checking the standard library. instead we can update the generator to emit a cloneNode for every element to return the right type. see microsoft/TypeScript-DOM-lib-generator#166 for guidance.

@mhegazy mhegazy added this to the Community milestone Aug 28, 2017
@HolgerJeromin
Copy link
Contributor

duplicate of the older ref #283

@mhegazy mhegazy added Duplicate An existing issue was already created and removed Bug A bug in TypeScript Domain: lib.d.ts The issue relates to the different libraries shipped with TypeScript Help Wanted You can do this labels Jun 20, 2018
@mhegazy mhegazy removed this from the Community milestone Jun 20, 2018
@typescript-bot
Copy link
Collaborator

Automatically closing this issue for housekeeping purposes. The issue labels indicate that it is unactionable at the moment or has already been addressed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Duplicate An existing issue was already created
Projects
None yet
Development

No branches or pull requests

6 participants