typescript 5.7.0-dev.20240923 → 5.7.0-dev.20240925

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/lib.es5.d.ts CHANGED
@@ -1719,25 +1719,25 @@ interface ArrayBufferConstructor {
1719
1719
  }
1720
1720
  declare var ArrayBuffer: ArrayBufferConstructor;
1721
1721
 
1722
- interface ArrayBufferView {
1722
+ interface ArrayBufferView<TArrayBuffer extends ArrayBufferLike = ArrayBufferLike> {
1723
1723
  /**
1724
1724
  * The ArrayBuffer instance referenced by the array.
1725
1725
  */
1726
- buffer: ArrayBufferLike;
1726
+ readonly buffer: TArrayBuffer;
1727
1727
 
1728
1728
  /**
1729
1729
  * The length in bytes of the array.
1730
1730
  */
1731
- byteLength: number;
1731
+ readonly byteLength: number;
1732
1732
 
1733
1733
  /**
1734
1734
  * The offset in bytes of the array.
1735
1735
  */
1736
- byteOffset: number;
1736
+ readonly byteOffset: number;
1737
1737
  }
1738
1738
 
1739
- interface DataView {
1740
- readonly buffer: ArrayBuffer;
1739
+ interface DataView<TArrayBuffer extends ArrayBufferLike = ArrayBufferLike> {
1740
+ readonly buffer: TArrayBuffer;
1741
1741
  readonly byteLength: number;
1742
1742
  readonly byteOffset: number;
1743
1743
  /**
@@ -1863,10 +1863,9 @@ interface DataView {
1863
1863
  */
1864
1864
  setUint32(byteOffset: number, value: number, littleEndian?: boolean): void;
1865
1865
  }
1866
-
1867
1866
  interface DataViewConstructor {
1868
- readonly prototype: DataView;
1869
- new (buffer: ArrayBufferLike & { BYTES_PER_ELEMENT?: never; }, byteOffset?: number, byteLength?: number): DataView;
1867
+ readonly prototype: DataView<ArrayBufferLike>;
1868
+ new <TArrayBuffer extends ArrayBufferLike & { BYTES_PER_ELEMENT?: never; }>(buffer: TArrayBuffer, byteOffset?: number, byteLength?: number): DataView<TArrayBuffer>;
1870
1869
  }
1871
1870
  declare var DataView: DataViewConstructor;
1872
1871
 
@@ -1874,7 +1873,7 @@ declare var DataView: DataViewConstructor;
1874
1873
  * A typed array of 8-bit integer values. The contents are initialized to 0. If the requested
1875
1874
  * number of bytes could not be allocated an exception is raised.
1876
1875
  */
1877
- interface Int8Array {
1876
+ interface Int8Array<TArrayBuffer extends ArrayBufferLike = ArrayBufferLike> {
1878
1877
  /**
1879
1878
  * The size in bytes of each element in the array.
1880
1879
  */
@@ -1883,7 +1882,7 @@ interface Int8Array {
1883
1882
  /**
1884
1883
  * The ArrayBuffer instance referenced by the array.
1885
1884
  */
1886
- readonly buffer: ArrayBufferLike;
1885
+ readonly buffer: TArrayBuffer;
1887
1886
 
1888
1887
  /**
1889
1888
  * The length in bytes of the array.
@@ -1914,7 +1913,7 @@ interface Int8Array {
1914
1913
  * @param thisArg An object to which the this keyword can refer in the predicate function.
1915
1914
  * If thisArg is omitted, undefined is used as the this value.
1916
1915
  */
1917
- every(predicate: (value: number, index: number, array: Int8Array) => unknown, thisArg?: any): boolean;
1916
+ every(predicate: (value: number, index: number, array: this) => unknown, thisArg?: any): boolean;
1918
1917
 
1919
1918
  /**
1920
1919
  * Changes all array elements from `start` to `end` index to a static `value` and returns the modified array
@@ -1933,7 +1932,7 @@ interface Int8Array {
1933
1932
  * @param thisArg An object to which the this keyword can refer in the predicate function.
1934
1933
  * If thisArg is omitted, undefined is used as the this value.
1935
1934
  */
1936
- filter(predicate: (value: number, index: number, array: Int8Array) => any, thisArg?: any): Int8Array;
1935
+ filter(predicate: (value: number, index: number, array: this) => any, thisArg?: any): Int8Array<ArrayBuffer>;
1937
1936
 
1938
1937
  /**
1939
1938
  * Returns the value of the first element in the array where predicate is true, and undefined
@@ -1944,7 +1943,7 @@ interface Int8Array {
1944
1943
  * @param thisArg If provided, it will be used as the this value for each invocation of
1945
1944
  * predicate. If it is not provided, undefined is used instead.
1946
1945
  */
1947
- find(predicate: (value: number, index: number, obj: Int8Array) => boolean, thisArg?: any): number | undefined;
1946
+ find(predicate: (value: number, index: number, obj: this) => boolean, thisArg?: any): number | undefined;
1948
1947
 
1949
1948
  /**
1950
1949
  * Returns the index of the first element in the array where predicate is true, and -1
@@ -1955,7 +1954,7 @@ interface Int8Array {
1955
1954
  * @param thisArg If provided, it will be used as the this value for each invocation of
1956
1955
  * predicate. If it is not provided, undefined is used instead.
1957
1956
  */
1958
- findIndex(predicate: (value: number, index: number, obj: Int8Array) => boolean, thisArg?: any): number;
1957
+ findIndex(predicate: (value: number, index: number, obj: this) => boolean, thisArg?: any): number;
1959
1958
 
1960
1959
  /**
1961
1960
  * Performs the specified action for each element in an array.
@@ -1964,7 +1963,7 @@ interface Int8Array {
1964
1963
  * @param thisArg An object to which the this keyword can refer in the callbackfn function.
1965
1964
  * If thisArg is omitted, undefined is used as the this value.
1966
1965
  */
1967
- forEach(callbackfn: (value: number, index: number, array: Int8Array) => void, thisArg?: any): void;
1966
+ forEach(callbackfn: (value: number, index: number, array: this) => void, thisArg?: any): void;
1968
1967
 
1969
1968
  /**
1970
1969
  * Returns the index of the first occurrence of a value in an array.
@@ -2002,7 +2001,7 @@ interface Int8Array {
2002
2001
  * @param thisArg An object to which the this keyword can refer in the callbackfn function.
2003
2002
  * If thisArg is omitted, undefined is used as the this value.
2004
2003
  */
2005
- map(callbackfn: (value: number, index: number, array: Int8Array) => number, thisArg?: any): Int8Array;
2004
+ map(callbackfn: (value: number, index: number, array: this) => number, thisArg?: any): Int8Array<ArrayBuffer>;
2006
2005
 
2007
2006
  /**
2008
2007
  * Calls the specified callback function for all the elements in an array. The return value of
@@ -2014,8 +2013,8 @@ interface Int8Array {
2014
2013
  * the accumulation. The first call to the callbackfn function provides this value as an argument
2015
2014
  * instead of an array value.
2016
2015
  */
2017
- reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int8Array) => number): number;
2018
- reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int8Array) => number, initialValue: number): number;
2016
+ reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: this) => number): number;
2017
+ reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: this) => number, initialValue: number): number;
2019
2018
 
2020
2019
  /**
2021
2020
  * Calls the specified callback function for all the elements in an array. The return value of
@@ -2027,7 +2026,7 @@ interface Int8Array {
2027
2026
  * the accumulation. The first call to the callbackfn function provides this value as an argument
2028
2027
  * instead of an array value.
2029
2028
  */
2030
- reduce<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int8Array) => U, initialValue: U): U;
2029
+ reduce<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: this) => U, initialValue: U): U;
2031
2030
 
2032
2031
  /**
2033
2032
  * Calls the specified callback function for all the elements in an array, in descending order.
@@ -2039,8 +2038,8 @@ interface Int8Array {
2039
2038
  * the accumulation. The first call to the callbackfn function provides this value as an
2040
2039
  * argument instead of an array value.
2041
2040
  */
2042
- reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int8Array) => number): number;
2043
- reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int8Array) => number, initialValue: number): number;
2041
+ reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: this) => number): number;
2042
+ reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: this) => number, initialValue: number): number;
2044
2043
 
2045
2044
  /**
2046
2045
  * Calls the specified callback function for all the elements in an array, in descending order.
@@ -2052,12 +2051,12 @@ interface Int8Array {
2052
2051
  * the accumulation. The first call to the callbackfn function provides this value as an argument
2053
2052
  * instead of an array value.
2054
2053
  */
2055
- reduceRight<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int8Array) => U, initialValue: U): U;
2054
+ reduceRight<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: this) => U, initialValue: U): U;
2056
2055
 
2057
2056
  /**
2058
2057
  * Reverses the elements in an Array.
2059
2058
  */
2060
- reverse(): Int8Array;
2059
+ reverse(): this;
2061
2060
 
2062
2061
  /**
2063
2062
  * Sets a value or an array of values.
@@ -2071,7 +2070,7 @@ interface Int8Array {
2071
2070
  * @param start The beginning of the specified portion of the array.
2072
2071
  * @param end The end of the specified portion of the array. This is exclusive of the element at the index 'end'.
2073
2072
  */
2074
- slice(start?: number, end?: number): Int8Array;
2073
+ slice(start?: number, end?: number): Int8Array<ArrayBuffer>;
2075
2074
 
2076
2075
  /**
2077
2076
  * Determines whether the specified callback function returns true for any element of an array.
@@ -2081,7 +2080,7 @@ interface Int8Array {
2081
2080
  * @param thisArg An object to which the this keyword can refer in the predicate function.
2082
2081
  * If thisArg is omitted, undefined is used as the this value.
2083
2082
  */
2084
- some(predicate: (value: number, index: number, array: Int8Array) => unknown, thisArg?: any): boolean;
2083
+ some(predicate: (value: number, index: number, array: this) => unknown, thisArg?: any): boolean;
2085
2084
 
2086
2085
  /**
2087
2086
  * Sorts an array.
@@ -2100,7 +2099,7 @@ interface Int8Array {
2100
2099
  * @param begin The index of the beginning of the array.
2101
2100
  * @param end The index of the end of the array.
2102
2101
  */
2103
- subarray(begin?: number, end?: number): Int8Array;
2102
+ subarray(begin?: number, end?: number): Int8Array<TArrayBuffer>;
2104
2103
 
2105
2104
  /**
2106
2105
  * Converts a number to a string by using the current locale.
@@ -2113,15 +2112,16 @@ interface Int8Array {
2113
2112
  toString(): string;
2114
2113
 
2115
2114
  /** Returns the primitive value of the specified object. */
2116
- valueOf(): Int8Array;
2115
+ valueOf(): this;
2117
2116
 
2118
2117
  [index: number]: number;
2119
2118
  }
2120
2119
  interface Int8ArrayConstructor {
2121
- readonly prototype: Int8Array;
2122
- new (length: number): Int8Array;
2123
- new (array: ArrayLike<number> | ArrayBufferLike): Int8Array;
2124
- new (buffer: ArrayBufferLike, byteOffset?: number, length?: number): Int8Array;
2120
+ readonly prototype: Int8Array<ArrayBufferLike>;
2121
+ new (length: number): Int8Array<ArrayBuffer>;
2122
+ new (array: ArrayLike<number>): Int8Array<ArrayBuffer>;
2123
+ new <TArrayBuffer extends ArrayBufferLike = ArrayBuffer>(buffer: TArrayBuffer, byteOffset?: number, length?: number): Int8Array<TArrayBuffer>;
2124
+ new (array: ArrayLike<number> | ArrayBuffer): Int8Array<ArrayBuffer>;
2125
2125
 
2126
2126
  /**
2127
2127
  * The size in bytes of each element in the array.
@@ -2132,13 +2132,13 @@ interface Int8ArrayConstructor {
2132
2132
  * Returns a new array from a set of elements.
2133
2133
  * @param items A set of elements to include in the new array object.
2134
2134
  */
2135
- of(...items: number[]): Int8Array;
2135
+ of(...items: number[]): Int8Array<ArrayBuffer>;
2136
2136
 
2137
2137
  /**
2138
2138
  * Creates an array from an array-like or iterable object.
2139
2139
  * @param arrayLike An array-like or iterable object to convert to an array.
2140
2140
  */
2141
- from(arrayLike: ArrayLike<number>): Int8Array;
2141
+ from(arrayLike: ArrayLike<number>): Int8Array<ArrayBuffer>;
2142
2142
 
2143
2143
  /**
2144
2144
  * Creates an array from an array-like or iterable object.
@@ -2146,7 +2146,7 @@ interface Int8ArrayConstructor {
2146
2146
  * @param mapfn A mapping function to call on every element of the array.
2147
2147
  * @param thisArg Value of 'this' used to invoke the mapfn.
2148
2148
  */
2149
- from<T>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => number, thisArg?: any): Int8Array;
2149
+ from<T>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => number, thisArg?: any): Int8Array<ArrayBuffer>;
2150
2150
  }
