UNPKG

minecraft-bedrock-json-types

Version:

Typescript types for Minecraft Bedrock's add-on json configuration files.

366 lines (365 loc) 8.52 kB
/** * This file was automatically generated by json-schema-to-typescript. * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, * and run json-schema-to-typescript to regenerate this file. */ /** * A version that tells minecraft what type of data format can be expected when reading this file. */ type FormatVersion = string; /** * How does time pass when playing the animation. Defaults to `query.anim_time + query.delta_time` which means advance in seconds. */ type AnimationTimeUpdate = (string | number); /** * Override calculated value (set as the last keyframe time) and set animation length in seconds. */ type AnimationLength = number; /** * The weight of the animation when blending with other animations. Defaults to 1. */ type BlendWeight = (string | number); /** * The Position transformation during this animation. */ type Position = (PositionArray | { [k: string]: TimelineObject; }); /** * An array of 3 items that describe the bones position. * * @minItems 3 * @maxItems 3 */ type PositionArray = [PositionX, PositionY, PositionZ]; /** * The position over the X-axis or forwards/backwards. * Can be molang or a float */ type PositionX = (string | number); /** * The position over the Y-axis, or up/down. * Can be molang or a float */ type PositionY = (string | number); /** * The position over the Z-axis, or left/right. * Can be molang or a float */ type PositionZ = (string | number); /** * A single point in time. */ type TimelineObject = (MolangNumber | PositionArray1 | { lerp_mode?: LerpMode; pre?: Pre; post?: Pre1; }); /** * Uniform position. */ type MolangNumber = (string | number); /** * An array of 3 items that describe the bones position. * * @minItems 3 * @maxItems 3 */ type PositionArray1 = [PositionX, PositionY, PositionZ]; /** * UNDOCUMENTED. */ type LerpMode = ("linear" | "catmullrom"); /** * UNDOCUMENTED. * * @minItems 3 * @maxItems 3 */ type Pre = [PositionX, PositionY, PositionZ]; /** * UNDOCUMENTED. * * @minItems 3 * @maxItems 3 */ type Pre1 = [PositionX, PositionY, PositionZ]; /** * The rotation transformation during this animation. */ type Rotation = (RotationArray | { [k: string]: TimelineObject1; }); /** * An array of 3 items that describe the bones rotation. * * @minItems 3 * @maxItems 3 */ type RotationArray = [RotationX, RotationY, RotationZ]; /** * The rotation over the X-axis, or up or down. * Can be molang or a float */ type RotationX = (string | number); /** * The rotation over the Y-axis, or yaw. * Can be molang or a float */ type RotationY = (string | number); /** * The rotation over the Z-axis, or roll. * Can be molang or a float */ type RotationZ = (string | number); /** * A single point in time. */ type TimelineObject1 = (MolangNumber1 | RotationArray1 | { lerp_mode?: LerpMode1; pre?: Pre2; post?: Pre3; }); /** * Uniform rotation. */ type MolangNumber1 = (string | number); /** * UNDOCUMENTED. * * @minItems 3 * @maxItems 3 */ type RotationArray1 = [RotationX, RotationY, RotationZ]; /** * UNDOCUMENTED. */ type LerpMode1 = ("linear" | "catmullrom"); /** * UNDOCUMENTED. * * @minItems 3 * @maxItems 3 */ type Pre2 = [RotationX, RotationY, RotationZ]; /** * UNDOCUMENTED. * * @minItems 3 * @maxItems 3 */ type Pre3 = [RotationX, RotationY, RotationZ]; /** * If set, makes the bone rotation relative to the entity instead of the bone's parent. */ type Rotation1 = string; /** * UNDOCUMENTED. */ type Scale = (MolangNumber2 | ScaleArray | { [k: string]: TimelineObject2; }); /** * Uniform scale. */ type MolangNumber2 = (string | number); /** * An array of 3 items that describe the bones scale. * * @minItems 3 * @maxItems 3 */ type ScaleArray = [ScaleX, ScaleY, ScaleZ]; /** * The scale over the X-axis or forwards/backwards. * Can be molang or a float */ type ScaleX = (string | number); /** * The scale over the Y-axis, or up/down. * Can be molang or a float */ type ScaleY = (string | number); /** * The scale over the Z-axis, or left/right. * Can be molang or a float */ type ScaleZ = (string | number); /** * A single point in time. */ type TimelineObject2 = (MolangNumber3 | ScaleArray1 | { lerp_mode?: LerpMode2; pre?: ScaleArray2; post?: ScaleArray3; }); /** * Uniform rotation. */ type MolangNumber3 = (string | number); /** * An array of 3 items that describe the bones scale. * * @minItems 3 * @maxItems 3 */ type ScaleArray1 = [ScaleX, ScaleY, ScaleZ]; /** * UNDOCUMENTED. */ type LerpMode2 = ("linear" | "catmullrom"); /** * An array of 3 items that describe the bones scale. * * @minItems 3 * @maxItems 3 */ type ScaleArray2 = [ScaleX, ScaleY, ScaleZ]; /** * An array of 3 items that describe the bones scale. * * @minItems 3 * @maxItems 3 */ type ScaleArray3 = [ScaleX, ScaleY, ScaleZ]; /** * Should this animation stop, loop, or stay on the last frame when finished (true, false, hold_on_last_frame). */ type Loop = (boolean | "hold_on_last_frame"); /** * How long to wait in seconds before looping this animation. Note that this expression is evaluated after each loop and on looping animation only. */ type LoopDelay = (string | number); /** * Reset bones in this animation to the default pose before applying this animation. */ type OverridePreviousAnimation = boolean; /** * A single point in time. */ type TimelineObject3 = (ParticleEffect | ParticleEffect1[]); /** * The name of a particle effect that should be played. */ type ParticleId = string; /** * The name of a locator on the actor where the effect should be located. */ type Locator = string; /** * A molang script that will be run when the particle emitter is initialized. */ type PreEffectScript = string; /** * Set to false to have the effect spawned in the world without being bound to an actor (by default an effect is bound to the actor). */ type BindToActor = false; /** * How long to wait in seconds before playing this animation. Note that this expression is evaluated once before playing, and only re-evaluated if asked to play from the beginning again. A looping animation should use `loop_delay` if it wants a delay between loops. */ type StartDelay = (string | number); /** * A single point in time. */ type TimelineObject4 = (SoundEffect1 | SoundEffect2[]); /** * Valid sound effect names should be listed in the entity's resource_definition json file. */ type Effect = string; /** * Variable definition. */ type Molang = string; /** * Variable definition. */ type Molang1 = string; type CollectionTimelimeItems = Molang1[]; /** * The RP animation that changes an actors models, or molang data. */ export interface ResourceAnimation { format_version: FormatVersion; animations: AnimationsSchema; } /** * The animation specification. */ interface AnimationsSchema { [k: string]: Animation; } /** * The animation specification. */ interface Animation { anim_time_update?: AnimationTimeUpdate; animation_length?: AnimationLength; blend_weight?: BlendWeight; bones?: Bones; loop?: Loop; loop_delay?: LoopDelay; override_previous_animation?: OverridePreviousAnimation; particle_effects?: ParticleEffects; start_delay?: StartDelay; sound_effects?: SoundEffect; timeline?: Timeline; } /** * Defines how the bones in an animation move or transform. */ interface Bones { [k: string]: BoneTransformation; } /** * The bone definition that declare how it transforms during animation. */ interface BoneTransformation { position?: Position; rotation?: Rotation; relative_to?: RelativeTo; scale?: Scale; } /** * If set, makes the bone rotation relative to the entity instead of the bone's parent. */ interface RelativeTo { rotation?: Rotation1; [k: string]: unknown; } /** * UNDOCUMENTED. */ interface ParticleEffects { [k: string]: TimelineObject3; } interface ParticleEffect { effect: ParticleId; locator?: Locator; pre_effect_script?: PreEffectScript; bind_to_actor?: BindToActor; } interface ParticleEffect1 { effect: ParticleId; locator?: Locator; pre_effect_script?: PreEffectScript; bind_to_actor?: BindToActor; } /** * UNDOCUMENTED. */ interface SoundEffect { [k: string]: TimelineObject4; } interface SoundEffect1 { effect?: Effect; } interface SoundEffect2 { effect?: Effect; } /** * The time line. */ interface Timeline { [k: string]: (Molang | CollectionTimelimeItems); } export {};