UNPKG

asajs

Version:

Make your Minecraft JsonUI with ScriptingAPI

90 lines (89 loc) 5.77 kB
import { Identifier } from "../types/components/Identifier"; import { UIChildNameCallback } from "../types/components/NameCallback"; import { ExtendInterface, StaticUIInterface, UIInterface } from "../types/components/UIInterface"; import { Renderer } from "../types/enums/Renderer"; import { Types } from "../types/enums/Types"; import { BindingInterface } from "../types/objects/BindingInterface"; import { ButtonMapping } from "../types/objects/ButtonMapping"; import { Button } from "../types/objects/elements/Button"; import { CollectionPanel } from "../types/objects/elements/CollectionPanel"; import { Dropdown } from "../types/objects/elements/Dropdown"; import { EditBox } from "../types/objects/elements/EditBox"; import { Grid } from "../types/objects/elements/Grid"; import { Image } from "../types/objects/elements/Image"; import { InputPanel } from "../types/objects/elements/InputPanel"; import { Label } from "../types/objects/elements/Label"; import { Panel } from "../types/objects/elements/panel"; import { PropertiesType } from "../types/objects/elements/PropertiesType"; import { Screen } from "../types/objects/elements/Screen"; import { ScrollbarBox } from "../types/objects/elements/ScrollbarBox"; import { ScrollbarTrack } from "../types/objects/elements/ScrollbarTrack"; import { ScrollView } from "../types/objects/elements/ScrollView"; import { Slider } from "../types/objects/elements/Slider"; import { SliderBox } from "../types/objects/elements/SliderBox"; import { StackPanel } from "../types/objects/elements/StackPanel"; import { Toggle } from "../types/objects/elements/Toggle"; import { TooltipTrigger } from "../types/objects/elements/TooltipTrigger"; import { Specials } from "../types/objects/properties/Specials"; import { VariablesInterface } from "../types/objects/Variables"; import { Binding } from "../types/values/Binding"; import { Animation } from "./Animation"; import { Modify } from "./Modify"; type ExtractUIType<T, K extends Types = Types.Any> = T extends UI<infer U> ? U : T extends Modify<infer U> ? U : T extends string ? K : T extends Identifier ? K : never; export declare class UI<T extends Types = Types.Any> { name?: string; namespace?: string; extends?: string; sourceBindings: Record<string, string>; private type?; private controls?; private bindings?; private button_mappings?; private variables?; private anims?; private properties?; constructor(identifier: UIInterface | UI | Modify); static panel(properties?: Panel, identifier?: StaticUIInterface): UI<Types.Panel>; static stackPanel(properties?: StackPanel, identifier?: StaticUIInterface): UI<Types.StackPanel>; static collectionPanel(properties?: CollectionPanel, identifier?: StaticUIInterface): UI<Types.CollectionPanel>; static inputPanel(properties?: InputPanel, identifier?: StaticUIInterface): UI<Types.InputPanel>; static grid(properties?: Grid, identifier?: StaticUIInterface): UI<Types.Grid>; static button(properties?: Button, identifier?: StaticUIInterface): UI<Types.Button>; static toggle(properties?: Toggle, identifier?: StaticUIInterface): UI<Types.Toggle>; static label(properties?: Label, identifier?: StaticUIInterface): UI<Types.Label>; static image(properties?: Image, identifier?: StaticUIInterface): UI<Types.Image>; static dropdown(properties?: Dropdown, identifier?: StaticUIInterface): UI<Types.Dropdown>; static slider(properties?: Slider, identifier?: StaticUIInterface): UI<Types.Slider>; static sliderBox(properties?: SliderBox, identifier?: StaticUIInterface): UI<Types.SliderBox>; static editBox(properties?: EditBox, identifier?: StaticUIInterface): UI<Types.EditBox>; static scrollView(properties?: ScrollView, identifier?: StaticUIInterface): UI<Types.ScrollView>; static scrollbarTrack(properties?: ScrollbarTrack, identifier?: StaticUIInterface): UI<Types.ScrollbarTrack>; static scrollbarBox(properties?: ScrollbarBox, identifier?: StaticUIInterface): UI<Types.ScrollbarBox>; static screen(properties?: Screen, identifier?: StaticUIInterface): UI<Types.Screen>; static custom<T extends Renderer>(renderer: T, properties?: Panel | Specials[T], identifier?: StaticUIInterface): UI<Types.Custom>; static tooltipTrigger(properties?: TooltipTrigger, identifier?: StaticUIInterface): UI<Types.TooltipTrigger>; static extend<K extends Types = Types.Any, T extends string | Identifier | UI | Modify = UI>(extendElement?: T, properties?: PropertiesType[ExtractUIType<typeof extendElement, K>], identifier?: StaticUIInterface): UI<ExtractUIType<T, K>>; searchBinding(bindingName: Binding, controlName?: string, targetBindingName?: Binding): Binding | undefined; setProperties(properties: PropertiesType[T]): this; private isDuplicate; private isRecusive; addChild<K extends Types = Types.Any, T extends string | Identifier | UI | Modify = any>(element?: T, properties?: PropertiesType[ExtractUIType<typeof element, K>] | null | 0, name?: string | null | 0, callback?: UIChildNameCallback): this; addBindings(bindings?: Array<BindingInterface> | BindingInterface): this; addMapping(mapping?: Array<ButtonMapping> | ButtonMapping): this; addVariables(variables?: VariablesInterface): this; addAnimation(animation?: Animation, startIndex?: number): this; getUI(): any; getPath(): string; getElement(): string; getFullPath(): string; extend(identifier?: ExtendInterface, properties?: PropertiesType[T]): UI<T>; private static apply; private static arguments; private static bind; private static call; private static caller; private static length; private static name; private static toString; } export {};