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
> import BitArray from "@bitarray/typedarray"
undefined
> let d = new BitArray([0,1,1], 0, 10)
<repl>.ts:5:31 - error TS2554: Expected 1 arguments, but got 3.
BitArray doesn't seem to support both buffer, byteOffset and length in the constructor, as other TypedArrays do:
I would suggest this requires careful thinking. For standards TypedArrays, it is always possible to match boundaries however one likes, with a proper combination of byteOffset and length. But, for bit arrays, it is not possible to match all bit boundaries.
Ideally, we should go for bitOffset rather than byteOffset (as suggested by you in the issue title). But this leads to other issues (this is not how array buffers work).
At this stage, I am not convinced byteOffset makes sense here, and has any practical use. I am rather inclined to allow calling the constructor with a buffer instance, but no other arguments (tbd). Are you with me?
BitArray doesn't seem to support both buffer, byteOffset and length in the constructor, as other TypedArrays do:
new TypedArray(buffer, byteOffset, length)
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#constructor
The text was updated successfully, but these errors were encountered: