Skip to content

Commit 0b44714

Browse files
mhausnercopybara-github
authored andcommitted
Add templated TArrayBuffer to TypedArray types
This keeps the definitions in sync with TS typings. In the d.ts files, the type parameter has a default type. Closure JS does not allow for default values in type parameters, but it allows a type reference without a type argument, in which case the type is {null}. Thus, we don't use the template type is not for anything. PiperOrigin-RevId: 715123561
1 parent 7b0570b commit 0b44714

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

externs/es6.js

+13
Original file line numberDiff line numberDiff line change
@@ -407,6 +407,7 @@ ArrayBuffer.isView = function(arg) {};
407407

408408
/**
409409
* @constructor
410+
* @template TArrayBuffer (unused)
410411
*/
411412
function ArrayBufferView() {}
412413

@@ -456,6 +457,7 @@ var AllowSharedBufferSource;
456457
* @implements {IArrayLike<number>}
457458
* @implements {Iterable<number>}
458459
* @extends {ArrayBufferView}
460+
* @template TArrayBuffer (unused)
459461
*/
460462
function TypedArray() {};
461463

@@ -734,6 +736,7 @@ TypedArray.prototype[Symbol.iterator] = function() {};
734736
* for readability and detection of programmer errors.
735737
* @param {number=} opt_byteOffset
736738
* @param {number=} opt_length
739+
* @template TArrayBuffer (unused)
737740
* @constructor
738741
* @extends {TypedArray}
739742
* @throws {Error}
@@ -780,6 +783,7 @@ Int8Array.of = function(var_args) {};
780783
* for readability and detection of programmer errors.
781784
* @param {number=} opt_byteOffset
782785
* @param {number=} opt_length
786+
* @template TArrayBuffer (unused)
783787
* @constructor
784788
* @extends {TypedArray}
785789
* @throws {Error}
@@ -816,6 +820,7 @@ Uint8Array.of = function(var_args) {};
816820
* for readability and detection of programmer errors.
817821
* @param {number=} opt_byteOffset
818822
* @param {number=} opt_length
823+
* @template TArrayBuffer (unused)
819824
* @constructor
820825
* @extends {TypedArray}
821826
* @throws {Error}
@@ -861,6 +866,7 @@ var CanvasPixelArray;
861866
* for readability and detection of programmer errors.
862867
* @param {number=} opt_byteOffset
863868
* @param {number=} opt_length
869+
* @template TArrayBuffer (unused)
864870
* @constructor
865871
* @extends {TypedArray}
866872
* @throws {Error}
@@ -897,6 +903,7 @@ Int16Array.of = function(var_args) {};
897903
* for readability and detection of programmer errors.
898904
* @param {number=} opt_byteOffset
899905
* @param {number=} opt_length
906+
* @template TArrayBuffer (unused)
900907
* @constructor
901908
* @extends {TypedArray}
902909
* @throws {Error}
@@ -933,6 +940,7 @@ Uint16Array.of = function(var_args) {};
933940
* for readability and detection of programmer errors.
934941
* @param {number=} opt_byteOffset
935942
* @param {number=} opt_length
943+
* @template TArrayBuffer (unused)
936944
* @constructor
937945
* @extends {TypedArray}
938946
* @throws {Error}
@@ -969,6 +977,7 @@ Int32Array.of = function(var_args) {};
969977
* for readability and detection of programmer errors.
970978
* @param {number=} opt_byteOffset
971979
* @param {number=} opt_length
980+
* @template TArrayBuffer (unused)
972981
* @constructor
973982
* @extends {TypedArray}
974983
* @throws {Error}
@@ -1005,6 +1014,7 @@ Uint32Array.of = function(var_args) {};
10051014
* for readability and detection of programmer errors.
10061015
* @param {number=} opt_byteOffset
10071016
* @param {number=} opt_length
1017+
* @template TArrayBuffer (unused)
10081018
* @constructor
10091019
* @extends {TypedArray}
10101020
* @throws {Error}
@@ -1041,6 +1051,7 @@ Float32Array.of = function(var_args) {};
10411051
* for readability and detection of programmer errors.
10421052
* @param {number=} opt_byteOffset
10431053
* @param {number=} opt_length
1054+
* @template TArrayBuffer (unused)
10441055
* @constructor
10451056
* @extends {TypedArray}
10461057
* @throws {Error}
@@ -1077,6 +1088,7 @@ Float64Array.of = function(var_args) {};
10771088
* for readability and detection of programmer errors.
10781089
* @param {number=} byteOffset
10791090
* @param {number=} bufferLength
1091+
* @template TArrayBuffer (unused)
10801092
* @constructor
10811093
* @extends {TypedArray}
10821094
* @throws {Error}
@@ -1113,6 +1125,7 @@ BigInt64Array.of = function(var_args) {};
11131125
* for readability and detection of programmer errors.
11141126
* @param {number=} byteOffset
11151127
* @param {number=} bufferLength
1128+
* @template TArrayBuffer (unused)
11161129
* @constructor
11171130
* @extends {TypedArray}
11181131
* @throws {Error}

0 commit comments

Comments
 (0)