BC-DCBOR TypeScript Library - v1.0.0-alpha.13
    Preparing search index...

    Type Alias CborInput

    CborInput:
        | Cbor
        | CborNumber
        | string
        | boolean
        | null
        | undefined
        | Uint8Array
        | ByteString
        | CborDate
        | CborMap
        | CborInput[]
        | Map<unknown, unknown>
        | Set<unknown>
        | Record<string, unknown>

    Type for values that can be converted to CBOR.

    This is a comprehensive union type representing all values that can be encoded as CBOR using the cbor() function. It includes:

    • Already-encoded CBOR values (Cbor)
    • Primitive types: numbers, bigints, strings, booleans, null, undefined
    • Binary data: Uint8Array, ByteString
    • Dates: CborDate
    • Collections: CborMap, arrays, JavaScript Map, JavaScript Set
    • Objects: Plain objects are converted to CBOR maps

    Matches Rust's From<T> trait implementations for CBOR.

    cbor(42);                              // number
    cbor("hello"); // string
    cbor([1, 2, 3]); // array
    cbor(new Map([["key", "value"]])); // Map
    cbor({ name: "Alice", age: 30 }); // plain object -> CborMap