//#region src/tag.d.ts declare enum TagType { End = 0, Byte = 1, Short = 2, Int = 3, Long = 4, Float = 5, Double = 6, ByteArray = 7, String = 8, List = 9, Compound = 10, IntArray = 11, LongArray = 12 } declare class Byte { value: number; constructor(value: number); valueOf(): number; } declare class Short { value: number; constructor(value: number); valueOf(): number; } declare class Int { value: number; constructor(value: number); valueOf(): number; } declare class Float { value: number; constructor(value: number); valueOf(): number; } interface TagArray extends Array {} interface TagObject { [key: string]: Tag | undefined | null; } interface TagMap extends Map {} type Tag = number | string | bigint | Byte | Short | Int | Float | Buffer | Int8Array | Int32Array | BigInt64Array | TagArray | TagObject | TagMap; declare function getTagType(tag: Tag): TagType; //#endregion //#region src/snbt.d.ts interface StringifyOptions { pretty?: boolean; breakLength?: number; quote?: "single" | "double"; } declare function stringify(tag: Tag, options?: StringifyOptions): string; interface ParseOptions { useMaps?: boolean; } declare function parse(text: string, options?: ParseOptions): Tag; //#endregion //#region src/index.d.ts interface DecodeResult { name: string | null; value: Tag | null; length: number; } interface DecodeOptions { /** Use ES6 `Map`s for compound tags instead of plain objects. */ useMaps?: boolean; /** Whether the root tag has a name. */ unnamed?: boolean; } /** * Decode a nbt tag from buffer. * * The result contains the decoded nbt value, the tag's name, if present, * and the length of how much was read from the buffer. */ declare function decode(buffer: Buffer, options?: DecodeOptions): DecodeResult; /** * Encode a nbt tag into a buffer. * * @param name Resulting tag will be unnamed if name is `null`. * @param tag If tag is `null`, only a zero byte is returned. */ declare function encode(name: string | null, tag: Tag | null): Buffer; //#endregion export { Byte, DecodeOptions, DecodeResult, Float, Int, ParseOptions, Short, StringifyOptions, Tag, TagArray, TagMap, TagObject, TagType, decode, encode, getTagType, parse, stringify };