• Public
  • Public/Protected
  • All

Represents Serializer plugin component.

Like Converter plugins each Serializer plugin defines a predicate that instructs if an object can be serialized by it, this is done dynamically at runtime via a supports method.

Additionally, each Serializer plugin must define a predicate that instructs the group it belongs to.

Serializers are grouped to improve performance when finding serializers that apply to a node, this makes it possible to skip the supports calls for Types when searching for a Reflection and vise versa.

Type parameters

  • T


  • SerializerComponent




owner: Serializer

Set when the SerializerComponent is added to the serializer.

PRIORITY: number = 0

The priority this serializer should be executed with. A higher priority means the Serializer will be applied earlier.


  • get priority(): number


  • serializeGroup(instance: unknown): boolean
  • A high-level predicate filtering which group this serializer belongs to. This is a high-level filter before the SerializerComponent.supports predicate filter.

    For example, use the Reflection class class to group all reflection based serializers:

    class ReflectionSerializer {
    serializeGroup(instance) { return instance instanceof Reflection }

    Use the Type class to group all type based serializers:

    class TypeSerializer {
    serializeGroup(instance) { return instance instanceof Type }


    • instance: unknown

    Returns boolean

  • supports(item: unknown): boolean

Generated using TypeDoc