@minecraft/creator-tools
Version:
Minecraft Creator Tools command line and libraries.
313 lines (312 loc) • 14.2 kB
JavaScript
"use strict";
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
Object.defineProperty(exports, "__esModule", { value: true });
exports.FieldValueSummarizerType = exports.FieldMessageType = exports.FieldValueHumanify = exports.FieldDataType = exports.FieldVisualExperience = exports.FieldExperienceType = void 0;
var FieldExperienceType;
(function (FieldExperienceType) {
FieldExperienceType["text"] = "text";
FieldExperienceType["dropdown"] = "dropdown";
FieldExperienceType["slider"] = "slider";
})(FieldExperienceType || (exports.FieldExperienceType = FieldExperienceType = {}));
var FieldVisualExperience;
(function (FieldVisualExperience) {
FieldVisualExperience["normal"] = "normal";
FieldVisualExperience["deemphasized"] = "deemphasized";
})(FieldVisualExperience || (exports.FieldVisualExperience = FieldVisualExperience = {}));
var FieldDataType;
(function (FieldDataType) {
/**
* Represents a 32-bit integer value.
*/
FieldDataType["int"] = "int";
/**
* Represents a boolean value (true or false).
*/
FieldDataType["boolean"] = "boolean";
/**
* Represents a string value.
*/
FieldDataType["string"] = "string";
/**
* Represents a floating-point number.
*/
FieldDataType["float"] = "float";
/**
* Represents a string that can take on a limited set of values, often used for enumerations.
*/
FieldDataType["stringEnum"] = "stringEnum";
/**
* Represents an integer that can take on a limited set of values, often used for enumerations.
*/
FieldDataType["intEnum"] = "intEnum";
/**
* Represents a boolean value that can be represented as an integer (0 or 1).
* This is often used for compatibility with systems that expect boolean values as integers.
*/
FieldDataType["intBoolean"] = "intBoolean";
/**
* Represents a numeric value (integer or floating-point).
*/
FieldDataType["number"] = "number";
/**
* Represents a string-based value that is chosen from a typically data-driven set of options (a lookup).
*/
FieldDataType["stringLookup"] = "stringLookup";
/**
* Represents an integer-based value that is chosen from a typically data-driven set of options (a lookup).
*/
FieldDataType["intValueLookup"] = "intValueLookup";
/**
* Represents a long integer value, which is typically a 64-bit integer.
* This is used for larger numeric values that exceed the range of standard integers.
*/
FieldDataType["long"] = "long";
/**
* Represents a point in 3D space, with x, y, and z coordinates.
*/
FieldDataType["point3"] = "point3";
/**
* Represents a point in 3D space, with integer x, y, and z coordinates.
*/
FieldDataType["intPoint3"] = "intPoint3";
/**
* Represents a long-form string, which is typically used for very long text entries.
* This is often used in contexts where the string may exceed standard length limits.
*/
FieldDataType["longFormString"] = "longFormString";
/**
* Represents a collection of objects where each object is identified by a unique string key.
* For example, { "foo": {x: 1, z: 3}, "bar": {x:10, y: 4} }
*/
FieldDataType["keyedObjectCollection"] = "keyedObjectCollection";
/**
* Represents an array of objects, where each object can have multiple properties.
* For example, [ { x: 1, id: "alpha", z: 3}, { x: 1, id: "bravo", z: 3} ]
*/
FieldDataType["objectArray"] = "objectArray";
/**
* Represents a generic object that can have any structure.
*/
FieldDataType["object"] = "object";
/**
* Represents an array of strings, which is often used for lists of text values.
*/
FieldDataType["stringArray"] = "stringArray";
/**
* Represents a range of integers. This can either be represented as a pair of integers on an object with min and max properties, or as a two element array, or as a single integer if the range is collapsed.
* For example, { "min": 0, "max": 100 } or [0, 100] or 50.
*/
FieldDataType["intRange"] = "intRange";
/**
* Represents a range of floating-point numbers. This can either be represented as a pair of floats on an object with min and max properties, or as a two element array, or as a single float if the range is collapsed.
* For example, { "min": 0.4, "max": 99.6 } or [0.4, 99.6] or 48.8.
*/
FieldDataType["floatRange"] = "floatRange";
/**
* Represents a filter that is specific to Minecraft, which can be used to filter entities or blocks based on certain criteria.
* This is fundamentally an object, e.g.,
* "filters": {
* "test": "in_lava", "subject": "self"
* }
*/
FieldDataType["minecraftFilter"] = "minecraftFilter";
/**
* Represents a range of floating-point numbers that represent a percentage chance, and the numbers should range between 0.0 and 1.0. This can either be represented as a pair of floats on an object with min and max properties, or as a two element array, or as a single float if the range is collapsed.
* For example, { "min": 0.04, "max": 0.996 } or [0.04, 0.996] or 0.488.
*/
FieldDataType["percentRange"] = "percentRange";
/**
* Represents a single Minecraft event trigger, which can be used to specify the identifier and context for an action that should fire.
*/
FieldDataType["minecraftEventTrigger"] = "minecraftEventTrigger";
/**
* Represents an array of long-form string that can contain multiple lines of text, often used for detailed descriptions or notes.
*/
FieldDataType["longFormStringArray"] = "longFormStringArray";
/**
* Represents a collection of key-value pairs where each key is a string and the value is also a string.
* For example, { "foo": "blah", "barg" : "borg" }
*/
FieldDataType["keyedStringCollection"] = "keyedStringCollection";
/**
* Represents a version, which can either be a semantic version string (e.g., "1.2.3") or a simple version number or an array of three numbers, for major, minor, and patch version.
*/
FieldDataType["version"] = "version";
/**
* Represents a universally unique identifier (UUID), which is a 128-bit number used to uniquely identify information in computer systems.
* This is typically represented as a string in the format "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx".
*/
FieldDataType["uuid"] = "uuid";
/**
* Represents a collection of key-value pairs where each key is a string and the value is a boolean.
* For example, { "foo": true, "blah": false }
*/
FieldDataType["keyedBooleanCollection"] = "keyedBooleanCollection";
/**
* Represents a collection of key-value pairs where each key is a string and the value is an array of strings.
* For example, { "foo": ["blah", "alpha"], "barg" : ["borg"] }
*/
FieldDataType["keyedStringArrayCollection"] = "keyedStringArrayCollection";
/**
* Represents an array of keyed string collections, where each element is a collection of key-value pairs.
* For example, [ { "blah": "alpha", "blaz": "blay" }, {"barg": "borg"} ]
*/
FieldDataType["arrayOfKeyedStringCollection"] = "arrayOfKeyedStringCollection";
/**
* Represents a collection of key-value pairs where each key is a string and the value is by itself a keyed string collection of an array of strings.
* For example, { "alpha": { "foo": ["blah", "alpha"], "barg" : ["borg"] } }
*/
FieldDataType["keyedKeyedStringArrayCollection"] = "keyedKeyedStringArrayCollection";
/**
* Represents a collection of key-value pairs where each key is a string and the value is a number.
* For example, { "foo": 17, "blah": 43 }
*/
FieldDataType["keyedNumberCollection"] = "keyedNumberCollection";
/**
* Represents an array of numbers.
*/
FieldDataType["numberArray"] = "numberArray";
/**
* Represents a checkbox list that is represented as an array of strings.
*/
FieldDataType["checkboxListAsStringArray"] = "checkboxListAsStringArray";
/**
* Represents a Molang expression in string form, which is a Minecraft-specific language used for data-driven content.
*/
FieldDataType["molang"] = "molang";
/**
* Represents an array of Molang expressions (an array of strings), which can be used to define multiple data-driven behaviors or properties in Minecraft.
*/
FieldDataType["molangArray"] = "molangArray";
/**
* Represents a point in 2D space, with x and y coordinates.
* This is often used for 2D graphical representations or spatial calculations.
*/
FieldDataType["point2"] = "point2";
/**
* Represents a localizable string, which is a string that is a token that is a refence to a localized string in a resource file. Or it can be a string literal (unlocalized)
*/
FieldDataType["localizableString"] = "localizableString";
/**
* Represents a keyed collection of numbers, where each key is a string and the value is an array of numbers.
* For example, { "foo": [255, 0.0, 2555], "barg" : [128, 0, 0] }
*/
FieldDataType["keyedNumberArrayCollection"] = "keyedNumberArrayCollection";
/**
* Represents a reference to a Minecraft event, which can be used to specify the identifier and context for an action that should fire.
*/
FieldDataType["minecraftEventReference"] = "minecraftEventReference";
/**
* Represents a location in 3D space, with x, y, and z coordinates but that is intended to be a location in a Minecraft world.
*/
FieldDataType["location"] = "location";
/**
* Represents a location in 3D space, with x, y, and z coordinates but that is intended to be a location offset adjustment in a Minecraft world.
*/
FieldDataType["locationOffset"] = "locationOffset";
/**
* Represents an array of Minecraft event triggers, which can be used to specify multiple identifiers and contexts for actions that should fire.
*/
FieldDataType["minecraftEventTriggerArray"] = "minecraftEventTriggerArray";
/**
* Represents a two dimensional string array, i.e.., string[][], e.g., [ ["a", "b"], ["c", "d"] ]
*/
FieldDataType["twoDStringArray"] = "twoDStringArray";
/**
* Represents an array where each item can be either a string or an object.
* This is commonly used for animation references like ["animation.walk", { "animation.jump": "query.is_jumping" }]
* Each item in the array can be a simple string reference OR an object with conditional properties.
*/
FieldDataType["stringOrObjectArray"] = "stringOrObjectArray";
/**
* Represents an array of tuples where each tuple is [string, number].
* This is used for weighted lists like generate_for_climates: [["medium", 1], ["cold", 2]]
*/
FieldDataType["stringNumberTupleArray"] = "stringNumberTupleArray";
/**
* Represents a single item that can be either a string or an object (not an array).
* Used when a field accepts "animation_name" OR { "animation_name": "condition" }
*/
FieldDataType["stringOrObject"] = "stringOrObject";
/**
* Represents a two dimensional array where each inner array contains Molang values (string OR number).
* This is used for gradient colors like: [[1.0, 0.5, 0.5, 1.0], ["variable.color", 0.5, 0.5, 1.0]]
* Schema: Array<Array<string | number>>
*/
FieldDataType["twoDMolangArray"] = "twoDMolangArray";
})(FieldDataType || (exports.FieldDataType = FieldDataType = {}));
/**
* Describes the way field values should be converted to a more human-readable format.
*/
var FieldValueHumanify;
(function (FieldValueHumanify) {
FieldValueHumanify["none"] = "none";
FieldValueHumanify["general"] = "general";
FieldValueHumanify["minecraft"] = "minecraft";
})(FieldValueHumanify || (exports.FieldValueHumanify = FieldValueHumanify = {}));
/**
* Describes the type of message for validator topic fields.
* This aligns with InfoItemType but is simplified for form field definitions.
*/
var FieldMessageType;
(function (FieldMessageType) {
/**
* Informational message - neutral status or aggregated data.
*/
FieldMessageType["info"] = "info";
/**
* Warning message - potential issue that should be reviewed.
*/
FieldMessageType["warning"] = "warning";
/**
* Error message - a definite problem that should be fixed.
*/
FieldMessageType["error"] = "error";
/**
* Recommendation message - a suggestion for improvement.
*/
FieldMessageType["recommendation"] = "recommendation";
})(FieldMessageType || (exports.FieldMessageType = FieldMessageType = {}));
/**
* The type of value summarizer visualization.
*/
var FieldValueSummarizerType;
(function (FieldValueSummarizerType) {
/**
* Simple text display with optional unit.
*/
FieldValueSummarizerType["text"] = "text";
/**
* Health bar visualization (hearts or bar).
*/
FieldValueSummarizerType["healthBar"] = "healthBar";
/**
* Probability bar visualization (0-100% or 0-1).
*/
FieldValueSummarizerType["probabilityBar"] = "probabilityBar";
/**
* Scale indicator showing percentage of normal size.
*/
FieldValueSummarizerType["scale"] = "scale";
/**
* Time visualization (ticks converted to seconds).
*/
FieldValueSummarizerType["time"] = "time";
/**
* Distance visualization with block unit.
*/
FieldValueSummarizerType["distance"] = "distance";
/**
* Color swatch for color values.
*/
FieldValueSummarizerType["color"] = "color";
/**
* Comparison against known reference values.
*/
FieldValueSummarizerType["comparison"] = "comparison";
/**
* Qualitative description based on thresholds.
*/
FieldValueSummarizerType["qualitative"] = "qualitative";
})(FieldValueSummarizerType || (exports.FieldValueSummarizerType = FieldValueSummarizerType = {}));