zon-format
Version:
ZON: The most token-efficient serialization format for LLMs - beats CSV, TOON, JSON, and all competitors
49 lines (48 loc) • 1 kB
TypeScript
/**
* Binary ZON Decoder
*
* Decodes binary ZON format back to JavaScript values
*/
/**
* Binary ZON Decoder
*/
export declare class BinaryZonDecoder {
private buffer;
private offset;
/**
* Decode binary ZON format to JavaScript value
*/
decode(buffer: Uint8Array): any;
/**
* Verify magic header
*/
private verifyMagicHeader;
/**
* Decode a single value
*/
private decodeValue;
/**
* Decode a string of known length
*/
private decodeString;
/**
* Decode an array of known length
*/
private decodeArray;
/**
* Decode a map/object of known length
*/
private decodeMap;
private readUint8;
private readUint16;
private readUint32;
private readInt8;
private readInt16;
private readInt32;
private readFloat32;
private readFloat64;
}
/**
* Decode binary ZON format to JavaScript value
*/
export declare function decodeBinary(buffer: Uint8Array): any;