@stencil/core 4.38.0 → 4.38.1

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.
Files changed (90) hide show
  1. package/cli/index.cjs +1 -1
  2. package/cli/index.js +1 -1
  3. package/cli/package.json +1 -1
  4. package/compiler/lib.decorators.d.ts +13 -15
  5. package/compiler/lib.dom.asynciterable.d.ts +14 -6
  6. package/compiler/lib.dom.d.ts +15847 -5014
  7. package/compiler/lib.dom.iterable.d.ts +207 -111
  8. package/compiler/lib.es2015.core.d.ts +9 -9
  9. package/compiler/lib.es2015.generator.d.ts +2 -2
  10. package/compiler/lib.es2015.iterable.d.ts +214 -104
  11. package/compiler/lib.es2015.symbol.wellknown.d.ts +11 -11
  12. package/compiler/lib.es2016.array.include.d.ts +9 -9
  13. package/compiler/lib.es2016.intl.d.ts +1 -1
  14. package/compiler/lib.es2017.arraybuffer.d.ts +21 -0
  15. package/compiler/lib.es2017.d.ts +3 -2
  16. package/compiler/lib.es2017.object.d.ts +4 -4
  17. package/compiler/lib.es2017.sharedmemory.d.ts +15 -15
  18. package/compiler/lib.es2017.typedarrays.d.ts +9 -9
  19. package/compiler/lib.es2018.asyncgenerator.d.ts +2 -2
  20. package/compiler/lib.es2018.asynciterable.d.ts +16 -6
  21. package/compiler/lib.es2020.bigint.d.ts +100 -62
  22. package/compiler/lib.es2020.intl.d.ts +36 -36
  23. package/compiler/lib.es2020.sharedmemory.d.ts +13 -11
  24. package/compiler/lib.es2020.string.d.ts +3 -1
  25. package/compiler/lib.es2020.symbol.wellknown.d.ts +5 -1
  26. package/compiler/lib.es2021.intl.d.ts +17 -17
  27. package/compiler/lib.es2021.weakref.d.ts +2 -0
  28. package/compiler/lib.es2022.array.d.ts +11 -11
  29. package/compiler/lib.es2022.d.ts +1 -2
  30. package/compiler/lib.es2022.error.d.ts +2 -0
  31. package/compiler/lib.es2022.intl.d.ts +39 -11
  32. package/compiler/lib.es2023.array.d.ts +79 -79
  33. package/compiler/lib.es2024.arraybuffer.d.ts +65 -0
  34. package/compiler/lib.es2024.collection.d.ts +29 -0
  35. package/compiler/lib.es2024.d.ts +26 -0
  36. package/compiler/lib.es2024.full.d.ts +24 -0
  37. package/compiler/lib.es2024.promise.d.ts +35 -0
  38. package/compiler/{lib.es2022.sharedmemory.d.ts → lib.es2024.sharedmemory.d.ts} +29 -0
  39. package/compiler/lib.es5.d.ts +321 -305
  40. package/compiler/lib.esnext.array.d.ts +1 -1
  41. package/compiler/lib.esnext.collection.d.ts +1 -11
  42. package/compiler/lib.esnext.d.ts +6 -5
  43. package/compiler/lib.esnext.disposable.d.ts +8 -0
  44. package/compiler/lib.esnext.error.d.ts +24 -0
  45. package/compiler/lib.esnext.float16.d.ts +445 -0
  46. package/compiler/lib.esnext.iterator.d.ts +148 -0
  47. package/compiler/lib.esnext.promise.d.ts +11 -12
  48. package/compiler/lib.esnext.sharedmemory.d.ts +25 -0
  49. package/compiler/lib.webworker.asynciterable.d.ts +14 -6
  50. package/compiler/lib.webworker.d.ts +5113 -1394
  51. package/compiler/lib.webworker.iterable.d.ts +125 -61
  52. package/compiler/package.json +1 -1
  53. package/compiler/stencil.js +20679 -15213
  54. package/dev-server/client/index.js +1 -1
  55. package/dev-server/client/package.json +1 -1
  56. package/dev-server/connector.html +2 -2
  57. package/dev-server/index.js +1 -1
  58. package/dev-server/package.json +1 -1
  59. package/dev-server/server-process.js +2 -2
  60. package/internal/app-data/package.json +1 -1
  61. package/internal/app-globals/package.json +1 -1
  62. package/internal/client/index.js +5 -2
  63. package/internal/client/package.json +1 -1
  64. package/internal/client/patch-browser.js +1 -1
  65. package/internal/hydrate/index.js +5 -2
  66. package/internal/hydrate/package.json +1 -1
  67. package/internal/hydrate/runner.js +2 -2
  68. package/internal/package.json +1 -1
  69. package/internal/stencil-public-runtime.d.ts +2 -1
  70. package/internal/testing/index.js +4 -1
  71. package/internal/testing/package.json +1 -1
  72. package/mock-doc/index.cjs +2 -2
  73. package/mock-doc/index.d.ts +2 -2
  74. package/mock-doc/index.js +2 -2
  75. package/mock-doc/package.json +1 -1
  76. package/package.json +9 -9
  77. package/screenshot/index.js +1 -1
  78. package/screenshot/package.json +1 -1
  79. package/screenshot/pixel-match.js +1 -1
  80. package/screenshot/screenshot-fs.d.ts +1 -1
  81. package/sys/node/index.js +1 -1
  82. package/sys/node/package.json +1 -1
  83. package/sys/node/worker.js +1 -1
  84. package/testing/index.d.ts +1 -1
  85. package/testing/index.js +93 -1
  86. package/testing/mocks.d.ts +1 -0
  87. package/testing/package.json +1 -1
  88. /package/compiler/{lib.esnext.object.d.ts → lib.es2024.object.d.ts} +0 -0
  89. /package/compiler/{lib.esnext.regexp.d.ts → lib.es2024.regexp.d.ts} +0 -0
  90. /package/compiler/{lib.esnext.string.d.ts → lib.es2024.string.d.ts} +0 -0
@@ -696,7 +696,7 @@ interface Math {
696
696
  */
697
697
  atan(x: number): number;
698
698
  /**
699
- * Returns the angle (in radians) from the X axis to a point.
699
+ * Returns the angle (in radians) between the X axis and the line going through both the origin and the given point.
700
700
  * @param y A numeric expression representing the cartesian y-coordinate.
701
701
  * @param x A numeric expression representing the cartesian x-coordinate.
702
702
  */
@@ -1158,6 +1158,7 @@ interface JSON {
1158
1158
  * @param text A valid JSON string.
1159
1159
  * @param reviver A function that transforms the results. This function is called for each member of the object.
1160
1160
  * If a member contains nested objects, the nested objects are transformed before the parent object is.
1161
+ * @throws {SyntaxError} If `text` is not valid JSON.
1161
1162
  */
1162
1163
  parse(text: string, reviver?: (this: any, key: string, value: any) => any): any;
1163
1164
  /**
@@ -1165,6 +1166,7 @@ interface JSON {
1165
1166
  * @param value A JavaScript value, usually an object or array, to be converted.
1166
1167
  * @param replacer A function that transforms the results.
1167
1168
  * @param space Adds indentation, white space, and line break characters to the return-value JSON text to make it easier to read.
1169
+ * @throws {TypeError} If a circular reference or a BigInt value is found.
1168
1170
  */
1169
1171
  stringify(value: any, replacer?: (this: any, key: string, value: any) => any, space?: string | number): string;
1170
1172
  /**
@@ -1172,6 +1174,7 @@ interface JSON {
1172
1174
  * @param value A JavaScript value, usually an object or array, to be converted.
1173
1175
  * @param replacer An array of strings and numbers that acts as an approved list for selecting the object properties that will be stringified.
1174
1176
  * @param space Adds indentation, white space, and line break characters to the return-value JSON text to make it easier to read.
1177
+ * @throws {TypeError} If a circular reference or a BigInt value is found.
1175
1178
  */
1176
1179
  stringify(value: any, replacer?: (number | string)[] | null, space?: string | number): string;
1177
1180
  }
@@ -1260,8 +1263,8 @@ interface ReadonlyArray<T> {
1260
1263
  some(predicate: (value: T, index: number, array: readonly T[]) => unknown, thisArg?: any): boolean;
1261
1264
  /**
1262
1265
  * Performs the specified action for each element in an array.
1263
- * @param callbackfn A function that accepts up to three arguments. forEach calls the callbackfn function one time for each element in the array.
1264
- * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.
1266
+ * @param callbackfn A function that accepts up to three arguments. forEach calls the callbackfn function one time for each element in the array.
1267
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.
1265
1268
  */
1266
1269
  forEach(callbackfn: (value: T, index: number, array: readonly T[]) => void, thisArg?: any): void;
1267
1270
  /**
@@ -1384,7 +1387,7 @@ interface Array<T> {
1384
1387
  * This method mutates the array and returns a reference to the same array.
1385
1388
  * @param compareFn Function used to determine the order of the elements. It is expected to return
1386
1389
  * a negative value if the first argument is less than the second argument, zero if they're equal, and a positive
1387
- * value otherwise. If omitted, the elements are sorted in ascending, ASCII character order.
1390
+ * value otherwise. If omitted, the elements are sorted in ascending, UTF-16 code unit order.
1388
1391
  * ```ts
1389
1392
  * [11,2,22,1].sort((a, b) => a - b)
1390
1393
  * ```
@@ -1393,14 +1396,18 @@ interface Array<T> {
1393
1396
  /**
1394
1397
  * Removes elements from an array and, if necessary, inserts new elements in their place, returning the deleted elements.
1395
1398
  * @param start The zero-based location in the array from which to start removing elements.
1396
- * @param deleteCount The number of elements to remove.
1399
+ * @param deleteCount The number of elements to remove. Omitting this argument will remove all elements from the start
1400
+ * paramater location to end of the array. If value of this argument is either a negative number, zero, undefined, or a type
1401
+ * that cannot be converted to an integer, the function will evaluate the argument as zero and not remove any elements.
1397
1402
  * @returns An array containing the elements that were deleted.
1398
1403
  */
1399
1404
  splice(start: number, deleteCount?: number): T[];
1400
1405
  /**
1401
1406
  * Removes elements from an array and, if necessary, inserts new elements in their place, returning the deleted elements.
1402
1407
  * @param start The zero-based location in the array from which to start removing elements.
1403
- * @param deleteCount The number of elements to remove.
1408
+ * @param deleteCount The number of elements to remove. If value of this argument is either a negative number, zero,
1409
+ * undefined, or a type that cannot be converted to an integer, the function will evaluate the argument as zero and
1410
+ * not remove any elements.
1404
1411
  * @param items Elements to insert into the array in place of the deleted elements.
1405
1412
  * @returns An array containing the elements that were deleted.
1406
1413
  */
@@ -1451,8 +1458,8 @@ interface Array<T> {
1451
1458
  some(predicate: (value: T, index: number, array: T[]) => unknown, thisArg?: any): boolean;
1452
1459
  /**
1453
1460
  * Performs the specified action for each element in an array.
1454
- * @param callbackfn A function that accepts up to three arguments. forEach calls the callbackfn function one time for each element in the array.
1455
- * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.
1461
+ * @param callbackfn A function that accepts up to three arguments. forEach calls the callbackfn function one time for each element in the array.
1462
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.
1456
1463
  */
1457
1464
  forEach(callbackfn: (value: T, index: number, array: T[]) => void, thisArg?: any): void;
1458
1465
  /**
@@ -1701,7 +1708,7 @@ interface ArrayBuffer {
1701
1708
  /**
1702
1709
  * Returns a section of an ArrayBuffer.
1703
1710
  */
1704
- slice(begin: number, end?: number): ArrayBuffer;
1711
+ slice(begin?: number, end?: number): ArrayBuffer;
1705
1712
  }
1706
1713
 
1707
1714
  /**
@@ -1719,25 +1726,25 @@ interface ArrayBufferConstructor {
1719
1726
  }
1720
1727
  declare var ArrayBuffer: ArrayBufferConstructor;
1721
1728
 
1722
- interface ArrayBufferView {
1729
+ interface ArrayBufferView<TArrayBuffer extends ArrayBufferLike = ArrayBufferLike> {
1723
1730
  /**
1724
1731
  * The ArrayBuffer instance referenced by the array.
1725
1732
  */
1726
- buffer: ArrayBufferLike;
1733
+ readonly buffer: TArrayBuffer;
1727
1734
 
1728
1735
  /**
1729
1736
  * The length in bytes of the array.
1730
1737
  */
1731
- byteLength: number;
1738
+ readonly byteLength: number;
1732
1739
 
1733
1740
  /**
1734
1741
  * The offset in bytes of the array.
1735
1742
  */
1736
- byteOffset: number;
1743
+ readonly byteOffset: number;
1737
1744
  }
1738
1745
 
1739
- interface DataView {
1740
- readonly buffer: ArrayBuffer;
1746
+ interface DataView<TArrayBuffer extends ArrayBufferLike = ArrayBufferLike> {
1747
+ readonly buffer: TArrayBuffer;
1741
1748
  readonly byteLength: number;
1742
1749
  readonly byteOffset: number;
1743
1750
  /**
@@ -1863,10 +1870,9 @@ interface DataView {
1863
1870
  */
1864
1871
  setUint32(byteOffset: number, value: number, littleEndian?: boolean): void;
1865
1872
  }
1866
-
1867
1873
  interface DataViewConstructor {
1868
- readonly prototype: DataView;
1869
- new (buffer: ArrayBufferLike & { BYTES_PER_ELEMENT?: never; }, byteOffset?: number, byteLength?: number): DataView;
1874
+ readonly prototype: DataView<ArrayBufferLike>;
1875
+ new <TArrayBuffer extends ArrayBufferLike & { BYTES_PER_ELEMENT?: never; }>(buffer: TArrayBuffer, byteOffset?: number, byteLength?: number): DataView<TArrayBuffer>;
1870
1876
  }
1871
1877
  declare var DataView: DataViewConstructor;
1872
1878
 
@@ -1874,7 +1880,7 @@ declare var DataView: DataViewConstructor;
1874
1880
  * A typed array of 8-bit integer values. The contents are initialized to 0. If the requested
1875
1881
  * number of bytes could not be allocated an exception is raised.
1876
1882
  */
1877
- interface Int8Array {
1883
+ interface Int8Array<TArrayBuffer extends ArrayBufferLike = ArrayBufferLike> {
1878
1884
  /**
1879
1885
  * The size in bytes of each element in the array.
1880
1886
  */
@@ -1883,7 +1889,7 @@ interface Int8Array {
1883
1889
  /**
1884
1890
  * The ArrayBuffer instance referenced by the array.
1885
1891
  */
1886
- readonly buffer: ArrayBufferLike;
1892
+ readonly buffer: TArrayBuffer;
1887
1893
 
1888
1894
  /**
1889
1895
  * The length in bytes of the array.
@@ -1914,7 +1920,7 @@ interface Int8Array {
1914
1920
  * @param thisArg An object to which the this keyword can refer in the predicate function.
1915
1921
  * If thisArg is omitted, undefined is used as the this value.
1916
1922
  */
1917
- every(predicate: (value: number, index: number, array: Int8Array) => unknown, thisArg?: any): boolean;
1923
+ every(predicate: (value: number, index: number, array: this) => unknown, thisArg?: any): boolean;
1918
1924
 
1919
1925
  /**
1920
1926
  * Changes all array elements from `start` to `end` index to a static `value` and returns the modified array
@@ -1933,7 +1939,7 @@ interface Int8Array {
1933
1939
  * @param thisArg An object to which the this keyword can refer in the predicate function.
1934
1940
  * If thisArg is omitted, undefined is used as the this value.
1935
1941
  */
1936
- filter(predicate: (value: number, index: number, array: Int8Array) => any, thisArg?: any): Int8Array;
1942
+ filter(predicate: (value: number, index: number, array: this) => any, thisArg?: any): Int8Array<ArrayBuffer>;
1937
1943
 
1938
1944
  /**
1939
1945
  * Returns the value of the first element in the array where predicate is true, and undefined
@@ -1944,7 +1950,7 @@ interface Int8Array {
1944
1950
  * @param thisArg If provided, it will be used as the this value for each invocation of
1945
1951
  * predicate. If it is not provided, undefined is used instead.
1946
1952
  */
1947
- find(predicate: (value: number, index: number, obj: Int8Array) => boolean, thisArg?: any): number | undefined;
1953
+ find(predicate: (value: number, index: number, obj: this) => boolean, thisArg?: any): number | undefined;
1948
1954
 
1949
1955
  /**
1950
1956
  * Returns the index of the first element in the array where predicate is true, and -1
@@ -1955,22 +1961,22 @@ interface Int8Array {
1955
1961
  * @param thisArg If provided, it will be used as the this value for each invocation of
1956
1962
  * predicate. If it is not provided, undefined is used instead.
1957
1963
  */
1958
- findIndex(predicate: (value: number, index: number, obj: Int8Array) => boolean, thisArg?: any): number;
1964
+ findIndex(predicate: (value: number, index: number, obj: this) => boolean, thisArg?: any): number;
1959
1965
 
1960
1966
  /**
1961
1967
  * Performs the specified action for each element in an array.
1962
- * @param callbackfn A function that accepts up to three arguments. forEach calls the
1968
+ * @param callbackfn A function that accepts up to three arguments. forEach calls the
1963
1969
  * callbackfn function one time for each element in the array.
1964
- * @param thisArg An object to which the this keyword can refer in the callbackfn function.
1970
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function.
1965
1971
  * If thisArg is omitted, undefined is used as the this value.
1966
1972
  */
1967
- forEach(callbackfn: (value: number, index: number, array: Int8Array) => void, thisArg?: any): void;
1973
+ forEach(callbackfn: (value: number, index: number, array: this) => void, thisArg?: any): void;
1968
1974
 
1969
1975
  /**
1970
1976
  * Returns the index of the first occurrence of a value in an array.
1971
1977
  * @param searchElement The value to locate in the array.
1972
1978
  * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the
1973
- * search starts at index 0.
1979
+ * search starts at index 0.
1974
1980
  */
1975
1981
  indexOf(searchElement: number, fromIndex?: number): number;
1976
1982
 
@@ -2002,7 +2008,7 @@ interface Int8Array {
2002
2008
  * @param thisArg An object to which the this keyword can refer in the callbackfn function.
2003
2009
  * If thisArg is omitted, undefined is used as the this value.
2004
2010
  */
2005
- map(callbackfn: (value: number, index: number, array: Int8Array) => number, thisArg?: any): Int8Array;
2011
+ map(callbackfn: (value: number, index: number, array: this) => number, thisArg?: any): Int8Array<ArrayBuffer>;
2006
2012
 
2007
2013
  /**
2008
2014
  * Calls the specified callback function for all the elements in an array. The return value of
@@ -2014,8 +2020,8 @@ interface Int8Array {
2014
2020
  * the accumulation. The first call to the callbackfn function provides this value as an argument
2015
2021
  * instead of an array value.
2016
2022
  */
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;
2023
+ reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: this) => number): number;
2024
+ reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: this) => number, initialValue: number): number;
2019
2025
 
2020
2026
  /**
2021
2027
  * Calls the specified callback function for all the elements in an array. The return value of
@@ -2027,7 +2033,7 @@ interface Int8Array {
2027
2033
  * the accumulation. The first call to the callbackfn function provides this value as an argument
2028
2034
  * instead of an array value.
2029
2035
  */
2030
- reduce<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int8Array) => U, initialValue: U): U;
2036
+ reduce<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: this) => U, initialValue: U): U;
2031
2037
 
