asajs 4.0.0-indev-1 → 4.0.0-indev-3

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.
Files changed (43) hide show
  1. package/config.d.ts +26 -0
  2. package/dist/js/compilers/Configuration.js +20 -1
  3. package/dist/js/compilers/Memory.js +1 -3
  4. package/dist/js/compilers/bindings/Checker.js +9 -0
  5. package/dist/js/compilers/bindings/Function.js +71 -0
  6. package/dist/js/compilers/bindings/Funtion.js +30 -6
  7. package/dist/js/compilers/bindings/Lexer.js +49 -6
  8. package/dist/js/compilers/bindings/Parser.js +152 -12
  9. package/dist/js/compilers/ui/buildcache.js +53 -0
  10. package/dist/js/compilers/ui/builddata.js +4 -0
  11. package/dist/js/compilers/ui/builder.js +30 -9
  12. package/dist/js/compilers/ui/installer.js +15 -1
  13. package/dist/js/compilers/ui/linker.js +43 -1
  14. package/dist/js/compilers/ui/manifest.js +25 -1
  15. package/dist/js/compilers/ui/prevdata.js +8 -0
  16. package/dist/js/components/AnimationKeyframe.js +1 -1
  17. package/dist/js/components/UI.js +25 -13
  18. package/dist/js/components/Utils.js +100 -23
  19. package/dist/js/config..js +1 -0
  20. package/dist/js/config.js +1 -0
  21. package/dist/js/index.js +4 -0
  22. package/dist/js/types/config.js +1 -0
  23. package/dist/types/compilers/Configuration.d.ts +5 -1
  24. package/dist/types/compilers/bindings/Checker.d.ts +3 -0
  25. package/dist/types/compilers/bindings/Function.d.ts +7 -0
  26. package/dist/types/compilers/bindings/Funtion.d.ts +1 -1
  27. package/dist/types/compilers/bindings/Parser.d.ts +12 -3
  28. package/dist/types/compilers/ui/buildcache.d.ts +8 -0
  29. package/dist/types/compilers/ui/builddata.d.ts +1 -0
  30. package/dist/types/compilers/ui/installer.d.ts +1 -1
  31. package/dist/types/compilers/ui/linker.d.ts +4 -0
  32. package/dist/types/compilers/ui/manifest.d.ts +1 -1
  33. package/dist/types/compilers/ui/prevdata.d.ts +3 -0
  34. package/dist/types/components/AnimationKeyframe.d.ts +4 -4
  35. package/dist/types/components/UI.d.ts +9 -2
  36. package/dist/types/components/Utils.d.ts +17 -16
  37. package/dist/types/config..d.ts +2 -0
  38. package/dist/types/config.d.ts +13 -0
  39. package/dist/types/index.d.ts +4 -0
  40. package/dist/types/types/config.d.ts +13 -0
  41. package/dist/types/types/enums/index.d.ts +0 -1
  42. package/package.json +1 -1
  43. package/resources/asajs.config.cjs +14 -0
@@ -11,7 +11,7 @@ import { Animation } from "./Animation.js";
11
11
  import { SmartAnimation } from "../types/enums/SmartAnimation.js";
12
12
  type CompileBinding = `[${string}]`;
13
13
  export declare function Color(hex: string | number): Array3<number>;
14
- export declare function ResolveBinding(...bindings: BindingItem[]): BindingItem[];
14
+ export declare function ResolveBinding(cache: Map<string, unknown>, ...bindings: BindingItem[]): BindingItem[];
15
15
  export declare function RandomString(length: number, base?: number): string;
16
16
  export declare function RandomBindingString(length: number, base?: number): Binding;
17
17
  export declare function GetItemByAuxID(auxID: number): string | undefined;
