asajs 4.1.12 → 4.1.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -50,7 +50,6 @@ if (!fs.existsSync("asajs.config.js")) {
50
50
  }
51
51
  export const config = createRequire(import.meta.url)(path.resolve(process.cwd(), "asajs.config.js")).config;
52
52
  export const debugMode = options["debug"] ?? false;
53
- console.log(debugMode);
54
53
  export const isBuildMode = options["build"] ?? config.compiler?.enabled ?? false;
55
54
  export const isLinkMode = options["link"] ?? config.compiler?.autoImport ?? false;
56
55
  export const unLinked = options["unlink"] ?? !(config.compiler?.autoImport ?? true);
@@ -1,6 +1,7 @@
1
1
  import { AnimType } from "../types/enums/AnimType.js";
2
2
  import { SmartAnimation } from "../types/enums/SmartAnimation.js";
3
3
  import { AnimationProperties } from "../types/properties/element/Animation.js";
4
+ import { Control } from "../types/properties/value.js";
4
5
  import { Class } from "./Class.js";
5
6
  import { KeyframeController } from "./KeyframeController.js";
6
7
  import util from "node:util";
@@ -18,7 +19,7 @@ export declare class Animation<T extends AnimType> extends Class {
18
19
  private transformKeyframe;
19
20
  private addKeyframes;
20
21
  setLoop(boolean: boolean): this;
21
- protected toString(): string;
22
+ toString(): Control;
22
23
  protected [util.inspect.custom]($: any, opts: any): string;
23
24
  }
24
25
  export {};
@@ -3,6 +3,7 @@ import { KeyframeAnimationProperties } from "../types/properties/element/Animati
3
3
  import { Animation } from "./Animation.js";
4
4
  import { Class } from "./Class.js";
5
5
  import util from "node:util";
6
+ import { Control } from "../types/properties/value.js";
6
7
  export declare class AnimationKeyframe<T extends AnimType> extends Class {
7
8
  readonly type: T;
8
9
  readonly properties: KeyframeAnimationProperties<T>;
@@ -88,6 +89,6 @@ export declare class AnimationKeyframe<T extends AnimType> extends Class {
88
89
  wait_until_rendered_to_play?: import("../types/properties/value.js").Value<boolean>;
89
90
  anim_type: T;
90
91
  };
91
- protected toString(): string;
92
+ toString(): Control;
92
93
  protected [util.inspect.custom]($: any, opts: any): string;
93
94
  }
@@ -2,7 +2,7 @@ import { AnimType } from "../types/enums/AnimType.js";
2
2
  import { Renderer } from "../types/enums/Renderer.js";
3
3
  import { Type } from "../types/enums/Type.js";
4
4
  import { Properties } from "../types/properties/components.js";
5
- import { BindingItem, ButtonMapping, ModificationItem, VariableItem, Variables } from "../types/properties/value.js";
5
+ import { BindingItem, ButtonMapping, Control, ModificationItem, VariableItem, Variables } from "../types/properties/value.js";
6
6
  import { Animation } from "./Animation.js";
7
7
  import { AnimationKeyframe } from "./AnimationKeyframe.js";
8
8
  import { Class } from "./Class.js";
@@ -69,7 +69,7 @@ export declare class UI<T extends Type, K extends Renderer | null = null> extend
69
69
  * @returns
70
70
  */
71
71
  createExtends(properties?: Properties<T, K>, name?: string, namespace?: string): UI<T, K>;
72
- protected toString(): string;
72
+ toString(): Control;
73
73
  protected toJsonUI(): any;
74
74
  protected toJSON(): any;
75
75
  protected [util.inspect.custom]($: any, opts: any): string;
@@ -7,7 +7,10 @@ export interface Sprite {
7
7
  uv_size?: AnimValue<Array2<number>>;
8
8
  texture_file_system?: Value<string>;
9
9
  nineslice_size?: AnimValue<Array2<number> | Array3<number> | Array4<number>>;
10
- tiled?: Value<boolean>;
10
+ tiled?: Value<boolean | {
11
+ x: number;
12
+ y: number;
13
+ }>;
11
14
  tiled_scale?: Value<Array<number>>;
12
15
  clip_direction?: Value<string | ClipDirection>;
13
16
  clip_ratio?: Value<number>;
@@ -13,11 +13,12 @@ import { AnimType } from "../enums/AnimType.js";
13
13
  import { AnimationKeyframe } from "../../components/AnimationKeyframe.js";
14
14
  export type Variable = `$${string}`;
15
15
  export type Binding = `#${string}`;
16
+ export type Control = `@${string}` | `${string}@${string}`;
16
17
  export type Animation = anim.Animation<AnimType> | AnimationKeyframe<AnimType> | `@${string}`;
17
18
  export type Array2<T> = [T, T];
18
19
  export type Array3<T> = [T, T, T];
19
20
  export type Array4<T> = [T, T, T, T];
20
- export type Value<T> = Variable | Binding | T;
21
+ export type Value<T> = Variable | Binding | Control | T;
21
22
  export type AnimValue<T> = Value<T | Animation>;
22
23
  export type BindingItem = {
23
24
  ignored?: Value<boolean>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "asajs",
3
- "version": "4.1.12",
3
+ "version": "4.1.14",
4
4
  "description": "Create your Minecraft JSON-UI resource packs using JavaScript",
5
5
  "keywords": [
6
6
  "Minecraft",