2032
2038
  /**
2033
2039
  * Calls the specified callback function for all the elements in an array, in descending order.
@@ -2039,8 +2045,8 @@ interface Int8Array {
2039
2045
  * the accumulation. The first call to the callbackfn function provides this value as an
2040
2046
  * argument instead of an array value.
2041
2047
  */
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;
2048
+ reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: this) => number): number;
2049
+ reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: this) => number, initialValue: number): number;
2044
2050
 
2045
2051
  /**
2046
2052
  * Calls the specified callback function for all the elements in an array, in descending order.
@@ -2052,12 +2058,12 @@ interface Int8Array {
2052
2058
  * the accumulation. The first call to the callbackfn function provides this value as an argument
2053
2059
  * instead of an array value.
2054
2060
  */
2055
- reduceRight<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int8Array) => U, initialValue: U): U;
2061
+ reduceRight<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: this) => U, initialValue: U): U;
2056
2062
 
2057
2063
  /**
2058
2064
  * Reverses the elements in an Array.
2059
2065
  */
2060
- reverse(): Int8Array;
2066
+ reverse(): this;
2061
2067
 
2062
2068
  /**
2063
2069
  * Sets a value or an array of values.
@@ -2071,7 +2077,7 @@ interface Int8Array {
2071
2077
  * @param start The beginning of the specified portion of the array.
2072
2078
  * @param end The end of the specified portion of the array. This is exclusive of the element at the index 'end'.
2073
2079
  */
2074
- slice(start?: number, end?: number): Int8Array;
2080
+ slice(start?: number, end?: number): Int8Array<ArrayBuffer>;
2075
2081
 
2076
2082
  /**
2077
2083
  * Determines whether the specified callback function returns true for any element of an array.
@@ -2081,7 +2087,7 @@ interface Int8Array {
2081
2087
  * @param thisArg An object to which the this keyword can refer in the predicate function.
2082
2088
  * If thisArg is omitted, undefined is used as the this value.
2083
2089
  */
2084
- some(predicate: (value: number, index: number, array: Int8Array) => unknown, thisArg?: any): boolean;
2090
+ some(predicate: (value: number, index: number, array: this) => unknown, thisArg?: any): boolean;
2085
2091
 
2086
2092
  /**
2087
2093
  * Sorts an array.
@@ -2100,7 +2106,7 @@ interface Int8Array {
2100
2106
  * @param begin The index of the beginning of the array.
2101
2107
  * @param end The index of the end of the array.
2102
2108
  */
2103
- subarray(begin?: number, end?: number): Int8Array;
2109
+ subarray(begin?: number, end?: number): Int8Array<TArrayBuffer>;
2104
2110
 
2105
2111
  /**
2106
2112
  * Converts a number to a string by using the current locale.
@@ -2113,15 +2119,17 @@ interface Int8Array {
2113
2119
  toString(): string;
2114
2120
 
2115
2121
  /** Returns the primitive value of the specified object. */
2116
- valueOf(): Int8Array;
2122
+ valueOf(): this;
2117
2123
 
2118
2124
  [index: number]: number;
2119
2125
  }
2120
2126
  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;
2127
+ readonly prototype: Int8Array<ArrayBufferLike>;
2128
+ new (length: number): Int8Array<ArrayBuffer>;
2129
+ new (array: ArrayLike<number>): Int8Array<ArrayBuffer>;
2130
+ new <TArrayBuffer extends ArrayBufferLike = ArrayBuffer>(buffer: TArrayBuffer, byteOffset?: number, length?: number): Int8Array<TArrayBuffer>;
2131
+ new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Int8Array<ArrayBuffer>;
2132
+ new (array: ArrayLike<number> | ArrayBuffer): Int8Array<ArrayBuffer>;
2125
2133
 
2126
2134
  /**
2127
2135
  * The size in bytes of each element in the array.
@@ -2132,21 +2140,21 @@ interface Int8ArrayConstructor {
2132
2140
  * Returns a new array from a set of elements.
2133
2141
  * @param items A set of elements to include in the new array object.
2134
2142
  */
2135
- of(...items: number[]): Int8Array;
2143
+ of(...items: number[]): Int8Array<ArrayBuffer>;
2136
2144
 
2137
2145
  /**
2138
2146
  * Creates an array from an array-like or iterable object.
2139
- * @param arrayLike An array-like or iterable object to convert to an array.
2147
+ * @param arrayLike An array-like object to convert to an array.
2140
2148
  */
2141
- from(arrayLike: ArrayLike<number>): Int8Array;
2149
+ from(arrayLike: ArrayLike<number>): Int8Array<ArrayBuffer>;
2142
2150
 
2143
2151
  /**
2144
2152
  * Creates an array from an array-like or iterable object.
2145
- * @param arrayLike An array-like or iterable object to convert to an array.
2153
+ * @param arrayLike An array-like object to convert to an array.
2146
2154
  * @param mapfn A mapping function to call on every element of the array.
2147
2155
  * @param thisArg Value of 'this' used to invoke the mapfn.
2148
2156
  */
2149
- from<T>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => number, thisArg?: any): Int8Array;
2157
+ from<T>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => number, thisArg?: any): Int8Array<ArrayBuffer>;
2150
2158
  }
2151
2159
  declare var Int8Array: Int8ArrayConstructor;
2152
2160
 
@@ -2154,7 +2162,7 @@ declare var Int8Array: Int8ArrayConstructor;
2154
2162
  * A typed array of 8-bit unsigned integer values. The contents are initialized to 0. If the
2155
2163
  * requested number of bytes could not be allocated an exception is raised.
2156
2164
  */
2157
- interface Uint8Array {
2165
+ interface Uint8Array<TArrayBuffer extends ArrayBufferLike = ArrayBufferLike> {
2158
2166
  /**
2159
2167
  * The size in bytes of each element in the array.
2160
2168
  */
@@ -2163,7 +2171,7 @@ interface Uint8Array {
2163
2171
  /**
2164
2172
  * The ArrayBuffer instance referenced by the array.
2165
2173
  */
2166
- readonly buffer: ArrayBufferLike;
2174
+ readonly buffer: TArrayBuffer;
2167
2175
 
2168
2176
  /**
2169
2177
  * The length in bytes of the array.
@@ -2194,7 +2202,7 @@ interface Uint8Array {
2194
2202
  * @param thisArg An object to which the this keyword can refer in the predicate function.
2195
2203
  * If thisArg is omitted, undefined is used as the this value.
2196
2204
  */
2197
- every(predicate: (value: number, index: number, array: Uint8Array) => unknown, thisArg?: any): boolean;
2205
+ every(predicate: (value: number, index: number, array: this) => unknown, thisArg?: any): boolean;
2198
2206
 
2199
2207
  /**
2200
2208
  * Changes all array elements from `start` to `end` index to a static `value` and returns the modified array
@@ -2213,7 +2221,7 @@ interface Uint8Array {
2213
2221
  * @param thisArg An object to which the this keyword can refer in the predicate function.
2214
2222
  * If thisArg is omitted, undefined is used as the this value.
2215
2223
  */
2216
- filter(predicate: (value: number, index: number, array: Uint8Array) => any, thisArg?: any): Uint8Array;
2224
+ filter(predicate: (value: number, index: number, array: this) => any, thisArg?: any): Uint8Array<ArrayBuffer>;
2217
2225
 
2218
2226
  /**
2219
2227
  * Returns the value of the first element in the array where predicate is true, and undefined
@@ -2224,7 +2232,7 @@ interface Uint8Array {
2224
2232
  * @param thisArg If provided, it will be used as the this value for each invocation of
2225
2233
  * predicate. If it is not provided, undefined is used instead.
2226
2234
  */
2227
- find(predicate: (value: number, index: number, obj: Uint8Array) => boolean, thisArg?: any): number | undefined;
2235
+ find(predicate: (value: number, index: number, obj: this) => boolean, thisArg?: any): number | undefined;
2228
2236
 
2229
2237
  /**
2230
2238
  * Returns the index of the first element in the array where predicate is true, and -1
@@ -2235,22 +2243,22 @@ interface Uint8Array {
2235
2243
  * @param thisArg If provided, it will be used as the this value for each invocation of
2236
2244
  * predicate. If it is not provided, undefined is used instead.
2237
2245
  */
2238
- findIndex(predicate: (value: number, index: number, obj: Uint8Array) => boolean, thisArg?: any): number;
2246
+ findIndex(predicate: (value: number, index: number, obj: this) => boolean, thisArg?: any): number;
2239
2247
 
2240
2248
  /**
2241
2249
  * Performs the specified action for each element in an array.
2242
- * @param callbackfn A function that accepts up to three arguments. forEach calls the
2250
+ * @param callbackfn A function that accepts up to three arguments. forEach calls the
2243
2251
  * callbackfn function one time for each element in the array.
2244
- * @param thisArg An object to which the this keyword can refer in the callbackfn function.
2252
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function.
2245
2253
  * If thisArg is omitted, undefined is used as the this value.
2246
2254
  */
2247
- forEach(callbackfn: (value: number, index: number, array: Uint8Array) => void, thisArg?: any): void;
2255
+ forEach(callbackfn: (value: number, index: number, array: this) => void, thisArg?: any): void;
2248
2256
 
2249
2257
  /**
2250
2258
  * Returns the index of the first occurrence of a value in an array.
2251
2259
  * @param searchElement The value to locate in the array.
2252
2260
  * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the
2253
- * search starts at index 0.
2261
+ * search starts at index 0.
2254
2262
  */
2255
2263
  indexOf(searchElement: number, fromIndex?: number): number;
2256
2264
 
@@ -2282,7 +2290,7 @@ interface Uint8Array {
2282
2290
  * @param thisArg An object to which the this keyword can refer in the callbackfn function.
2283
2291
  * If thisArg is omitted, undefined is used as the this value.
2284
2292
  */
2285
- map(callbackfn: (value: number, index: number, array: Uint8Array) => number, thisArg?: any): Uint8Array;
2293
+ map(callbackfn: (value: number, index: number, array: this) => number, thisArg?: any): Uint8Array<ArrayBuffer>;
2286
2294
 
2287
2295
  /**
2288
2296
  * Calls the specified callback function for all the elements in an array. The return value of
@@ -2294,8 +2302,8 @@ interface Uint8Array {
2294
2302
  * the accumulation. The first call to the callbackfn function provides this value as an argument
2295
2303
  * instead of an array value.
2296
2304
  */
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;
2305
+ reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: this) => number): number;
2306
+ reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: this) => number, initialValue: number): number;
2299
2307
 
