cbor2
    Preparing search index...

    Class TypeEncoderMap

    Contain a set of mappings from an object constructor to a matching TypeEncoder.

    Index

    Constructors

    Methods

    • Register an encoder for a given type.

      Type Parameters

      Parameters

      • typ: T

        The class to encode. This is the function for the constructor of objects of this type. For example, Uint8Array the value of the constructor property of a Uint8Array instance.

      • encoder: TypeEncoder<InstanceType<T>>

        The function to use for encoding this type.

      Returns undefined | TypeEncoder<T>

      Previous registration, or undefined if none.