2151
2151
  declare var Int8Array: Int8ArrayConstructor;
2152
2152
 
@@ -2154,7 +2154,7 @@ declare var Int8Array: Int8ArrayConstructor;
2154
2154
  * A typed array of 8-bit unsigned integer values. The contents are initialized to 0. If the
2155
2155
  * requested number of bytes could not be allocated an exception is raised.
2156
2156
  */
2157
- interface Uint8Array {
2157
+ interface Uint8Array<TArrayBuffer extends ArrayBufferLike = ArrayBufferLike> {
2158
2158
  /**
2159
2159
  * The size in bytes of each element in the array.
2160
2160
  */
@@ -2163,7 +2163,7 @@ interface Uint8Array {
2163
2163
  /**
2164
2164
  * The ArrayBuffer instance referenced by the array.
2165
2165
  */
2166
- readonly buffer: ArrayBufferLike;
2166
+ readonly buffer: TArrayBuffer;
2167
2167
 
2168
2168
  /**
2169
2169
  * The length in bytes of the array.
@@ -2194,7 +2194,7 @@ interface Uint8Array {
2194
2194
  * @param thisArg An object to which the this keyword can refer in the predicate function.
2195
2195
  * If thisArg is omitted, undefined is used as the this value.
2196
2196
  */
2197
- every(predicate: (value: number, index: number, array: Uint8Array) => unknown, thisArg?: any): boolean;
2197
+ every(predicate: (value: number, index: number, array: this) => unknown, thisArg?: any): boolean;
2198
2198
 
2199
2199
  /**
2200
2200
  * Changes all array elements from `start` to `end` index to a static `value` and returns the modified array
@@ -2213,7 +2213,7 @@ interface Uint8Array {
2213
2213
  * @param thisArg An object to which the this keyword can refer in the predicate function.
2214
2214
  * If thisArg is omitted, undefined is used as the this value.
2215
2215
  */
2216
- filter(predicate: (value: number, index: number, array: Uint8Array) => any, thisArg?: any): Uint8Array;
2216
+ filter(predicate: (value: number, index: number, array: this) => any, thisArg?: any): Uint8Array<ArrayBuffer>;
2217
2217
 
2218
2218
  /**
2219
2219
  * Returns the value of the first element in the array where predicate is true, and undefined
@@ -2224,7 +2224,7 @@ interface Uint8Array {
2224
2224
  * @param thisArg If provided, it will be used as the this value for each invocation of
2225
2225
  * predicate. If it is not provided, undefined is used instead.
2226
2226
  */
2227
- find(predicate: (value: number, index: number, obj: Uint8Array) => boolean, thisArg?: any): number | undefined;
2227
+ find(predicate: (value: number, index: number, obj: this) => boolean, thisArg?: any): number | undefined;
2228
2228
 
2229
2229
  /**
2230
2230
  * Returns the index of the first element in the array where predicate is true, and -1
@@ -2235,7 +2235,7 @@ interface Uint8Array {
2235
2235
  * @param thisArg If provided, it will be used as the this value for each invocation of
2236
2236
  * predicate. If it is not provided, undefined is used instead.
2237
2237
  */
2238
- findIndex(predicate: (value: number, index: number, obj: Uint8Array) => boolean, thisArg?: any): number;
2238
+ findIndex(predicate: (value: number, index: number, obj: this) => boolean, thisArg?: any): number;
2239
2239
 
2240
2240
  /**
2241
2241
  * Performs the specified action for each element in an array.
@@ -2244,7 +2244,7 @@ interface Uint8Array {
2244
2244
  * @param thisArg An object to which the this keyword can refer in the callbackfn function.
2245
2245
  * If thisArg is omitted, undefined is used as the this value.
2246
2246
  */
2247
- forEach(callbackfn: (value: number, index: number, array: Uint8Array) => void, thisArg?: any): void;
2247
+ forEach(callbackfn: (value: number, index: number, array: this) => void, thisArg?: any): void;
2248
2248
 
2249
2249
  /**
2250
2250
  * Returns the index of the first occurrence of a value in an array.
@@ -2282,7 +2282,7 @@ interface Uint8Array {
2282
2282
  * @param thisArg An object to which the this keyword can refer in the callbackfn function.
2283
2283
  * If thisArg is omitted, undefined is used as the this value.
2284
2284
  */
2285
- map(callbackfn: (value: number, index: number, array: Uint8Array) => number, thisArg?: any): Uint8Array;
2285
+ map(callbackfn: (value: number, index: number, array: this) => number, thisArg?: any): Uint8Array<ArrayBuffer>;
2286
2286
 
2287
2287
  /**
2288
2288
  * Calls the specified callback function for all the elements in an array. The return value of
@@ -2294,8 +2294,8 @@ interface Uint8Array {
2294
2294
  * the accumulation. The first call to the callbackfn function provides this value as an argument
2295
2295
  * instead of an array value.
2296
2296
  */
2297
- reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8Array) => number): number;
2298
- reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8Array) => number, initialValue: number): number;
2297
+ reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: this) => number): number;
2298
+ reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: this) => number, initialValue: number): number;
2299
2299
 
2300
2300
  /**
2301
2301
  * Calls the specified callback function for all the elements in an array. The return value of
@@ -2307,7 +2307,7 @@ interface Uint8Array {
2307
2307
  * the accumulation. The first call to the callbackfn function provides this value as an argument
2308
2308
  * instead of an array value.
2309
2309
  */
2310
- reduce<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint8Array) => U, initialValue: U): U;
2310
+ reduce<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: this) => U, initialValue: U): U;
2311
2311
 
2312
2312
  /**
2313
2313
  * Calls the specified callback function for all the elements in an array, in descending order.
@@ -2319,8 +2319,8 @@ interface Uint8Array {
2319
2319
  * the accumulation. The first call to the callbackfn function provides this value as an
2320
2320
  * argument instead of an array value.
2321
2321
  */
2322
- reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8Array) => number): number;
2323
- reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8Array) => number, initialValue: number): number;
2322
+ reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: this) => number): number;
2323
+ reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: this) => number, initialValue: number): number;
2324
2324
 
2325
2325
  /**
2326
2326
  * Calls the specified callback function for all the elements in an array, in descending order.
@@ -2332,12 +2332,12 @@ interface Uint8Array {
2332
2332
  * the accumulation. The first call to the callbackfn function provides this value as an argument
2333
2333
  * instead of an array value.
2334
2334
  */
2335
- reduceRight<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint8Array) => U, initialValue: U): U;
2335
+ reduceRight<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: this) => U, initialValue: U): U;
2336
2336
 
2337
2337
  /**
2338
2338
  * Reverses the elements in an Array.
2339
2339
  */
2340
- reverse(): Uint8Array;
2340
+ reverse(): this;
2341
2341
 
2342
2342
  /**
2343
2343
  * Sets a value or an array of values.
@@ -2351,7 +2351,7 @@ interface Uint8Array {
2351
2351
  * @param start The beginning of the specified portion of the array.
2352
2352
  * @param end The end of the specified portion of the array. This is exclusive of the element at the index 'end'.
2353
2353
  */
2354
- slice(start?: number, end?: number): Uint8Array;
2354
+ slice(start?: number, end?: number): Uint8Array<ArrayBuffer>;
2355
2355
 
2356
2356
  /**
2357
2357
  * Determines whether the specified callback function returns true for any element of an array.
@@ -2361,7 +2361,7 @@ interface Uint8Array {
2361
2361
  * @param thisArg An object to which the this keyword can refer in the predicate function.
2362
2362
  * If thisArg is omitted, undefined is used as the this value.
2363
2363
  */
2364
- some(predicate: (value: number, index: number, array: Uint8Array) => unknown, thisArg?: any): boolean;
2364
+ some(predicate: (value: number, index: number, array: this) => unknown, thisArg?: any): boolean;
2365
2365
 
2366
2366
  /**
2367
2367
  * Sorts an array.
@@ -2380,7 +2380,7 @@ interface Uint8Array {
2380
2380
  * @param begin The index of the beginning of the array.
2381
2381
  * @param end The index of the end of the array.
2382
2382
  */
2383
- subarray(begin?: number, end?: number): Uint8Array;
2383
+ subarray(begin?: number, end?: number): Uint8Array<TArrayBuffer>;
2384
2384
 
2385
2385
  /**
2386
2386
  * Converts a number to a string by using the current locale.
@@ -2393,16 +2393,16 @@ interface Uint8Array {
2393
2393
  toString(): string;
2394
2394
 
2395
2395
  /** Returns the primitive value of the specified object. */
2396
- valueOf(): Uint8Array;
2396
+ valueOf(): this;
2397
2397
 
2398
2398
  [index: number]: number;
2399
2399
  }
2400
-
2401
2400
  interface Uint8ArrayConstructor {
2402
- readonly prototype: Uint8Array;
2403
- new (length: number): Uint8Array;
2404
- new (array: ArrayLike<number> | ArrayBufferLike): Uint8Array;
2405
- new (buffer: ArrayBufferLike, byteOffset?: number, length?: number): Uint8Array;
2401
+ readonly prototype: Uint8Array<ArrayBufferLike>;
2402
+ new (length: number): Uint8Array<ArrayBuffer>;
2403
+ new (array: ArrayLike<number>): Uint8Array<ArrayBuffer>;
2404
+ new <TArrayBuffer extends ArrayBufferLike = ArrayBuffer>(buffer: TArrayBuffer, byteOffset?: number, length?: number): Uint8Array<TArrayBuffer>;
2405
+ new (array: ArrayLike<number> | ArrayBuffer): Uint8Array<ArrayBuffer>;
2406
2406
 
2407
2407
  /**
2408
2408
  * The size in bytes of each element in the array.
@@ -2413,13 +2413,13 @@ interface Uint8ArrayConstructor {
2413
2413
  * Returns a new array from a set of elements.
2414
2414
  * @param items A set of elements to include in the new array object.
2415
2415
  */
2416
- of(...items: number[]): Uint8Array;
2416
+ of(...items: number[]): Uint8Array<ArrayBuffer>;
2417
2417
 
2418
2418
  /**
2419
2419
  * Creates an array from an array-like or iterable object.
2420
2420
  * @param arrayLike An array-like or iterable object to convert to an array.
2421
2421
  */
2422
- from(arrayLike: ArrayLike<number>): Uint8Array;
2422
+ from(arrayLike: ArrayLike<number>): Uint8Array<ArrayBuffer>;
2423
2423
 
2424
2424
  /**
2425
2425
  * Creates an array from an array-like or iterable object.
@@ -2427,7 +2427,7 @@ interface Uint8ArrayConstructor {
2427
2427
  * @param mapfn A mapping function to call on every element of the array.
2428
2428
  * @param thisArg Value of 'this' used to invoke the mapfn.
2429
2429
  */
2430
- from<T>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => number, thisArg?: any): Uint8Array;
2430
+ from<T>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => number, thisArg?: any): Uint8Array<ArrayBuffer>;
2431
2431
  }
2432
2432
  declare var Uint8Array: Uint8ArrayConstructor;
2433
2433
 
@@ -2435,7 +2435,7 @@ declare var Uint8Array: Uint8ArrayConstructor;
2435
2435
  * A typed array of 8-bit unsigned integer (clamped) values. The contents are initialized to 0.
2436
2436
  * If the requested number of bytes could not be allocated an exception is raised.
2437
2437
  */
2438
- interface Uint8ClampedArray {
2438
+ interface Uint8ClampedArray<TArrayBuffer extends ArrayBufferLike = ArrayBufferLike> {
2439
2439
  /**
2440
2440
  * The size in bytes of each element in the array.
2441
2441
  */
@@ -2444,7 +2444,7 @@ interface Uint8ClampedArray {
2444
2444
  /**
2445
2445
  * The ArrayBuffer instance referenced by the array.
2446
2446
  */
2447
- readonly buffer: ArrayBufferLike;
2447
+ readonly buffer: TArrayBuffer;
2448
2448
 
2449
2449
  /**
2450
2450
  * The length in bytes of the array.
@@ -2475,7 +2475,7 @@ interface Uint8ClampedArray {
2475
2475
  * @param thisArg An object to which the this keyword can refer in the predicate function.
2476
2476
  * If thisArg is omitted, undefined is used as the this value.
2477
2477
  */
2478
- every(predicate: (value: number, index: number, array: Uint8ClampedArray) => unknown, thisArg?: any): boolean;
2478
+ every(predicate: (value: number, index: number, array: this) => unknown, thisArg?: any): boolean;
2479
2479
 
2480
2480
  /**
2481
2481
  * Changes all array elements from `start` to `end` index to a static `value` and returns the modified array
@@ -2494,7 +2494,7 @@ interface Uint8ClampedArray {
2494
2494
  * @param thisArg An object to which the this keyword can refer in the predicate function.
2495
2495
  * If thisArg is omitted, undefined is used as the this value.
2496
2496
  */
2497
- filter(predicate: (value: number, index: number, array: Uint8ClampedArray) => any, thisArg?: any): Uint8ClampedArray;
2497
+ filter(predicate: (value: number, index: number, array: this) => any, thisArg?: any): Uint8ClampedArray<ArrayBuffer>;
2498
2498
 
2499
2499
  /**
2500
2500
  * Returns the value of the first element in the array where predicate is true, and undefined
@@ -2505,7 +2505,7 @@ interface Uint8ClampedArray {
2505
2505
  * @param thisArg If provided, it will be used as the this value for each invocation of
2506
2506
  * predicate. If it is not provided, undefined is used instead.
2507
2507
  */
2508
- find(predicate: (value: number, index: number, obj: Uint8ClampedArray) => boolean, thisArg?: any): number | undefined;
2508
+ find(predicate: (value: number, index: number, obj: this) => boolean, thisArg?: any): number | undefined;
2509
2509
 
2510
2510
  /**
2511
2511
  * Returns the index of the first element in the array where predicate is true, and -1
@@ -2516,7 +2516,7 @@ interface Uint8ClampedArray {
2516
2516
  * @param thisArg If provided, it will be used as the this value for each invocation of
2517
2517
  * predicate. If it is not provided, undefined is used instead.
2518
2518
  */
2519
- findIndex(predicate: (value: number, index: number, obj: Uint8ClampedArray) => boolean, thisArg?: any): number;
2519
+ findIndex(predicate: (value: number, index: number, obj: this) => boolean, thisArg?: any): number;
2520
2520
 
2521
2521
  /**
2522
2522
  * Performs the specified action for each element in an array.
@@ -2525,7 +2525,7 @@ interface Uint8ClampedArray {
2525
2525
  * @param thisArg An object to which the this keyword can refer in the callbackfn function.
2526
2526
  * If thisArg is omitted, undefined is used as the this value.
2527
2527
  */
2528
- forEach(callbackfn: (value: number, index: number, array: Uint8ClampedArray) => void, thisArg?: any): void;
2528
+ forEach(callbackfn: (value: number, index: number, array: this) => void, thisArg?: any): void;
2529
2529
 
2530
2530
  /**
2531
2531
  * Returns the index of the first occurrence of a value in an array.
@@ -2563,7 +2563,7 @@ interface Uint8ClampedArray {
2563
2563
  * @param thisArg An object to which the this keyword can refer in the callbackfn function.
2564
2564
  * If thisArg is omitted, undefined is used as the this value.
2565
2565
  */
2566
- map(callbackfn: (value: number, index: number, array: Uint8ClampedArray) => number, thisArg?: any): Uint8ClampedArray;
2566
+ map(callbackfn: (value: number, index: number, array: this) => number, thisArg?: any): Uint8ClampedArray<ArrayBuffer>;
2567
2567
 
2568
2568
  /**
2569
2569
  * Calls the specified callback function for all the elements in an array. The return value of
@@ -2575,8 +2575,8 @@ interface Uint8ClampedArray {
2575
2575
  * the accumulation. The first call to the callbackfn function provides this value as an argument
2576
2576
  * instead of an array value.
2577
2577
  */
2578
- reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8ClampedArray) => number): number;
2579
- reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8ClampedArray) => number, initialValue: number): number;
2578
+ reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: this) => number): number;
2579
+ reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: this) => number, initialValue: number): number;
2580
2580
 
2581
2581
  /**
2582
2582
  * Calls the specified callback function for all the elements in an array. The return value of
@@ -2588,7 +2588,7 @@ interface Uint8ClampedArray {
2588
2588
  * the accumulation. The first call to the callbackfn function provides this value as an argument
2589
2589
  * instead of an array value.
2590
2590
  */
2591
- reduce<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint8ClampedArray) => U, initialValue: U): U;
2591
+ reduce<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: this) => U, initialValue: U): U;
2592
2592
 
2593
2593
  /**
2594
2594
  * Calls the specified callback function for all the elements in an array, in descending order.
@@ -2600,8 +2600,8 @@ interface Uint8ClampedArray {
2600
2600
  * the accumulation. The first call to the callbackfn function provides this value as an
2601
2601
  * argument instead of an array value.
2602
2602
  */
2603
- reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8ClampedArray) => number): number;
2604
- reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8ClampedArray) => number, initialValue: number): number;
2603
+ reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: this) => number): number;
2604
+ reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: this) => number, initialValue: number): number;
2605
2605
 
2606
2606
  /**
2607
2607
  * Calls the specified callback function for all the elements in an array, in descending order.
@@ -2613,12 +2613,12 @@ interface Uint8ClampedArray {
2613
2613
  * the accumulation. The first call to the callbackfn function provides this value as an argument
2614
2614
  * instead of an array value.
2615
2615
  */
2616
- reduceRight<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint8ClampedArray) => U, initialValue: U): U;
2616
+ reduceRight<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: this) => U, initialValue: U): U;
2617
2617
 
2618
2618
  /**
2619
2619
  * Reverses the elements in an Array.
2620
2620
  */
2621
- reverse(): Uint8ClampedArray;
2621
+ reverse(): this;
2622
2622
 
2623
2623
  /**
2624
2624
  * Sets a value or an array of values.
@@ -2632,7 +2632,7 @@ interface Uint8ClampedArray {
2632
2632
  * @param start The beginning of the specified portion of the array.
2633
2633
  * @param end The end of the specified portion of the array. This is exclusive of the element at the index 'end'.
2634
2634
  */
2635
- slice(start?: number, end?: number): Uint8ClampedArray;
2635
+ slice(start?: number, end?: number): Uint8ClampedArray<ArrayBuffer>;
2636
2636
 
2637
2637
  /**
2638
2638
  * Determines whether the specified callback function returns true for any element of an array.
@@ -2642,7 +2642,7 @@ interface Uint8ClampedArray {
2642
2642
  * @param thisArg An object to which the this keyword can refer in the predicate function.
2643
2643
  * If thisArg is omitted, undefined is used as the this value.
2644
2644
  */
2645
- some(predicate: (value: number, index: number, array: Uint8ClampedArray) => unknown, thisArg?: any): boolean;
2645
+ some(predicate: (value: number, index: number, array: this) => unknown, thisArg?: any): boolean;
2646
2646
 
2647
2647
  /**
2648
2648
  * Sorts an array.
@@ -2661,7 +2661,7 @@ interface Uint8ClampedArray {
2661
2661
  * @param begin The index of the beginning of the array.
2662
2662
  * @param end The index of the end of the array.
2663
2663
  */
2664
- subarray(begin?: number, end?: number): Uint8ClampedArray;
2664
+ subarray(begin?: number, end?: number): Uint8ClampedArray<TArrayBuffer>;
2665
2665
 
2666
2666
  /**
2667
2667
  * Converts a number to a string by using the current locale.
@@ -2674,16 +2674,16 @@ interface Uint8ClampedArray {
2674
2674
  toString(): string;
2675
2675
 
2676
2676
  /** Returns the primitive value of the specified object. */
2677
- valueOf(): Uint8ClampedArray;
2677
+ valueOf(): this;
2678
2678
 
2679
2679
  [index: number]: number;
2680
2680
  }
2681
-
2682
2681
  interface Uint8ClampedArrayConstructor {
2683
- readonly prototype: Uint8ClampedArray;
2684
- new (length: number): Uint8ClampedArray;
2685
- new (array: ArrayLike<number> | ArrayBufferLike): Uint8ClampedArray;
2686
- new (buffer: ArrayBufferLike, byteOffset?: number, length?: number): Uint8ClampedArray;
2682
+ readonly prototype: Uint8ClampedArray<ArrayBufferLike>;
2683
+ new (length: number): Uint8ClampedArray<ArrayBuffer>;
2684
+ new (array: ArrayLike<number>): Uint8ClampedArray<ArrayBuffer>;
2685
+ new <TArrayBuffer extends ArrayBufferLike = ArrayBuffer>(buffer: TArrayBuffer, byteOffset?: number, length?: number): Uint8ClampedArray<TArrayBuffer>;
2686
+ new (array: ArrayLike<number> | ArrayBuffer): Uint8ClampedArray<ArrayBuffer>;
2687
2687
 
2688
2688
  /**
2689
2689
  * The size in bytes of each element in the array.
@@ -2694,13 +2694,13 @@ interface Uint8ClampedArrayConstructor {
2694
2694
  * Returns a new array from a set of elements.
2695
2695
  * @param items A set of elements to include in the new array object.
2696
2696
  */
2697
- of(...items: number[]): Uint8ClampedArray;
2697
+ of(...items: number[]): Uint8ClampedArray<ArrayBuffer>;
2698
2698
 
2699
2699
  /**
2700
2700
  * Creates an array from an array-like or iterable object.
2701
2701
  * @param arrayLike An array-like or iterable object to convert to an array.
2702
2702
  */
2703
- from(arrayLike: ArrayLike<number>): Uint8ClampedArray;
2703
+ from(arrayLike: ArrayLike<number>): Uint8ClampedArray<ArrayBuffer>;
2704
2704
 
2705
2705
  /**
2706
2706
  * Creates an array from an array-like or iterable object.
@@ -2708,7 +2708,7 @@ interface Uint8ClampedArrayConstructor {
2708
2708
  * @param mapfn A mapping function to call on every element of the array.
2709
2709
  * @param thisArg Value of 'this' used to invoke the mapfn.
2710
2710
  */
2711
- from<T>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => number, thisArg?: any): Uint8ClampedArray;
2711
+ from<T>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => number, thisArg?: any): Uint8ClampedArray<ArrayBuffer>;
2712
2712
  }
2713
2713
  declare var Uint8ClampedArray: Uint8ClampedArrayConstructor;
2714
2714
 
@@ -2716,7 +2716,7 @@ declare var Uint8ClampedArray: Uint8ClampedArrayConstructor;
2716
2716
  * A typed array of 16-bit signed integer values. The contents are initialized to 0. If the
2717
2717
  * requested number of bytes could not be allocated an exception is raised.
2718
2718
  */
