Make DOM types available without polluting the global scope with 790 global variables
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 5/5
- 预计耗时
- 一周以上
- 新手友好度
- 25/100
- Issue 类型
- 功能
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- typescript
调研方向
未指定文件、测试或入口点。首先检查此仓库如何生成 DOM 库文件,以及 lib: ['DOM'] 选项如何公开声明;将当前生成的输出与所要求的仅类型行为进行比较。在不引入所列的不需要的全局变量的情况下提供 DOM 类型信息,即表示完成。
由索引模型根据 Issue 内容生成。
描述
Adding lib: ['DOM'] introduces 790 global variables. Many of these are deprecated and useless. Many of them have short names that can hide mistakes like a missing var or let. Some obvious offenders that absolutely result in regular bugs:
eventclosedparentscreenstatustoolbartoplengthselfhistorylocationorigin
For this reason I have so far refrained from using lib: ['DOM'] in my projects and prefer to access all globals via window.foo instead for clarity and safety.
However, this means that TS doesn't know about any of these types. Please can we make these types available so that we can at least access and use the type information without polluting the global scope with all these variables.
I'd be happy with one that just declares document and window globals, or a types-only version that leave all globals up to us, either way I don't mind, just anything that makes the types available without all these junk globals.
- 主要语言
- TypeScript
- 星标
- 741
- 派生
- 475
- 平均合并
- 6 天 10 小时
- 30 天内合并 PR
- 6
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
microsoft/TypeScript-DOM-lib-generator 的其他 Issue
-
lib.d.ts bug
难度 2/5 1-3 小时 新手友好度 62/100
microsoft/TypeScript-DOM-lib-generator#2566 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 74/100
microsoft/TypeScript-DOM-lib-generator#2554 · 6 条评论 ·
维护者通常 1 天内回复
-
lib.d.ts bug
难度 2/5 1-3 小时 新手友好度 68/100
microsoft/TypeScript-DOM-lib-generator#2485 ·
维护者通常 1 天内回复
-
Incorrect MDN link for requestAnimationFrame in lib.dom.d.ts可能已有人在做 @Mohitlikestocode 于 253 天前认领。 未关闭lib.d.ts bug
难度 1/5 1 小时以内 新手友好度 68/100
microsoft/TypeScript-DOM-lib-generator#2154 · 1 个 reaction ·
维护者通常 1 天内回复
-
lib.d.ts bug
难度 2/5 1-3 小时 新手友好度 68/100
microsoft/TypeScript-DOM-lib-generator#2107 · 5 条评论 ·
维护者通常 1 天内回复
查看 microsoft/TypeScript-DOM-lib-generator 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
-
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 4 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复