@@ -49,22 +49,23 @@ export declare function ScrollView(properties?: ScrollView, namespace?: string,
49
49
  export declare function Slider(properties?: Slider, namespace?: string, name?: string): UI<Type.SLIDER, null>;
50
50
  export declare function SliderBox(properties?: SliderBox, namespace?: string, name?: string): UI<Type.SLIDER_BOX, null>;
51
51
  export declare function ExtendsOf<T extends Type, K extends Renderer | null>(element: UI<T, K>, properties?: Properties<T, K>, namespace?: string, name?: string): typeof element;
52
- export declare function KeyframeOffset(properties?: KeyframeAnimationProperties<AnimType.OFFSET>, namespace?: string, name?: string): AnimationKeyframe<AnimType.OFFSET>;
53
- export declare function KeyframeSize(properties?: KeyframeAnimationProperties<AnimType.SIZE>, namespace?: string, name?: string): AnimationKeyframe<AnimType.SIZE>;
54
- export declare function KeyframeUV(properties?: KeyframeAnimationProperties<AnimType.UV>, namespace?: string, name?: string): AnimationKeyframe<AnimType.UV>;
55
- export declare function KeyframeClip(properties?: KeyframeAnimationProperties<AnimType.CLIP>, namespace?: string, name?: string): AnimationKeyframe<AnimType.CLIP>;
56
- export declare function KeyframeColor(properties?: KeyframeAnimationProperties<AnimType.COLOR>, namespace?: string, name?: string): AnimationKeyframe<AnimType.COLOR>;
57
- export declare function KeyframeAlpha(properties?: KeyframeAnimationProperties<AnimType.ALPHA>, namespace?: string, name?: string): AnimationKeyframe<AnimType.ALPHA>;
58
- export declare function KeyframeWait(properties?: KeyframeAnimationProperties<AnimType.WAIT>, namespace?: string, name?: string): AnimationKeyframe<AnimType.WAIT>;
59
- export declare function KeyframeFlipBook(properties?: KeyframeAnimationProperties<AnimType.FLIP_BOOK>, namespace?: string, name?: string): AnimationKeyframe<AnimType.FLIP_BOOK>;
60
- export declare function KeyframeAsepriteFlipBook(properties?: KeyframeAnimationProperties<AnimType.ASEPRITE_FLIP_BOOK>, namespace?: string, name?: string): AnimationKeyframe<AnimType.ASEPRITE_FLIP_BOOK>;
52
+ export declare function VanillaExtendsOf<T extends Namespace, K extends Exclude<Element<T>, `${string}/${string}`>>(originNamespace: T, originName: K, properties?: Properties<VanillaType<T, K>, null>, namespace?: string, name?: string): UI<VanillaType<T, K>, null>;
53
+ export declare function OffsetKeyframe(properties?: KeyframeAnimationProperties<AnimType.OFFSET>, namespace?: string, name?: string): AnimationKeyframe<AnimType.OFFSET>;
54
+ export declare function SizeKeyframe(properties?: KeyframeAnimationProperties<AnimType.SIZE>, namespace?: string, name?: string): AnimationKeyframe<AnimType.SIZE>;
55
+ export declare function UVKeyframe(properties?: KeyframeAnimationProperties<AnimType.UV>, namespace?: string, name?: string): AnimationKeyframe<AnimType.UV>;
56
+ export declare function ClipKeyframe(properties?: KeyframeAnimationProperties<AnimType.CLIP>, namespace?: string, name?: string): AnimationKeyframe<AnimType.CLIP>;
57
+ export declare function ColorKeyframe(properties?: KeyframeAnimationProperties<AnimType.COLOR>, namespace?: string, name?: string): AnimationKeyframe<AnimType.COLOR>;
58
+ export declare function AlphaKeyframe(properties?: KeyframeAnimationProperties<AnimType.ALPHA>, namespace?: string, name?: string): AnimationKeyframe<AnimType.ALPHA>;
59
+ export declare function WaitKeyframe(properties?: KeyframeAnimationProperties<AnimType.WAIT>, namespace?: string, name?: string): AnimationKeyframe<AnimType.WAIT>;
60
+ export declare function FlipBookKeyframe(properties?: KeyframeAnimationProperties<AnimType.FLIP_BOOK>, namespace?: string, name?: string): AnimationKeyframe<AnimType.FLIP_BOOK>;
61
+ export declare function AsepriteFlipBookKeyframe(properties?: KeyframeAnimationProperties<AnimType.ASEPRITE_FLIP_BOOK>, namespace?: string, name?: string): AnimationKeyframe<AnimType.ASEPRITE_FLIP_BOOK>;
61
62
  type Anim<T extends AnimType> = AnimationProperties<T> | number;
62
63
  type AnimWithSmartAnim<T extends AnimType> = [SmartAnimation | Anim<T>, ...Anim<T>[]];
63
- export declare function AnimationOffset(...keyframes: AnimWithSmartAnim<AnimType.OFFSET>): Animation<AnimType.OFFSET>;
64
- export declare function AnimationSize(...keyframes: AnimWithSmartAnim<AnimType.SIZE>): Animation<AnimType.SIZE>;
65
- export declare function AnimationUV(...keyframes: AnimWithSmartAnim<AnimType.UV>): Animation<AnimType.UV>;
66
- export declare function AnimationClip(...keyframes: AnimWithSmartAnim<AnimType.CLIP>): Animation<AnimType.CLIP>;
67
- export declare function AnimationColor(...keyframes: AnimWithSmartAnim<AnimType.COLOR>): Animation<AnimType.COLOR>;
68
- export declare function AnimationAlpha(...keyframes: AnimWithSmartAnim<AnimType.ALPHA>): Animation<AnimType.ALPHA>;
64
+ export declare function OffsetAnimation(...keyframes: AnimWithSmartAnim<AnimType.OFFSET>): Animation<AnimType.OFFSET>;
65
+ export declare function SizeAnimation(...keyframes: AnimWithSmartAnim<AnimType.SIZE>): Animation<AnimType.SIZE>;
66
+ export declare function UVAnimation(...keyframes: AnimWithSmartAnim<AnimType.UV>): Animation<AnimType.UV>;
67
+ export declare function ClipAnimation(...keyframes: AnimWithSmartAnim<AnimType.CLIP>): Animation<AnimType.CLIP>;
68
+ export declare function ColorAnimation(...keyframes: AnimWithSmartAnim<AnimType.COLOR>): Animation<AnimType.COLOR>;
69
+ export declare function AlphaAnimation(...keyframes: AnimWithSmartAnim<AnimType.ALPHA>): Animation<AnimType.ALPHA>;
69
70
  export declare function AnimationExtendsOf<T extends AnimType>(animation: AnimationKeyframe<T> | Animation<T>, properties?: AnimationProperties<T>): AnimationKeyframe<T>;
70
71
  export {};
@@ -0,0 +1,2 @@
1
+ export interface Config {
2
+ }
@@ -0,0 +1,13 @@
1
+ import { Variable } from "./src/types/properties/value.js";
2
+ export interface Config {
3
+ compiler?: {
4
+ enabled?: boolean;
5
+ linked?: boolean;
6
+ };
7
+ packinfo?: {
8
+ name?: string;
9
+ description?: string;
10
+ version?: [number, number, number];
11
+ };
12
+ global_variables?: Record<Variable, string>;
13
+ }
@@ -1,5 +1,7 @@
1
+ import "./compilers/Configuration.js";
1
2
  import "./compilers/PreCompile.js";
2
3
  import "./compilers/ui/builder.js";
4
+ import "./compilers/ui/installer.js";
3
5
  export { Animation } from "./components/Animation.js";
4
6
  export { AnimationKeyframe } from "./components/AnimationKeyframe.js";
5
7
  export { ModifyUI, UI } from "./components/UI.js";
@@ -7,3 +9,5 @@ export * from "./components/Utils.js";
7
9
  export * from "./types/enums/index.js";
8
10
  export * as Properties from "./types/properties/index.js";
9
11
  export { ItemAuxID } from "./types/enums/Items.js";
12
+ export { ArrayName, Operation } from "./types/properties/index.js";
13
+ export { Lexer } from "./compilers/bindings/Lexer.js";
@@ -0,0 +1,13 @@
1
+ import { Variable } from "./properties/value.js";
2
+ export interface Config {
3
+ compiler?: {
4
+ enabled?: boolean;
5
+ linked?: boolean;
6
+ };
7
+ packinfo?: {
8
+ name?: string;
9
+ description?: string;
10
+ version?: [number, number, number];
11
+ };
12
+ global_variables?: Record<Variable, string>;
13
+ }
@@ -28,4 +28,3 @@ export { SliderName } from "./SliderName.js";
28
28
  export { ToggleName } from "./ToggleName.js";
29
29
  export { BagBinding } from "./BagBinding.js";
30
30
  export { Binding } from "./Binding.js";
31
- export { SmartAnimation } from "./SmartAnimation.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "asajs",
3
- "version": "4.0.0-indev-1",
3
+ "version": "4.0.0-indev-3",
4
4
  "description": "Create your Minecraft JSON-UI resource packs using JavaScript",
5
5
  "keywords": [
6
6
  "Minecraft",
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Configuration object for the AsaJS build process.
3
+ * @type {import('asajs/config.d.ts').Config}
4
+ */
5
+ export const config = {
6
+ packinfo: {
7
+ name: "AsaJS",
8
+ description: "Create your Minecraft JSON-UI resource packs using JavaScript.",
9
+ },
10
+ compiler: {
11
+ enabled: true,
12
+ linked: false,
13
+ },
14
+ }