Readonlyspan: SpanWhere the token sits in the source, in UTF-16 code units.
Readonlytype: "Bool"The discriminant.
Readonlyvalue: booleantrue or false.
Readonlytype: "BraceOpen"The discriminant.
Readonlytype: "BraceClose"The discriminant.
Readonlytype: "BracketOpen"The discriminant.
Readonlytype: "BracketClose"The discriminant.
Readonlytype: "ParenthesisOpen"The discriminant.
Readonlytype: "ParenthesisClose"The discriminant.
Readonlytype: "Colon"The discriminant.
Readonlytype: "Comma"The discriminant.
Readonlytype: "Null"The discriminant.
Readonlytype: "NaN"The discriminant.
Readonlytype: "Infinity"The discriminant.
Readonlytype: "NegInfinity"The discriminant.
Readonlytype: "ByteStringHex"The discriminant.
Readonlyvalue: DcborResult<Uint8Array, DcborParseError>The bytes, or InvalidHexString for an odd number of digits.
Readonlytype: "ByteStringBase64"The discriminant.
Readonlyvalue: DcborResult<Uint8Array, DcborParseError>The bytes, or InvalidBase64String for a body that is not canonical base64.
Readonlytype: "DateLiteral"The discriminant.
Readonlyvalue: DcborResult<CborDate, DcborParseError>The date, or InvalidDateString for text the date parser rejects.
Readonlytype: "Number"The discriminant.
Readonlyvalue: numberThe number, as parseFloat reads it.
Readonlytype: "String"The discriminant.
Readonlyvalue: stringThe source text, quotes included; escapes as written.
Readonlytype: "TagValue"The discriminant.
Readonlyvalue: DcborResult<number | bigint, DcborParseError>The tag number, or InvalidTagValue past 2⁶⁴ − 1.
Readonlytype: "TagName"The discriminant.
Readonlyvalue: stringThe name before the (.
Readonlytype: "KnownValueNumber"The discriminant.
Readonlyvalue: DcborResult<number | bigint, DcborParseError>The known-value number, or InvalidKnownValue past 2⁶⁴ − 1.
Readonlytype: "KnownValueName"The discriminant.
Readonlyvalue: stringThe name between the quotes; empty for ''.
Readonlytype: "Unit"The discriminant.
Readonlytype: "UR"The discriminant.
Readonlyvalue: DcborResult<UR, DcborParseError>The decoded UR, or InvalidUr for one the decoder rejects.
A token of the notation, with its span.
The six literal kinds carry their decoded value or, when the text matched the literal's pattern but did not decode (an odd number of hex digits, a non-canonical base64 body, an impossible date, a tag or known-value number past 2⁶⁴ − 1, a UR the decoder rejects), the error the parser reports for it.
TagValueandKnownValueNumberaccept the full unsigned 64-bit range: a value that fits inNumber.MAX_SAFE_INTEGERis anumber, anything larger abigint, so no precision is lost. AStringtoken holds its source text, quotes included; escape sequences are kept as written.