Skip to content

Missing URL constructor definition #2583

Closed

Description

Currently:

interface URL {
    revokeObjectURL(url: string): void;
    createObjectURL(object: any, options?: ObjectURLOptions): string;
}
declare var URL: URL;

Should be:

interface URLConstructor {
    hash: string;
    search: string;
    pathname: string;
    port: string;
    hostname: string;
    host: string;
    password: string;
    username: string;
    protocol: string;
    origin: string;
    href: string;
}
interface URL {
    revokeObjectURL(url: string): void;
    createObjectURL(object: any, options?: ObjectURLOptions): string;
    new(url: string, base?: string): URLConstructor
}
declare var URL: URL;

URL spec is here: https://url.spec.whatwg.org/#api

Activity

  1. added
    BugA bug in TypeScript
    RevisitAn issue worth coming back to
    Domain: lib.d.tsThe issue relates to the different libraries shipped with TypeScript
    on Apr 1, 2015
  2. kennysong commented on Jun 8, 2015

    @kennysong

    Where is the URL interface currently defined? I can't find it.

  3. mhegazy commented on Jun 8, 2015

    @mhegazy
    Contributor

    it is defined in lib.d.ts.

  4. kennysong commented on Jun 8, 2015

    @kennysong

    It doesn't seem to be in lib.d.ts.

  5. danquirk commented on Jun 8, 2015

    @danquirk
    Member

    GitHub isn't showing the whole file. It cuts off around 11k lines but URL is defined on line 14455

  6. mhegazy commented on Jun 8, 2015

    @mhegazy
    Contributor
  7. 29 remaining items

  8. RReverser commented on Jan 13, 2016

    @RReverser
    Contributor

    however as the spec files are generated from internal builds of Edge, the APIs may not be available yet in the released version

    I don't really see how is that a problem - just because public release of Edge doesn't support some new spec APIs natively, that doesn't mean people don't use those APIs (through polyfills, in other browsers, etc.) and doesn't mean they don't want those definitions as soon as they're available... Or am I missing something?

  9. mhegazy commented on Jan 14, 2016

    @mhegazy
    Contributor

    Ingvar Stepanyan (@RReverser), I am not sure i understand the problem or the proposal here.

    We have lib.d.ts that is generated from the IE/Edge IDL files. Zhengbo Li (@zhengbli) updates they, usually quertelly/semi anally.
    These definition files may not contain all APIs, or include addtional non-standard ones, or ones that are not standard-complient, for that, we have three files: https://github.com/Microsoft/TSJS-lib-generator/blob/master/inputfiles/overridingTypes.json, https://github.com/Microsoft/TSJS-lib-generator/blob/master/inputfiles/addedTypes.json and https://github.com/Microsoft/TSJS-lib-generator/blob/master/inputfiles/removedTypes.json that we use to make the output correct.

    The PR to add URL constructor for instance is using these fiels, see: microsoft/TypeScript-DOM-lib-generator#44.

    so am i missing something?

  10. RReverser commented on Jan 14, 2016

    @RReverser
    Contributor

    or include addtional non-standard ones, or ones that are not standard-complient

    Gotcha - this was the part I wasn't aware about and thus asked

    Or am I missing something?

    (I thought it's just that internal builds contain APIs that are not released yet, but are fully spec-compliant and still could be used for TS; thanks for explanations)

  11. NekR commented on Mar 27, 2016

    @NekR

    I am on TS 1.8.9 and this is almost April now, haven't you generated new version yet?

  12. mhegazy commented on Mar 28, 2016

    @mhegazy
    Contributor

    Arthur Stolyar (@NekR), PRs are welcomed. see more information in #2583 (comment)

  13. zhengbli commented on Mar 28, 2016

    @zhengbli

    As an update, this issue should be fixed by #7619
    We recently took a new drop of the XML spec which has the correct definitions for URL.

  14. NekR commented on Mar 28, 2016

    @NekR

    Great, thanks for the update.

  15. pritambaral commented on May 30, 2016

    @pritambaral

    Zhengbo Li (@zhengbli) When may we see the fix? The latest release 1.8.10 doesn't have it.

  16. modified the milestones: TypeScript 2.0, on May 31, 2016
  17. locked and limited conversation to collaborators on Jun 18, 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

    BugA 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