2300
2308
  /**
2301
2309
  * Calls the specified callback function for all the elements in an array. The return value of
@@ -2307,7 +2315,7 @@ interface Uint8Array {
2307
2315
  * the accumulation. The first call to the callbackfn function provides this value as an argument
2308
2316
  * instead of an array value.
2309
2317
  */
2310
- reduce<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint8Array) => U, initialValue: U): U;
2318
+ reduce<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: this) => U, initialValue: U): U;
2311
2319
 
2312
2320
  /**
2313
2321
  * Calls the specified callback function for all the elements in an array, in descending order.
@@ -2319,8 +2327,8 @@ interface Uint8Array {
2319
2327
  * the accumulation. The first call to the callbackfn function provides this value as an
2320
2328
  * argument instead of an array value.
2321
2329
  */
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;
2330
+ reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: this) => number): number;
2331
+ reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: this) => number, initialValue: number): number;
2324
2332
 
2325
2333
  /**
2326
2334
  * Calls the specified callback function for all the elements in an array, in descending order.
@@ -2332,12 +2340,12 @@ interface Uint8Array {
2332
2340
  * the accumulation. The first call to the callbackfn function provides this value as an argument
2333
2341
  * instead of an array value.
2334
2342
  */
2335
- reduceRight<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint8Array) => U, initialValue: U): U;
2343
+ reduceRight<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: this) => U, initialValue: U): U;
2336
2344
 
2337
2345
  /**
2338
2346
  * Reverses the elements in an Array.
2339
2347
  */
2340
- reverse(): Uint8Array;
2348
+ reverse(): this;
2341
2349
 
2342
2350
  /**
2343
2351
  * Sets a value or an array of values.
@@ -2351,7 +2359,7 @@ interface Uint8Array {
2351
2359
  * @param start The beginning of the specified portion of the array.
2352
2360
  * @param end The end of the specified portion of the array. This is exclusive of the element at the index 'end'.
2353
2361
  */
2354
- slice(start?: number, end?: number): Uint8Array;
2362
+ slice(start?: number, end?: number): Uint8Array<ArrayBuffer>;
2355
2363
 
2356
2364
  /**
2357
2365
  * Determines whether the specified callback function returns true for any element of an array.
@@ -2361,7 +2369,7 @@ interface Uint8Array {
2361
2369
  * @param thisArg An object to which the this keyword can refer in the predicate function.
2362
2370
  * If thisArg is omitted, undefined is used as the this value.
2363
2371
  */
2364
- some(predicate: (value: number, index: number, array: Uint8Array) => unknown, thisArg?: any): boolean;
2372
+ some(predicate: (value: number, index: number, array: this) => unknown, thisArg?: any): boolean;
2365
2373
 
2366
2374
  /**
2367
2375
  * Sorts an array.
@@ -2380,7 +2388,7 @@ interface Uint8Array {
2380
2388
  * @param begin The index of the beginning of the array.
2381
2389
  * @param end The index of the end of the array.
2382
2390
  */
2383
- subarray(begin?: number, end?: number): Uint8Array;
2391
+ subarray(begin?: number, end?: number): Uint8Array<TArrayBuffer>;
2384
2392
 
2385
2393
  /**
2386
2394
  * Converts a number to a string by using the current locale.
@@ -2393,16 +2401,17 @@ interface Uint8Array {
2393
2401
  toString(): string;
2394
2402
 
2395
2403
  /** Returns the primitive value of the specified object. */
2396
- valueOf(): Uint8Array;
2404
+ valueOf(): this;
2397
2405
 
2398
2406
  [index: number]: number;
2399
2407
  }
2400
-
2401
2408
  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;
2409
+ readonly prototype: Uint8Array<ArrayBufferLike>;
2410
+ new (length: number): Uint8Array<ArrayBuffer>;
2411
+ new (array: ArrayLike<number>): Uint8Array<ArrayBuffer>;
2412
+ new <TArrayBuffer extends ArrayBufferLike = ArrayBuffer>(buffer: TArrayBuffer, byteOffset?: number, length?: number): Uint8Array<TArrayBuffer>;
2413
+ new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Uint8Array<ArrayBuffer>;
2414
+ new (array: ArrayLike<number> | ArrayBuffer): Uint8Array<ArrayBuffer>;
2406
2415
 
2407
2416
  /**
2408
2417
  * The size in bytes of each element in the array.
@@ -2413,21 +2422,21 @@ interface Uint8ArrayConstructor {
2413
2422
  * Returns a new array from a set of elements.
2414
2423
  * @param items A set of elements to include in the new array object.
2415
2424
  */
2416
- of(...items: number[]): Uint8Array;
2425
+ of(...items: number[]): Uint8Array<ArrayBuffer>;
2417
2426
 
2418
2427
  /**
2419
2428
  * Creates an array from an array-like or iterable object.
2420
- * @param arrayLike An array-like or iterable object to convert to an array.
2429
+ * @param arrayLike An array-like object to convert to an array.
2421
2430
  */
2422
- from(arrayLike: ArrayLike<number>): Uint8Array;
2431
+ from(arrayLike: ArrayLike<number>): Uint8Array<ArrayBuffer>;
2423
2432
 
2424
2433
  /**
2425
2434
  * Creates an array from an array-like or iterable object.
2426
- * @param arrayLike An array-like or iterable object to convert to an array.
2435
+ * @param arrayLike An array-like object to convert to an array.
2427
2436
  * @param mapfn A mapping function to call on every element of the array.
2428
2437
  * @param thisArg Value of 'this' used to invoke the mapfn.
2429
2438
  */
2430
- from<T>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => number, thisArg?: any): Uint8Array;
2439
+ from<T>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => number, thisArg?: any): Uint8Array<ArrayBuffer>;
2431
2440
  }
2432
2441
  declare var Uint8Array: Uint8ArrayConstructor;
2433
2442
 
@@ -2435,7 +2444,7 @@ declare var Uint8Array: Uint8ArrayConstructor;
2435
2444
  * A typed array of 8-bit unsigned integer (clamped) values. The contents are initialized to 0.
2436
2445
  * If the requested number of bytes could not be allocated an exception is raised.
2437
2446
  */
2438
- interface Uint8ClampedArray {
2447
+ interface Uint8ClampedArray<TArrayBuffer extends ArrayBufferLike = ArrayBufferLike> {
2439
2448
  /**
2440
2449
  * The size in bytes of each element in the array.
2441
2450
  */
@@ -2444,7 +2453,7 @@ interface Uint8ClampedArray {
2444
2453
  /**
2445
2454
  * The ArrayBuffer instance referenced by the array.
2446
2455
  */
2447
- readonly buffer: ArrayBufferLike;
2456
+ readonly buffer: TArrayBuffer;
2448
2457
 
2449
2458
  /**
2450
2459
  * The length in bytes of the array.
@@ -2475,7 +2484,7 @@ interface Uint8ClampedArray {
2475
2484
  * @param thisArg An object to which the this keyword can refer in the predicate function.
2476
2485
  * If thisArg is omitted, undefined is used as the this value.
2477
2486
  */
2478
- every(predicate: (value: number, index: number, array: Uint8ClampedArray) => unknown, thisArg?: any): boolean;
2487
+ every(predicate: (value: number, index: number, array: this) => unknown, thisArg?: any): boolean;
2479
2488
 
2480
2489
  /**
2481
2490
  * Changes all array elements from `start` to `end` index to a static `value` and returns the modified array
@@ -2494,7 +2503,7 @@ interface Uint8ClampedArray {
2494
2503
  * @param thisArg An object to which the this keyword can refer in the predicate function.
2495
2504
  * If thisArg is omitted, undefined is used as the this value.
2496
2505
  */
2497
- filter(predicate: (value: number, index: number, array: Uint8ClampedArray) => any, thisArg?: any): Uint8ClampedArray;
2506
+ filter(predicate: (value: number, index: number, array: this) => any, thisArg?: any): Uint8ClampedArray<ArrayBuffer>;
2498
2507
 
2499
2508
  /**
2500
2509
  * Returns the value of the first element in the array where predicate is true, and undefined
@@ -2505,7 +2514,7 @@ interface Uint8ClampedArray {
2505
2514
  * @param thisArg If provided, it will be used as the this value for each invocation of
2506
2515
  * predicate. If it is not provided, undefined is used instead.
2507
2516
  */
2508
- find(predicate: (value: number, index: number, obj: Uint8ClampedArray) => boolean, thisArg?: any): number | undefined;
2517
+ find(predicate: (value: number, index: number, obj: this) => boolean, thisArg?: any): number | undefined;
2509
2518
 
2510
2519
  /**
2511
2520
  * Returns the index of the first element in the array where predicate is true, and -1
@@ -2516,22 +2525,22 @@ interface Uint8ClampedArray {
2516
2525
  * @param thisArg If provided, it will be used as the this value for each invocation of
2517
2526
  * predicate. If it is not provided, undefined is used instead.
2518
2527
  */
2519
- findIndex(predicate: (value: number, index: number, obj: Uint8ClampedArray) => boolean, thisArg?: any): number;
2528
+ findIndex(predicate: (value: number, index: number, obj: this) => boolean, thisArg?: any): number;
2520
2529
 
2521
2530
  /**
2522
2531
  * Performs the specified action for each element in an array.
2523
- * @param callbackfn A function that accepts up to three arguments. forEach calls the
2532
+ * @param callbackfn A function that accepts up to three arguments. forEach calls the
2524
2533
  * callbackfn function one time for each element in the array.
2525
- * @param thisArg An object to which the this keyword can refer in the callbackfn function.
2534
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function.
2526
2535
  * If thisArg is omitted, undefined is used as the this value.
2527
2536
  */
2528
- forEach(callbackfn: (value: number, index: number, array: Uint8ClampedArray) => void, thisArg?: any): void;
2537
+ forEach(callbackfn: (value: number, index: number, array: this) => void, thisArg?: any): void;
2529
2538
 
2530
2539
  /**
2531
2540
  * Returns the index of the first occurrence of a value in an array.
2532
2541
  * @param searchElement The value to locate in the array.
2533
2542
  * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the
2534
- * search starts at index 0.
2543
+ * search starts at index 0.
2535
2544
  */
2536
2545
  indexOf(searchElement: number, fromIndex?: number): number;
2537
2546
 
@@ -2563,7 +2572,7 @@ interface Uint8ClampedArray {
2563
2572
  * @param thisArg An object to which the this keyword can refer in the callbackfn function.
2564
2573
  * If thisArg is omitted, undefined is used as the this value.
2565
2574
  */
2566
- map(callbackfn: (value: number, index: number, array: Uint8ClampedArray) => number, thisArg?: any): Uint8ClampedArray;
2575
+ map(callbackfn: (value: number, index: number, array: this) => number, thisArg?: any): Uint8ClampedArray<ArrayBuffer>;
2567
2576
 
2568
2577
  /**
2569
2578
  * Calls the specified callback function for all the elements in an array. The return value of
@@ -2575,8 +2584,8 @@ interface Uint8ClampedArray {
2575
2584
  * the accumulation. The first call to the callbackfn function provides this value as an argument
2576
2585
  * instead of an array value.
2577
2586
  */
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;
2587
+ reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: this) => number): number;
2588
+ reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: this) => number, initialValue: number): number;
2580
2589
 
2581
2590
  /**
2582
2591
  * Calls the specified callback function for all the elements in an array. The return value of
@@ -2588,7 +2597,7 @@ interface Uint8ClampedArray {
2588
2597
  * the accumulation. The first call to the callbackfn function provides this value as an argument
2589
2598
  * instead of an array value.
2590
2599
  */
2591
- reduce<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint8ClampedArray) => U, initialValue: U): U;
2600
+ reduce<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: this) => U, initialValue: U): U;
2592
2601
 
2593
2602
  /**
2594
2603
  * Calls the specified callback function for all the elements in an array, in descending order.
@@ -2600,8 +2609,8 @@ interface Uint8ClampedArray {
2600
2609
  * the accumulation. The first call to the callbackfn function provides this value as an
2601
2610
  * argument instead of an array value.
2602
2611
  */
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;
2612
+ reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: this) => number): number;
2613
+ reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: this) => number, initialValue: number): number;
2605
2614
 
