MatDialog `open` method `R` generic is too loose
未关闭
area: material/dialog
P4
refactoring
- 主要语言
- TypeScript
- 星标
- 25k
- 派生
- 6.8k
- 平均合并
- 1 天 8 小时
- 30 天内合并 PR
- 91
描述
Because the `R` generic on `MatDialog.open` isn't constrained by arguments to the function, it's effectively always `any`. We should remove the method generic and change the return generic to `{}`, which will force people to explicitly state which type it is when consuming it.
贡献指南
调研方向
首先定位 MatDialog.open 方法的声明,并检查其泛型 R 是如何定义和返回的。按照描述更新泛型类型,然后验证对话框结果的使用者必须明确提供其预期类型,并且现有的 TypeScript 检查仍然通过。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- angular, typescript
- 领域
- frontend
- Issue 类型
- 缺陷
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 35/100