2719
- interface Int16Array {
2719
+ interface Int16Array<TArrayBuffer extends ArrayBufferLike = ArrayBufferLike> {
2720
2720
  /**
2721
2721
  * The size in bytes of each element in the array.
2722
2722
  */
@@ -2725,7 +2725,7 @@ interface Int16Array {
2725
2725
  /**
2726
2726
  * The ArrayBuffer instance referenced by the array.
2727
2727
  */
2728
- readonly buffer: ArrayBufferLike;
2728
+ readonly buffer: TArrayBuffer;
2729
2729
 
2730
2730
  /**
2731
2731
  * The length in bytes of the array.
@@ -2756,7 +2756,7 @@ interface Int16Array {
2756
2756
  * @param thisArg An object to which the this keyword can refer in the predicate function.
2757
2757
  * If thisArg is omitted, undefined is used as the this value.
2758
2758
  */
2759
- every(predicate: (value: number, index: number, array: Int16Array) => unknown, thisArg?: any): boolean;
2759
+ every(predicate: (value: number, index: number, array: this) => unknown, thisArg?: any): boolean;
2760
2760
 
2761
2761
  /**
2762
2762
  * Changes all array elements from `start` to `end` index to a static `value` and returns the modified array
@@ -2775,7 +2775,7 @@ interface Int16Array {
2775
2775
  * @param thisArg An object to which the this keyword can refer in the predicate function.
2776
2776
  * If thisArg is omitted, undefined is used as the this value.
2777
2777
  */
2778
- filter(predicate: (value: number, index: number, array: Int16Array) => any, thisArg?: any): Int16Array;
2778
+ filter(predicate: (value: number, index: number, array: this) => any, thisArg?: any): Int16Array<ArrayBuffer>;
2779
2779
 
2780
2780
  /**
2781
2781
  * Returns the value of the first element in the array where predicate is true, and undefined
@@ -2786,7 +2786,7 @@ interface Int16Array {
2786
2786
  * @param thisArg If provided, it will be used as the this value for each invocation of
2787
2787
  * predicate. If it is not provided, undefined is used instead.
2788
2788
  */
2789
- find(predicate: (value: number, index: number, obj: Int16Array) => boolean, thisArg?: any): number | undefined;
2789
+ find(predicate: (value: number, index: number, obj: this) => boolean, thisArg?: any): number | undefined;
2790
2790
 
2791
2791
  /**
2792
2792
  * Returns the index of the first element in the array where predicate is true, and -1
@@ -2797,7 +2797,7 @@ interface Int16Array {
2797
2797
  * @param thisArg If provided, it will be used as the this value for each invocation of
2798
2798
  * predicate. If it is not provided, undefined is used instead.
2799
2799
  */
2800
- findIndex(predicate: (value: number, index: number, obj: Int16Array) => boolean, thisArg?: any): number;
2800
+ findIndex(predicate: (value: number, index: number, obj: this) => boolean, thisArg?: any): number;
2801
2801
 
2802
2802
  /**
2803
2803
  * Performs the specified action for each element in an array.
@@ -2806,7 +2806,7 @@ interface Int16Array {
2806
2806
  * @param thisArg An object to which the this keyword can refer in the callbackfn function.
2807
2807
  * If thisArg is omitted, undefined is used as the this value.
2808
2808
  */
2809
- forEach(callbackfn: (value: number, index: number, array: Int16Array) => void, thisArg?: any): void;
2809
+ forEach(callbackfn: (value: number, index: number, array: this) => void, thisArg?: any): void;
2810
2810
  /**
2811
2811
  * Returns the index of the first occurrence of a value in an array.
2812
2812
  * @param searchElement The value to locate in the array.
@@ -2843,7 +2843,7 @@ interface Int16Array {
2843
2843
  * @param thisArg An object to which the this keyword can refer in the callbackfn function.
2844
2844
  * If thisArg is omitted, undefined is used as the this value.
2845
2845
  */
2846
- map(callbackfn: (value: number, index: number, array: Int16Array) => number, thisArg?: any): Int16Array;
2846
+ map(callbackfn: (value: number, index: number, array: this) => number, thisArg?: any): Int16Array<ArrayBuffer>;
2847
2847
 
2848
2848
  /**
2849
2849
  * Calls the specified callback function for all the elements in an array. The return value of
@@ -2855,8 +2855,8 @@ interface Int16Array {
2855
2855
  * the accumulation. The first call to the callbackfn function provides this value as an argument
2856
2856
  * instead of an array value.
2857
2857
  */
2858
- reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int16Array) => number): number;
2859
- reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int16Array) => number, initialValue: number): number;
2858
+ reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: this) => number): number;
2859
+ reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: this) => number, initialValue: number): number;
2860
2860
 
2861
2861
  /**
2862
2862
  * Calls the specified callback function for all the elements in an array. The return value of
@@ -2868,7 +2868,7 @@ interface Int16Array {
2868
2868
  * the accumulation. The first call to the callbackfn function provides this value as an argument
2869
2869
  * instead of an array value.
2870
2870
  */
2871
- reduce<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int16Array) => U, initialValue: U): U;
2871
+ reduce<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: this) => U, initialValue: U): U;
2872
2872
 
2873
2873
  /**
2874
2874
  * Calls the specified callback function for all the elements in an array, in descending order.
@@ -2880,8 +2880,8 @@ interface Int16Array {
2880
2880
  * the accumulation. The first call to the callbackfn function provides this value as an
2881
2881
  * argument instead of an array value.
2882
2882
  */
2883
- reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int16Array) => number): number;
2884
- reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int16Array) => number, initialValue: number): number;
2883
+ reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: this) => number): number;
2884
+ reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: this) => number, initialValue: number): number;
2885
2885
 
2886
2886
  /**
2887
2887
  * Calls the specified callback function for all the elements in an array, in descending order.
@@ -2893,12 +2893,12 @@ interface Int16Array {
2893
2893
  * the accumulation. The first call to the callbackfn function provides this value as an argument
2894
2894
  * instead of an array value.
2895
2895
  */
2896
- reduceRight<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int16Array) => U, initialValue: U): U;
2896
+ reduceRight<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: this) => U, initialValue: U): U;
2897
2897
 
2898
2898
  /**
2899
2899
  * Reverses the elements in an Array.
2900
2900
  */
2901
- reverse(): Int16Array;
2901
+ reverse(): this;
2902
2902
 
2903
2903
  /**
2904
2904
  * Sets a value or an array of values.
@@ -2912,7 +2912,7 @@ interface Int16Array {
2912
2912
  * @param start The beginning of the specified portion of the array.
2913
2913
  * @param end The end of the specified portion of the array. This is exclusive of the element at the index 'end'.
2914
2914
  */
2915
- slice(start?: number, end?: number): Int16Array;
2915
+ slice(start?: number, end?: number): Int16Array<ArrayBuffer>;
2916
2916
 
2917
2917
  /**
2918
2918
  * Determines whether the specified callback function returns true for any element of an array.
@@ -2922,7 +2922,7 @@ interface Int16Array {
2922
2922
  * @param thisArg An object to which the this keyword can refer in the predicate function.
2923
2923
  * If thisArg is omitted, undefined is used as the this value.
2924
2924
  */
2925
- some(predicate: (value: number, index: number, array: Int16Array) => unknown, thisArg?: any): boolean;
2925
+ some(predicate: (value: number, index: number, array: this) => unknown, thisArg?: any): boolean;
2926
2926
 
2927
2927
  /**
2928
2928
  * Sorts an array.
@@ -2941,7 +2941,7 @@ interface Int16Array {
2941
2941
  * @param begin The index of the beginning of the array.
2942
2942
  * @param end The index of the end of the array.
2943
2943
  */
2944
- subarray(begin?: number, end?: number): Int16Array;
2944
+ subarray(begin?: number, end?: number): Int16Array<TArrayBuffer>;
2945
2945
 
2946
2946
  /**
2947
2947
  * Converts a number to a string by using the current locale.
@@ -2954,16 +2954,16 @@ interface Int16Array {
2954
2954
  toString(): string;
2955
2955
 
2956
2956
  /** Returns the primitive value of the specified object. */
2957
- valueOf(): Int16Array;
2957
+ valueOf(): this;
2958
2958
 
2959
2959
  [index: number]: number;
2960
2960
  }
2961
-
2962
2961
  interface Int16ArrayConstructor {
2963
- readonly prototype: Int16Array;
2964
- new (length: number): Int16Array;
2965
- new (array: ArrayLike<number> | ArrayBufferLike): Int16Array;
2966
- new (buffer: ArrayBufferLike, byteOffset?: number, length?: number): Int16Array;
2962
+ readonly prototype: Int16Array<ArrayBufferLike>;
2963
+ new (length: number): Int16Array<ArrayBuffer>;
2964
+ new (array: ArrayLike<number>): Int16Array<ArrayBuffer>;
2965
+ new <TArrayBuffer extends ArrayBufferLike = ArrayBuffer>(buffer: TArrayBuffer, byteOffset?: number, length?: number): Int16Array<TArrayBuffer>;
2966
+ new (array: ArrayLike<number> | ArrayBuffer): Int16Array<ArrayBuffer>;
2967
2967
 
2968
2968
  /**
2969
2969
  * The size in bytes of each element in the array.
@@ -2974,13 +2974,13 @@ interface Int16ArrayConstructor {
2974
2974
  * Returns a new array from a set of elements.
2975
2975
  * @param items A set of elements to include in the new array object.
2976
2976
  */
2977
- of(...items: number[]): Int16Array;
2977
+ of(...items: number[]): Int16Array<ArrayBuffer>;
2978
2978
 
2979
2979
  /**
2980
2980
  * Creates an array from an array-like or iterable object.
2981
2981
  * @param arrayLike An array-like or iterable object to convert to an array.
2982
2982
  */
2983
- from(arrayLike: ArrayLike<number>): Int16Array;
2983
+ from(arrayLike: ArrayLike<number>): Int16Array<ArrayBuffer>;
2984
2984
 
2985
2985
  /**
2986
2986
  * Creates an array from an array-like or iterable object.
@@ -2988,7 +2988,7 @@ interface Int16ArrayConstructor {
2988
2988
  * @param mapfn A mapping function to call on every element of the array.
2989
2989
  * @param thisArg Value of 'this' used to invoke the mapfn.
2990
2990
  */
2991
- from<T>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => number, thisArg?: any): Int16Array;
2991
+ from<T>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => number, thisArg?: any): Int16Array<ArrayBuffer>;
2992
2992
  }
2993
2993
  declare var Int16Array: Int16ArrayConstructor;
2994
2994
 
@@ -2996,7 +2996,7 @@ declare var Int16Array: Int16ArrayConstructor;
2996
2996
  * A typed array of 16-bit unsigned integer values. The contents are initialized to 0. If the
2997
2997
  * requested number of bytes could not be allocated an exception is raised.
2998
2998
  */
2999
- interface Uint16Array {
2999
+ interface Uint16Array<TArrayBuffer extends ArrayBufferLike = ArrayBufferLike> {
3000
3000
  /**
3001
3001
  * The size in bytes of each element in the array.
3002
3002
  */
@@ -3005,7 +3005,7 @@ interface Uint16Array {
3005
3005
  /**
3006
3006
  * The ArrayBuffer instance referenced by the array.
3007
3007
  */
3008
- readonly buffer: ArrayBufferLike;
3008
+ readonly buffer: TArrayBuffer;
3009
3009
 
3010
3010
  /**
3011
3011
  * The length in bytes of the array.
@@ -3036,7 +3036,7 @@ interface Uint16Array {
3036
3036
  * @param thisArg An object to which the this keyword can refer in the predicate function.
3037
3037
  * If thisArg is omitted, undefined is used as the this value.
3038
3038
  */
3039
- every(predicate: (value: number, index: number, array: Uint16Array) => unknown, thisArg?: any): boolean;
3039
+ every(predicate: (value: number, index: number, array: this) => unknown, thisArg?: any): boolean;
3040
3040
 
3041
3041
  /**
3042
3042
  * Changes all array elements from `start` to `end` index to a static `value` and returns the modified array
@@ -3055,7 +3055,7 @@ interface Uint16Array {
3055
3055
  * @param thisArg An object to which the this keyword can refer in the predicate function.
3056
3056
  * If thisArg is omitted, undefined is used as the this value.
3057
3057
  */
3058
- filter(predicate: (value: number, index: number, array: Uint16Array) => any, thisArg?: any): Uint16Array;
3058
+ filter(predicate: (value: number, index: number, array: this) => any, thisArg?: any): Uint16Array<ArrayBuffer>;
3059
3059
 
3060
3060
  /**
3061
3061
  * Returns the value of the first element in the array where predicate is true, and undefined
@@ -3066,7 +3066,7 @@ interface Uint16Array {
3066
3066
  * @param thisArg If provided, it will be used as the this value for each invocation of
3067
3067
  * predicate. If it is not provided, undefined is used instead.
3068
3068
  */
3069
- find(predicate: (value: number, index: number, obj: Uint16Array) => boolean, thisArg?: any): number | undefined;
3069
+ find(predicate: (value: number, index: number, obj: this) => boolean, thisArg?: any): number | undefined;
3070
3070
 
3071
3071
  /**
3072
3072
  * Returns the index of the first element in the array where predicate is true, and -1
@@ -3077,7 +3077,7 @@ interface Uint16Array {
3077
3077
  * @param thisArg If provided, it will be used as the this value for each invocation of
3078
3078
  * predicate. If it is not provided, undefined is used instead.
3079
3079
  */
3080
- findIndex(predicate: (value: number, index: number, obj: Uint16Array) => boolean, thisArg?: any): number;
3080
+ findIndex(predicate: (value: number, index: number, obj: this) => boolean, thisArg?: any): number;
3081
3081
 
3082
3082
  /**
3083
3083
  * Performs the specified action for each element in an array.
@@ -3086,7 +3086,7 @@ interface Uint16Array {
3086
3086
  * @param thisArg An object to which the this keyword can refer in the callbackfn function.
3087
3087
  * If thisArg is omitted, undefined is used as the this value.
3088
3088
  */
3089
- forEach(callbackfn: (value: number, index: number, array: Uint16Array) => void, thisArg?: any): void;
3089
+ forEach(callbackfn: (value: number, index: number, array: this) => void, thisArg?: any): void;
3090
3090
 
3091
3091
  /**
3092
3092
  * Returns the index of the first occurrence of a value in an array.
@@ -3124,7 +3124,7 @@ interface Uint16Array {
3124
3124
  * @param thisArg An object to which the this keyword can refer in the callbackfn function.
3125
3125
  * If thisArg is omitted, undefined is used as the this value.
3126
3126
  */
3127
- map(callbackfn: (value: number, index: number, array: Uint16Array) => number, thisArg?: any): Uint16Array;
3127
+ map(callbackfn: (value: number, index: number, array: this) => number, thisArg?: any): Uint16Array<ArrayBuffer>;
3128
3128
 
3129
3129
  /**
3130
3130
  * Calls the specified callback function for all the elements in an array. The return value of
@@ -3136,8 +3136,8 @@ interface Uint16Array {
3136
3136
  * the accumulation. The first call to the callbackfn function provides this value as an argument
3137
3137
  * instead of an array value.
3138
3138
  */
3139
- reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint16Array) => number): number;
3140
- reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint16Array) => number, initialValue: number): number;
3139
+ reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: this) => number): number;
3140
+ reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: this) => number, initialValue: number): number;
3141
3141
 
