constructor(elementType: TypeId)
View sourceCreates set metadata for one registered element type.
Class
ExtendsTypeInfo
Describes the element type in set reflection metadata.
SetInfo records the registered TypeId for every set element. It
describes the set type, not the values currently stored in a set, and its
serial form uses the set kind discriminator.
const info = new SetInfo(typeid(String))
info.getElementType() // the registered string type ID
info.serialize() // { kind: 'set', elementType: info.elementType }constructor(elementType: TypeId)Creates set metadata for one registered element type.
getElementType(): TypeIdReturns the type ID recorded for each set element.
serialize(): SetInfoSerialSerializes this metadata to its { kind: 'set', elementType } shape.
The result contains type metadata only; set values are not serialized.
serialize(value: SetInfo): SetInfoSerialConverts set metadata to a plain serial object.
deserialize(value: SetInfoSerial, out?: SetInfo): SetInfoRestores set metadata from a serial object.
If out is omitted, a new SetInfo 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
SetInfo.validateSerial.
validateSerial(value: unknown): value is SetInfoSerialChecks whether a value has the serial shape for set metadata.
The value must be a non-null, non-array object with kind: 'set' and a
string elementType. Additional properties are allowed.