Skip to content

Commit 34ff3ce

Browse files
committed
Add missing JSDoc to ReadonlySet and ReadonlyMap members
1 parent f3d3968 commit 34ff3ce

1 file changed

Lines changed: 22 additions & 0 deletions

File tree

src/lib/es2015.collection.d.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,22 @@ interface MapConstructor {
3838
declare var Map: MapConstructor;
3939

4040
interface ReadonlyMap<K, V> {
41+
/**
42+
* Executes a provided function once per each key/value pair in the Map, in insertion order.
43+
*/
4144
forEach(callbackfn: (value: V, key: K, map: ReadonlyMap<K, V>) => void, thisArg?: any): void;
45+
/**
46+
* Returns a specified element from the Map object. If the value that is associated to the provided key is an object, then you will get a reference to that object and any change made to that object will effectively modify it inside the Map.
47+
* @returns Returns the element associated with the specified key. If no element is associated with the specified key, undefined is returned.
48+
*/
4249
get(key: K): V | undefined;
50+
/**
51+
* @returns boolean indicating whether an element with the specified key exists or not.
52+
*/
4353
has(key: K): boolean;
54+
/**
55+
* @returns the number of elements in the Map.
56+
*/
4457
readonly size: number;
4558
}
4659

@@ -106,8 +119,17 @@ interface SetConstructor {
106119
declare var Set: SetConstructor;
107120

108121
interface ReadonlySet<T> {
122+
/**
123+
* Executes a provided function once per each value in the Set object, in insertion order.
124+
*/
109125
forEach(callbackfn: (value: T, value2: T, set: ReadonlySet<T>) => void, thisArg?: any): void;
126+
/**
127+
* @returns a boolean indicating whether an element with the specified value exists in the Set or not.
128+
*/
110129
has(value: T): boolean;
130+
/**
131+
* @returns the number of (unique) elements in the Set.
132+
*/
111133
readonly size: number;
112134
}
113135

0 commit comments

Comments
 (0)