Skip to content

Commit 7f3db5c

Browse files
Added overloads for 'map' on tuple types.
1 parent d1416de commit 7f3db5c

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

src/lib/es5.d.ts

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1200,6 +1200,30 @@ interface Array<T> {
12001200
* @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.
12011201
*/
12021202
forEach(callbackfn: (value: T, index: number, array: T[]) => void, thisArg?: any): void;
1203+
/**
1204+
* Calls a defined callback function on each element of an array, and returns an array that contains the results.
1205+
* @param callbackfn A function that accepts up to three arguments. The map method calls the callbackfn function one time for each element in the array.
1206+
* @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.
1207+
*/
1208+
map<U>(this: [T, T, T, T, T], callbackfn: (value: T, index: number, array: T[]) => U, thisArg?: any): [U, U, U, U, U];
1209+
/**
1210+
* Calls a defined callback function on each element of an array, and returns an array that contains the results.
1211+
* @param callbackfn A function that accepts up to three arguments. The map method calls the callbackfn function one time for each element in the array.
1212+
* @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.
1213+
*/
1214+
map<U>(this: [T, T, T, T], callbackfn: (value: T, index: number, array: T[]) => U, thisArg?: any): [U, U, U, U];
1215+
/**
1216+
* Calls a defined callback function on each element of an array, and returns an array that contains the results.
1217+
* @param callbackfn A function that accepts up to three arguments. The map method calls the callbackfn function one time for each element in the array.
1218+
* @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.
1219+
*/
1220+
map<U>(this: [T, T, T], callbackfn: (value: T, index: number, array: T[]) => U, thisArg?: any): [U, U, U];
1221+
/**
1222+
* Calls a defined callback function on each element of an array, and returns an array that contains the results.
1223+
* @param callbackfn A function that accepts up to three arguments. The map method calls the callbackfn function one time for each element in the array.
1224+
* @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.
1225+
*/
1226+
map<U>(this: [T, T], callbackfn: (value: T, index: number, array: T[]) => U, thisArg?: any): [U, U];
12031227
/**
12041228
* Calls a defined callback function on each element of an array, and returns an array that contains the results.
12051229
* @param callbackfn A function that accepts up to three arguments. The map method calls the callbackfn function one time for each element in the array.

0 commit comments

Comments
 (0)