Feature request: split whatwg definitions in separate files
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 5/5
- 预计耗时
- 一周以上
- 新手友好度
- 25/100
- Issue 类型
- 功能
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- typescript
- 领域
- tooling
调研方向
该 issue 未指出任何文件、测试或入口点。首先阅读相关 issue 41727 和 31535,然后检查此生成器如何组织 DOM 库定义。当用户可以选择单独的 whatwg URL,并在不依赖更广泛的 DOM lib 的情况下获取与 ECMAScript lib 一起使用的定义时,即表示完成。
由索引模型根据 Issue 内容生成。
描述
Use case
I want to write an isomorphic library that runs in the browser and nodejs. I want to make sure that I only rely on globals that are available in both environments. Currently, to do this, I must use lib: ["dom"] and types: ["node"], which results in defined globals that are not actually available in both runtime envs, leading to a fake sense of type safety when writing code.
Suggested solution
As a user of typescript, I would like to be able to pick more precisely the libs I depend on. For example: lib: ["es2022", "whatwg.url", "whatwg.fetch"]
There would be a lot of benefit to doing this:
@types/nodewould not have to re-define definitions already provided bytypescript(new URL(u as URL)incorrectly yields an error when usingtypes: ["node"])- All libraries targeting both dom & scripthost envs would benefit from improved type safety
Related issues
- 主要语言
- TypeScript
- 星标
- 740
- 派生
- 474
- 平均合并
- 3 天 7 小时
- 30 天内合并 PR
- 14
环境准备
我们还没有检查这个项目的环境配置文件。先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
microsoft/TypeScript-DOM-lib-generator 的其他 Issue
-
难度 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 天内回复
-
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 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
microsoft/TypeScript-DOM-lib-generator#1675 · 2 条评论 · 1 个 reaction ·
维护者通常 1 天内回复
查看 microsoft/TypeScript-DOM-lib-generator 的全部 Issue
相似的 Issue
-
bug
难度 2/5 1-3 小时 新手友好度 88/100
MystenLabs/MemWal#1085 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 84/100
维护者通常 1 天内回复
-
📕documentation
难度 2/5 1-3 小时 新手友好度 72/100
db-ux-design-system/core-web#8343 ·
维护者通常 1 天内回复
-
enhancement triage/needs-triage
难度 2/5 1-3 小时 新手友好度 88/100
heygen-com/hyperframes#4944 ·
维护者通常 1 天内回复
-
ai-driven-qa bug claude
难度 2/5 1-3 小时 新手友好度 82/100
linagora/twake-calendar-frontend#1493 · 1 条评论 ·
维护者通常 1 天内回复