Skip to content

Commit af05e46

Browse files
Added overloads for typed array constructors to take an 'Iterable<number>'.
1 parent 0efa859 commit af05e46

2 files changed

Lines changed: 10 additions & 1 deletion

File tree

src/lib/core.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3822,4 +3822,4 @@ interface Float64ArrayConstructor {
38223822
*/
38233823
from(arrayLike: ArrayLike<number>, mapfn?: (v: number, k: number) => number, thisArg?: any): Float64Array;
38243824
}
3825-
declare var Float64Array: Float64ArrayConstructor;
3825+
declare var Float64Array: Float64ArrayConstructor;

src/lib/es6.d.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -885,6 +885,7 @@ interface Int8Array {
885885
}
886886

887887
interface Int8ArrayConstructor {
888+
new (elements: Iterable<number>): Int8Array;
888889
/**
889890
* Creates an array from an array-like or iterable object.
890891
* @param arrayLike An array-like or iterable object to convert to an array.
@@ -915,6 +916,7 @@ interface Uint8Array {
915916
}
916917

917918
interface Uint8ArrayConstructor {
919+
new (elements: Iterable<number>): Uint8Array;
918920
/**
919921
* Creates an array from an array-like or iterable object.
920922
* @param arrayLike An array-like or iterable object to convert to an array.
@@ -948,6 +950,7 @@ interface Uint8ClampedArray {
948950
}
949951

950952
interface Uint8ClampedArrayConstructor {
953+
new (elements: Iterable<number>): Uint8ClampedArray;
951954

952955
/**
953956
* Creates an array from an array-like or iterable object.
@@ -983,6 +986,7 @@ interface Int16Array {
983986
}
984987

985988
interface Int16ArrayConstructor {
989+
new (elements: Iterable<number>): Int16Array;
986990
/**
987991
* Creates an array from an array-like or iterable object.
988992
* @param arrayLike An array-like or iterable object to convert to an array.
@@ -1013,6 +1017,7 @@ interface Uint16Array {
10131017
}
10141018

10151019
interface Uint16ArrayConstructor {
1020+
new (elements: Iterable<number>): Uint16Array;
10161021
/**
10171022
* Creates an array from an array-like or iterable object.
10181023
* @param arrayLike An array-like or iterable object to convert to an array.
@@ -1043,6 +1048,7 @@ interface Int32Array {
10431048
}
10441049

10451050
interface Int32ArrayConstructor {
1051+
new (elements: Iterable<number>): Int32Array;
10461052
/**
10471053
* Creates an array from an array-like or iterable object.
10481054
* @param arrayLike An array-like or iterable object to convert to an array.
@@ -1073,6 +1079,7 @@ interface Uint32Array {
10731079
}
10741080

10751081
interface Uint32ArrayConstructor {
1082+
new (elements: Iterable<number>): Uint32Array;
10761083
/**
10771084
* Creates an array from an array-like or iterable object.
10781085
* @param arrayLike An array-like or iterable object to convert to an array.
@@ -1103,6 +1110,7 @@ interface Float32Array {
11031110
}
11041111

11051112
interface Float32ArrayConstructor {
1113+
new (elements: Iterable<number>): Float32Array;
11061114
/**
11071115
* Creates an array from an array-like or iterable object.
11081116
* @param arrayLike An array-like or iterable object to convert to an array.
@@ -1133,6 +1141,7 @@ interface Float64Array {
11331141
}
11341142

11351143
interface Float64ArrayConstructor {
1144+
new (elements: Iterable<number>): Float64Array;
11361145
/**
11371146
* Creates an array from an array-like or iterable object.
11381147
* @param arrayLike An array-like or iterable object to convert to an array.

0 commit comments

Comments
 (0)