2606
2615
  /**
2607
2616
  * Calls the specified callback function for all the elements in an array, in descending order.
@@ -2613,12 +2622,12 @@ interface Uint8ClampedArray {
2613
2622
  * the accumulation. The first call to the callbackfn function provides this value as an argument
2614
2623
  * instead of an array value.
2615
2624
  */
2616
- reduceRight<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint8ClampedArray) => U, initialValue: U): U;
2625
+ reduceRight<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: this) => U, initialValue: U): U;
2617
2626
 
2618
2627
  /**
2619
2628
  * Reverses the elements in an Array.
2620
2629
  */
2621
- reverse(): Uint8ClampedArray;
2630
+ reverse(): this;
2622
2631
 
2623
2632
  /**
2624
2633
  * Sets a value or an array of values.
@@ -2632,7 +2641,7 @@ interface Uint8ClampedArray {
2632
2641
  * @param start The beginning of the specified portion of the array.
2633
2642
  * @param end The end of the specified portion of the array. This is exclusive of the element at the index 'end'.
2634
2643
  */
2635
- slice(start?: number, end?: number): Uint8ClampedArray;
2644
+ slice(start?: number, end?: number): Uint8ClampedArray<ArrayBuffer>;
2636
2645
 
2637
2646
  /**
2638
2647
  * Determines whether the specified callback function returns true for any element of an array.
@@ -2642,7 +2651,7 @@ interface Uint8ClampedArray {
2642
2651
  * @param thisArg An object to which the this keyword can refer in the predicate function.
2643
2652
  * If thisArg is omitted, undefined is used as the this value.
2644
2653
  */
2645
- some(predicate: (value: number, index: number, array: Uint8ClampedArray) => unknown, thisArg?: any): boolean;
2654
+ some(predicate: (value: number, index: number, array: this) => unknown, thisArg?: any): boolean;
2646
2655
 
2647
2656
  /**
2648
2657
  * Sorts an array.
@@ -2661,7 +2670,7 @@ interface Uint8ClampedArray {
2661
2670
  * @param begin The index of the beginning of the array.
2662
2671
  * @param end The index of the end of the array.
2663
2672
  */
2664
- subarray(begin?: number, end?: number): Uint8ClampedArray;
2673
+ subarray(begin?: number, end?: number): Uint8ClampedArray<TArrayBuffer>;
2665
2674
 
2666
2675
  /**
2667
2676
  * Converts a number to a string by using the current locale.
@@ -2674,16 +2683,17 @@ interface Uint8ClampedArray {
2674
2683
  toString(): string;
2675
2684
 
2676
2685
  /** Returns the primitive value of the specified object. */
2677
- valueOf(): Uint8ClampedArray;
2686
+ valueOf(): this;
2678
2687
 
2679
2688
  [index: number]: number;
2680
2689
  }
2681
-
2682
2690
  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;
2691
+ readonly prototype: Uint8ClampedArray<ArrayBufferLike>;
2692
+ new (length: number): Uint8ClampedArray<ArrayBuffer>;
2693
+ new (array: ArrayLike<number>): Uint8ClampedArray<ArrayBuffer>;
2694
+ new <TArrayBuffer extends ArrayBufferLike = ArrayBuffer>(buffer: TArrayBuffer, byteOffset?: number, length?: number): Uint8ClampedArray<TArrayBuffer>;
2695
+ new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Uint8ClampedArray<ArrayBuffer>;
2696
+ new (array: ArrayLike<number> | ArrayBuffer): Uint8ClampedArray<ArrayBuffer>;
2687
2697
 
2688
2698
  /**
2689
2699
  * The size in bytes of each element in the array.
@@ -2694,21 +2704,21 @@ interface Uint8ClampedArrayConstructor {
2694
2704
  * Returns a new array from a set of elements.
2695
2705
  * @param items A set of elements to include in the new array object.
2696
2706
  */
2697
- of(...items: number[]): Uint8ClampedArray;
2707
+ of(...items: number[]): Uint8ClampedArray<ArrayBuffer>;
2698
2708
 
2699
2709
  /**
2700
2710
  * Creates an array from an array-like or iterable object.
2701
- * @param arrayLike An array-like or iterable object to convert to an array.
2711
+ * @param arrayLike An array-like object to convert to an array.
2702
2712
  */
2703
- from(arrayLike: ArrayLike<number>): Uint8ClampedArray;
2713
+ from(arrayLike: ArrayLike<number>): Uint8ClampedArray<ArrayBuffer>;
2704
2714
 
2705
2715
  /**
2706
2716
  * Creates an array from an array-like or iterable object.
2707
- * @param arrayLike An array-like or iterable object to convert to an array.
2717
+ * @param arrayLike An array-like object to convert to an array.
2708
2718
  * @param mapfn A mapping function to call on every element of the array.
2709
2719
  * @param thisArg Value of 'this' used to invoke the mapfn.
2710
2720
  */
2711
- from<T>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => number, thisArg?: any): Uint8ClampedArray;
2721
+ from<T>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => number, thisArg?: any): Uint8ClampedArray<ArrayBuffer>;
2712
2722
  }
2713
2723
  declare var Uint8ClampedArray: Uint8ClampedArrayConstructor;
2714
2724
 
@@ -2716,7 +2726,7 @@ declare var Uint8ClampedArray: Uint8ClampedArrayConstructor;
2716
2726
  * A typed array of 16-bit signed integer values. The contents are initialized to 0. If the
2717
2727
  * requested number of bytes could not be allocated an exception is raised.
2718
2728
  */
2719
- interface Int16Array {
2729
+ interface Int16Array<TArrayBuffer extends ArrayBufferLike = ArrayBufferLike> {
2720
2730
  /**
2721
2731
  * The size in bytes of each element in the array.
2722
2732
  */
@@ -2725,7 +2735,7 @@ interface Int16Array {
2725
2735
  /**
2726
2736
  * The ArrayBuffer instance referenced by the array.
2727
2737
  */
2728
- readonly buffer: ArrayBufferLike;
2738
+ readonly buffer: TArrayBuffer;
2729
2739
 
2730
2740
  /**
2731
2741
  * The length in bytes of the array.
@@ -2756,7 +2766,7 @@ interface Int16Array {
2756
2766
  * @param thisArg An object to which the this keyword can refer in the predicate function.
2757
2767
  * If thisArg is omitted, undefined is used as the this value.
2758
2768
  */
2759
- every(predicate: (value: number, index: number, array: Int16Array) => unknown, thisArg?: any): boolean;
2769
+ every(predicate: (value: number, index: number, array: this) => unknown, thisArg?: any): boolean;
2760
2770
 
2761
2771
  /**
2762
2772
  * Changes all array elements from `start` to `end` index to a static `value` and returns the modified array
@@ -2775,7 +2785,7 @@ interface Int16Array {
2775
2785
  * @param thisArg An object to which the this keyword can refer in the predicate function.
2776
2786
  * If thisArg is omitted, undefined is used as the this value.
2777
2787
  */
2778
- filter(predicate: (value: number, index: number, array: Int16Array) => any, thisArg?: any): Int16Array;
2788
+ filter(predicate: (value: number, index: number, array: this) => any, thisArg?: any): Int16Array<ArrayBuffer>;
2779
2789
 
2780
2790
  /**
2781
2791
  * Returns the value of the first element in the array where predicate is true, and undefined
@@ -2786,7 +2796,7 @@ interface Int16Array {
2786
2796
  * @param thisArg If provided, it will be used as the this value for each invocation of
2787
2797
  * predicate. If it is not provided, undefined is used instead.
2788
2798
  */
2789
- find(predicate: (value: number, index: number, obj: Int16Array) => boolean, thisArg?: any): number | undefined;
2799
+ find(predicate: (value: number, index: number, obj: this) => boolean, thisArg?: any): number | undefined;
2790
2800
 
2791
2801
  /**
2792
2802
  * Returns the index of the first element in the array where predicate is true, and -1
@@ -2797,21 +2807,21 @@ interface Int16Array {
2797
2807
  * @param thisArg If provided, it will be used as the this value for each invocation of
2798
2808
  * predicate. If it is not provided, undefined is used instead.
2799
2809
  */
2800
- findIndex(predicate: (value: number, index: number, obj: Int16Array) => boolean, thisArg?: any): number;
2810
+ findIndex(predicate: (value: number, index: number, obj: this) => boolean, thisArg?: any): number;
2801
2811
 
2802
2812
  /**
2803
2813
  * Performs the specified action for each element in an array.
2804
- * @param callbackfn A function that accepts up to three arguments. forEach calls the
2814
+ * @param callbackfn A function that accepts up to three arguments. forEach calls the
2805
2815
  * callbackfn function one time for each element in the array.
2806
- * @param thisArg An object to which the this keyword can refer in the callbackfn function.
2816
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function.
2807
2817
  * If thisArg is omitted, undefined is used as the this value.
2808
2818
  */
2809
- forEach(callbackfn: (value: number, index: number, array: Int16Array) => void, thisArg?: any): void;
2819
+ forEach(callbackfn: (value: number, index: number, array: this) => void, thisArg?: any): void;
2810
2820
  /**
2811
2821
  * Returns the index of the first occurrence of a value in an array.
2812
2822
  * @param searchElement The value to locate in the array.
2813
2823
  * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the
2814
- * search starts at index 0.
2824
+ * search starts at index 0.
2815
2825
  */
2816
2826
  indexOf(searchElement: number, fromIndex?: number): number;
2817
2827
 
@@ -2843,7 +2853,7 @@ interface Int16Array {
2843
2853
  * @param thisArg An object to which the this keyword can refer in the callbackfn function.
2844
2854
  * If thisArg is omitted, undefined is used as the this value.
2845
2855
  */
2846
- map(callbackfn: (value: number, index: number, array: Int16Array) => number, thisArg?: any): Int16Array;
2856
+ map(callbackfn: (value: number, index: number, array: this) => number, thisArg?: any): Int16Array<ArrayBuffer>;
2847
2857
 
2848
2858
  /**
2849
2859
  * Calls the specified callback function for all the elements in an array. The return value of
@@ -2855,8 +2865,8 @@ interface Int16Array {
2855
2865
  * the accumulation. The first call to the callbackfn function provides this value as an argument
2856
2866
  * instead of an array value.
2857
2867
  */
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;
2868
+ reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: this) => number): number;
2869
+ reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: this) => number, initialValue: number): number;
2860
2870
 
2861
2871
  /**
2862
2872
  * Calls the specified callback function for all the elements in an array. The return value of
@@ -2868,7 +2878,7 @@ interface Int16Array {
2868
2878
  * the accumulation. The first call to the callbackfn function provides this value as an argument
2869
2879
  * instead of an array value.
2870
2880
  */
2871
- reduce<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int16Array) => U, initialValue: U): U;
2881
+ reduce<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: this) => U, initialValue: U): U;
2872
2882
 
2873
2883
  /**
2874
2884
  * Calls the specified callback function for all the elements in an array, in descending order.
@@ -2880,8 +2890,8 @@ interface Int16Array {
2880
2890
  * the accumulation. The first call to the callbackfn function provides this value as an
2881
2891
  * argument instead of an array value.
2882
2892
  */
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;
2893
+ reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: this) => number): number;
2894
+ reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: this) => number, initialValue: number): number;
2885
2895
 
2886
2896
  /**
2887
2897
  * Calls the specified callback function for all the elements in an array, in descending order.
@@ -2893,12 +2903,12 @@ interface Int16Array {
2893
2903
  * the accumulation. The first call to the callbackfn function provides this value as an argument
2894
2904
  * instead of an array value.
2895
2905
  */
2896
- reduceRight<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int16Array) => U, initialValue: U): U;
2906
+ reduceRight<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: this) => U, initialValue: U): U;
2897
2907
 
2898
2908
  /**
2899
2909
  * Reverses the elements in an Array.
2900
2910
  */
2901
- reverse(): Int16Array;
2911
+ reverse(): this;
2902
2912
 
2903
2913
  /**
2904
2914
  * Sets a value or an array of values.
@@ -2912,7 +2922,7 @@ interface Int16Array {
2912
2922
  * @param start The beginning of the specified portion of the array.
2913
2923
  * @param end The end of the specified portion of the array. This is exclusive of the element at the index 'end'.
2914
2924
  */
2915
- slice(start?: number, end?: number): Int16Array;
2925
+ slice(start?: number, end?: number): Int16Array<ArrayBuffer>;
2916
2926
 
2917
2927
  /**
2918
2928
  * Determines whether the specified callback function returns true for any element of an array.
@@ -2922,7 +2932,7 @@ interface Int16Array {
2922
2932
  * @param thisArg An object to which the this keyword can refer in the predicate function.
2923
2933
  * If thisArg is omitted, undefined is used as the this value.
2924
2934
  */
2925
- some(predicate: (value: number, index: number, array: Int16Array) => unknown, thisArg?: any): boolean;
2935
+ some(predicate: (value: number, index: number, array: this) => unknown, thisArg?: any): boolean;
2926
2936
 
2927
2937
  /**
2928
2938
  * Sorts an array.
@@ -2941,7 +2951,7 @@ interface Int16Array {
2941
2951
  * @param begin The index of the beginning of the array.
2942
2952
  * @param end The index of the end of the array.
2943
2953
  */
2944
- subarray(begin?: number, end?: number): Int16Array;
2954
+ subarray(begin?: number, end?: number): Int16Array<TArrayBuffer>;
2945
2955
 
2946
2956
  /**
2947
2957
  * Converts a number to a string by using the current locale.
@@ -2954,16 +2964,17 @@ interface Int16Array {
2954
2964
  toString(): string;
2955
2965
 
2956
2966
  /** Returns the primitive value of the specified object. */
2957
- valueOf(): Int16Array;
2967
+ valueOf(): this;
2958
2968
 
2959
2969
  [index: number]: number;
2960
2970
  }
2961
-
2962
2971
  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;
2972
+ readonly prototype: Int16Array<ArrayBufferLike>;
2973
+ new (length: number): Int16Array<ArrayBuffer>;
2974
+ new (array: ArrayLike<number>): Int16Array<ArrayBuffer>;
2975
+ new <TArrayBuffer extends ArrayBufferLike = ArrayBuffer>(buffer: TArrayBuffer, byteOffset?: number, length?: number): Int16Array<TArrayBuffer>;
2976
+ new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Int16Array<ArrayBuffer>;
2977
+ new (array: ArrayLike<number> | ArrayBuffer): Int16Array<ArrayBuffer>;
2967
2978
 
