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

#182 for dom.generated.d.ts? #15348

Closed
saschanaz opened this issue Apr 24, 2017 · 6 comments
Closed

#182 for dom.generated.d.ts? #15348

saschanaz opened this issue Apr 24, 2017 · 6 comments
Labels
Bug A bug in TypeScript Domain: lib.d.ts The issue relates to the different libraries shipped with TypeScript Won't Fix The severity and priority of this issue do not warrant the time or complexity needed to fix it

Comments

@saschanaz
Copy link
Contributor

TypeScript Version: 2.2.1 / nightly (2.2.0-dev.201xxxxx)

Code

(Covered by #15338)

declare var URLSearchParams: {
    prototype: URLSearchParams;
    /**
      * Constructor returning a URLSearchParams object.
      */
    new (init?: string | URLSearchParams): URLSearchParams;

}

new URLSearchParams({key: "730d67"}) // valid but error

Expected behavior:

#182 should be applied to DOM types

Actual behavior:

No way to add a new overload signature before a PR to fix

@saschanaz
Copy link
Contributor Author

saschanaz commented Apr 24, 2017

Or can we please just convert them to classes?

@DanielRosenwasser DanielRosenwasser added Bug A bug in TypeScript Domain: lib.d.ts The issue relates to the different libraries shipped with TypeScript labels Apr 24, 2017
@DanielRosenwasser
Copy link
Member

DanielRosenwasser commented Apr 24, 2017

Classes wouldn't allow you to add new construct signatures - only new static members.

@saschanaz
Copy link
Contributor Author

Ah yes, you're right.

@mhegazy
Copy link
Contributor

mhegazy commented Apr 24, 2017

I would not want to add a static interface for every DOM interface, that is a lot of global scope pollution.

If you are really blocked, just copy lib.d.ts change the declaration, and use it until the issue is fixed.

@mhegazy mhegazy added the Won't Fix The severity and priority of this issue do not warrant the time or complexity needed to fix it label Apr 24, 2017
@saschanaz
Copy link
Contributor Author

that is a lot of global scope pollution.

I agree, but then what do you think about class-ifying them? It will still not allow adding constructor signatures but at least will do for other members.

@mhegazy
Copy link
Contributor

mhegazy commented Apr 24, 2017

I think we should add classes regardless. that is covered by #574

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 Won't Fix The severity and priority of this issue do not warrant the time or complexity needed to fix it
Projects
None yet
Development

No branches or pull requests

3 participants