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.
- package/README.md +2 -2
- package/dist/js/compilers/bindings/Binary.js +36 -0
- package/dist/js/compilers/bindings/Function.js +116 -66
- package/dist/js/compilers/bindings/Lexer.js +11 -6
- package/dist/js/compilers/bindings/Parser.js +8 -76
- package/dist/js/compilers/bindings/types.js +10 -9
- package/dist/js/compilers/ui/builder.js +1 -1
- package/dist/js/components/UI.js +1 -1
- package/dist/js/index.js +1 -1
- package/dist/js/types/enums/Items.js +1 -0
- package/dist/js/types/vanilla/paths.js +236 -140
- package/dist/types/compilers/bindings/Binary.d.ts +10 -0
- package/dist/types/compilers/bindings/Function.d.ts +86 -0
- package/dist/types/compilers/bindings/types.d.ts +10 -9
- package/dist/types/components/AnimationKeyframe.d.ts +4 -4
- package/dist/types/index.d.ts +1 -1
- package/dist/types/types/enums/Items.d.ts +1 -0
- package/dist/types/types/vanilla/intellisense.d.ts +11946 -11562
- package/dist/types/types/vanilla/paths.d.ts +236 -140
- package/package.json +3 -2
- package/resources/asajs.config.cjs +1 -1
|
@@ -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
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
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").
|
|
19
|
-
to?: import("../types/properties/value.js").
|
|
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").
|
|
37
|
-
to?: import("../types/properties/value.js").
|
|
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>>;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -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
|
|
13
|
+
export * from "./compilers/bindings/Binary.js";
|