Skip to content

ReadonlyMap lacks documentation for forEach, get, has and size #63710

Description

@KimMaru10

⚙ 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Domain: lib.d.tsThe issue relates to the different libraries shipped with TypeScriptPossible ImprovementThe current behavior isn't wrong, but it's possible to see that it might be better in some cases

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions