TypeDoc API - v0.28.2

    Interface SerializerComponent<T>

    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.

    interface SerializerComponent<T extends object> {
        priority: number;
        supports(item: unknown): boolean;
        toObject(
            item: T,
            obj: Partial<ModelToObject<T>>,
            serializer: Serializer,
        ): Partial<ModelToObject<T>>;
    }

    Type Parameters

    • T extends object
    Index

    Methods

    Properties

    Methods

    • Technically this should return item is T, but that doesn't play nicely with inference, so allow the looser boolean return type.

      Parameters

      • item: unknown

      Returns boolean

    Properties

    priority: number

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

    MMNEPVFCICPMFPCPTTAAATR