@blockchaincommons/components - v1.0.0-beta.4
    Preparing search index...

    Interface ComponentCodec<T>

    A codec over a tagged type. decode requires one of tags (the reference's from_tagged_cbor; an untagged or foreign-tagged value is a Cbor failure); decodeUntagged is the explicit door for content whose tag has already been consumed by the caller.

    interface ComponentCodec<T> {
        tagValues: readonly CborNumber[];
        tags: readonly Tag[];
        decode: (cbor: Cbor) => T;
        encode: (value: T) => Cbor;
        decodeUntagged: (cbor: Cbor) => T;
        encodeUntagged: (value: T) => Cbor;
    }

    Type Parameters

    • T

    Hierarchy

    • CborCodec<T>
      • ComponentCodec
    Index
    tagValues: readonly CborNumber[]

    The tag values this type is written and read with; the first is written.

    tags: readonly Tag[]

    tagValues resolved through dcbor's global tags store at each access (the reference's tags_for_values): named once registerTags() ran, numeric otherwise.

    decode: (cbor: Cbor) => T

    Decode a value tagged with any of tags; anything else is a Cbor failure.

    encode: (value: T) => Cbor

    Encode to the tagged form.

    decodeUntagged: (cbor: Cbor) => T

    Decode the content inside the tag.

    encodeUntagged: (value: T) => Cbor

    Encode the content inside the tag.