2968
2979
  /**
2969
2980
  * The size in bytes of each element in the array.
@@ -2974,21 +2985,21 @@ interface Int16ArrayConstructor {
2974
2985
  * Returns a new array from a set of elements.
2975
2986
  * @param items A set of elements to include in the new array object.
2976
2987
  */
2977
- of(...items: number[]): Int16Array;
2988
+ of(...items: number[]): Int16Array<ArrayBuffer>;
2978
2989
 
2979
2990
  /**
2980
2991
  * Creates an array from an array-like or iterable object.
2981
- * @param arrayLike An array-like or iterable object to convert to an array.
2992
+ * @param arrayLike An array-like object to convert to an array.
2982
2993
  */
2983
- from(arrayLike: ArrayLike<number>): Int16Array;
2994
+ from(arrayLike: ArrayLike<number>): Int16Array<ArrayBuffer>;
2984
2995
 
2985
2996
  /**
2986
2997
  * Creates an array from an array-like or iterable object.
2987
- * @param arrayLike An array-like or iterable object to convert to an array.
2998
+ * @param arrayLike An array-like object to convert to an array.
2988
2999
  * @param mapfn A mapping function to call on every element of the array.
2989
3000
  * @param thisArg Value of 'this' used to invoke the mapfn.
2990
3001
  */
2991
- from<T>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => number, thisArg?: any): Int16Array;
3002
+ from<T>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => number, thisArg?: any): Int16Array<ArrayBuffer>;
2992
3003
  }
2993
3004
  declare var Int16Array: Int16ArrayConstructor;
2994
3005
 
@@ -2996,7 +3007,7 @@ declare var Int16Array: Int16ArrayConstructor;
2996
3007
  * A typed array of 16-bit unsigned integer values. The contents are initialized to 0. If the
2997
3008
  * requested number of bytes could not be allocated an exception is raised.
2998
3009
  */
2999
- interface Uint16Array {
3010
+ interface Uint16Array<TArrayBuffer extends ArrayBufferLike = ArrayBufferLike> {
3000
3011
  /**
3001
3012
  * The size in bytes of each element in the array.
3002
3013
  */
@@ -3005,7 +3016,7 @@ interface Uint16Array {
3005
3016
  /**
3006
3017
  * The ArrayBuffer instance referenced by the array.
3007
3018
  */
3008
- readonly buffer: ArrayBufferLike;
3019
+ readonly buffer: TArrayBuffer;
3009
3020
 
3010
3021
  /**
3011
3022
  * The length in bytes of the array.
@@ -3036,7 +3047,7 @@ interface Uint16Array {
3036
3047
  * @param thisArg An object to which the this keyword can refer in the predicate function.
3037
3048
  * If thisArg is omitted, undefined is used as the this value.
3038
3049
  */
3039
- every(predicate: (value: number, index: number, array: Uint16Array) => unknown, thisArg?: any): boolean;
3050
+ every(predicate: (value: number, index: number, array: this) => unknown, thisArg?: any): boolean;
3040
3051
 
3041
3052
  /**
3042
3053
  * Changes all array elements from `start` to `end` index to a static `value` and returns the modified array
@@ -3055,7 +3066,7 @@ interface Uint16Array {
3055
3066
  * @param thisArg An object to which the this keyword can refer in the predicate function.
3056
3067
  * If thisArg is omitted, undefined is used as the this value.
3057
3068
  */
3058
- filter(predicate: (value: number, index: number, array: Uint16Array) => any, thisArg?: any): Uint16Array;
3069
+ filter(predicate: (value: number, index: number, array: this) => any, thisArg?: any): Uint16Array<ArrayBuffer>;
3059
3070
 
3060
3071
  /**
3061
3072
  * Returns the value of the first element in the array where predicate is true, and undefined
@@ -3066,7 +3077,7 @@ interface Uint16Array {
3066
3077
  * @param thisArg If provided, it will be used as the this value for each invocation of
3067
3078
  * predicate. If it is not provided, undefined is used instead.
3068
3079
  */
3069
- find(predicate: (value: number, index: number, obj: Uint16Array) => boolean, thisArg?: any): number | undefined;
3080
+ find(predicate: (value: number, index: number, obj: this) => boolean, thisArg?: any): number | undefined;
3070
3081
 
3071
3082
  /**
3072
3083
  * Returns the index of the first element in the array where predicate is true, and -1
@@ -3077,22 +3088,22 @@ interface Uint16Array {
3077
3088
  * @param thisArg If provided, it will be used as the this value for each invocation of
3078
3089
  * predicate. If it is not provided, undefined is used instead.
3079
3090
  */
3080
- findIndex(predicate: (value: number, index: number, obj: Uint16Array) => boolean, thisArg?: any): number;
3091
+ findIndex(predicate: (value: number, index: number, obj: this) => boolean, thisArg?: any): number;
3081
3092
 
3082
3093
  /**
3083
3094
  * Performs the specified action for each element in an array.
3084
- * @param callbackfn A function that accepts up to three arguments. forEach calls the
3095
+ * @param callbackfn A function that accepts up to three arguments. forEach calls the
3085
3096
  * callbackfn function one time for each element in the array.
3086
- * @param thisArg An object to which the this keyword can refer in the callbackfn function.
3097
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function.
3087
3098
  * If thisArg is omitted, undefined is used as the this value.
3088
3099
  */
3089
- forEach(callbackfn: (value: number, index: number, array: Uint16Array) => void, thisArg?: any): void;
3100
+ forEach(callbackfn: (value: number, index: number, array: this) => void, thisArg?: any): void;
3090
3101
 
3091
3102
  /**
3092
3103
  * Returns the index of the first occurrence of a value in an array.
3093
3104
  * @param searchElement The value to locate in the array.
3094
3105
  * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the
3095
- * search starts at index 0.
3106
+ * search starts at index 0.
3096
3107
  */
3097
3108
  indexOf(searchElement: number, fromIndex?: number): number;
3098
3109
 
@@ -3124,7 +3135,7 @@ interface Uint16Array {
3124
3135
  * @param thisArg An object to which the this keyword can refer in the callbackfn function.
3125
3136
  * If thisArg is omitted, undefined is used as the this value.
3126
3137
  */
3127
- map(callbackfn: (value: number, index: number, array: Uint16Array) => number, thisArg?: any): Uint16Array;
3138
+ map(callbackfn: (value: number, index: number, array: this) => number, thisArg?: any): Uint16Array<ArrayBuffer>;
3128
3139
 
3129
3140
  /**
3130
3141
  * Calls the specified callback function for all the elements in an array. The return value of
@@ -3136,8 +3147,8 @@ interface Uint16Array {
3136
3147
  * the accumulation. The first call to the callbackfn function provides this value as an argument
3137
3148
  * instead of an array value.
3138
3149
  */
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;
3150
+ reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: this) => number): number;
3151
+ reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: this) => number, initialValue: number): number;
3141
3152
 
3142
3153
  /**
3143
3154
  * Calls the specified callback function for all the elements in an array. The return value of
@@ -3149,7 +3160,7 @@ interface Uint16Array {
3149
3160
  * the accumulation. The first call to the callbackfn function provides this value as an argument
3150
3161
  * instead of an array value.
3151
3162
  */
3152
- reduce<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint16Array) => U, initialValue: U): U;
3163
+ reduce<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: this) => U, initialValue: U): U;
3153
3164
 
3154
3165
  /**
3155
3166
  * Calls the specified callback function for all the elements in an array, in descending order.
@@ -3161,8 +3172,8 @@ interface Uint16Array {
3161
3172
  * the accumulation. The first call to the callbackfn function provides this value as an
3162
3173
  * argument instead of an array value.
3163
3174
  */
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;
3175
+ reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: this) => number): number;
3176
+ reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: this) => number, initialValue: number): number;
3166
3177
 
3167
3178
  /**
3168
3179
  * Calls the specified callback function for all the elements in an array, in descending order.
@@ -3174,12 +3185,12 @@ interface Uint16Array {
3174
3185
  * the accumulation. The first call to the callbackfn function provides this value as an argument
3175
3186
  * instead of an array value.
3176
3187
  */
3177
- reduceRight<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint16Array) => U, initialValue: U): U;
3188
+ reduceRight<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: this) => U, initialValue: U): U;
3178
3189
 
3179
3190
  /**
3180
3191
  * Reverses the elements in an Array.
3181
3192
  */
3182
- reverse(): Uint16Array;
3193
+ reverse(): this;
3183
3194
 
3184
3195
  /**
3185
3196
  * Sets a value or an array of values.
@@ -3193,7 +3204,7 @@ interface Uint16Array {
3193
3204
  * @param start The beginning of the specified portion of the array.
3194
3205
  * @param end The end of the specified portion of the array. This is exclusive of the element at the index 'end'.
3195
3206
  */
3196
- slice(start?: number, end?: number): Uint16Array;
3207
+ slice(start?: number, end?: number): Uint16Array<ArrayBuffer>;
3197
3208
 
3198
3209
  /**
3199
3210
  * Determines whether the specified callback function returns true for any element of an array.
@@ -3203,7 +3214,7 @@ interface Uint16Array {
3203
3214
  * @param thisArg An object to which the this keyword can refer in the predicate function.
3204
3215
  * If thisArg is omitted, undefined is used as the this value.
3205
3216
  */
3206
- some(predicate: (value: number, index: number, array: Uint16Array) => unknown, thisArg?: any): boolean;
3217
+ some(predicate: (value: number, index: number, array: this) => unknown, thisArg?: any): boolean;
3207
3218
 
3208
3219
  /**
3209
3220
  * Sorts an array.
@@ -3222,7 +3233,7 @@ interface Uint16Array {
3222
3233
  * @param begin The index of the beginning of the array.
3223
3234
  * @param end The index of the end of the array.
3224
3235
  */
3225
- subarray(begin?: number, end?: number): Uint16Array;
3236
+ subarray(begin?: number, end?: number): Uint16Array<TArrayBuffer>;
3226
3237
 
3227
3238
  /**
3228
3239
  * Converts a number to a string by using the current locale.
@@ -3235,16 +3246,17 @@ interface Uint16Array {
3235
3246
  toString(): string;
3236
3247
 
3237
3248
  /** Returns the primitive value of the specified object. */
3238
- valueOf(): Uint16Array;
3249
+ valueOf(): this;
3239
3250
 
3240
3251
  [index: number]: number;
3241
3252
  }
3242
-
3243
3253
  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;
3254
+ readonly prototype: Uint16Array<ArrayBufferLike>;
3255
+ new (length: number): Uint16Array<ArrayBuffer>;
3256
+ new (array: ArrayLike<number>): Uint16Array<ArrayBuffer>;
3257
+ new <TArrayBuffer extends ArrayBufferLike = ArrayBuffer>(buffer: TArrayBuffer, byteOffset?: number, length?: number): Uint16Array<TArrayBuffer>;
3258
+ new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Uint16Array<ArrayBuffer>;
3259
+ new (array: ArrayLike<number> | ArrayBuffer): Uint16Array<ArrayBuffer>;
3248
3260
 
3249
3261
  /**
3250
3262
  * The size in bytes of each element in the array.
@@ -3255,28 +3267,28 @@ interface Uint16ArrayConstructor {
3255
3267
  * Returns a new array from a set of elements.
3256
3268
  * @param items A set of elements to include in the new array object.
3257
3269
  */
3258
- of(...items: number[]): Uint16Array;
3270
+ of(...items: number[]): Uint16Array<ArrayBuffer>;
3259
3271
 
3260
3272
  /**
3261
3273
  * Creates an array from an array-like or iterable object.
3262
- * @param arrayLike An array-like or iterable object to convert to an array.
3274
+ * @param arrayLike An array-like object to convert to an array.
3263
3275
  */
3264
- from(arrayLike: ArrayLike<number>): Uint16Array;
3276
+ from(arrayLike: ArrayLike<number>): Uint16Array<ArrayBuffer>;
3265
3277
 
3266
3278
  /**
3267
3279
  * Creates an array from an array-like or iterable object.
3268
- * @param arrayLike An array-like or iterable object to convert to an array.
3280
+ * @param arrayLike An array-like object to convert to an array.
3269
3281
  * @param mapfn A mapping function to call on every element of the array.
3270
3282
  * @param thisArg Value of 'this' used to invoke the mapfn.
3271
3283
  */
3272
- from<T>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => number, thisArg?: any): Uint16Array;
3284
+ from<T>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => number, thisArg?: any): Uint16Array<ArrayBuffer>;
3273
3285
  }
3274
3286
  declare var Uint16Array: Uint16ArrayConstructor;
3275
3287
  /**
3276
3288
  * A typed array of 32-bit signed integer values. The contents are initialized to 0. If the
3277
3289
  * requested number of bytes could not be allocated an exception is raised.
3278
3290
  */
