OptionalallowAllows extra array items in lists.
OptionalallowAllows extra properties in compounds.
OptionalemitEmit named type aliases for union branches.
OptionalinlineWhether to inline references to other NBT schemas.
OptionaloriginalThe values to put in the @see TSDoc comment of the TypeScript interface.
OptionalrefLookup for NBT schemas for the $ref property of NBT schemas.
writeFileSync(
path.join(import.meta.dirname, "./nbtSchemaTypeScriptTypes.d.ts"),
Object.entries(NBTSchemas.nbtSchemas)
.map(([name, schema]) =>
NBTSchemas.Utils.Conversion.ToTypeScriptType.nbtSchemaToTypeScriptType(schema, "DataTypes_" + name, {
originalSymbolReference: `NBTSchemas.nbtSchemas.${name}`, // This makes the generated types have a clickable link to go to the original NBT schema.
})
)
.join("\n\n")
);
Options for converting NBT schemas to TypeScript interfaces.
See
nbtSchemaToTypeScriptType