asajs 4.0.1 → 4.0.3-preview

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.
@@ -0,0 +1,10 @@
1
+ import { Binding } from "../../types/properties/value.js";
2
+ import { GenBinding } from "./types.js";
3
+ export declare function intToBin(input: string): {
4
+ ret: `#${string}`;
5
+ bindings: GenBinding[];
6
+ };
7
+ export declare function binToInt(input: Binding): {
8
+ ret: `#${string}`;
9
+ bindings: GenBinding[];
10
+ };
@@ -4,4 +4,90 @@ type Callback = (...args: Expression[]) => {
4
4
  value: Expression;
5
5
  };
6
6
  export declare const FunctionMap: Map<string, Callback>;
7
+ export declare const defaultFunctions: {
8
+ /**
9
+ * Returns the absolute value of a number (the value without regard to whether it is positive or negative). For example, the absolute value of -5 is the same as the absolute value of 5.
10
+ * @param number
11
+ * @returns
12
+ */
13
+ abs: (number: string) => {
14
+ genBindings: {
15
+ source: string;
16
+ target: `#${string}`;
17
+ }[];
18
+ value: `#${string}`;
19
+ };
20
+ /**
21
+ * Returns the negative absolute value of a number (the value without regard to whether it is positive or negative). For example, the absolute value of 5 is the same as the negative absolute value of -5.
22
+ * @param number
23
+ * @returns
24
+ */
25
+ negabs: (number: string) => {
26
+ genBindings: {
27
+ source: string;
28
+ target: `#${string}`;
29
+ }[];
30
+ value: `#${string}`;
31
+ };
32
+ /**
33
+ * Generate a new binding for expression
34
+ * @param expression
35
+ * @returns
36
+ */
37
+ new: (expression: string) => {
38
+ genBindings: {
39
+ source: string;
40
+ target: `#${string}`;
41
+ }[];
42
+ value: `#${string}`;
43
+ };
44
+ /**
45
+ * Returns the square root of a number.
46
+ * @param number
47
+ * @returns
48
+ */
49
+ sqrt: (number: string) => {
50
+ genBindings: GenBinding[];
51
+ value: `#${string}`;
52
+ };
53
+ /**
54
+ * Return a translatable string
55
+ * @param key
56
+ * @returns
57
+ */
58
+ translatable: (key: string) => {
59
+ value: string;
60
+ };
61
+ /**
62
+ * Return a binary of int32 number in string
63
+ * @param value
64
+ * @param bait
65
+ * @returns
66
+ */
67
+ /**
68
+ * Generate value bindings
69
+ * @param value
70
+ * @param bait
71
+ * @returns
72
+ */
73
+ bind: (value: string, bait: string) => {
74
+ genBindings: {
75
+ source: string;
76
+ target: `#${string}`;
77
+ }[];
78
+ value: `#${string}`;
79
+ };
80
+ /**
81
+ * Return a int of float number, because string in JSON-UI cannot read it.
82
+ * @param input
83
+ * @returns
84
+ */
85
+ int: (input: string) => {
86
+ genBindings: {
87
+ source: string;
88
+ target: `#${string}`;
89
+ }[];
90
+ value: `#${string}`;
91
+ };
92
+ };
7
93
  export {};
@@ -1,14 +1,15 @@
1
1
  export declare enum TokenKind {
2
2
  VARIABLE = 0,
3
- NUMBER = 1,
4
- STRING = 2,
5
- TEMPLATE_STRING = 3,
6
- WORD = 4,
7
- OPEN_PARENTHESIS = 5,
8
- CLOSE_PARENTHESIS = 6,
9
- OPERATOR = 7,
10
- COMMA = 8,
11
- EOF = 9
3
+ STRING = 1,
4
+ TEMPLATE_STRING = 2,
5
+ WORD = 3,
6
+ INT = 4,
7
+ FLOAT = 5,
8
+ OPEN_PARENTHESIS = 6,
9
+ CLOSE_PARENTHESIS = 7,
10
+ OPERATOR = 8,
11
+ COMMA = 9,
12
+ EOF = 10
12
13
  }
13
14
  export declare enum TSTokenKind {
14
15
  STRING = 0,
@@ -15,8 +15,8 @@ export declare class AnimationKeyframe<T extends AnimType> extends Class {
15
15
  clearNext(): this;
16
16
  protected toJsonUI(): KeyframeAnimationProperties<AnimType>;
17
17
  protected toJSON(): (Partial<import("../types/properties/element/Animation.js").DurationAnimation> & import("../types/properties/element/Animation.js").KeyframeAnimationPropertiesItem) | (Partial<import("../types/properties/element/Animation.js").AsepriteFlipBookAnimation> & import("../types/properties/element/Animation.js").KeyframeAnimationPropertiesItem) | {
18
- from?: import("../types/properties/value.js").Value<number> | undefined;
19
- to?: import("../types/properties/value.js").Value<number> | undefined;
18
+ from?: import("../types/properties/value.js").Array2<string | number> | undefined;
19
+ to?: import("../types/properties/value.js").Array2<string | number> | undefined;
20
20
  duration?: import("../types/properties/value.js").Value<number> | undefined;
21
21
  easing?: import("../types/properties/value.js").Value<string | import("../index.js").Easing> | undefined;
22
22
  next?: import("../types/properties/value.js").Value<string | AnimationKeyframe<AnimType> | Animation<AnimType>>;
@@ -33,8 +33,8 @@ export declare class AnimationKeyframe<T extends AnimType> extends Class {
33
33
  wait_until_rendered_to_play?: import("../types/properties/value.js").Value<boolean>;
34
34
  anim_type: T;
35
35
  } | {
36
- from?: import("../types/properties/value.js").Array2<string | number> | undefined;
37
- to?: import("../types/properties/value.js").Array2<string | number> | undefined;
36
+ from?: import("../types/properties/value.js").Value<number> | undefined;
37
+ to?: import("../types/properties/value.js").Value<number> | undefined;
38
38
  duration?: import("../types/properties/value.js").Value<number> | undefined;
39
39
  easing?: import("../types/properties/value.js").Value<string | import("../index.js").Easing> | undefined;
40
40
  next?: import("../types/properties/value.js").Value<string | AnimationKeyframe<AnimType> | Animation<AnimType>>;
@@ -10,4 +10,4 @@ export * from "./types/enums/index.js";
10
10
  export * as Properties from "./types/properties/index.js";
11
11
  export { ItemAuxID } from "./types/enums/Items.js";
12
12
  export { ArrayName, Operation } from "./types/properties/index.js";
13
- export { Lexer } from "./compilers/bindings/Lexer.js";
13
+ export * from "./compilers/bindings/Binary.js";
@@ -557,6 +557,7 @@ export declare enum ItemAuxID {
557
557
  GOLDEN_BOOTS = 25296896,
558
558
  GOLDEN_CARROT = 20447232,
559
559
  GOLDEN_CHESTPLATE = 25165824,
560
+ GOLDEN_DANDELION = -71499776,
560
561
  GOLDEN_HELMET = 25100288,
561
562
  GOLDEN_HOE = 23920640,
562
563
  GOLDEN_HORSE_ARMOR = 37421056,