3279
- interface Int32Array {
3291
+ interface Int32Array<TArrayBuffer extends ArrayBufferLike = ArrayBufferLike> {
3280
3292
  /**
3281
3293
  * The size in bytes of each element in the array.
3282
3294
  */
@@ -3285,7 +3297,7 @@ interface Int32Array {
3285
3297
  /**
3286
3298
  * The ArrayBuffer instance referenced by the array.
3287
3299
  */
3288
- readonly buffer: ArrayBufferLike;
3300
+ readonly buffer: TArrayBuffer;
3289
3301
 
3290
3302
  /**
3291
3303
  * The length in bytes of the array.
@@ -3316,7 +3328,7 @@ interface Int32Array {
3316
3328
  * @param thisArg An object to which the this keyword can refer in the predicate function.
3317
3329
  * If thisArg is omitted, undefined is used as the this value.
3318
3330
  */
3319
- every(predicate: (value: number, index: number, array: Int32Array) => unknown, thisArg?: any): boolean;
3331
+ every(predicate: (value: number, index: number, array: this) => unknown, thisArg?: any): boolean;
3320
3332
 
3321
3333
  /**
3322
3334
  * Changes all array elements from `start` to `end` index to a static `value` and returns the modified array
@@ -3335,7 +3347,7 @@ interface Int32Array {
3335
3347
  * @param thisArg An object to which the this keyword can refer in the predicate function.
3336
3348
  * If thisArg is omitted, undefined is used as the this value.
3337
3349
  */
3338
- filter(predicate: (value: number, index: number, array: Int32Array) => any, thisArg?: any): Int32Array;
3350
+ filter(predicate: (value: number, index: number, array: this) => any, thisArg?: any): Int32Array<ArrayBuffer>;
3339
3351
 
3340
3352
  /**
3341
3353
  * Returns the value of the first element in the array where predicate is true, and undefined
@@ -3346,7 +3358,7 @@ interface Int32Array {
3346
3358
  * @param thisArg If provided, it will be used as the this value for each invocation of
3347
3359
  * predicate. If it is not provided, undefined is used instead.
3348
3360
  */
3349
- find(predicate: (value: number, index: number, obj: Int32Array) => boolean, thisArg?: any): number | undefined;
3361
+ find(predicate: (value: number, index: number, obj: this) => boolean, thisArg?: any): number | undefined;
3350
3362
 
3351
3363
  /**
3352
3364
  * Returns the index of the first element in the array where predicate is true, and -1
@@ -3357,22 +3369,22 @@ interface Int32Array {
3357
3369
  * @param thisArg If provided, it will be used as the this value for each invocation of
3358
3370
  * predicate. If it is not provided, undefined is used instead.
3359
3371
  */
3360
- findIndex(predicate: (value: number, index: number, obj: Int32Array) => boolean, thisArg?: any): number;
3372
+ findIndex(predicate: (value: number, index: number, obj: this) => boolean, thisArg?: any): number;
3361
3373
 
3362
3374
  /**
3363
3375
  * Performs the specified action for each element in an array.
3364
- * @param callbackfn A function that accepts up to three arguments. forEach calls the
3376
+ * @param callbackfn A function that accepts up to three arguments. forEach calls the
3365
3377
  * callbackfn function one time for each element in the array.
3366
- * @param thisArg An object to which the this keyword can refer in the callbackfn function.
3378
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function.
3367
3379
  * If thisArg is omitted, undefined is used as the this value.
3368
3380
  */
3369
- forEach(callbackfn: (value: number, index: number, array: Int32Array) => void, thisArg?: any): void;
3381
+ forEach(callbackfn: (value: number, index: number, array: this) => void, thisArg?: any): void;
3370
3382
 
3371
3383
  /**
3372
3384
  * Returns the index of the first occurrence of a value in an array.
3373
3385
  * @param searchElement The value to locate in the array.
3374
3386
  * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the
3375
- * search starts at index 0.
3387
+ * search starts at index 0.
3376
3388
  */
3377
3389
  indexOf(searchElement: number, fromIndex?: number): number;
3378
3390
 
@@ -3404,7 +3416,7 @@ interface Int32Array {
3404
3416
  * @param thisArg An object to which the this keyword can refer in the callbackfn function.
3405
3417
  * If thisArg is omitted, undefined is used as the this value.
3406
3418
  */
3407
- map(callbackfn: (value: number, index: number, array: Int32Array) => number, thisArg?: any): Int32Array;
3419
+ map(callbackfn: (value: number, index: number, array: this) => number, thisArg?: any): Int32Array<ArrayBuffer>;
3408
3420
 
3409
3421
  /**
3410
3422
  * Calls the specified callback function for all the elements in an array. The return value of
@@ -3416,8 +3428,8 @@ interface Int32Array {
3416
3428
  * the accumulation. The first call to the callbackfn function provides this value as an argument
3417
3429
  * instead of an array value.
3418
3430
  */
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;
3431
+ reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: this) => number): number;
3432
+ reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: this) => number, initialValue: number): number;
3421
3433
 
3422
3434
  /**
3423
3435
  * Calls the specified callback function for all the elements in an array. The return value of
@@ -3429,7 +3441,7 @@ interface Int32Array {
3429
3441
  * the accumulation. The first call to the callbackfn function provides this value as an argument
3430
3442
  * instead of an array value.
3431
3443
  */
3432
- reduce<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int32Array) => U, initialValue: U): U;
3444
+ reduce<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: this) => U, initialValue: U): U;
3433
3445
 
3434
3446
  /**
3435
3447
  * Calls the specified callback function for all the elements in an array, in descending order.
@@ -3441,8 +3453,8 @@ interface Int32Array {
3441
3453
  * the accumulation. The first call to the callbackfn function provides this value as an
3442
3454
  * argument instead of an array value.
3443
3455
  */
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;
3456
+ reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: this) => number): number;
3457
+ reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: this) => number, initialValue: number): number;
3446
3458
 
3447
3459
  /**
3448
3460
  * Calls the specified callback function for all the elements in an array, in descending order.
@@ -3454,12 +3466,12 @@ interface Int32Array {
3454
3466
  * the accumulation. The first call to the callbackfn function provides this value as an argument
3455
3467
  * instead of an array value.
3456
3468
  */
3457
- reduceRight<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int32Array) => U, initialValue: U): U;
3469
+ reduceRight<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: this) => U, initialValue: U): U;
3458
3470
 
3459
3471
  /**
3460
3472
  * Reverses the elements in an Array.
3461
3473
  */
3462
- reverse(): Int32Array;
3474
+ reverse(): this;
3463
3475
 
3464
3476
  /**
3465
3477
  * Sets a value or an array of values.
@@ -3473,7 +3485,7 @@ interface Int32Array {
3473
3485
  * @param start The beginning of the specified portion of the array.
3474
3486
  * @param end The end of the specified portion of the array. This is exclusive of the element at the index 'end'.
3475
3487
  */
3476
- slice(start?: number, end?: number): Int32Array;
3488
+ slice(start?: number, end?: number): Int32Array<ArrayBuffer>;
3477
3489
 
3478
3490
  /**
3479
3491
  * Determines whether the specified callback function returns true for any element of an array.
@@ -3483,7 +3495,7 @@ interface Int32Array {
3483
3495
  * @param thisArg An object to which the this keyword can refer in the predicate function.
3484
3496
  * If thisArg is omitted, undefined is used as the this value.
3485
3497
  */
3486
- some(predicate: (value: number, index: number, array: Int32Array) => unknown, thisArg?: any): boolean;
3498
+ some(predicate: (value: number, index: number, array: this) => unknown, thisArg?: any): boolean;
3487
3499
 
3488
3500
  /**
3489
3501
  * Sorts an array.
@@ -3502,7 +3514,7 @@ interface Int32Array {
3502
3514
  * @param begin The index of the beginning of the array.
3503
3515
  * @param end The index of the end of the array.
3504
3516
  */
3505
- subarray(begin?: number, end?: number): Int32Array;
3517
+ subarray(begin?: number, end?: number): Int32Array<TArrayBuffer>;
3506
3518
 
3507
3519
  /**
3508
3520
  * Converts a number to a string by using the current locale.
@@ -3515,16 +3527,17 @@ interface Int32Array {
3515
3527
  toString(): string;
3516
3528
 
3517
3529
  /** Returns the primitive value of the specified object. */
3518
- valueOf(): Int32Array;
3530
+ valueOf(): this;
3519
3531
 
3520
3532
  [index: number]: number;
3521
3533
  }
3522
-
3523
3534
  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;
3535
+ readonly prototype: Int32Array<ArrayBufferLike>;
3536
+ new (length: number): Int32Array<ArrayBuffer>;
3537
+ new (array: ArrayLike<number>): Int32Array<ArrayBuffer>;
3538
+ new <TArrayBuffer extends ArrayBufferLike = ArrayBuffer>(buffer: TArrayBuffer, byteOffset?: number, length?: number): Int32Array<TArrayBuffer>;
3539
+ new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Int32Array<ArrayBuffer>;
3540
+ new (array: ArrayLike<number> | ArrayBuffer): Int32Array<ArrayBuffer>;
3528
3541
 
3529
3542
  /**
3530
3543
  * The size in bytes of each element in the array.
@@ -3535,21 +3548,21 @@ interface Int32ArrayConstructor {
3535
3548
  * Returns a new array from a set of elements.
3536
3549
  * @param items A set of elements to include in the new array object.
3537
3550
  */
3538
- of(...items: number[]): Int32Array;
3551
+ of(...items: number[]): Int32Array<ArrayBuffer>;
3539
3552
 
3540
3553
  /**
3541
3554
  * Creates an array from an array-like or iterable object.
3542
- * @param arrayLike An array-like or iterable object to convert to an array.
3555
+ * @param arrayLike An array-like object to convert to an array.
3543
3556
  */
3544
- from(arrayLike: ArrayLike<number>): Int32Array;
3557
+ from(arrayLike: ArrayLike<number>): Int32Array<ArrayBuffer>;
3545
3558
 
3546
3559
  /**
3547
3560
  * Creates an array from an array-like or iterable object.
3548
- * @param arrayLike An array-like or iterable object to convert to an array.
3561
+ * @param arrayLike An array-like object to convert to an array.
3549
3562
  * @param mapfn A mapping function to call on every element of the array.
3550
3563
  * @param thisArg Value of 'this' used to invoke the mapfn.
3551
3564
  */
3552
- from<T>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => number, thisArg?: any): Int32Array;
3565
+ from<T>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => number, thisArg?: any): Int32Array<ArrayBuffer>;
3553
3566
  }
3554
3567
  declare var Int32Array: Int32ArrayConstructor;
3555
3568
 
@@ -3557,7 +3570,7 @@ declare var Int32Array: Int32ArrayConstructor;
3557
3570
  * A typed array of 32-bit unsigned integer values. The contents are initialized to 0. If the
3558
3571
  * requested number of bytes could not be allocated an exception is raised.
3559
3572
  */
3560
- interface Uint32Array {
3573
+ interface Uint32Array<TArrayBuffer extends ArrayBufferLike = ArrayBufferLike> {
3561
3574
  /**
3562
3575
  * The size in bytes of each element in the array.
3563
3576
  */
@@ -3566,7 +3579,7 @@ interface Uint32Array {
3566
3579
  /**
3567
3580
  * The ArrayBuffer instance referenced by the array.
3568
3581
  */
3569
- readonly buffer: ArrayBufferLike;
3582
+ readonly buffer: TArrayBuffer;
3570
3583
 
3571
3584
  /**
3572
3585
  * The length in bytes of the array.
@@ -3597,7 +3610,7 @@ interface Uint32Array {
3597
3610
  * @param thisArg An object to which the this keyword can refer in the predicate function.
3598
3611
  * If thisArg is omitted, undefined is used as the this value.
3599
3612
  */
3600
- every(predicate: (value: number, index: number, array: Uint32Array) => unknown, thisArg?: any): boolean;
3613
+ every(predicate: (value: number, index: number, array: this) => unknown, thisArg?: any): boolean;
3601
3614
 
3602
3615
  /**
3603
3616
  * Changes all array elements from `start` to `end` index to a static `value` and returns the modified array
@@ -3616,7 +3629,7 @@ interface Uint32Array {
3616
3629
  * @param thisArg An object to which the this keyword can refer in the predicate function.
3617
3630
  * If thisArg is omitted, undefined is used as the this value.
3618
3631
  */
3619
- filter(predicate: (value: number, index: number, array: Uint32Array) => any, thisArg?: any): Uint32Array;
3632
+ filter(predicate: (value: number, index: number, array: this) => any, thisArg?: any): Uint32Array<ArrayBuffer>;
3620
3633
 
3621
3634
  /**
3622
3635
  * Returns the value of the first element in the array where predicate is true, and undefined
@@ -3627,7 +3640,7 @@ interface Uint32Array {
3627
3640
  * @param thisArg If provided, it will be used as the this value for each invocation of
3628
3641
  * predicate. If it is not provided, undefined is used instead.
3629
3642
  */
3630
- find(predicate: (value: number, index: number, obj: Uint32Array) => boolean, thisArg?: any): number | undefined;
3643
+ find(predicate: (value: number, index: number, obj: this) => boolean, thisArg?: any): number | undefined;
3631
3644
 
3632
3645
  /**
3633
3646
  * Returns the index of the first element in the array where predicate is true, and -1
@@ -3638,21 +3651,21 @@ interface Uint32Array {
3638
3651
  * @param thisArg If provided, it will be used as the this value for each invocation of
3639
3652
  * predicate. If it is not provided, undefined is used instead.
3640
3653
  */
3641
- findIndex(predicate: (value: number, index: number, obj: Uint32Array) => boolean, thisArg?: any): number;
3654
+ findIndex(predicate: (value: number, index: number, obj: this) => boolean, thisArg?: any): number;
3642
3655
 
3643
3656
  /**
3644
3657
  * Performs the specified action for each element in an array.
3645
- * @param callbackfn A function that accepts up to three arguments. forEach calls the
3658
+ * @param callbackfn A function that accepts up to three arguments. forEach calls the
3646
3659
  * callbackfn function one time for each element in the array.
3647
- * @param thisArg An object to which the this keyword can refer in the callbackfn function.
3660
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function.
3648
3661
  * If thisArg is omitted, undefined is used as the this value.
3649
3662
  */
3650
- forEach(callbackfn: (value: number, index: number, array: Uint32Array) => void, thisArg?: any): void;
3663
+ forEach(callbackfn: (value: number, index: number, array: this) => void, thisArg?: any): void;
3651
3664
  /**
3652
3665
  * Returns the index of the first occurrence of a value in an array.
3653
3666
  * @param searchElement The value to locate in the array.
3654
3667
  * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the
3655
- * search starts at index 0.
3668
+ * search starts at index 0.
3656
3669
  */
3657
3670
  indexOf(searchElement: number, fromIndex?: number): number;
3658
3671
 
@@ -3684,7 +3697,7 @@ interface Uint32Array {
3684
3697
  * @param thisArg An object to which the this keyword can refer in the callbackfn function.
3685
3698
  * If thisArg is omitted, undefined is used as the this value.
3686
3699
  */
3687
- map(callbackfn: (value: number, index: number, array: Uint32Array) => number, thisArg?: any): Uint32Array;
3700
+ map(callbackfn: (value: number, index: number, array: this) => number, thisArg?: any): Uint32Array<ArrayBuffer>;
3688
3701
 
3689
3702
  /**
3690
3703
  * Calls the specified callback function for all the elements in an array. The return value of
@@ -3696,8 +3709,8 @@ interface Uint32Array {
3696
3709
  * the accumulation. The first call to the callbackfn function provides this value as an argument
3697
3710
  * instead of an array value.
3698
3711
  */
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;
3712
+ reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: this) => number): number;
3713
+ reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: this) => number, initialValue: number): number;
3701
3714
 
3702
3715
  /**
3703
3716
  * Calls the specified callback function for all the elements in an array. The return value of
@@ -3709,7 +3722,7 @@ interface Uint32Array {
3709
3722
  * the accumulation. The first call to the callbackfn function provides this value as an argument
3710
3723
  * instead of an array value.
3711
3724
  */
3712
- reduce<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint32Array) => U, initialValue: U): U;
3725
+ reduce<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: this) => U, initialValue: U): U;
3713
3726
 
3714
3727
  /**
3715
3728
  * Calls the specified callback function for all the elements in an array, in descending order.
@@ -3721,8 +3734,8 @@ interface Uint32Array {
3721
3734
  * the accumulation. The first call to the callbackfn function provides this value as an
3722
3735
  * argument instead of an array value.
3723
3736
  */
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;
3737
+ reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: this) => number): number;
3738
+ reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: this) => number, initialValue: number): number;
3726
3739
 
3727
3740
  /**
3728
3741
  * Calls the specified callback function for all the elements in an array, in descending order.
@@ -3734,12 +3747,12 @@ interface Uint32Array {
3734
3747
  * the accumulation. The first call to the callbackfn function provides this value as an argument
3735
3748
  * instead of an array value.
3736
3749
  */
3737
- reduceRight<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint32Array) => U, initialValue: U): U;
3750
+ reduceRight<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: this) => U, initialValue: U): U;
3738
3751
 
3739
3752
  /**
3740
3753
  * Reverses the elements in an Array.
3741
3754
  */
3742
- reverse(): Uint32Array;
3755
+ reverse(): this;
3743
3756
 
3744
3757
  /**
3745
3758
  * Sets a value or an array of values.
@@ -3753,7 +3766,7 @@ interface Uint32Array {
3753
3766
  * @param start The beginning of the specified portion of the array.
3754
3767
  * @param end The end of the specified portion of the array. This is exclusive of the element at the index 'end'.
3755
3768
  */
3756
- slice(start?: number, end?: number): Uint32Array;
3769
+ slice(start?: number, end?: number): Uint32Array<ArrayBuffer>;
3757
3770
 
3758
3771
  /**
3759
3772
  * Determines whether the specified callback function returns true for any element of an array.
@@ -3763,7 +3776,7 @@ interface Uint32Array {
3763
3776
  * @param thisArg An object to which the this keyword can refer in the predicate function.
3764
3777
  * If thisArg is omitted, undefined is used as the this value.
3765
3778
  */
3766
- some(predicate: (value: number, index: number, array: Uint32Array) => unknown, thisArg?: any): boolean;
3779
+ some(predicate: (value: number, index: number, array: this) => unknown, thisArg?: any): boolean;
3767
3780
 
3768
3781
  /**
3769
3782
  * Sorts an array.
@@ -3782,7 +3795,7 @@ interface Uint32Array {
3782
3795
  * @param begin The index of the beginning of the array.
3783
3796
  * @param end The index of the end of the array.
3784
3797
  */
3785
- subarray(begin?: number, end?: number): Uint32Array;
3798
+ subarray(begin?: number, end?: number): Uint32Array<TArrayBuffer>;
3786
3799
 
3787
3800
  /**
3788
3801
  * Converts a number to a string by using the current locale.
@@ -3795,16 +3808,17 @@ interface Uint32Array {
3795
3808
  toString(): string;
3796
3809
 
3797
3810
  /** Returns the primitive value of the specified object. */
3798
- valueOf(): Uint32Array;
3811
+ valueOf(): this;
3799
3812
 
3800
3813
  [index: number]: number;
3801
3814
  }
3802
-
3803
3815
  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;
3816
+ readonly prototype: Uint32Array<ArrayBufferLike>;
3817
+ new (length: number): Uint32Array<ArrayBuffer>;
3818
+ new (array: ArrayLike<number>): Uint32Array<ArrayBuffer>;
3819
+ new <TArrayBuffer extends ArrayBufferLike = ArrayBuffer>(buffer: TArrayBuffer, byteOffset?: number, length?: number): Uint32Array<TArrayBuffer>;
3820
+ new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Uint32Array<ArrayBuffer>;
3821
+ new (array: ArrayLike<number> | ArrayBuffer): Uint32Array<ArrayBuffer>;
3808
3822
 
3809
3823
  /**
3810
3824
  * The size in bytes of each element in the array.
@@ -3815,21 +3829,21 @@ interface Uint32ArrayConstructor {
3815
3829
  * Returns a new array from a set of elements.
3816
3830
  * @param items A set of elements to include in the new array object.
3817
3831
  */
3818
- of(...items: number[]): Uint32Array;
3832
+ of(...items: number[]): Uint32Array<ArrayBuffer>;
3819
3833
 
3820
3834
  /**
3821
3835
  * Creates an array from an array-like or iterable object.
3822
- * @param arrayLike An array-like or iterable object to convert to an array.
3836
+ * @param arrayLike An array-like object to convert to an array.
3823
3837
  */
3824
- from(arrayLike: ArrayLike<number>): Uint32Array;
3838
+ from(arrayLike: ArrayLike<number>): Uint32Array<ArrayBuffer>;
3825
3839
 
3826
3840
  /**
3827
3841
  * Creates an array from an array-like or iterable object.
3828
- * @param arrayLike An array-like or iterable object to convert to an array.
3842
+ * @param arrayLike An array-like object to convert to an array.
3829
3843
  * @param mapfn A mapping function to call on every element of the array.
3830
3844
  * @param thisArg Value of 'this' used to invoke the mapfn.
3831
3845
  */
3832
- from<T>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => number, thisArg?: any): Uint32Array;
3846
+ from<T>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => number, thisArg?: any): Uint32Array<ArrayBuffer>;
3833
3847
  }
3834
3848
  declare var Uint32Array: Uint32ArrayConstructor;
3835
3849
 
@@ -3837,7 +3851,7 @@ declare var Uint32Array: Uint32ArrayConstructor;
3837
3851
  * A typed array of 32-bit float values. The contents are initialized to 0. If the requested number
3838
3852
  * of bytes could not be allocated an exception is raised.
3839
3853
  */
3840
- interface Float32Array {
3854
+ interface Float32Array<TArrayBuffer extends ArrayBufferLike = ArrayBufferLike> {
3841
3855
  /**
3842
3856
  * The size in bytes of each element in the array.
3843
3857
  */
@@ -3846,7 +3860,7 @@ interface Float32Array {
3846
3860
  /**
3847
3861
  * The ArrayBuffer instance referenced by the array.
3848
3862
  */
3849
- readonly buffer: ArrayBufferLike;
3863
+ readonly buffer: TArrayBuffer;
3850
3864
 
3851
3865
  /**
3852
3866
  * The length in bytes of the array.
@@ -3877,7 +3891,7 @@ interface Float32Array {
3877
3891
  * @param thisArg An object to which the this keyword can refer in the predicate function.
3878
3892
  * If thisArg is omitted, undefined is used as the this value.
3879
3893
  */
3880
- every(predicate: (value: number, index: number, array: Float32Array) => unknown, thisArg?: any): boolean;
3894
+ every(predicate: (value: number, index: number, array: this) => unknown, thisArg?: any): boolean;
3881
3895
 
3882
3896
  /**
3883
3897
  * Changes all array elements from `start` to `end` index to a static `value` and returns the modified array
@@ -3896,7 +3910,7 @@ interface Float32Array {
3896
3910
  * @param thisArg An object to which the this keyword can refer in the predicate function.
3897
3911
  * If thisArg is omitted, undefined is used as the this value.
3898
3912
  */
3899
- filter(predicate: (value: number, index: number, array: Float32Array) => any, thisArg?: any): Float32Array;
3913
+ filter(predicate: (value: number, index: number, array: this) => any, thisArg?: any): Float32Array<ArrayBuffer>;
3900
3914
 
3901
3915
  /**
3902
3916
  * Returns the value of the first element in the array where predicate is true, and undefined
@@ -3907,7 +3921,7 @@ interface Float32Array {
3907
3921
  * @param thisArg If provided, it will be used as the this value for each invocation of
3908
3922
  * predicate. If it is not provided, undefined is used instead.
3909
3923
  */
3910
- find(predicate: (value: number, index: number, obj: Float32Array) => boolean, thisArg?: any): number | undefined;
3924
+ find(predicate: (value: number, index: number, obj: this) => boolean, thisArg?: any): number | undefined;
3911
3925
 
3912
3926
  /**
3913
3927
  * Returns the index of the first element in the array where predicate is true, and -1
@@ -3918,22 +3932,22 @@ interface Float32Array {
3918
3932
  * @param thisArg If provided, it will be used as the this value for each invocation of
3919
3933
  * predicate. If it is not provided, undefined is used instead.
3920
3934
  */
3921
- findIndex(predicate: (value: number, index: number, obj: Float32Array) => boolean, thisArg?: any): number;
3935
+ findIndex(predicate: (value: number, index: number, obj: this) => boolean, thisArg?: any): number;
3922
3936
 
3923
3937
  /**
3924
3938
  * Performs the specified action for each element in an array.
3925
- * @param callbackfn A function that accepts up to three arguments. forEach calls the
3939
+ * @param callbackfn A function that accepts up to three arguments. forEach calls the
3926
3940
  * callbackfn function one time for each element in the array.
3927
- * @param thisArg An object to which the this keyword can refer in the callbackfn function.
3941
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function.
3928
3942
  * If thisArg is omitted, undefined is used as the this value.
3929
3943
  */
3930
- forEach(callbackfn: (value: number, index: number, array: Float32Array) => void, thisArg?: any): void;
3944
+ forEach(callbackfn: (value: number, index: number, array: this) => void, thisArg?: any): void;
3931
3945
 
3932
3946
  /**
3933
3947
  * Returns the index of the first occurrence of a value in an array.
3934
3948
  * @param searchElement The value to locate in the array.
3935
3949
  * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the
3936
- * search starts at index 0.
3950
+ * search starts at index 0.
3937
3951
  */
3938
3952
  indexOf(searchElement: number, fromIndex?: number): number;
3939
3953
 
@@ -3965,7 +3979,7 @@ interface Float32Array {
3965
3979
  * @param thisArg An object to which the this keyword can refer in the callbackfn function.
3966
3980
  * If thisArg is omitted, undefined is used as the this value.
3967
3981
  */
3968
- map(callbackfn: (value: number, index: number, array: Float32Array) => number, thisArg?: any): Float32Array;
3982
+ map(callbackfn: (value: number, index: number, array: this) => number, thisArg?: any): Float32Array<ArrayBuffer>;
3969
3983
 
3970
3984
  /**
3971
3985
  * Calls the specified callback function for all the elements in an array. The return value of
@@ -3977,8 +3991,8 @@ interface Float32Array {
3977
3991
  * the accumulation. The first call to the callbackfn function provides this value as an argument
3978
3992
  * instead of an array value.
3979
3993
  */
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;
3994
+ reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: this) => number): number;
3995
+ reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: this) => number, initialValue: number): number;
3982
3996
 
3983
3997
  /**
3984
3998
  * Calls the specified callback function for all the elements in an array. The return value of
@@ -3990,7 +4004,7 @@ interface Float32Array {
3990
4004
  * the accumulation. The first call to the callbackfn function provides this value as an argument
3991
4005
  * instead of an array value.
3992
4006
  */
3993
- reduce<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Float32Array) => U, initialValue: U): U;
4007
+ reduce<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: this) => U, initialValue: U): U;
3994
4008
 
3995
4009
  /**
3996
4010
  * Calls the specified callback function for all the elements in an array, in descending order.
@@ -4002,8 +4016,8 @@ interface Float32Array {
4002
4016
  * the accumulation. The first call to the callbackfn function provides this value as an
4003
4017
  * argument instead of an array value.
4004
4018
  */
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;
4019
+ reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: this) => number): number;
4020
+ reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: this) => number, initialValue: number): number;
4007
4021
 
4008
4022
  /**
4009
4023
  * Calls the specified callback function for all the elements in an array, in descending order.
@@ -4015,12 +4029,12 @@ interface Float32Array {
4015
4029
  * the accumulation. The first call to the callbackfn function provides this value as an argument
4016
4030
  * instead of an array value.
4017
4031
  */
4018
- reduceRight<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Float32Array) => U, initialValue: U): U;
4032
+ reduceRight<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: this) => U, initialValue: U): U;
4019
4033
 
4020
4034
  /**
4021
4035
  * Reverses the elements in an Array.
4022
4036
  */
4023
- reverse(): Float32Array;
4037
+ reverse(): this;
4024
4038
 
4025
4039
  /**
4026
4040
  * Sets a value or an array of values.
@@ -4034,7 +4048,7 @@ interface Float32Array {
4034
4048
  * @param start The beginning of the specified portion of the array.
4035
4049
  * @param end The end of the specified portion of the array. This is exclusive of the element at the index 'end'.
4036
4050
  */
4037
- slice(start?: number, end?: number): Float32Array;
4051
+ slice(start?: number, end?: number): Float32Array<ArrayBuffer>;
4038
4052
 
4039
4053
  /**
4040
4054
  * Determines whether the specified callback function returns true for any element of an array.
@@ -4044,7 +4058,7 @@ interface Float32Array {
4044
4058
  * @param thisArg An object to which the this keyword can refer in the predicate function.
4045
4059
  * If thisArg is omitted, undefined is used as the this value.
4046
4060
  */
