import { AnimType } from "../types/enums/AnimType.js"; import { ArrayName } from "../types/enums/ArrayName.js"; import { Renderer } from "../types/enums/Renderer.js"; import { Type } from "../types/enums/Type.js"; import { Properties } from "../types/properties/components.js"; import { BindingItem, ButtonMapping, Control, ModificationItem, VariableItem, Variables } from "../types/properties/value.js"; import { Animation } from "./Animation.js"; import { AnimationKeyframe } from "./AnimationKeyframe.js"; import { Class } from "./Class.js"; import util from "node:util"; import { FactoryManager } from "./Factory.js"; interface ExtendUI { name: string; namespace: string; toString(): string; } type ChildInput> = { child: C; properties?: C extends UI ? Partial> : never; name?: string; callback?: (name: string, parent: UI) => void; }; export declare class UI extends Class { type?: T | undefined; readonly path: string; readonly name: string; readonly namespace: string; readonly extend?: UI | ExtendUI; readonly extendable: boolean; protected readonly controls: Map, Properties]>; protected readonly bindings: BindingItem[]; protected readonly variables: VariableItem[]; protected readonly buttonMappings: ButtonMapping[]; protected readonly anims: (Animation | AnimationKeyframe)[]; protected readonly extendType?: Type; protected factory?: FactoryManager; protected properties: Properties; protected bindCache: Map; constructor(type?: T | undefined, name?: string, namespace?: string, path?: string, allowObfuscate?: boolean); /** * Set properties for this element * @param properties * @returns */ setProperties(properties: Properties): this; setFactory(factory: FactoryManager): this; /** * Bind data (coming from the code) to this UI element to use. * @param bindings * @returns */ addBindings(...bindings: BindingItem[]): this; /** * Changes variables values if conditions are met. * @param variables * @returns */ addVariables(variables: Variables): this; /** * Add button mappings for this element * @param mappings * @returns */ addButtonMappings(...mappings: ButtonMapping[]): this; /** * Children of the UI element. * @param child * @param properties * @param name * @returns */ addChild(child: UI, properties?: Properties, name?: string, callback?: (name: string, parent: UI) => void): this; addChilds[]>(...childs: { [K in keyof UIs]: ChildInput; }): this; addAnimations(...anims: (Animation | AnimationKeyframe)[]): this; /** * Return a extend of this element * @param properties * @param name * @param namespace * @returns */ createExtends(properties?: Properties, name?: string, namespace?: string): UI; toString(): Control; protected toJsonUI(): any; protected toJSON(): any; protected [util.inspect.custom]($: any, opts: any): string; } export declare class ModifyUI extends UI { private isClearBinding; private isClearVariables; private isClearControls; private isClearAnims; private isClearButtonMappings; protected modifications: ModificationItem[]; constructor(namespace: string, name: string, path: string); clearArray(arrayName: ArrayName): this; /** * Remove all variables of this modfy element * @returns */ clearVariables(): this; /** * Allows to modify the UI elements from resource packs below this one * @returns */ addModifications(...modifications: ModificationItem[]): this; insertBackChild(child: UI, properties?: Properties, name?: string): this; insertFrontChild(child: UI, properties?: Properties, name?: string): this; insertAfterChild(where: S, child: UI, properties?: Properties, name?: string): this; insertBeforeChild(where: S, child: UI, properties?: Properties, name?: string): this; insertChild(child: UI, properties?: Properties, name?: string): this; replaceChild(where: S, child: UI, properties?: Properties): this; /** * Remove a child of this element * @param name * @returns */ removeChild(name: S): this; insertBackBindings(...bindings: BindingItem[]): this; insertFrontBindings(...bindings: BindingItem[]): this; insertBindings(...bindings: BindingItem[]): this; /** * Remove a binding of this element * @param binding */ removeBinding(binding: BindingItem): this; insertBackButtonMappings(...buttonMappings: ButtonMapping[]): this; insertFrontButtonMappings(...buttonMappings: ButtonMapping[]): this; insertButtonMappings(...buttonMappings: ButtonMapping[]): this; /** * Remove a button mapping of this element * @param buttonMapping * @returns */ removeButtonMapping(buttonMapping: ButtonMapping): this; protected toJsonUIModify(): any; protected toJSON(): any; protected [util.inspect.custom]($: any, opts: any): string; } export {};