UNPKG

cbor-sync

Version:

CBOR encode/decode (synchronous, semantic, browser-compatible)

12 lines (9 loc) 468 B
declare namespace CBOR { export function encode(data: any, format?: "buffer"): Buffer; export function encode(data: any, format: "hex"|"base64"): string; export function decode(data: Buffer, format?: "buffer"): any; export function decode(data: string, format: "hex"|"base64"): any; export function addSemanticEncode(tag: number, fn: (data: any) => any): any; export function addSemanticDecode(tag: number, fn: (data: any) => any): any; } export = CBOR;