Class
TypeInfo
View sourceDefines the base contract for serializable reflection metadata.
Concrete metadata classes such as OpaqueInfo, StructInfo,
and EnumInfo provide metadata-specific serialization,
deserialization, and validation. This base class defines no serial shape:
its instance and static hooks throw a TypeError until a concrete
subtype implements the operation.
Examples
TypeInfo.serialize(new TypeInfo())
// throws TypeError: TypeInfo is abstract and cannot be serialized directlyConstructor
Methods
serialize(): TypeInfoSerial
View sourceSerializes this metadata through the base contract.
Concrete metadata classes override this method with a subtype-specific
serial shape. Calling the inherited method directly delegates to the
abstract TypeInfo.serialize implementation and throws.
staticserialize(_value: TypeInfo): void
View sourceAbstract serialization hook for reflection metadata.
This base implementation never returns a serial value. Concrete subclasses should override it with their own serial shape.
staticdeserialize(_value: TypeInfoSerial, _out?: TypeInfo): void
View sourceAbstract deserialization hook for reflection metadata.
Concrete subclasses use the serial value to create or update metadata. The base implementation does not inspect either argument and always throws.
staticvalidateSerial(_value: unknown): void
View sourceAbstract serial-shape validator for reflection metadata.
Concrete subclasses return a boolean type guard for their own serial shape. The base implementation does not validate the value and always throws.
staticvalidSerial(_value: unknown): void
View sourceAbstract serial-shape validator alias contract for reflection metadata.
Concrete subclasses may provide their own implementation. This base
implementation does not validate the value and always throws, just like
TypeInfo.validateSerial.
