You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is no global property named TypedArray, nor is there a directly visible TypedArray constructor
However that appears to be untrue in all browsers, TypedArray is visible on the prototype of any typed array constructor.
It would be nice if lib.dom was able to represent this class somehow, such that it would be possible to do the following to make it easy to reference the base class:
constTypedArray=Float32Array.__proto__console.log(newFloat64Array()instanceofTypedArray)// logs "true" in all browsersconsole.log(newInt8Array()instanceofTypedArray)// logs "true" in all browsersconsole.log(newInt16Array()instanceofTypedArray)// logs "true" in all browsersconsole.log(newInt32Array()instanceofTypedArray)// logs "true" in all browsersconsole.log(newUint8Array()instanceofTypedArray)// logs "true" in all browsersconsole.log(newBigInt64Array()instanceofTypedArray)// logs "true" in all browsers
This would also simplify certain functions, for example:
functiondoSomethingWithTypedArray(array: TypedArray){// ...Does something with any sort of typed array...}
The text was updated successfully, but these errors were encountered:
⚙ Compilation target
n/a
⚙ Library
lib.dom.d.ts
Missing / Incorrect Definition
TypedArray
is missing from typed array classes.Sample Code
In all browsers, this works:
Currently that code gives the type error
Documentation Link
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray
The MDN doc mentions:
However that appears to be untrue in all browsers,
TypedArray
is visible on the prototype of any typed array constructor.It would be nice if lib.dom was able to represent this class somehow, such that it would be possible to do the following to make it easy to reference the base class:
This would also simplify certain functions, for example:
The text was updated successfully, but these errors were encountered: