UNPKG

cbor-edn

Version:

Parse CBOR Extended Diagnostic Notation as defined by [draft-ietf-cbor-edn-literals-16](https://www.ietf.org/archive/id/draft-ietf-cbor-edn-literals-16.html) and some CBOR working group discussions.

19 lines (18 loc) 553 B
export declare const ORIGINAL: unique symbol; export interface IntNumber { int: number; } export interface FloatNumber { float: number; } export type TypedNumber = IntNumber | FloatNumber; /** * Encode a number as a Uint8Array. * * @param n Int or Float to encode. * @param spec '' for indefinite, null for default, '0' for one-byte, etc. * @param mt Major type to add to integer. * @returns Encoded number. * @throws On invlid state. */ export declare function numToBytes(n: TypedNumber, spec?: string | null, mt?: number): Uint8Array;