TypeInfo

View source

Defines 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 directly

Constructor


constructor()

Methods


serialize(): TypeInfoSerial

View source

Serializes 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.

Throws

If this method is used without a concrete subtype implementation.

staticserialize(_value: TypeInfo): void

View source

Abstract serialization hook for reflection metadata.

This base implementation never returns a serial value. Concrete subclasses should override it with their own serial shape.

Parameters

NameDescriptionDefault
_value——

Throws

Always; TypeInfo is abstract and cannot be serialized directly.

staticdeserialize(_value: TypeInfoSerial, _out?: TypeInfo): void

View source

Abstract 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.

Parameters

NameDescriptionDefault
_value——
_out?——

Throws

Always; TypeInfo is abstract and cannot be deserialized directly.

staticvalidateSerial(_value: unknown): void

View source

Abstract 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.

Parameters

NameDescriptionDefault
_value——

Throws

Always; TypeInfo is abstract and cannot validate serials directly.

staticvalidSerial(_value: unknown): void

View source

Abstract 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.

Parameters

NameDescriptionDefault
_value——

Throws

Always; TypeInfo is abstract and cannot validate serials directly.