Most objects in this library inherit from DataView or TypedArray. That means they have a number of methods which don't respect the type abstraction.
e.g. since Uint16View extends DataView, it has a setFloat32 method. Note this also writes outside of the 2 bytes one expects the view to refer to.
e.g. since GridMixin extends a TypedArray, it has map, at, findIndex, which all use linear indexing.
Furthermore, Int32View extends Uint8View. This renders the type annotation x: Uint8View practically meaningless.
It would be nice if this library used less inheritance. It does make sense for binary-backed objects to implement the more minimal ArrayBufferView interface ({buffer, byteLength, byteOffset}).
Most objects in this library inherit from
DataVieworTypedArray. That means they have a number of methods which don't respect the type abstraction.e.g. since
Uint16ViewextendsDataView, it has asetFloat32method. Note this also writes outside of the 2 bytes one expects the view to refer to.e.g. since
GridMixinextends aTypedArray, it hasmap,at,findIndex, which all use linear indexing.Furthermore,
Int32ViewextendsUint8View. This renders the type annotationx: Uint8Viewpractically meaningless.It would be nice if this library used less inheritance. It does make sense for binary-backed objects to implement the more minimal
ArrayBufferViewinterface ({buffer, byteLength, byteOffset}).