@blockchaincommons/dcbor - v1.0.0-beta.1
    Preparing search index...

    Interface CborCodec<T>Beta

    A two-way codec binding a TypeScript type T to its CBOR representation. The codec value is the runtime witness that justifies the generic in decodeWith - no unwitnessed casts.

    Ship-with exemplar: CborDate.codec.

    interface CborCodec<T> {
        tags?: readonly Tag[];
        decode(cbor: Cbor): T;
        encode(value: T): Cbor;
    }

    Type Parameters

    • T
    Index
    tags?: readonly Tag[]

    The tags this codec's encoding carries, if any (informational).

    • Beta

      Convert a decoded CBOR value to T.

      Parameters

      Returns T

      on shape/tag mismatch.