Microsoft/TypeScript

URL interface is not part of the Window object

Open

#44,245 创建于 2021年5月25日

在 GitHub 查看
 (7 评论) (0 反应) (0 负责人)TypeScript (6,726 fork)batch import
BugDomain: lib.d.tsHelp Wanted

仓库指标

Star
 (48,455 star)
PR 合并指标
 (平均合并 2天 7小时) (30 天内合并 8 个 PR)

描述

Bug Report

As the title says, the URL interface (#3753) should be part of the Window object: window.URL. Please look at https://developer.mozilla.org/fr/docs/Web/API/URL .

🔎 Search Terms

window url, url, new url, createObjectURL, revokeObjectURL

🕗 Version & Regression Information

I'm using TypeScript 4.2.4.

🙁 Actual behavior

window.URL is not defined.

🙂 Expected behavior

window.URL should refer to the URL interface you added on the issue #3753:

URL: {
    prototype: URL;
    new(url: string, base?: string | URL): URL;
    createObjectURL(object: any): string;
    revokeObjectURL(url: string): void;
};

贡献者指南