OpaqueInfo

View source

ExtendsTypeInfo

Describes metadata for a reflected type with an intentionally opaque structure.

Opaque metadata records only the opaque kind. It does not describe fields or validate values of the reflected type. Use OpaqueInfo.default for the standard metadata instance.

Examples

import { OpaqueInfo } from '@wimaengine/reflect'

const info = OpaqueInfo.default()
info.serialize() // { kind: 'opaque' }
OpaqueInfo.validateSerial({ kind: 'opaque' }) // true

Constructor


constructor()

Methods


serialize(): OpaqueInfoSerial

View source

Returns the opaque metadata serial for this instance.

The instance has no fields to inspect, so serialization always returns a new object with only kind: 'opaque'.

staticserialize(_value: OpaqueInfo): OpaqueInfoSerial

View source

Serializes opaque metadata.

The supplied instance is not inspected because all OpaqueInfo instances have the same serial form.

Parameters

NameDescriptionDefault
_value——

staticdeserialize(_value: OpaqueInfoSerial, out?: OpaqueInfo): OpaqueInfo

View source

Restores opaque metadata into an instance.

Opaque metadata has no state to restore, so this method returns the supplied out instance unchanged, or creates and returns a new instance. It does not inspect _value; callers should validate the serial first.

Parameters

NameDescriptionDefault
_value——
out?—...

staticvalidateSerial(value: unknown): value is OpaqueInfoSerial

View source

Checks whether a value has the opaque metadata serial shape.

Validation accepts a non-null, non-array object whose kind property is exactly 'opaque'. It validates metadata shape, not a runtime value, and permits additional properties on the serial object.

Parameters

NameDescriptionDefault
value——