Skip to content

window.open return type #6418

Closed
microsoft/TypeScript-DOM-lib-generator
#46

Description

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?

Activity

  1. RyanCavanaugh commented on Jan 11, 2016

    @RyanCavanaugh
    Member

    Zhengbo Li (@zhengbli) can you confirm?

  2. zhengbli commented on Jan 11, 2016

    @zhengbli

    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

  3. modified the milestones: , TypeScript 1.8 on Jan 11, 2016
  4. modified the milestones: TypeScript 1.8, on Jan 19, 2016
  5. locked and limited conversation to collaborators on Jun 19, 2018
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

    Breaking ChangeWould introduce errors in existing codeBugA bug in TypeScriptDomain: lib.d.tsThe issue relates to the different libraries shipped with TypeScriptFixedA PR has been merged for this issueHelp WantedYou can do this

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions