microsoft / microsoft/TypeScript

`ReadonlyMap` lacks documentation for `forEach`, `get`, `has` and `size`

未关闭 适合新手
#63,710 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

Domain: lib.d.ts Possible Improvement
主要语言
Go
星标
111k
派生
14.3k
平均合并
2 天 4 小时
30 天内合并 PR
132

描述

⚙ Compilation target

ES2015+

⚙ Library

lib.es2015.collection.d.ts

Missing / Incorrect Definition

ReadonlyMap<K, V> lacks documentation for forEach, get, has and size.

Hovering these members in an editor shows no description, unlike the corresponding members of Map<K, V>. The documentation should ideally be copied from regular Map<K, V> for consistency, exactly as was done for ReadonlySet<T> in #63481 (fixed by #63483).

Note: the ReadonlyMap members declared in lib.es2015.iterable.d.ts (entries, keys, values and [Symbol.iterator]) are already documented; only the four members declared in lib.es2015.collection.d.ts lack documentation.

Sample Code
declare const m: ReadonlyMap<string, number>;

// Hover any of these: no documentation is shown
m.get("a");
m.has("a");
m.size;
m.forEach(v => console.log(v));
Documentation Link

No response

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

打开 lib.es2015.collection.d.ts,将 Map<K, V> 中有文档说明的成员与 ReadonlyMap<K, V> 上的 forEach、get、has 和 size 进行比较。检查来自 #63481/#63483 的 ReadonlySet 文档变更是否一致。完成的标准是,编辑器悬停提示会显示全部四个 ReadonlyMap 成员的描述,并且与对应的 Map 文档匹配。

由索引模型根据 Issue 内容生成。

评估

技术栈
typescript
领域
documentation
Issue 类型
文档
难度
1/5
预计耗时
1 小时以内
活跃度
冷清
描述清晰度
描述清楚
新手友好度
90/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。