Skip to content

Commit 29d85cd

Browse files
committed
Merge remote-tracking branch 'origin/master' into go_to_implementation_pr
2 parents 4eef417 + 9d8d2b6 commit 29d85cd

File tree

3 files changed

+26
-13
lines changed

3 files changed

+26
-13
lines changed

src/lib/es2015.collection.d.ts

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
interface Map<K, V> {
22
clear(): void;
33
delete(key: K): boolean;
4-
forEach(callbackfn: (value: V, index: K, map: Map<K, V>) => void, thisArg?: any): void;
4+
forEach(callbackfn: (value: V, key: K, map: Map<K, V>) => void, thisArg?: any): void;
55
get(key: K): V | undefined;
66
has(key: K): boolean;
77
set(key: K, value?: V): this;
@@ -15,6 +15,13 @@ interface MapConstructor {
1515
}
1616
declare var Map: MapConstructor;
1717

18+
interface ReadonlyMap<K, V> {
19+
forEach(callbackfn: (value: V, key: K, map: ReadonlyMap<K, V>) => void, thisArg?: any): void;
20+
get(key: K): V|undefined;
21+
has(key: K): boolean;
22+
readonly size: number;
23+
}
24+
1825
interface WeakMap<K, V> {
1926
delete(key: K): boolean;
2027
get(key: K): V | undefined;
@@ -33,7 +40,7 @@ interface Set<T> {
3340
add(value: T): this;
3441
clear(): void;
3542
delete(value: T): boolean;
36-
forEach(callbackfn: (value: T, index: T, set: Set<T>) => void, thisArg?: any): void;
43+
forEach(callbackfn: (value: T, value2: T, set: Set<T>) => void, thisArg?: any): void;
3744
has(value: T): boolean;
3845
readonly size: number;
3946
}
@@ -45,6 +52,12 @@ interface SetConstructor {
4552
}
4653
declare var Set: SetConstructor;
4754

55+
interface ReadonlySet<T> {
56+
forEach(callbackfn: (value: T, value2: T, set: ReadonlySet<T>) => void, thisArg?: any): void;
57+
has(value: T): boolean;
58+
readonly size: number;
59+
}
60+
4861
interface WeakSet<T> {
4962
add(value: T): this;
5063
delete(value: T): boolean;

src/lib/es2015.core.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ interface Array<T> {
2121
* @param thisArg If provided, it will be used as the this value for each invocation of
2222
* predicate. If it is not provided, undefined is used instead.
2323
*/
24-
findIndex(predicate: (value: T) => boolean, thisArg?: any): number;
24+
findIndex(predicate: (value: T, index: number, obj: Array<T>) => boolean, thisArg?: any): number;
2525

2626
/**
2727
* Returns the this object after filling the section identified by start and end with value
@@ -368,7 +368,7 @@ interface ReadonlyArray<T> {
368368
* @param thisArg If provided, it will be used as the this value for each invocation of
369369
* predicate. If it is not provided, undefined is used instead.
370370
*/
371-
findIndex(predicate: (value: T) => boolean, thisArg?: any): number;
371+
findIndex(predicate: (value: T, index: number, obj: Array<T>) => boolean, thisArg?: any): number;
372372
}
373373

374374
interface RegExp {

src/lib/es5.d.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1576,7 +1576,7 @@ interface Int8Array {
15761576
* @param thisArg If provided, it will be used as the this value for each invocation of
15771577
* predicate. If it is not provided, undefined is used instead.
15781578
*/
1579-
findIndex(predicate: (value: number) => boolean, thisArg?: any): number;
1579+
findIndex(predicate: (value: number, index: number, obj: Array<number>) => boolean, thisArg?: any): number;
15801580

15811581
/**
15821582
* Performs the specified action for each element in an array.
@@ -1849,7 +1849,7 @@ interface Uint8Array {
18491849
* @param thisArg If provided, it will be used as the this value for each invocation of
18501850
* predicate. If it is not provided, undefined is used instead.
18511851
*/
1852-
findIndex(predicate: (value: number) => boolean, thisArg?: any): number;
1852+
findIndex(predicate: (value: number, index: number, obj: Array<number>) => boolean, thisArg?: any): number;
18531853

18541854
/**
18551855
* Performs the specified action for each element in an array.
@@ -2123,7 +2123,7 @@ interface Uint8ClampedArray {
21232123
* @param thisArg If provided, it will be used as the this value for each invocation of
21242124
* predicate. If it is not provided, undefined is used instead.
21252125
*/
2126-
findIndex(predicate: (value: number) => boolean, thisArg?: any): number;
2126+
findIndex(predicate: (value: number, index: number, obj: Array<number>) => boolean, thisArg?: any): number;
21272127

21282128
/**
21292129
* Performs the specified action for each element in an array.
@@ -2396,7 +2396,7 @@ interface Int16Array {
23962396
* @param thisArg If provided, it will be used as the this value for each invocation of
23972397
* predicate. If it is not provided, undefined is used instead.
23982398
*/
2399-
findIndex(predicate: (value: number) => boolean, thisArg?: any): number;
2399+
findIndex(predicate: (value: number, index: number, obj: Array<number>) => boolean, thisArg?: any): number;
24002400

24012401
/**
24022402
* Performs the specified action for each element in an array.
@@ -2670,7 +2670,7 @@ interface Uint16Array {
26702670
* @param thisArg If provided, it will be used as the this value for each invocation of
26712671
* predicate. If it is not provided, undefined is used instead.
26722672
*/
2673-
findIndex(predicate: (value: number) => boolean, thisArg?: any): number;
2673+
findIndex(predicate: (value: number, index: number, obj: Array<number>) => boolean, thisArg?: any): number;
26742674

26752675
/**
26762676
* Performs the specified action for each element in an array.
@@ -2943,7 +2943,7 @@ interface Int32Array {
29432943
* @param thisArg If provided, it will be used as the this value for each invocation of
29442944
* predicate. If it is not provided, undefined is used instead.
29452945
*/
2946-
findIndex(predicate: (value: number) => boolean, thisArg?: any): number;
2946+
findIndex(predicate: (value: number, index: number, obj: Array<number>) => boolean, thisArg?: any): number;
29472947

29482948
/**
29492949
* Performs the specified action for each element in an array.
@@ -3216,7 +3216,7 @@ interface Uint32Array {
32163216
* @param thisArg If provided, it will be used as the this value for each invocation of
32173217
* predicate. If it is not provided, undefined is used instead.
32183218
*/
3219-
findIndex(predicate: (value: number) => boolean, thisArg?: any): number;
3219+
findIndex(predicate: (value: number, index: number, obj: Array<number>) => boolean, thisArg?: any): number;
32203220

32213221
/**
32223222
* Performs the specified action for each element in an array.
@@ -3489,7 +3489,7 @@ interface Float32Array {
34893489
* @param thisArg If provided, it will be used as the this value for each invocation of
34903490
* predicate. If it is not provided, undefined is used instead.
34913491
*/
3492-
findIndex(predicate: (value: number) => boolean, thisArg?: any): number;
3492+
findIndex(predicate: (value: number, index: number, obj: Array<number>) => boolean, thisArg?: any): number;
34933493

34943494
/**
34953495
* Performs the specified action for each element in an array.
@@ -3763,7 +3763,7 @@ interface Float64Array {
37633763
* @param thisArg If provided, it will be used as the this value for each invocation of
37643764
* predicate. If it is not provided, undefined is used instead.
37653765
*/
3766-
findIndex(predicate: (value: number) => boolean, thisArg?: any): number;
3766+
findIndex(predicate: (value: number, index: number, obj: Array<number>) => boolean, thisArg?: any): number;
37673767

37683768
/**
37693769
* Performs the specified action for each element in an array.

0 commit comments

Comments
 (0)