3142
3142
  /**
3143
3143
  * Calls the specified callback function for all the elements in an array. The return value of
@@ -3149,7 +3149,7 @@ interface Uint16Array {
3149
3149
  * the accumulation. The first call to the callbackfn function provides this value as an argument
3150
3150
  * instead of an array value.
3151
3151
  */
3152
- reduce<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint16Array) => U, initialValue: U): U;
3152
+ reduce<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: this) => U, initialValue: U): U;
3153
3153
 
3154
3154
  /**
3155
3155
  * Calls the specified callback function for all the elements in an array, in descending order.
@@ -3161,8 +3161,8 @@ interface Uint16Array {
3161
3161
  * the accumulation. The first call to the callbackfn function provides this value as an
3162
3162
  * argument instead of an array value.
3163
3163
  */
3164
- reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint16Array) => number): number;
3165
- reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint16Array) => number, initialValue: number): number;
3164
+ reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: this) => number): number;
3165
+ reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: this) => number, initialValue: number): number;
3166
3166
 
3167
3167
  /**
3168
3168
  * Calls the specified callback function for all the elements in an array, in descending order.
@@ -3174,12 +3174,12 @@ interface Uint16Array {
3174
3174
  * the accumulation. The first call to the callbackfn function provides this value as an argument
3175
3175
  * instead of an array value.
3176
3176
  */
3177
- reduceRight<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint16Array) => U, initialValue: U): U;
3177
+ reduceRight<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: this) => U, initialValue: U): U;
3178
3178
 
3179
3179
  /**
3180
3180
  * Reverses the elements in an Array.
3181
3181
  */
3182
- reverse(): Uint16Array;
3182
+ reverse(): this;
3183
3183
 
3184
3184
  /**
3185
3185
  * Sets a value or an array of values.
@@ -3193,7 +3193,7 @@ interface Uint16Array {
3193
3193
  * @param start The beginning of the specified portion of the array.
3194
3194
  * @param end The end of the specified portion of the array. This is exclusive of the element at the index 'end'.
3195
3195
  */
3196
- slice(start?: number, end?: number): Uint16Array;
3196
+ slice(start?: number, end?: number): Uint16Array<ArrayBuffer>;
3197
3197
 
3198
3198
  /**
3199
3199
  * Determines whether the specified callback function returns true for any element of an array.
@@ -3203,7 +3203,7 @@ interface Uint16Array {
3203
3203
  * @param thisArg An object to which the this keyword can refer in the predicate function.
3204
3204
  * If thisArg is omitted, undefined is used as the this value.
3205
3205
  */
3206
- some(predicate: (value: number, index: number, array: Uint16Array) => unknown, thisArg?: any): boolean;
3206
+ some(predicate: (value: number, index: number, array: this) => unknown, thisArg?: any): boolean;
3207
3207
 
3208
3208
  /**
3209
3209
  * Sorts an array.
@@ -3222,7 +3222,7 @@ interface Uint16Array {
3222
3222
  * @param begin The index of the beginning of the array.
3223
3223
  * @param end The index of the end of the array.
3224
3224
  */
3225
- subarray(begin?: number, end?: number): Uint16Array;
3225
+ subarray(begin?: number, end?: number): Uint16Array<TArrayBuffer>;
3226
3226
 
3227
3227
  /**
3228
3228
  * Converts a number to a string by using the current locale.
@@ -3235,16 +3235,16 @@ interface Uint16Array {
3235
3235
  toString(): string;
3236
3236
 
3237
3237
  /** Returns the primitive value of the specified object. */
3238
- valueOf(): Uint16Array;
3238
+ valueOf(): this;
3239
3239
 
3240
3240
  [index: number]: number;
3241
3241
  }
3242
-
3243
3242
  interface Uint16ArrayConstructor {
3244
- readonly prototype: Uint16Array;
3245
- new (length: number): Uint16Array;
3246
- new (array: ArrayLike<number> | ArrayBufferLike): Uint16Array;
3247
- new (buffer: ArrayBufferLike, byteOffset?: number, length?: number): Uint16Array;
3243
+ readonly prototype: Uint16Array<ArrayBufferLike>;
3244
+ new (length: number): Uint16Array<ArrayBuffer>;
3245
+ new (array: ArrayLike<number>): Uint16Array<ArrayBuffer>;
3246
+ new <TArrayBuffer extends ArrayBufferLike = ArrayBuffer>(buffer: TArrayBuffer, byteOffset?: number, length?: number): Uint16Array<TArrayBuffer>;
3247
+ new (array: ArrayLike<number> | ArrayBuffer): Uint16Array<ArrayBuffer>;
3248
3248
 
3249
3249
  /**
3250
3250
  * The size in bytes of each element in the array.
@@ -3255,13 +3255,13 @@ interface Uint16ArrayConstructor {
3255
3255
  * Returns a new array from a set of elements.
3256
3256
  * @param items A set of elements to include in the new array object.
3257
3257
  */
3258
- of(...items: number[]): Uint16Array;
3258
+ of(...items: number[]): Uint16Array<ArrayBuffer>;
3259
3259
 
3260
3260
  /**
3261
3261
  * Creates an array from an array-like or iterable object.
3262
3262
  * @param arrayLike An array-like or iterable object to convert to an array.
3263
3263
  */
3264
- from(arrayLike: ArrayLike<number>): Uint16Array;
3264
+ from(arrayLike: ArrayLike<number>): Uint16Array<ArrayBuffer>;
3265
3265
 
3266
3266
  /**
3267
3267
  * Creates an array from an array-like or iterable object.
@@ -3269,14 +3269,14 @@ interface Uint16ArrayConstructor {
3269
3269
  * @param mapfn A mapping function to call on every element of the array.
3270
3270
  * @param thisArg Value of 'this' used to invoke the mapfn.
3271
3271
  */
3272
- from<T>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => number, thisArg?: any): Uint16Array;
3272
+ from<T>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => number, thisArg?: any): Uint16Array<ArrayBuffer>;
3273
3273
  }
3274
3274
  declare var Uint16Array: Uint16ArrayConstructor;
3275
3275
  /**
3276
3276
  * A typed array of 32-bit signed integer values. The contents are initialized to 0. If the
3277
3277
  * requested number of bytes could not be allocated an exception is raised.
3278
3278
  */
3279
- interface Int32Array {
3279
+ interface Int32Array<TArrayBuffer extends ArrayBufferLike = ArrayBufferLike> {
3280
3280
  /**
3281
3281
  * The size in bytes of each element in the array.
3282
3282
  */
@@ -3285,7 +3285,7 @@ interface Int32Array {
3285
3285
  /**
3286
3286
  * The ArrayBuffer instance referenced by the array.
3287
3287
  */
3288
- readonly buffer: ArrayBufferLike;
3288
+ readonly buffer: TArrayBuffer;
3289
3289
 
3290
3290
  /**
3291
3291
  * The length in bytes of the array.
@@ -3316,7 +3316,7 @@ interface Int32Array {
3316
3316
  * @param thisArg An object to which the this keyword can refer in the predicate function.
3317
3317
  * If thisArg is omitted, undefined is used as the this value.
3318
3318
  */
3319
- every(predicate: (value: number, index: number, array: Int32Array) => unknown, thisArg?: any): boolean;
3319
+ every(predicate: (value: number, index: number, array: this) => unknown, thisArg?: any): boolean;
3320
3320
 
3321
3321
  /**
3322
3322
  * Changes all array elements from `start` to `end` index to a static `value` and returns the modified array
@@ -3335,7 +3335,7 @@ interface Int32Array {
3335
3335
  * @param thisArg An object to which the this keyword can refer in the predicate function.
3336
3336
  * If thisArg is omitted, undefined is used as the this value.
3337
3337
  */
3338
- filter(predicate: (value: number, index: number, array: Int32Array) => any, thisArg?: any): Int32Array;
3338
+ filter(predicate: (value: number, index: number, array: this) => any, thisArg?: any): Int32Array<ArrayBuffer>;
3339
3339
 
3340
3340
  /**
3341
3341
  * Returns the value of the first element in the array where predicate is true, and undefined
@@ -3346,7 +3346,7 @@ interface Int32Array {
3346
3346
  * @param thisArg If provided, it will be used as the this value for each invocation of
3347
3347
  * predicate. If it is not provided, undefined is used instead.
3348
3348
  */
3349
- find(predicate: (value: number, index: number, obj: Int32Array) => boolean, thisArg?: any): number | undefined;
3349
+ find(predicate: (value: number, index: number, obj: this) => boolean, thisArg?: any): number | undefined;
3350
3350
 
3351
3351
  /**
3352
3352
  * Returns the index of the first element in the array where predicate is true, and -1
@@ -3357,7 +3357,7 @@ interface Int32Array {
3357
3357
  * @param thisArg If provided, it will be used as the this value for each invocation of
3358
3358
  * predicate. If it is not provided, undefined is used instead.
3359
3359
  */
3360
- findIndex(predicate: (value: number, index: number, obj: Int32Array) => boolean, thisArg?: any): number;
3360
+ findIndex(predicate: (value: number, index: number, obj: this) => boolean, thisArg?: any): number;
3361
3361
 
3362
3362
  /**
3363
3363
  * Performs the specified action for each element in an array.
@@ -3366,7 +3366,7 @@ interface Int32Array {
3366
3366
  * @param thisArg An object to which the this keyword can refer in the callbackfn function.
3367
3367
  * If thisArg is omitted, undefined is used as the this value.
3368
3368
  */
3369
- forEach(callbackfn: (value: number, index: number, array: Int32Array) => void, thisArg?: any): void;
3369
+ forEach(callbackfn: (value: number, index: number, array: this) => void, thisArg?: any): void;
3370
3370
 
3371
3371
  /**
3372
3372
  * Returns the index of the first occurrence of a value in an array.
@@ -3404,7 +3404,7 @@ interface Int32Array {
3404
3404
  * @param thisArg An object to which the this keyword can refer in the callbackfn function.
3405
3405
  * If thisArg is omitted, undefined is used as the this value.
3406
3406
  */
3407
- map(callbackfn: (value: number, index: number, array: Int32Array) => number, thisArg?: any): Int32Array;
3407
+ map(callbackfn: (value: number, index: number, array: this) => number, thisArg?: any): Int32Array<ArrayBuffer>;
3408
3408
 
3409
3409
  /**
3410
3410
  * Calls the specified callback function for all the elements in an array. The return value of
@@ -3416,8 +3416,8 @@ interface Int32Array {
3416
3416
  * the accumulation. The first call to the callbackfn function provides this value as an argument
3417
3417
  * instead of an array value.
3418
3418
  */
3419
- reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int32Array) => number): number;
3420
- reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int32Array) => number, initialValue: number): number;
3419
+ reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: this) => number): number;
3420
+ reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: this) => number, initialValue: number): number;
3421
3421
 
3422
3422
  /**
3423
3423
  * Calls the specified callback function for all the elements in an array. The return value of
@@ -3429,7 +3429,7 @@ interface Int32Array {
3429
3429
  * the accumulation. The first call to the callbackfn function provides this value as an argument
3430
3430
  * instead of an array value.
3431
3431
  */
3432
- reduce<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int32Array) => U, initialValue: U): U;
3432
+ reduce<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: this) => U, initialValue: U): U;
3433
3433
 
3434
3434
  /**
3435
3435
  * Calls the specified callback function for all the elements in an array, in descending order.
@@ -3441,8 +3441,8 @@ interface Int32Array {
3441
3441
  * the accumulation. The first call to the callbackfn function provides this value as an
3442
3442
  * argument instead of an array value.
3443
3443
  */
