/** * A reference of the JSON serialized format of the NBT docs * * https://github.com/Yurihaia/nbtdoc-rs/blob/master/docs/json_format.d.ts * * @author Yurihaia https://github.com/Yurihaia * @license MIT https://github.com/Yurihaia/nbtdoc-rs/blob/master/LICENSE-MIT */ export declare namespace nbtdoc { /** * A reference to an element inside an `Arena` */ export type Index = number; /** * A referenceable list */ export type Arena = T[]; /** * A type of index */ export type ItemIndex = { Compound: Index; } | { Enum: Index; } | { Module: Index; }; /** * A segment of a path to an actual NBT value */ export type FieldPath = 'Super' | { Child: string; }; /** * The type that a field can be */ export type NbtValue = 'Boolean' | { /**i8 range*/ Byte: NumberTag; } | { /**i16 range*/ Short: NumberTag; } | { /**i32 range*/ Int: NumberTag; } | { /**i64 range, lossy in JS*/ Long: NumberTag; } | { /**f32 range*/ Float: NumberTag; } | { /**f64 range*/ Double: NumberTag; } | 'String' | { /**i8 value range*/ ByteArray: NumberArrayTag; } | { /**i32 value range*/ IntArray: NumberArrayTag; } | { /**i64 value range*/ LongArray: NumberArrayTag; } | { Compound: Index; } | { Enum: Index; } | { List: { /**positive i32 range*/ length_range: Range | null; value_type: NbtValue; }; } | { Index: { /**ID*/ target: string; path: FieldPath[]; }; } | { /**ID*/ Id: string; } | { Or: NbtValue[]; }; /** * Internal Use * Signifies a certain inject that has not been executed yet */ type UnresolvedInject = { Compound: [string, Field][]; } | { Enum: EnumType; }; /** * A range of numbers. Both sides inclusive */ type Range = [number | null, number | null]; /** * The different types of enums */ export type EnumType = { Byte: { /**i8 range*/ [key: string]: EnumOption; }; } | { Short: { /**i16 range*/ [key: string]: EnumOption; }; } | { Int: { /**i32 range*/ [key: string]: EnumOption; }; } | { Long: { /**i64 range, lossy in JS*/ [key: string]: EnumOption; }; } | { Float: { /**f32 range*/ [key: string]: EnumOption; }; } | { Double: { /**f64 range*/ [key: string]: EnumOption; }; } | { String: { [key: string]: EnumOption; }; }; /** * The main struct in the validation process */ export interface Root { registries: { [/**ID*/ key: string]: [ { [/**ID*/ key: string]: Index; }, (Index | null) ]; }; root_modules: { [key: string]: Index; }; compound_arena: Arena; enum_arena: Arena; module_arena: Arena; /** Only needed for inner workings */ unresolved_inject: Array<{ Unregistered: [string[], UnresolvedInject]; } | { Registered: [ItemIndex, UnresolvedInject, string]; }>; } /** * A specific compound definition */ export interface CompoundTag { description: string; fields: { [key: string]: Field; }; supers: ({ Compound: Index; } | { Registry: { /**ID*/ target: string; path: FieldPath[]; }; } | null); } /** * A field in a compound definition */ export interface Field { description: string; nbttype: NbtValue; } /** * An individual module */ export interface Module { children: { [key: string]: ItemIndex; }; parent: Index | null; } /** * A value enumeration */ export interface EnumItem { et: EnumType; description: string; } /** * An individual enum option */ export interface EnumOption { value: T; description: string; } /** * A scalar number NBT value */ export interface NumberTag { range: Range | null; } /** * A scalar number array NBT value */ export interface NumberArrayTag { /**positive i32 range*/ length_range: Range | null; value_range: Range | null; } export {}; }