DataValue
DataValue = {
kind:"int";value:bigint; } | {kind:"float";value:number; } | {kind:"bytes";value:Uint8Array; } | {kind:"text";value:string; } | {items: readonlyDataValue[];kind:"array"; } | {entries: readonly readonly [DataValue,DataValue][];kind:"map"; } | {kind:"tag";tag:bigint;value:DataValue; } | {kind:"bool";value:boolean; } | {kind:"null"; } | {kind:"undefined"; } | {kind:"simple";value:number; }
Defined in: packages/format-cbor/src/ast.ts:9
The CBOR generic data model (RFC 8949 §2) — the single value tree shared by the binary codec, the diagnostic-notation codec, and the JSON bridge.
Integers and floating-point values are distinct even when numerically equal
(RFC 8949 §2), so int always carries a bigint and float always carries
a JS number (binary64) — never conflated.
Union Members
Section titled “Union Members”Type Literal
Section titled “Type Literal”{ kind: "int"; value: bigint; }
Type Literal
Section titled “Type Literal”{ kind: "float"; value: number; }
Type Literal
Section titled “Type Literal”{ kind: "bytes"; value: Uint8Array; }
Type Literal
Section titled “Type Literal”{ kind: "text"; value: string; }
Type Literal
Section titled “Type Literal”{ items: readonly DataValue[]; kind: "array"; }
Type Literal
Section titled “Type Literal”{ entries: readonly readonly [DataValue, DataValue][]; kind: "map"; }
Type Literal
Section titled “Type Literal”{ kind: "tag"; tag: bigint; value: DataValue; }
Type Literal
Section titled “Type Literal”{ kind: "bool"; value: boolean; }
Type Literal
Section titled “Type Literal”{ kind: "null"; }
Type Literal
Section titled “Type Literal”{ kind: "undefined"; }
Type Literal
Section titled “Type Literal”{ kind: "simple"; value: number; }
An unassigned simple value (RFC 8949 §3.3), 0-19 or 32-255.