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

window.open return type #6418

Closed
JirkaDellOro opened this issue Jan 9, 2016 · 2 comments · Fixed by microsoft/TypeScript-DOM-lib-generator#46
Closed

window.open return type #6418

JirkaDellOro opened this issue Jan 9, 2016 · 2 comments · Fixed by microsoft/TypeScript-DOM-lib-generator#46
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 Help Wanted You can do this

Comments

@JirkaDellOro
Copy link

In the lib.d.ts I found, that the return type of the window.open method is declared as any. Shouldn't it be Window?

@RyanCavanaugh RyanCavanaugh added Bug A bug in TypeScript Domain: lib.d.ts The issue relates to the different libraries shipped with TypeScript labels Jan 11, 2016
@RyanCavanaugh
Copy link
Member

@zhengbli can you confirm?

@zhengbli
Copy link
Contributor

The reason it is any now is that technically it returns a WindowProxy object, for which the XML spec does have a definition.
However according to the W3 spec:

As mentioned earlier, each browsing context has a WindowProxy object. This object is unusual in that it must proxy all operations to the Window object of the browsing context's active document. It is thus indistinguishable from that Window object in every way, except that it is not equal to it.

So it might be ok to use window instead in lib.d.ts

@mhegazy mhegazy added Breaking Change Would introduce errors in existing code Help Wanted You can do this labels Jan 11, 2016
@mhegazy mhegazy modified the milestones: Community, TypeScript 1.8 Jan 11, 2016
@mhegazy mhegazy modified the milestones: TypeScript 1.8, Community Jan 19, 2016
@zhengbli zhengbli added Fixed A PR has been merged for this issue and removed Fixed in TSJS repo labels Jan 20, 2016
@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 Help Wanted You can do this
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants