constructor(elementType: TypeId)
View sourceCreates array metadata for one registered element type.
Class
ExtendsTypeInfo
Describes the element type in array reflection metadata.
ArrayInfo records the registered TypeId for every array element.
It describes the array type, not the values currently stored in an array,
and its serial form uses the array kind discriminator.
const info = new ArrayInfo(typeid(Number))
info.getElementType() // the registered number type ID
info.serialize() // { kind: 'array', elementType: info.elementType }constructor(elementType: TypeId)Creates array metadata for one registered element type.
getElementType(): TypeIdReturns the type ID recorded for each array element.
serialize(): ArrayInfoSerialSerializes this metadata to its { kind: 'array', elementType } shape.
The result contains type metadata only; array values are not serialized.
serialize(value: ArrayInfo): ArrayInfoSerialConverts array metadata to a plain serial object.
deserialize(value: ArrayInfoSerial, out?: ArrayInfo): ArrayInfoRestores array metadata from a serial object.
If out is omitted, a new ArrayInfo is created. If supplied, its
elementType is replaced in place and the same instance is returned. This
method assigns the serial value directly and does not call
ArrayInfo.validateSerial.
validateSerial(value: unknown): value is ArrayInfoSerialChecks whether a value has the serial shape for array metadata.
The value must be a non-null, non-array object with kind: 'array' and a
string elementType. Additional properties are allowed.