Add valueOf declarations for TypedArrays (#36668)

This commit is contained in:
Cayman
2020-03-13 21:50:16 +01:00
committed by GitHub
parent 4c160683c3
commit 4432178ded
6 changed files with 236 additions and 0 deletions

View File

@@ -268,6 +268,9 @@ interface BigInt64Array {
/** Returns a string representation of the array. */
toString(): string;
/** Returns the primitive value of the specified object. */
valueOf(): BigInt64Array;
/** Yields each value in the array. */
values(): IterableIterator<bigint>;
@@ -537,6 +540,9 @@ interface BigUint64Array {
/** Returns a string representation of the array. */
toString(): string;
/** Returns the primitive value of the specified object. */
valueOf(): BigUint64Array;
/** Yields each value in the array. */
values(): IterableIterator<bigint>;

27
src/lib/es5.d.ts vendored
View File

@@ -1920,6 +1920,9 @@ interface Int8Array {
*/
toString(): string;
/** Returns the primitive value of the specified object. */
valueOf(): Int8Array;
[index: number]: number;
}
interface Int8ArrayConstructor {
@@ -2199,6 +2202,9 @@ interface Uint8Array {
*/
toString(): string;
/** Returns the primitive value of the specified object. */
valueOf(): Uint8Array;
[index: number]: number;
}
@@ -2478,6 +2484,9 @@ interface Uint8ClampedArray {
*/
toString(): string;
/** Returns the primitive value of the specified object. */
valueOf(): Uint8ClampedArray;
[index: number]: number;
}
@@ -2755,6 +2764,9 @@ interface Int16Array {
*/
toString(): string;
/** Returns the primitive value of the specified object. */
valueOf(): Int16Array;
[index: number]: number;
}
@@ -3035,6 +3047,9 @@ interface Uint16Array {
*/
toString(): string;
/** Returns the primitive value of the specified object. */
valueOf(): Uint16Array;
[index: number]: number;
}
@@ -3314,6 +3329,9 @@ interface Int32Array {
*/
toString(): string;
/** Returns the primitive value of the specified object. */
valueOf(): Int32Array;
[index: number]: number;
}
@@ -3592,6 +3610,9 @@ interface Uint32Array {
*/
toString(): string;
/** Returns the primitive value of the specified object. */
valueOf(): Uint32Array;
[index: number]: number;
}
@@ -3871,6 +3892,9 @@ interface Float32Array {
*/
toString(): string;
/** Returns the primitive value of the specified object. */
valueOf(): Float32Array;
[index: number]: number;
}
@@ -4142,6 +4166,9 @@ interface Float64Array {
toString(): string;
/** Returns the primitive value of the specified object. */
valueOf(): Float64Array;
[index: number]: number;
}