3444
- reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int32Array) => number): number;
3445
- reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int32Array) => number, initialValue: number): number;
3444
+ reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: this) => number): number;
3445
+ reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: this) => number, initialValue: number): number;
3446
3446
 
3447
3447
  /**
3448
3448
  * Calls the specified callback function for all the elements in an array, in descending order.
@@ -3454,12 +3454,12 @@ interface Int32Array {
3454
3454
  * the accumulation. The first call to the callbackfn function provides this value as an argument
3455
3455
  * instead of an array value.
3456
3456
  */
3457
- reduceRight<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int32Array) => U, initialValue: U): U;
3457
+ reduceRight<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: this) => U, initialValue: U): U;
3458
3458
 
3459
3459
  /**
3460
3460
  * Reverses the elements in an Array.
3461
3461
  */
3462
- reverse(): Int32Array;
3462
+ reverse(): this;
3463
3463
 
3464
3464
  /**
3465
3465
  * Sets a value or an array of values.
@@ -3473,7 +3473,7 @@ interface Int32Array {
3473
3473
  * @param start The beginning of the specified portion of the array.
3474
3474
  * @param end The end of the specified portion of the array. This is exclusive of the element at the index 'end'.
3475
3475
  */
3476
- slice(start?: number, end?: number): Int32Array;
3476
+ slice(start?: number, end?: number): Int32Array<ArrayBuffer>;
3477
3477
 
3478
3478
  /**
3479
3479
  * Determines whether the specified callback function returns true for any element of an array.
@@ -3483,7 +3483,7 @@ interface Int32Array {
3483
3483
  * @param thisArg An object to which the this keyword can refer in the predicate function.
3484
3484
  * If thisArg is omitted, undefined is used as the this value.
3485
3485
  */
3486
- some(predicate: (value: number, index: number, array: Int32Array) => unknown, thisArg?: any): boolean;
3486
+ some(predicate: (value: number, index: number, array: this) => unknown, thisArg?: any): boolean;
3487
3487
 
3488
3488
  /**
3489
3489
  * Sorts an array.
@@ -3502,7 +3502,7 @@ interface Int32Array {
3502
3502
  * @param begin The index of the beginning of the array.
3503
3503
  * @param end The index of the end of the array.
3504
3504
  */
3505
- subarray(begin?: number, end?: number): Int32Array;
3505
+ subarray(begin?: number, end?: number): Int32Array<TArrayBuffer>;
3506
3506
 
3507
3507
  /**
3508
3508
  * Converts a number to a string by using the current locale.
@@ -3515,16 +3515,16 @@ interface Int32Array {
3515
3515
  toString(): string;
3516
3516
 
3517
3517
  /** Returns the primitive value of the specified object. */
3518
- valueOf(): Int32Array;
3518
+ valueOf(): this;
3519
3519
 
3520
3520
  [index: number]: number;
3521
3521
  }
3522
-
3523
3522
  interface Int32ArrayConstructor {
3524
- readonly prototype: Int32Array;
3525
- new (length: number): Int32Array;
3526
- new (array: ArrayLike<number> | ArrayBufferLike): Int32Array;
3527
- new (buffer: ArrayBufferLike, byteOffset?: number, length?: number): Int32Array;
3523
+ readonly prototype: Int32Array<ArrayBufferLike>;
3524
+ new (length: number): Int32Array<ArrayBuffer>;
3525
+ new (array: ArrayLike<number>): Int32Array<ArrayBuffer>;
3526
+ new <TArrayBuffer extends ArrayBufferLike = ArrayBuffer>(buffer: TArrayBuffer, byteOffset?: number, length?: number): Int32Array<TArrayBuffer>;
3527
+ new (array: ArrayLike<number> | ArrayBuffer): Int32Array<ArrayBuffer>;
3528
3528
 
3529
3529
  /**
3530
3530
  * The size in bytes of each element in the array.
@@ -3535,13 +3535,13 @@ interface Int32ArrayConstructor {
3535
3535
  * Returns a new array from a set of elements.
3536
3536
  * @param items A set of elements to include in the new array object.
3537
3537
  */
3538
- of(...items: number[]): Int32Array;
3538
+ of(...items: number[]): Int32Array<ArrayBuffer>;
3539
3539
 
3540
3540
  /**
3541
3541
  * Creates an array from an array-like or iterable object.
3542
3542
  * @param arrayLike An array-like or iterable object to convert to an array.
3543
3543
  */
3544
- from(arrayLike: ArrayLike<number>): Int32Array;
3544
+ from(arrayLike: ArrayLike<number>): Int32Array<ArrayBuffer>;
3545
3545
 
3546
3546
  /**
3547
3547
  * Creates an array from an array-like or iterable object.
@@ -3549,7 +3549,7 @@ interface Int32ArrayConstructor {
3549
3549
  * @param mapfn A mapping function to call on every element of the array.
3550
3550
  * @param thisArg Value of 'this' used to invoke the mapfn.
3551
3551
  */
3552
- from<T>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => number, thisArg?: any): Int32Array;
3552
+ from<T>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => number, thisArg?: any): Int32Array<ArrayBuffer>;
3553
3553
  }
3554
3554
  declare var Int32Array: Int32ArrayConstructor;
3555
3555
 
@@ -3557,7 +3557,7 @@ declare var Int32Array: Int32ArrayConstructor;
3557
3557
  * A typed array of 32-bit unsigned integer values. The contents are initialized to 0. If the
3558
3558
  * requested number of bytes could not be allocated an exception is raised.
3559
3559
  */
3560
- interface Uint32Array {
3560
+ interface Uint32Array<TArrayBuffer extends ArrayBufferLike = ArrayBufferLike> {
3561
3561
  /**
3562
3562
  * The size in bytes of each element in the array.
3563
3563
  */
@@ -3566,7 +3566,7 @@ interface Uint32Array {
3566
3566
  /**
3567
3567
  * The ArrayBuffer instance referenced by the array.
3568
3568
  */
3569
- readonly buffer: ArrayBufferLike;
3569
+ readonly buffer: TArrayBuffer;
3570
3570
 
3571
3571
  /**
3572
3572
  * The length in bytes of the array.
@@ -3597,7 +3597,7 @@ interface Uint32Array {
3597
3597
  * @param thisArg An object to which the this keyword can refer in the predicate function.
3598
3598
  * If thisArg is omitted, undefined is used as the this value.
3599
3599
  */
3600
- every(predicate: (value: number, index: number, array: Uint32Array) => unknown, thisArg?: any): boolean;
3600
+ every(predicate: (value: number, index: number, array: this) => unknown, thisArg?: any): boolean;
3601
3601
 
3602
3602
  /**
3603
3603
  * Changes all array elements from `start` to `end` index to a static `value` and returns the modified array
@@ -3616,7 +3616,7 @@ interface Uint32Array {
3616
3616
  * @param thisArg An object to which the this keyword can refer in the predicate function.
3617
3617
  * If thisArg is omitted, undefined is used as the this value.
3618
3618
  */
3619
- filter(predicate: (value: number, index: number, array: Uint32Array) => any, thisArg?: any): Uint32Array;
3619
+ filter(predicate: (value: number, index: number, array: this) => any, thisArg?: any): Uint32Array<ArrayBuffer>;
3620
3620
 
3621
3621
  /**
3622
3622
  * Returns the value of the first element in the array where predicate is true, and undefined
@@ -3627,7 +3627,7 @@ interface Uint32Array {
3627
3627
  * @param thisArg If provided, it will be used as the this value for each invocation of
3628
3628
  * predicate. If it is not provided, undefined is used instead.
3629
3629
  */
3630
- find(predicate: (value: number, index: number, obj: Uint32Array) => boolean, thisArg?: any): number | undefined;
3630
+ find(predicate: (value: number, index: number, obj: this) => boolean, thisArg?: any): number | undefined;
3631
3631
 
3632
3632
  /**
3633
3633
  * Returns the index of the first element in the array where predicate is true, and -1
@@ -3638,7 +3638,7 @@ interface Uint32Array {
3638
3638
  * @param thisArg If provided, it will be used as the this value for each invocation of
3639
3639
  * predicate. If it is not provided, undefined is used instead.
3640
3640
  */
3641
- findIndex(predicate: (value: number, index: number, obj: Uint32Array) => boolean, thisArg?: any): number;
3641
+ findIndex(predicate: (value: number, index: number, obj: this) => boolean, thisArg?: any): number;
3642
3642
 
3643
3643
  /**
3644
3644
  * Performs the specified action for each element in an array.
@@ -3647,7 +3647,7 @@ interface Uint32Array {
3647
3647
  * @param thisArg An object to which the this keyword can refer in the callbackfn function.
3648
3648
  * If thisArg is omitted, undefined is used as the this value.
3649
3649
  */
3650
- forEach(callbackfn: (value: number, index: number, array: Uint32Array) => void, thisArg?: any): void;
3650
+ forEach(callbackfn: (value: number, index: number, array: this) => void, thisArg?: any): void;
3651
3651
  /**
3652
3652
  * Returns the index of the first occurrence of a value in an array.
3653
3653
  * @param searchElement The value to locate in the array.
@@ -3684,7 +3684,7 @@ interface Uint32Array {
3684
3684
  * @param thisArg An object to which the this keyword can refer in the callbackfn function.
3685
3685
  * If thisArg is omitted, undefined is used as the this value.
3686
3686
  */
3687
- map(callbackfn: (value: number, index: number, array: Uint32Array) => number, thisArg?: any): Uint32Array;
3687
+ map(callbackfn: (value: number, index: number, array: this) => number, thisArg?: any): Uint32Array<ArrayBuffer>;
3688
3688
 
3689
3689
  /**
3690
3690
  * Calls the specified callback function for all the elements in an array. The return value of
@@ -3696,8 +3696,8 @@ interface Uint32Array {
3696
3696
  * the accumulation. The first call to the callbackfn function provides this value as an argument
3697
3697
  * instead of an array value.
3698
3698
  */
3699
- reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint32Array) => number): number;
3700
- reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint32Array) => number, initialValue: number): number;
3699
+ reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: this) => number): number;
3700
+ reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: this) => number, initialValue: number): number;
3701
3701
 
3702
3702
  /**
3703
3703
  * Calls the specified callback function for all the elements in an array. The return value of
@@ -3709,7 +3709,7 @@ interface Uint32Array {
3709
3709
  * the accumulation. The first call to the callbackfn function provides this value as an argument
3710
3710
  * instead of an array value.
3711
3711
  */
3712
- reduce<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint32Array) => U, initialValue: U): U;
3712
+ reduce<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: this) => U, initialValue: U): U;
3713
3713
 
3714
3714
  /**
3715
3715
  * Calls the specified callback function for all the elements in an array, in descending order.
@@ -3721,8 +3721,8 @@ interface Uint32Array {
3721
3721
  * the accumulation. The first call to the callbackfn function provides this value as an
3722
3722
  * argument instead of an array value.
3723
3723
  */
3724
- reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint32Array) => number): number;
3725
- reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint32Array) => number, initialValue: number): number;
3724
+ reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: this) => number): number;
3725
+ reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: this) => number, initialValue: number): number;
3726
3726
 
3727
3727
  /**
3728
3728
  * Calls the specified callback function for all the elements in an array, in descending order.
@@ -3734,12 +3734,12 @@ interface Uint32Array {
3734
3734
  * the accumulation. The first call to the callbackfn function provides this value as an argument
3735
3735
  * instead of an array value.
3736
3736
  */
3737
- reduceRight<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint32Array) => U, initialValue: U): U;
3737
+ reduceRight<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: this) => U, initialValue: U): U;
3738
3738
 
3739
3739
  /**
3740
3740
  * Reverses the elements in an Array.
3741
3741
  */
3742
- reverse(): Uint32Array;
3742
+ reverse(): this;
3743
3743
 
3744
3744
  /**
3745
3745
  * Sets a value or an array of values.
@@ -3753,7 +3753,7 @@ interface Uint32Array {
3753
3753
  * @param start The beginning of the specified portion of the array.
3754
3754
  * @param end The end of the specified portion of the array. This is exclusive of the element at the index 'end'.
3755
3755
  */
3756
- slice(start?: number, end?: number): Uint32Array;
3756
+ slice(start?: number, end?: number): Uint32Array<ArrayBuffer>;
3757
3757
 
3758
3758
  /**
3759
3759
  * Determines whether the specified callback function returns true for any element of an array.
@@ -3763,7 +3763,7 @@ interface Uint32Array {
3763
3763
  * @param thisArg An object to which the this keyword can refer in the predicate function.
3764
3764
  * If thisArg is omitted, undefined is used as the this value.
3765
3765
  */
3766
- some(predicate: (value: number, index: number, array: Uint32Array) => unknown, thisArg?: any): boolean;
3766
+ some(predicate: (value: number, index: number, array: this) => unknown, thisArg?: any): boolean;
3767
3767
 
3768
3768
  /**
3769
3769
  * Sorts an array.
@@ -3782,7 +3782,7 @@ interface Uint32Array {
3782
3782
  * @param begin The index of the beginning of the array.
3783
3783
  * @param end The index of the end of the array.
3784
3784
  */
3785
- subarray(begin?: number, end?: number): Uint32Array;
3785
+ subarray(begin?: number, end?: number): Uint32Array<TArrayBuffer>;
3786
3786
 
3787
3787
  /**
3788
3788
  * Converts a number to a string by using the current locale.
@@ -3795,16 +3795,16 @@ interface Uint32Array {
3795
3795
  toString(): string;
3796
3796
 
3797
3797
  /** Returns the primitive value of the specified object. */
3798
- valueOf(): Uint32Array;
3798
+ valueOf(): this;
3799
3799
 
3800
3800
  [index: number]: number;
3801
3801
  }
3802
-
3803
3802
  interface Uint32ArrayConstructor {
3804
- readonly prototype: Uint32Array;
3805
- new (length: number): Uint32Array;
3806
- new (array: ArrayLike<number> | ArrayBufferLike): Uint32Array;
3807
- new (buffer: ArrayBufferLike, byteOffset?: number, length?: number): Uint32Array;
3803
+ readonly prototype: Uint32Array<ArrayBufferLike>;
3804
+ new (length: number): Uint32Array<ArrayBuffer>;
3805
+ new (array: ArrayLike<number>): Uint32Array<ArrayBuffer>;
3806
+ new <TArrayBuffer extends ArrayBufferLike = ArrayBuffer>(buffer: TArrayBuffer, byteOffset?: number, length?: number): Uint32Array<TArrayBuffer>;
3807
+ new (array: ArrayLike<number> | ArrayBuffer): Uint32Array<ArrayBuffer>;
3808
3808
 
3809
3809
  /**
3810
3810
  * The size in bytes of each element in the array.
@@ -3815,13 +3815,13 @@ interface Uint32ArrayConstructor {
3815
3815
  * Returns a new array from a set of elements.
3816
3816
  * @param items A set of elements to include in the new array object.
3817
3817
  */
3818
- of(...items: number[]): Uint32Array;
3818
+ of(...items: number[]): Uint32Array<ArrayBuffer>;
3819
3819
 
3820
3820
  /**
3821
3821
  * Creates an array from an array-like or iterable object.
3822
3822
  * @param arrayLike An array-like or iterable object to convert to an array.
3823
3823
  */
3824
- from(arrayLike: ArrayLike<number>): Uint32Array;
3824
+ from(arrayLike: ArrayLike<number>): Uint32Array<ArrayBuffer>;
3825
3825
 
3826
3826
  /**
3827
3827
  * Creates an array from an array-like or iterable object.
@@ -3829,7 +3829,7 @@ interface Uint32ArrayConstructor {
3829
3829
  * @param mapfn A mapping function to call on every element of the array.
3830
3830
  * @param thisArg Value of 'this' used to invoke the mapfn.
3831
3831
  */
3832
- from<T>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => number, thisArg?: any): Uint32Array;
3832
+ from<T>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => number, thisArg?: any): Uint32Array<ArrayBuffer>;
3833
3833
  }
3834
3834
  declare var Uint32Array: Uint32ArrayConstructor;
3835
3835
 
@@ -3837,7 +3837,7 @@ declare var Uint32Array: Uint32ArrayConstructor;
3837
3837
  * A typed array of 32-bit float values. The contents are initialized to 0. If the requested number
3838
3838
  * of bytes could not be allocated an exception is raised.
3839
3839
  */
3840
- interface Float32Array {
3840
+ interface Float32Array<TArrayBuffer extends ArrayBufferLike = ArrayBufferLike> {
3841
3841
  /**
3842
3842
  * The size in bytes of each element in the array.
3843
3843
  */
@@ -3846,7 +3846,7 @@ interface Float32Array {
3846
3846
  /**
3847
3847
  * The ArrayBuffer instance referenced by the array.
3848
3848
  */
3849
- readonly buffer: ArrayBufferLike;
3849
+ readonly buffer: TArrayBuffer;
3850
3850
 
3851
3851
  /**
3852
3852
  * The length in bytes of the array.
@@ -3877,7 +3877,7 @@ interface Float32Array {
3877
3877
  * @param thisArg An object to which the this keyword can refer in the predicate function.
3878
3878
  * If thisArg is omitted, undefined is used as the this value.
3879
3879
  */
3880
- every(predicate: (value: number, index: number, array: Float32Array) => unknown, thisArg?: any): boolean;
3880
+ every(predicate: (value: number, index: number, array: this) => unknown, thisArg?: any): boolean;
3881
3881
 
3882
3882
  /**
3883
3883
  * Changes all array elements from `start` to `end` index to a static `value` and returns the modified array
@@ -3896,7 +3896,7 @@ interface Float32Array {
3896
3896
  * @param thisArg An object to which the this keyword can refer in the predicate function.
3897
3897
  * If thisArg is omitted, undefined is used as the this value.
3898
3898
  */
3899
- filter(predicate: (value: number, index: number, array: Float32Array) => any, thisArg?: any): Float32Array;
3899
+ filter(predicate: (value: number, index: number, array: this) => any, thisArg?: any): Float32Array<ArrayBuffer>;
3900
3900
 
3901
3901
  /**
3902
3902
  * Returns the value of the first element in the array where predicate is true, and undefined
@@ -3907,7 +3907,7 @@ interface Float32Array {
3907
3907
  * @param thisArg If provided, it will be used as the this value for each invocation of
3908
3908
  * predicate. If it is not provided, undefined is used instead.
3909
3909
  */
3910
- find(predicate: (value: number, index: number, obj: Float32Array) => boolean, thisArg?: any): number | undefined;
3910
+ find(predicate: (value: number, index: number, obj: this) => boolean, thisArg?: any): number | undefined;
3911
3911
 
3912
3912
  /**
3913
3913
  * Returns the index of the first element in the array where predicate is true, and -1
@@ -3918,7 +3918,7 @@ interface Float32Array {
3918
3918
  * @param thisArg If provided, it will be used as the this value for each invocation of
3919
3919
  * predicate. If it is not provided, undefined is used instead.
3920
3920
  */
3921
- findIndex(predicate: (value: number, index: number, obj: Float32Array) => boolean, thisArg?: any): number;
3921
+ findIndex(predicate: (value: number, index: number, obj: this) => boolean, thisArg?: any): number;
3922
3922
 
3923
3923
  /**
3924
3924
  * Performs the specified action for each element in an array.
@@ -3927,7 +3927,7 @@ interface Float32Array {
3927
3927
  * @param thisArg An object to which the this keyword can refer in the callbackfn function.
3928
3928
  * If thisArg is omitted, undefined is used as the this value.
3929
3929
  */
3930
- forEach(callbackfn: (value: number, index: number, array: Float32Array) => void, thisArg?: any): void;
3930
+ forEach(callbackfn: (value: number, index: number, array: this) => void, thisArg?: any): void;
3931
3931
 
3932
3932
  /**
3933
3933
  * Returns the index of the first occurrence of a value in an array.
@@ -3965,7 +3965,7 @@ interface Float32Array {
3965
3965
  * @param thisArg An object to which the this keyword can refer in the callbackfn function.
3966
3966
  * If thisArg is omitted, undefined is used as the this value.
3967
3967
  */
3968
- map(callbackfn: (value: number, index: number, array: Float32Array) => number, thisArg?: any): Float32Array;
3968
+ map(callbackfn: (value: number, index: number, array: this) => number, thisArg?: any): Float32Array<ArrayBuffer>;
3969
3969
 
3970
3970
  /**
3971
3971
  * Calls the specified callback function for all the elements in an array. The return value of
@@ -3977,8 +3977,8 @@ interface Float32Array {
3977
3977
  * the accumulation. The first call to the callbackfn function provides this value as an argument
3978
3978
  * instead of an array value.
3979
3979
  */
3980
- reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float32Array) => number): number;
3981
- reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float32Array) => number, initialValue: number): number;
3980
+ reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: this) => number): number;
3981
+ reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: this) => number, initialValue: number): number;
3982
3982
 
3983
3983
  /**
3984
3984
  * Calls the specified callback function for all the elements in an array. The return value of
@@ -3990,7 +3990,7 @@ interface Float32Array {
3990
3990
  * the accumulation. The first call to the callbackfn function provides this value as an argument
3991
3991
  * instead of an array value.
3992
3992
  */
3993
- reduce<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Float32Array) => U, initialValue: U): U;
3993
+ reduce<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: this) => U, initialValue: U): U;
3994
3994
 
3995
3995
  /**
3996
3996
  * Calls the specified callback function for all the elements in an array, in descending order.
@@ -4002,8 +4002,8 @@ interface Float32Array {
4002
4002
  * the accumulation. The first call to the callbackfn function provides this value as an
4003
4003
  * argument instead of an array value.
4004
4004
  */
4005
- reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float32Array) => number): number;
4006
- reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float32Array) => number, initialValue: number): number;
4005
+ reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: this) => number): number;
4006
+ reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: this) => number, initialValue: number): number;
4007
4007
 
4008
4008
  /**
4009
4009
  * Calls the specified callback function for all the elements in an array, in descending order.
@@ -4015,12 +4015,12 @@ interface Float32Array {
4015
4015
  * the accumulation. The first call to the callbackfn function provides this value as an argument
4016
4016
  * instead of an array value.
4017
4017
  */
4018
- reduceRight<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Float32Array) => U, initialValue: U): U;
4018
+ reduceRight<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: this) => U, initialValue: U): U;
4019
4019
 
4020
4020
  /**
4021
4021
  * Reverses the elements in an Array.
4022
4022
  */
4023
- reverse(): Float32Array;
4023
+ reverse(): this;
4024
4024
 
4025
4025
  /**
4026
4026
  * Sets a value or an array of values.
@@ -4034,7 +4034,7 @@ interface Float32Array {
4034
4034
  * @param start The beginning of the specified portion of the array.
4035
4035
  * @param end The end of the specified portion of the array. This is exclusive of the element at the index 'end'.
4036
4036
  */
4037
- slice(start?: number, end?: number): Float32Array;
4037
+ slice(start?: number, end?: number): Float32Array<ArrayBuffer>;
4038
4038
 
4039
4039
  /**
4040
4040
  * Determines whether the specified callback function returns true for any element of an array.
@@ -4044,7 +4044,7 @@ interface Float32Array {
4044
4044
  * @param thisArg An object to which the this keyword can refer in the predicate function.
4045
4045
  * If thisArg is omitted, undefined is used as the this value.
4046
4046
  */
4047
- some(predicate: (value: number, index: number, array: Float32Array) => unknown, thisArg?: any): boolean;
4047
+ some(predicate: (value: number, index: number, array: this) => unknown, thisArg?: any): boolean;
4048
4048
 
4049
4049
  /**
4050
4050
  * Sorts an array.
@@ -4063,7 +4063,7 @@ interface Float32Array {
4063
4063
  * @param begin The index of the beginning of the array.
4064
4064
  * @param end The index of the end of the array.
4065
4065
  */
4066
- subarray(begin?: number, end?: number): Float32Array;
4066
+ subarray(begin?: number, end?: number): Float32Array<TArrayBuffer>;
4067
4067
 
4068
4068
  /**
4069
4069
  * Converts a number to a string by using the current locale.
@@ -4076,16 +4076,16 @@ interface Float32Array {
4076
4076
  toString(): string;
4077
4077
 
4078
4078
  /** Returns the primitive value of the specified object. */
4079
- valueOf(): Float32Array;
4079
+ valueOf(): this;
4080
4080
 
4081
4081
  [index: number]: number;
4082
4082
  }
4083
-
4084
4083
  interface Float32ArrayConstructor {
4085
- readonly prototype: Float32Array;
4086
- new (length: number): Float32Array;
4087
- new (array: ArrayLike<number> | ArrayBufferLike): Float32Array;
4088
- new (buffer: ArrayBufferLike, byteOffset?: number, length?: number): Float32Array;
4084
+ readonly prototype: Float32Array<ArrayBufferLike>;
4085
+ new (length: number): Float32Array<ArrayBuffer>;
4086
+ new (array: ArrayLike<number>): Float32Array<ArrayBuffer>;
4087
+ new <TArrayBuffer extends ArrayBufferLike = ArrayBuffer>(buffer: TArrayBuffer, byteOffset?: number, length?: number): Float32Array<TArrayBuffer>;
4088
+ new (array: ArrayLike<number> | ArrayBuffer): Float32Array<ArrayBuffer>;
4089
4089
 
4090
4090
  /**
4091
4091
  * The size in bytes of each element in the array.
@@ -4096,13 +4096,13 @@ interface Float32ArrayConstructor {
4096
4096
  * Returns a new array from a set of elements.
4097
4097
  * @param items A set of elements to include in the new array object.
4098
4098
  */
4099
- of(...items: number[]): Float32Array;
4099
+ of(...items: number[]): Float32Array<ArrayBuffer>;
4100
4100
 
4101
4101
  /**
4102
4102
  * Creates an array from an array-like or iterable object.
4103
4103
  * @param arrayLike An array-like or iterable object to convert to an array.
4104
4104
  */
4105
- from(arrayLike: ArrayLike<number>): Float32Array;
4105
+ from(arrayLike: ArrayLike<number>): Float32Array<ArrayBuffer>;
4106
4106
 
4107
4107
  /**
4108
4108
  * Creates an array from an array-like or iterable object.
@@ -4110,7 +4110,7 @@ interface Float32ArrayConstructor {
4110
4110
  * @param mapfn A mapping function to call on every element of the array.
4111
4111
  * @param thisArg Value of 'this' used to invoke the mapfn.
4112
4112
  */
4113
- from<T>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => number, thisArg?: any): Float32Array;
4113
+ from<T>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => number, thisArg?: any): Float32Array<ArrayBuffer>;
4114
4114
  }
4115
4115
  declare var Float32Array: Float32ArrayConstructor;
4116
4116
 
@@ -4118,7 +4118,7 @@ declare var Float32Array: Float32ArrayConstructor;
4118
4118
  * A typed array of 64-bit float values. The contents are initialized to 0. If the requested
4119
4119
  * number of bytes could not be allocated an exception is raised.
4120
4120
  */
4121
- interface Float64Array {
4121
+ interface Float64Array<TArrayBuffer extends ArrayBufferLike = ArrayBufferLike> {
4122
4122
  /**
4123
4123
  * The size in bytes of each element in the array.
4124
4124
  */
@@ -4127,7 +4127,7 @@ interface Float64Array {
4127
4127
  /**
4128
4128
  * The ArrayBuffer instance referenced by the array.
4129
4129
  */
4130
- readonly buffer: ArrayBufferLike;
4130
+ readonly buffer: TArrayBuffer;
4131
4131
 
4132
4132
  /**
4133
4133
  * The length in bytes of the array.
@@ -4158,7 +4158,7 @@ interface Float64Array {
4158
4158
  * @param thisArg An object to which the this keyword can refer in the predicate function.
4159
4159
  * If thisArg is omitted, undefined is used as the this value.
4160
4160
  */
4161
- every(predicate: (value: number, index: number, array: Float64Array) => unknown, thisArg?: any): boolean;
4161
+ every(predicate: (value: number, index: number, array: this) => unknown, thisArg?: any): boolean;
4162
4162
 
4163
4163
  /**
4164
4164
  * Changes all array elements from `start` to `end` index to a static `value` and returns the modified array
@@ -4177,7 +4177,7 @@ interface Float64Array {
4177
4177
  * @param thisArg An object to which the this keyword can refer in the predicate function.
4178
4178
  * If thisArg is omitted, undefined is used as the this value.
4179
4179
  */
4180
- filter(predicate: (value: number, index: number, array: Float64Array) => any, thisArg?: any): Float64Array;
4180
+ filter(predicate: (value: number, index: number, array: this) => any, thisArg?: any): Float64Array<ArrayBuffer>;
4181
4181
 
4182
4182
  /**
4183
4183
  * Returns the value of the first element in the array where predicate is true, and undefined
@@ -4188,7 +4188,7 @@ interface Float64Array {
4188
4188
  * @param thisArg If provided, it will be used as the this value for each invocation of
4189
4189
  * predicate. If it is not provided, undefined is used instead.
4190
4190
  */
4191
- find(predicate: (value: number, index: number, obj: Float64Array) => boolean, thisArg?: any): number | undefined;
4191
+ find(predicate: (value: number, index: number, obj: this) => boolean, thisArg?: any): number | undefined;
4192
4192
 
4193
4193
  /**
4194
4194
  * Returns the index of the first element in the array where predicate is true, and -1
@@ -4199,7 +4199,7 @@ interface Float64Array {
4199
4199
  * @param thisArg If provided, it will be used as the this value for each invocation of
4200
4200
  * predicate. If it is not provided, undefined is used instead.
4201
4201
  */
4202
- findIndex(predicate: (value: number, index: number, obj: Float64Array) => boolean, thisArg?: any): number;
4202
+ findIndex(predicate: (value: number, index: number, obj: this) => boolean, thisArg?: any): number;
4203
4203
 
4204
4204
  /**
4205
4205
  * Performs the specified action for each element in an array.
@@ -4208,7 +4208,7 @@ interface Float64Array {
4208
4208
  * @param thisArg An object to which the this keyword can refer in the callbackfn function.
4209
4209
  * If thisArg is omitted, undefined is used as the this value.
4210
4210
  */
4211
- forEach(callbackfn: (value: number, index: number, array: Float64Array) => void, thisArg?: any): void;
4211
+ forEach(callbackfn: (value: number, index: number, array: this) => void, thisArg?: any): void;
4212
4212
 
4213
4213
  /**
4214
4214
  * Returns the index of the first occurrence of a value in an array.
@@ -4246,7 +4246,7 @@ interface Float64Array {
4246
4246
  * @param thisArg An object to which the this keyword can refer in the callbackfn function.
4247
4247
  * If thisArg is omitted, undefined is used as the this value.
4248
4248
  */
4249
- map(callbackfn: (value: number, index: number, array: Float64Array) => number, thisArg?: any): Float64Array;
4249
+ map(callbackfn: (value: number, index: number, array: this) => number, thisArg?: any): Float64Array<ArrayBuffer>;
4250
4250
 
4251
4251
  /**
4252
4252
  * Calls the specified callback function for all the elements in an array. The return value of
@@ -4258,8 +4258,8 @@ interface Float64Array {
4258
4258
  * the accumulation. The first call to the callbackfn function provides this value as an argument
4259
4259
  * instead of an array value.
4260
4260
  */
4261
- reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float64Array) => number): number;
4262
- reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float64Array) => number, initialValue: number): number;
4261
+ reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: this) => number): number;
4262
+ reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: this) => number, initialValue: number): number;
4263
4263
 
4264
4264
  /**
4265
4265
  * Calls the specified callback function for all the elements in an array. The return value of
@@ -4271,7 +4271,7 @@ interface Float64Array {
4271
4271
  * the accumulation. The first call to the callbackfn function provides this value as an argument
4272
4272
  * instead of an array value.
4273
4273
  */
4274
- reduce<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Float64Array) => U, initialValue: U): U;
4274
+ reduce<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: this) => U, initialValue: U): U;
4275
4275
 
4276
4276
  /**
4277
4277
  * Calls the specified callback function for all the elements in an array, in descending order.
@@ -4283,8 +4283,8 @@ interface Float64Array {
4283
4283
  * the accumulation. The first call to the callbackfn function provides this value as an
4284
4284
  * argument instead of an array value.
4285
4285
  */
4286
- reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float64Array) => number): number;
4287
- reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float64Array) => number, initialValue: number): number;
4286
+ reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: this) => number): number;
4287
+ reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: this) => number, initialValue: number): number;
4288
4288
 
4289
4289
  /**
4290
4290
  * Calls the specified callback function for all the elements in an array, in descending order.
@@ -4296,12 +4296,12 @@ interface Float64Array {
4296
4296
  * the accumulation. The first call to the callbackfn function provides this value as an argument
4297
4297
  * instead of an array value.
4298
4298
  */
4299
- reduceRight<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Float64Array) => U, initialValue: U): U;
4299
+ reduceRight<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: this) => U, initialValue: U): U;
4300
4300
 
4301
4301
  /**
4302
4302
  * Reverses the elements in an Array.
4303
4303
  */
4304
- reverse(): Float64Array;
4304
+ reverse(): this;
4305
4305
 
4306
4306
  /**
4307
4307
  * Sets a value or an array of values.
@@ -4315,7 +4315,7 @@ interface Float64Array {
4315
4315
  * @param start The beginning of the specified portion of the array.
4316
4316
  * @param end The end of the specified portion of the array. This is exclusive of the element at the index 'end'.
4317
4317
  */
4318
- slice(start?: number, end?: number): Float64Array;
4318
+ slice(start?: number, end?: number): Float64Array<ArrayBuffer>;
4319
4319
 
4320
4320
  /**
4321
4321
  * Determines whether the specified callback function returns true for any element of an array.
@@ -4325,7 +4325,7 @@ interface Float64Array {
4325
4325
  * @param thisArg An object to which the this keyword can refer in the predicate function.
4326
4326
  * If thisArg is omitted, undefined is used as the this value.
4327
4327
  */
4328
- some(predicate: (value: number, index: number, array: Float64Array) => unknown, thisArg?: any): boolean;
4328
+ some(predicate: (value: number, index: number, array: this) => unknown, thisArg?: any): boolean;
4329
4329
 
4330
4330
  /**
4331
4331
  * Sorts an array.
@@ -4344,7 +4344,7 @@ interface Float64Array {
4344
4344
  * @param begin The index of the beginning of the array.
4345
4345
  * @param end The index of the end of the array.
4346
4346
  */
4347
- subarray(begin?: number, end?: number): Float64Array;
4347
+ subarray(begin?: number, end?: number): Float64Array<TArrayBuffer>;
4348
4348
 
4349
4349
  /**
4350
4350
  * Converts a number to a string by using the current locale.
@@ -4357,16 +4357,16 @@ interface Float64Array {
4357
4357
  toString(): string;
4358
4358
 
4359
4359
  /** Returns the primitive value of the specified object. */
4360
- valueOf(): Float64Array;
4360
+ valueOf(): this;
4361
4361
 
4362
4362
  [index: number]: number;
4363
4363
  }
4364
-
4365
4364
  interface Float64ArrayConstructor {
4366
- readonly prototype: Float64Array;
4367
- new (length: number): Float64Array;
4368
- new (array: ArrayLike<number> | ArrayBufferLike): Float64Array;
4369
- new (buffer: ArrayBufferLike, byteOffset?: number, length?: number): Float64Array;
4365
+ readonly prototype: Float64Array<ArrayBufferLike>;
4366
+ new (length: number): Float64Array<ArrayBuffer>;
4367
+ new (array: ArrayLike<number>): Float64Array<ArrayBuffer>;
4368
+ new <TArrayBuffer extends ArrayBufferLike = ArrayBuffer>(buffer: TArrayBuffer, byteOffset?: number, length?: number): Float64Array<TArrayBuffer>;
4369
+ new (array: ArrayLike<number> | ArrayBuffer): Float64Array<ArrayBuffer>;
4370
4370
 
4371
4371
  /**
4372
4372
  * The size in bytes of each element in the array.
@@ -4377,13 +4377,13 @@ interface Float64ArrayConstructor {
4377
4377
  * Returns a new array from a set of elements.
4378
4378
  * @param items A set of elements to include in the new array object.
4379
4379
  */
4380
- of(...items: number[]): Float64Array;
4380
+ of(...items: number[]): Float64Array<ArrayBuffer>;
4381
4381
 
4382
4382
  /**
4383
4383
  * Creates an array from an array-like or iterable object.
4384
4384
  * @param arrayLike An array-like or iterable object to convert to an array.
4385
4385
  */
4386
- from(arrayLike: ArrayLike<number>): Float64Array;
4386
+ from(arrayLike: ArrayLike<number>): Float64Array<ArrayBuffer>;
4387
4387
 
4388
4388
  /**
4389
4389
  * Creates an array from an array-like or iterable object.
@@ -4391,7 +4391,7 @@ interface Float64ArrayConstructor {
4391
4391
  * @param mapfn A mapping function to call on every element of the array.
4392
4392
  * @param thisArg Value of 'this' used to invoke the mapfn.
4393
4393
  */
4394
- from<T>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => number, thisArg?: any): Float64Array;
4394
+ from<T>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => number, thisArg?: any): Float64Array<ArrayBuffer>;
4395
4395
  }
4396
4396
  declare var Float64Array: Float64ArrayConstructor;
4397
4397