4047
- some(predicate: (value: number, index: number, array: Float32Array) => unknown, thisArg?: any): boolean;
4061
+ some(predicate: (value: number, index: number, array: this) => unknown, thisArg?: any): boolean;
4048
4062
 
4049
4063
  /**
4050
4064
  * Sorts an array.
@@ -4063,7 +4077,7 @@ interface Float32Array {
4063
4077
  * @param begin The index of the beginning of the array.
4064
4078
  * @param end The index of the end of the array.
4065
4079
  */
4066
- subarray(begin?: number, end?: number): Float32Array;
4080
+ subarray(begin?: number, end?: number): Float32Array<TArrayBuffer>;
4067
4081
 
4068
4082
  /**
4069
4083
  * Converts a number to a string by using the current locale.
@@ -4076,16 +4090,17 @@ interface Float32Array {
4076
4090
  toString(): string;
4077
4091
 
4078
4092
  /** Returns the primitive value of the specified object. */
4079
- valueOf(): Float32Array;
4093
+ valueOf(): this;
4080
4094
 
4081
4095
  [index: number]: number;
4082
4096
  }
4083
-
4084
4097
  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;
4098
+ readonly prototype: Float32Array<ArrayBufferLike>;
4099
+ new (length: number): Float32Array<ArrayBuffer>;
4100
+ new (array: ArrayLike<number>): Float32Array<ArrayBuffer>;
4101
+ new <TArrayBuffer extends ArrayBufferLike = ArrayBuffer>(buffer: TArrayBuffer, byteOffset?: number, length?: number): Float32Array<TArrayBuffer>;
4102
+ new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Float32Array<ArrayBuffer>;
4103
+ new (array: ArrayLike<number> | ArrayBuffer): Float32Array<ArrayBuffer>;
4089
4104
 
4090
4105
  /**
4091
4106
  * The size in bytes of each element in the array.
@@ -4096,21 +4111,21 @@ interface Float32ArrayConstructor {
4096
4111
  * Returns a new array from a set of elements.
4097
4112
  * @param items A set of elements to include in the new array object.
4098
4113
  */
4099
- of(...items: number[]): Float32Array;
4114
+ of(...items: number[]): Float32Array<ArrayBuffer>;
4100
4115
 
4101
4116
  /**
4102
4117
  * Creates an array from an array-like or iterable object.
4103
- * @param arrayLike An array-like or iterable object to convert to an array.
4118
+ * @param arrayLike An array-like object to convert to an array.
4104
4119
  */
4105
- from(arrayLike: ArrayLike<number>): Float32Array;
4120
+ from(arrayLike: ArrayLike<number>): Float32Array<ArrayBuffer>;
4106
4121
 
4107
4122
  /**
4108
4123
  * Creates an array from an array-like or iterable object.
4109
- * @param arrayLike An array-like or iterable object to convert to an array.
4124
+ * @param arrayLike An array-like object to convert to an array.
4110
4125
  * @param mapfn A mapping function to call on every element of the array.
4111
4126
  * @param thisArg Value of 'this' used to invoke the mapfn.
4112
4127
  */
4113
- from<T>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => number, thisArg?: any): Float32Array;
4128
+ from<T>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => number, thisArg?: any): Float32Array<ArrayBuffer>;
4114
4129
  }
4115
4130
  declare var Float32Array: Float32ArrayConstructor;
4116
4131
 
@@ -4118,7 +4133,7 @@ declare var Float32Array: Float32ArrayConstructor;
4118
4133
  * A typed array of 64-bit float values. The contents are initialized to 0. If the requested
4119
4134
  * number of bytes could not be allocated an exception is raised.
4120
4135
  */
4121
- interface Float64Array {
4136
+ interface Float64Array<TArrayBuffer extends ArrayBufferLike = ArrayBufferLike> {
4122
4137
  /**
4123
4138
  * The size in bytes of each element in the array.
4124
4139
  */
@@ -4127,7 +4142,7 @@ interface Float64Array {
4127
4142
  /**
4128
4143
  * The ArrayBuffer instance referenced by the array.
4129
4144
  */
4130
- readonly buffer: ArrayBufferLike;
4145
+ readonly buffer: TArrayBuffer;
4131
4146
 
4132
4147
  /**
4133
4148
  * The length in bytes of the array.
@@ -4158,7 +4173,7 @@ interface Float64Array {
4158
4173
  * @param thisArg An object to which the this keyword can refer in the predicate function.
4159
4174
  * If thisArg is omitted, undefined is used as the this value.
4160
4175
  */
4161
- every(predicate: (value: number, index: number, array: Float64Array) => unknown, thisArg?: any): boolean;
4176
+ every(predicate: (value: number, index: number, array: this) => unknown, thisArg?: any): boolean;
4162
4177
 
4163
4178
  /**
4164
4179
  * Changes all array elements from `start` to `end` index to a static `value` and returns the modified array
@@ -4177,7 +4192,7 @@ interface Float64Array {
4177
4192
  * @param thisArg An object to which the this keyword can refer in the predicate function.
4178
4193
  * If thisArg is omitted, undefined is used as the this value.
4179
4194
  */
4180
- filter(predicate: (value: number, index: number, array: Float64Array) => any, thisArg?: any): Float64Array;
4195
+ filter(predicate: (value: number, index: number, array: this) => any, thisArg?: any): Float64Array<ArrayBuffer>;
4181
4196
 
4182
4197
  /**
4183
4198
  * Returns the value of the first element in the array where predicate is true, and undefined
@@ -4188,7 +4203,7 @@ interface Float64Array {
4188
4203
  * @param thisArg If provided, it will be used as the this value for each invocation of
4189
4204
  * predicate. If it is not provided, undefined is used instead.
4190
4205
  */
4191
- find(predicate: (value: number, index: number, obj: Float64Array) => boolean, thisArg?: any): number | undefined;
4206
+ find(predicate: (value: number, index: number, obj: this) => boolean, thisArg?: any): number | undefined;
4192
4207
 
4193
4208
  /**
4194
4209
  * Returns the index of the first element in the array where predicate is true, and -1
@@ -4199,22 +4214,22 @@ interface Float64Array {
4199
4214
  * @param thisArg If provided, it will be used as the this value for each invocation of
4200
4215
  * predicate. If it is not provided, undefined is used instead.
4201
4216
  */
4202
- findIndex(predicate: (value: number, index: number, obj: Float64Array) => boolean, thisArg?: any): number;
4217
+ findIndex(predicate: (value: number, index: number, obj: this) => boolean, thisArg?: any): number;
4203
4218
 
4204
4219
  /**
4205
4220
  * Performs the specified action for each element in an array.
4206
- * @param callbackfn A function that accepts up to three arguments. forEach calls the
4221
+ * @param callbackfn A function that accepts up to three arguments. forEach calls the
4207
4222
  * callbackfn function one time for each element in the array.
4208
- * @param thisArg An object to which the this keyword can refer in the callbackfn function.
4223
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function.
4209
4224
  * If thisArg is omitted, undefined is used as the this value.
4210
4225
  */
4211
- forEach(callbackfn: (value: number, index: number, array: Float64Array) => void, thisArg?: any): void;
4226
+ forEach(callbackfn: (value: number, index: number, array: this) => void, thisArg?: any): void;
4212
4227
 
4213
4228
  /**
4214
4229
  * Returns the index of the first occurrence of a value in an array.
4215
4230
  * @param searchElement The value to locate in the array.
4216
4231
  * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the
4217
- * search starts at index 0.
4232
+ * search starts at index 0.
4218
4233
  */
4219
4234
  indexOf(searchElement: number, fromIndex?: number): number;
4220
4235
 
@@ -4246,7 +4261,7 @@ interface Float64Array {
4246
4261
  * @param thisArg An object to which the this keyword can refer in the callbackfn function.
4247
4262
  * If thisArg is omitted, undefined is used as the this value.
4248
4263
  */
4249
- map(callbackfn: (value: number, index: number, array: Float64Array) => number, thisArg?: any): Float64Array;
4264
+ map(callbackfn: (value: number, index: number, array: this) => number, thisArg?: any): Float64Array<ArrayBuffer>;
4250
4265
 
4251
4266
  /**
4252
4267
  * Calls the specified callback function for all the elements in an array. The return value of
@@ -4258,8 +4273,8 @@ interface Float64Array {
4258
4273
  * the accumulation. The first call to the callbackfn function provides this value as an argument
4259
4274
  * instead of an array value.
4260
4275
  */
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;
4276
+ reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: this) => number): number;
4277
+ reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: this) => number, initialValue: number): number;
4263
4278
 
4264
4279
  /**
4265
4280
  * Calls the specified callback function for all the elements in an array. The return value of
@@ -4271,7 +4286,7 @@ interface Float64Array {
4271
4286
  * the accumulation. The first call to the callbackfn function provides this value as an argument
4272
4287
  * instead of an array value.
4273
4288
  */
4274
- reduce<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Float64Array) => U, initialValue: U): U;
4289
+ reduce<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: this) => U, initialValue: U): U;
4275
4290
 
4276
4291
  /**
4277
4292
  * Calls the specified callback function for all the elements in an array, in descending order.
@@ -4283,8 +4298,8 @@ interface Float64Array {
4283
4298
  * the accumulation. The first call to the callbackfn function provides this value as an
4284
4299
  * argument instead of an array value.
4285
4300
  */
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;
4301
+ reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: this) => number): number;
4302
+ reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: this) => number, initialValue: number): number;
4288
4303
 
4289
4304
  /**
4290
4305
  * Calls the specified callback function for all the elements in an array, in descending order.
@@ -4296,12 +4311,12 @@ interface Float64Array {
4296
4311
  * the accumulation. The first call to the callbackfn function provides this value as an argument
4297
4312
  * instead of an array value.
4298
4313
  */
4299
- reduceRight<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Float64Array) => U, initialValue: U): U;
4314
+ reduceRight<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: this) => U, initialValue: U): U;
4300
4315
 
4301
4316
  /**
4302
4317
  * Reverses the elements in an Array.
4303
4318
  */
4304
- reverse(): Float64Array;
4319
+ reverse(): this;
4305
4320
 
4306
4321
  /**
4307
4322
  * Sets a value or an array of values.
@@ -4315,7 +4330,7 @@ interface Float64Array {
4315
4330
  * @param start The beginning of the specified portion of the array.
4316
4331
  * @param end The end of the specified portion of the array. This is exclusive of the element at the index 'end'.
4317
4332
  */
4318
- slice(start?: number, end?: number): Float64Array;
4333
+ slice(start?: number, end?: number): Float64Array<ArrayBuffer>;
4319
4334
 
4320
4335
  /**
4321
4336
  * Determines whether the specified callback function returns true for any element of an array.
@@ -4325,7 +4340,7 @@ interface Float64Array {
4325
4340
  * @param thisArg An object to which the this keyword can refer in the predicate function.
4326
4341
  * If thisArg is omitted, undefined is used as the this value.
4327
4342
  */
4328
- some(predicate: (value: number, index: number, array: Float64Array) => unknown, thisArg?: any): boolean;
4343
+ some(predicate: (value: number, index: number, array: this) => unknown, thisArg?: any): boolean;
4329
4344
 
4330
4345
  /**
4331
4346
  * Sorts an array.
@@ -4344,7 +4359,7 @@ interface Float64Array {
4344
4359
  * @param begin The index of the beginning of the array.
4345
4360
  * @param end The index of the end of the array.
4346
4361
  */
4347
- subarray(begin?: number, end?: number): Float64Array;
4362
+ subarray(begin?: number, end?: number): Float64Array<TArrayBuffer>;
4348
4363
 
4349
4364
  /**
4350
4365
  * Converts a number to a string by using the current locale.
@@ -4357,16 +4372,17 @@ interface Float64Array {
4357
4372
  toString(): string;
4358
4373
 
4359
4374
  /** Returns the primitive value of the specified object. */
4360
- valueOf(): Float64Array;
4375
+ valueOf(): this;
4361
4376
 
4362
4377
  [index: number]: number;
4363
4378
  }
4364
-
4365
4379
  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;
4380
+ readonly prototype: Float64Array<ArrayBufferLike>;
4381
+ new (length: number): Float64Array<ArrayBuffer>;
4382
+ new (array: ArrayLike<number>): Float64Array<ArrayBuffer>;
4383
+ new <TArrayBuffer extends ArrayBufferLike = ArrayBuffer>(buffer: TArrayBuffer, byteOffset?: number, length?: number): Float64Array<TArrayBuffer>;
4384
+ new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Float64Array<ArrayBuffer>;
4385
+ new (array: ArrayLike<number> | ArrayBuffer): Float64Array<ArrayBuffer>;
4370
4386
 
4371
4387
  /**
4372
4388
  * The size in bytes of each element in the array.
@@ -4377,21 +4393,21 @@ interface Float64ArrayConstructor {
4377
4393
  * Returns a new array from a set of elements.
4378
4394
  * @param items A set of elements to include in the new array object.
4379
4395
  */
4380
- of(...items: number[]): Float64Array;
4396
+ of(...items: number[]): Float64Array<ArrayBuffer>;
4381
4397
 
4382
4398
  /**
4383
4399
  * Creates an array from an array-like or iterable object.
4384
- * @param arrayLike An array-like or iterable object to convert to an array.
4400
+ * @param arrayLike An array-like object to convert to an array.
4385
4401
  */
4386
- from(arrayLike: ArrayLike<number>): Float64Array;
4402
+ from(arrayLike: ArrayLike<number>): Float64Array<ArrayBuffer>;
4387
4403
 
4388
4404
  /**
4389
4405
  * Creates an array from an array-like or iterable object.
4390
- * @param arrayLike An array-like or iterable object to convert to an array.
4406
+ * @param arrayLike An array-like object to convert to an array.
4391
4407
  * @param mapfn A mapping function to call on every element of the array.
4392
4408
  * @param thisArg Value of 'this' used to invoke the mapfn.
4393
4409
  */
4394
- from<T>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => number, thisArg?: any): Float64Array;
4410
+ from<T>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => number, thisArg?: any): Float64Array<ArrayBuffer>;
4395
4411
  }
4396
4412
  declare var Float64Array: Float64ArrayConstructor;
4397
4413