NBTify
NBTify copied to clipboard
ArrayTag Generic Types
Looking into a few different ways to accomplish representing tuple types with TypedArray
-based NBT key types.
Right now the standard library types don't provide anything like tuple support for TypedArray
values. I'd like to be able to do something like Int8Array<[number, number]>
, and only allow access of those two properties, just like the regular Array
tuple type notation allows for ([number, number]
on it's own).
I've encountered a few places where this would be a great help at type validation, namely things like player NBT UUID fields, which would be IntArrayTag<[number, number, number, number]>
, as well as position tuple fields, which tend to be what would be described with IntArrayTag<[number, number, number]>
.