diff --git a/BasaltLS.lua b/BasaltLS.lua index ca8e169..26464f1 100644 --- a/BasaltLS.lua +++ b/BasaltLS.lua @@ -1,88 +1,1986 @@ ---@meta ----@class Animation -local Animation = {} +---@class ErrorHandler +local ErrorHandler = {} ----Adds a new animation to the sequence ----@param type string The type of animation ----@param args table The animation arguments ----@param duration number The duration in seconds ----@param easing string The easing function name -function Animation:addAnimation(type, args, duration, easing) end +---Handles an error +---@param errMsg string The error message +function errorHandler.error(errMsg) end ----Registers a callback for the complete event +---@class TextBox : VisualElement +---@field scrollY number Vertical scroll offset +---@field autoCompleteEnabled boolean Whether autocomplete suggestions are enabled +---@field autoCompleteSelectedForeground color Foreground color for the selected suggestion +---@field editable boolean Whether text can be edited +---@field autoCompleteAcceptOnClick boolean Whether clicking a suggestion accepts it immediately +---@field autoCompleteShowBorder boolean Whether to render a character border around the popup +---@field autoCompleteSelectedBackground color Background color for the selected suggestion +---@field cursorX number Cursor X position +---@field autoCompleteMaxWidth number Maximum width of the autocomplete popup (0 uses the textbox width) +---@field autoCompleteMinChars number Minimum characters required before showing suggestions +---@field autoCompleteBorderColor color Color of the popup border when enabled +---@field autoCompleteAcceptOnEnter boolean Whether pressing Enter accepts the current suggestion +---@field autoCompleteForeground color Foreground color of the suggestion popup +---@field autoPairSkipClosing boolean Skip inserting a closing char if the same one is already at cursor +---@field autoCompleteCloseOnEscape boolean Whether pressing Escape closes the popup +---@field cursorColor number Color of the cursor +---@field autoCompleteMaxItems number Maximum number of visible suggestions +---@field syntaxPatterns table Syntax highlighting patterns +---@field autoCompleteProvider function Optional suggestion provider returning a list for the current prefix +---@field autoPairNewlineIndent boolean On Enter between matching braces, create blank line and keep closing aligned +---@field autoPairEnabled boolean Whether automatic bracket/quote pairing is enabled +---@field autoPairOverType boolean When pressing a closing char that matches the next char, move over it instead of inserting +---@field scrollX number Horizontal scroll offset +---@field cursorY number Cursor Y position (line number) +---@field lines table Array of text lines +---@field autoCompleteBackground color Background color of the suggestion popup +---@field autoCompleteZOffset number Z-index offset applied to the popup frame +---@field autoPairCharacters table ["("]=")", ["["]="]", ["{"]="}", ['"']='"', ['\'']='\'', ['`']='`'} Mapping of opening to closing characters for auto pairing +---@field autoCompleteOffsetY number Vertical offset applied to the popup frame relative to the TextBox bottom edge +---@field autoCompleteTokenPattern string Pattern used to extract the current token for suggestions +---@field autoCompleteOffsetX number Horizontal offset applied to the popup frame relative to the TextBox +---@field autoCompleteItems table List of suggestions used when no provider is supplied +---@field autoCompleteCaseInsensitive boolean Whether suggestions should match case-insensitively +local TextBox = {} + +---Sets the value of the AutoCompleteProvider property. +---@param self TextBox self +---@param AutoCompleteProvider function Optional suggestion provider returning a list for the current prefix +function TextBox:setAutoCompleteProvider(self, AutoCompleteProvider) end + +---Sets the value of the AutoCompleteMaxItems property. +---@param self TextBox self +---@param AutoCompleteMaxItems number Maximum number of visible suggestions +function TextBox:setAutoCompleteMaxItems(self, AutoCompleteMaxItems) end + +---Gets the value of the AutoCompleteEnabled property. +---@param self TextBox self +---@return boolean false Whether autocomplete suggestions are enabled +function TextBox:getAutoCompleteEnabled(self) end + +---Gets the value of the AutoCompleteBorderColor property. +---@param self TextBox self +---@return color black Color of the popup border when enabled +function TextBox:getAutoCompleteBorderColor(self) end + +---Gets the value of the ScrollY property. +---@param self TextBox self +---@return number 0 Vertical scroll offset +function TextBox:getScrollY(self) end + +---Gets the value of the AutoCompleteMinChars property. +---@param self TextBox self +---@return number 1 Minimum characters required before showing suggestions +function TextBox:getAutoCompleteMinChars(self) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param direction number The scroll direction +---@param x number The x position of the scroll +---@param y number The y position of the scroll +---@return boolean handled Whether the event was handled +---@protected +function TextBox:mouse_scroll(direction, x, y) end + +---Sets the value of the CursorY property. +---@param self TextBox self +---@param CursorY number Cursor Y position (line number) +function TextBox:setCursorY(self, CursorY) end + +---Gets the value of the AutoCompleteZOffset property. +---@param self TextBox self +---@return number 1 Z-index offset applied to the popup frame +function TextBox:getAutoCompleteZOffset(self) end + +---Gets the value of the CursorY property. +---@param self TextBox self +---@return number 1 Cursor Y position (line number) +function TextBox:getCursorY(self) end + +---Sets the value of the AutoCompleteShowBorder property. +---@param self TextBox self +---@param AutoCompleteShowBorder boolean Whether to render a character border around the popup +function TextBox:setAutoCompleteShowBorder(self, AutoCompleteShowBorder) end + +---Gets the value of the Lines property. +---@param self TextBox self +---@return table {} Array of text lines +function TextBox:getLines(self) end + +---Sets the value of the AutoCompleteAcceptOnClick property. +---@param self TextBox self +---@param AutoCompleteAcceptOnClick boolean Whether clicking a suggestion accepts it immediately +function TextBox:setAutoCompleteAcceptOnClick(self, AutoCompleteAcceptOnClick) end + +---Sets the value of the ScrollX property. +---@param self TextBox self +---@param ScrollX number Horizontal scroll offset +function TextBox:setScrollX(self, ScrollX) end + +---Sets the value of the AutoCompleteItems property. +---@param self TextBox self +---@param AutoCompleteItems table List of suggestions used when no provider is supplied +function TextBox:setAutoCompleteItems(self, AutoCompleteItems) end + +---Gets the value of the AutoPairCharacters property. +---@param self TextBox self +---@return table { ["("]=")", ["["]="]", ["{"]="}", ['"']='"', ['\'']='\'', ['`']='`'} Mapping of opening to closing characters for auto pairing +function TextBox:getAutoPairCharacters(self) end + +---Sets the value of the AutoCompleteOffsetX property. +---@param self TextBox self +---@param AutoCompleteOffsetX number Horizontal offset applied to the popup frame relative to the TextBox +function TextBox:setAutoCompleteOffsetX(self, AutoCompleteOffsetX) end + +---Gets the value of the AutoCompleteSelectedForeground property. +---@param self TextBox self +---@return color white Foreground color for the selected suggestion +function TextBox:getAutoCompleteSelectedForeground(self) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@protected +function TextBox:render() end + +---Sets the value of the AutoPairCharacters property. +---@param self TextBox self +---@param AutoPairCharacters table ["("]=")", ["["]="]", ["{"]="}", ['"']='"', ['\'']='\'', ['`']='`'} Mapping of opening to closing characters for auto pairing +function TextBox:setAutoPairCharacters(self, AutoPairCharacters) end + +---Gets the value of the AutoPairSkipClosing property. +---@param self TextBox self +---@return boolean true Skip inserting a closing char if the same one is already at cursor +function TextBox:getAutoPairSkipClosing(self) end + +---Sets the value of the AutoCompleteTokenPattern property. +---@param self TextBox self +---@param AutoCompleteTokenPattern string Pattern used to extract the current token for suggestions +function TextBox:setAutoCompleteTokenPattern(self, AutoCompleteTokenPattern) end + +---Gets the value of the AutoCompleteAcceptOnEnter property. +---@param self TextBox self +---@return boolean true Whether pressing Enter accepts the current suggestion +function TextBox:getAutoCompleteAcceptOnEnter(self) end + +---Gets the value of the AutoCompleteCaseInsensitive property. +---@param self TextBox self +---@return boolean true Whether suggestions should match case-insensitively +function TextBox:getAutoCompleteCaseInsensitive(self) end + +---Gets the value of the AutoPairNewlineIndent property. +---@param self TextBox self +---@return boolean true On Enter between matching braces, create blank line and keep closing aligned +function TextBox:getAutoPairNewlineIndent(self) end + +---Sets the value of the Lines property. +---@param self TextBox self +---@param Lines table Array of text lines +function TextBox:setLines(self, Lines) end + +---Sets the value of the AutoPairEnabled property. +---@param self TextBox self +---@param AutoPairEnabled boolean Whether automatic bracket/quote pairing is enabled +function TextBox:setAutoPairEnabled(self, AutoPairEnabled) end + +---Sets the value of the AutoCompleteCloseOnEscape property. +---@param self TextBox self +---@param AutoCompleteCloseOnEscape boolean Whether pressing Escape closes the popup +function TextBox:setAutoCompleteCloseOnEscape(self, AutoCompleteCloseOnEscape) end + +---Sets the value of the AutoCompleteSelectedBackground property. +---@param self TextBox self +---@param AutoCompleteSelectedBackground color Background color for the selected suggestion +function TextBox:setAutoCompleteSelectedBackground(self, AutoCompleteSelectedBackground) end + +---Sets the value of the AutoPairOverType property. +---@param self TextBox self +---@param AutoPairOverType boolean When pressing a closing char that matches the next char, move over it instead of inserting +function TextBox:setAutoPairOverType(self, AutoPairOverType) end + +---Gets the value of the AutoCompleteShowBorder property. +---@param self TextBox self +---@return boolean true Whether to render a character border around the popup +function TextBox:getAutoCompleteShowBorder(self) end + +---Gets the value of the ScrollX property. +---@param self TextBox self +---@return number 0 Horizontal scroll offset +function TextBox:getScrollX(self) end + +---Sets the value of the AutoCompleteBackground property. +---@param self TextBox self +---@param AutoCompleteBackground color Background color of the suggestion popup +function TextBox:setAutoCompleteBackground(self, AutoCompleteBackground) end + +---Gets the value of the AutoCompleteOffsetY property. +---@param self TextBox self +---@return number 1 Vertical offset applied to the popup frame relative to the TextBox bottom edge +function TextBox:getAutoCompleteOffsetY(self) end + +---Sets the value of the AutoCompleteBorderColor property. +---@param self TextBox self +---@param AutoCompleteBorderColor color Color of the popup border when enabled +function TextBox:setAutoCompleteBorderColor(self, AutoCompleteBorderColor) end + +---Gets the value of the AutoCompleteProvider property. +---@param self TextBox self +---@return function nil Optional suggestion provider returning a list for the current prefix +function TextBox:getAutoCompleteProvider(self) end + +---Gets the value of the AutoCompleteAcceptOnClick property. +---@param self TextBox self +---@return boolean true Whether clicking a suggestion accepts it immediately +function TextBox:getAutoCompleteAcceptOnClick(self) end + +---Sets the value of the ScrollY property. +---@param self TextBox self +---@param ScrollY number Vertical scroll offset +function TextBox:setScrollY(self, ScrollY) end + +---Sets the text of the TextBox +---@param text string The text to set +---@return TextBox self The TextBox instance +function TextBox:setText(text) end + +---Sets the value of the AutoCompleteSelectedForeground property. +---@param self TextBox self +---@param AutoCompleteSelectedForeground color Foreground color for the selected suggestion +function TextBox:setAutoCompleteSelectedForeground(self, AutoCompleteSelectedForeground) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param char string The character that was typed +---@return boolean handled Whether the event was handled +---@protected +function TextBox:char(char) end + +---Gets the value of the CursorColor property. +---@param self TextBox self +---@return number nil Color of the cursor +function TextBox:getCursorColor(self) end + +---Gets the text of the TextBox +---@return string text The text of the TextBox +function TextBox:getText() end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param props table The properties to initialize the element with +---@param basalt table The basalt instance +---@return TextBox self The initialized instance +---@protected +function TextBox:init(props, basalt) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param button number The button that was clicked +---@param x number The x position of the click +---@param y number The y position of the click +---@return boolean handled Whether the event was handled +---@protected +function TextBox:mouse_click(button, x, y) end + +---Gets the value of the AutoPairEnabled property. +---@param self TextBox self +---@return boolean true Whether automatic bracket/quote pairing is enabled +function TextBox:getAutoPairEnabled(self) end + +---Sets the value of the AutoCompleteOffsetY property. +---@param self TextBox self +---@param AutoCompleteOffsetY number Vertical offset applied to the popup frame relative to the TextBox bottom edge +function TextBox:setAutoCompleteOffsetY(self, AutoCompleteOffsetY) end + +---Sets the value of the AutoPairNewlineIndent property. +---@param self TextBox self +---@param AutoPairNewlineIndent boolean On Enter between matching braces, create blank line and keep closing aligned +function TextBox:setAutoPairNewlineIndent(self, AutoPairNewlineIndent) end + +function TextBox:destroy() end + +---Sets the value of the Editable property. +---@param self TextBox self +---@param Editable boolean Whether text can be edited +function TextBox:setEditable(self, Editable) end + +---Sets the value of the AutoCompleteMaxWidth property. +---@param self TextBox self +---@param AutoCompleteMaxWidth number Maximum width of the autocomplete popup (0 uses the textbox width) +function TextBox:setAutoCompleteMaxWidth(self, AutoCompleteMaxWidth) end + +---Clears all syntax highlighting patterns +---@return TextBox self +function TextBox:clearSyntaxPatterns() end + +---Gets the value of the AutoCompleteTokenPattern property. +---@param self TextBox self +---@return string "[%w_]+" Pattern used to extract the current token for suggestions +function TextBox:getAutoCompleteTokenPattern(self) end + +---Sets the value of the AutoPairSkipClosing property. +---@param self TextBox self +---@param AutoPairSkipClosing boolean Skip inserting a closing char if the same one is already at cursor +function TextBox:setAutoPairSkipClosing(self, AutoPairSkipClosing) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@protected +function TextBox:paste() end + +---Gets the value of the AutoPairOverType property. +---@param self TextBox self +---@return boolean true When pressing a closing char that matches the next char, move over it instead of inserting +function TextBox:getAutoPairOverType(self) end + +---Sets the value of the CursorX property. +---@param self TextBox self +---@param CursorX number Cursor X position +function TextBox:setCursorX(self, CursorX) end + +---Updates the viewport to keep the cursor in view +---@return TextBox self The TextBox instance +function TextBox:updateViewport() end + +---Gets the value of the AutoCompleteMaxWidth property. +---@param self TextBox self +---@return number 0 Maximum width of the autocomplete popup (0 uses the textbox width) +function TextBox:getAutoCompleteMaxWidth(self) end + +---Gets the value of the AutoCompleteCloseOnEscape property. +---@param self TextBox self +---@return boolean true Whether pressing Escape closes the popup +function TextBox:getAutoCompleteCloseOnEscape(self) end + +---Gets the value of the AutoCompleteOffsetX property. +---@param self TextBox self +---@return number 0 Horizontal offset applied to the popup frame relative to the TextBox +function TextBox:getAutoCompleteOffsetX(self) end + +---Gets the value of the SyntaxPatterns property. +---@param self TextBox self +---@return table {} Syntax highlighting patterns +function TextBox:getSyntaxPatterns(self) end + +---Sets the value of the AutoCompleteAcceptOnEnter property. +---@param self TextBox self +---@param AutoCompleteAcceptOnEnter boolean Whether pressing Enter accepts the current suggestion +function TextBox:setAutoCompleteAcceptOnEnter(self, AutoCompleteAcceptOnEnter) end + +---Gets the value of the AutoCompleteItems property. +---@param self TextBox self +---@return table {} List of suggestions used when no provider is supplied +function TextBox:getAutoCompleteItems(self) end + +---Gets the value of the AutoCompleteForeground property. +---@param self TextBox self +---@return color black Foreground color of the suggestion popup +function TextBox:getAutoCompleteForeground(self) end + +---Gets the value of the AutoCompleteMaxItems property. +---@param self TextBox self +---@return number 6 Maximum number of visible suggestions +function TextBox:getAutoCompleteMaxItems(self) end + +---Sets the value of the AutoCompleteMinChars property. +---@param self TextBox self +---@param AutoCompleteMinChars number Minimum characters required before showing suggestions +function TextBox:setAutoCompleteMinChars(self, AutoCompleteMinChars) end + +---Adds a new syntax highlighting pattern +---@param pattern string The regex pattern to match +---@param color number The color to apply +---@return TextBox self The TextBox instance +function TextBox:addSyntaxPattern(pattern, color) end + +---Sets the value of the SyntaxPatterns property. +---@param self TextBox self +---@param SyntaxPatterns table Syntax highlighting patterns +function TextBox:setSyntaxPatterns(self, SyntaxPatterns) end + +---Removes a syntax pattern by index (1-based) +---@param index number The index of the pattern to remove +---@return TextBox self +function TextBox:removeSyntaxPattern(index) end + +---Sets the value of the AutoCompleteCaseInsensitive property. +---@param self TextBox self +---@param AutoCompleteCaseInsensitive boolean Whether suggestions should match case-insensitively +function TextBox:setAutoCompleteCaseInsensitive(self, AutoCompleteCaseInsensitive) end + +---Sets the value of the CursorColor property. +---@param self TextBox self +---@param CursorColor number Color of the cursor +function TextBox:setCursorColor(self, CursorColor) end + +---Gets the value of the CursorX property. +---@param self TextBox self +---@return number 1 Cursor X position +function TextBox:getCursorX(self) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param key number The key that was pressed +---@return boolean handled Whether the event was handled +---@protected +function TextBox:key(key) end + +---Sets the value of the AutoCompleteZOffset property. +---@param self TextBox self +---@param AutoCompleteZOffset number Z-index offset applied to the popup frame +function TextBox:setAutoCompleteZOffset(self, AutoCompleteZOffset) end + +---Gets the value of the AutoCompleteBackground property. +---@param self TextBox self +---@return color lightGray Background color of the suggestion popup +function TextBox:getAutoCompleteBackground(self) end + +---Sets the value of the AutoCompleteEnabled property. +---@param self TextBox self +---@param AutoCompleteEnabled boolean Whether autocomplete suggestions are enabled +function TextBox:setAutoCompleteEnabled(self, AutoCompleteEnabled) end + +---Sets the value of the AutoCompleteForeground property. +---@param self TextBox self +---@param AutoCompleteForeground color Foreground color of the suggestion popup +function TextBox:setAutoCompleteForeground(self, AutoCompleteForeground) end + +---Gets the value of the AutoCompleteSelectedBackground property. +---@param self TextBox self +---@return color gray Background color for the selected suggestion +function TextBox:getAutoCompleteSelectedBackground(self) end + +---Gets the value of the Editable property. +---@param self TextBox self +---@return boolean true Whether text can be edited +function TextBox:getEditable(self) end + +---@class Menu : List +---@field separatorColor color The color used for separator items in the menu +local Menu = {} + +---Sets the value of the SeparatorColor property. +---@param self Menu self +---@param SeparatorColor color The color used for separator items in the menu +function Menu:setSeparatorColor(self, SeparatorColor) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param button number The button that was clicked +---@param x number The x position of the click +---@param y number The y position of the click +---@return boolean Whether the event was handled +---@protected +function Menu:mouse_click(button, x, y) end + +---Gets the value of the SeparatorColor property. +---@param self Menu self +---@return color gray The color used for separator items in the menu +function Menu:getSeparatorColor(self) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param props table The properties to initialize the element with +---@param basalt table The basalt instance +---@return Menu self The initialized instance +---@protected +function Menu:init(props, basalt) end + +---Sets the menu items +---@param items table [] List of items with {text, separator, callback, foreground, background} properties +---@return Menu self The Menu instance +function Menu:setItems(items) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@protected +function Menu:render() end + +---@class Slider : VisualElement +---@field barColor color Color of the slider track +---@field horizontal boolean Whether the slider is horizontal (false for vertical) +---@field max number Maximum value for value conversion (maps slider position to this range) +---@field sliderColor color Color of the slider handle +---@field step number Current position of the slider handle (1 to width/height) +local Slider = {} + +---Gets the value of the SliderColor property. +---@param self Slider self +---@return color blue Color of the slider handle +function Slider:getSliderColor(self) end + +---Gets the value of the BarColor property. +---@param self Slider self +---@return color gray Color of the slider track +function Slider:getBarColor(self) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@protected +function Slider:render() end + +---Sets the value of the BarColor property. +---@param self Slider self +---@param BarColor color Color of the slider track +function Slider:setBarColor(self, BarColor) end + +---Gets the value of the Horizontal property. +---@param self Slider self +---@return boolean true Whether the slider is horizontal (false for vertical) +function Slider:getHorizontal(self) end + +---Sets the value of the Max property. +---@param self Slider self +---@param Max number Maximum value for value conversion (maps slider position to this range) +function Slider:setMax(self, Max) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param props table The properties to initialize the element with +---@param basalt table The basalt instance +---@return Slider self The initialized instance +---@protected +function Slider:init(props, basalt) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param button number The mouse button that was released +---@param x number The x position of the release +---@param y number The y position of the release +---@return boolean handled Whether the event was handled +---@protected +function Slider:mouse_scroll(button, x, y) end + +---Sets the value of the Step property. +---@param self Slider self +---@param Step number Current position of the slider handle (1 to width/height) +function Slider:setStep(self, Step) end + +---Gets the value of the Step property. +---@param self Slider self +---@return number 1 Current position of the slider handle (1 to width/height) +function Slider:getStep(self) end + +---Sets the value of the SliderColor property. +---@param self Slider self +---@param SliderColor color Color of the slider handle +function Slider:setSliderColor(self, SliderColor) end + +---Gets the value of the Max property. +---@param self Slider self +---@return number 100 Maximum value for value conversion (maps slider position to this range) +function Slider:getMax(self) end + +---Registers a function to handle the onChange event. +---@param value number +---@param self Slider self +---@param func function The function to be called when the event fires +function Slider:onOnChange(self, func) end + +---Gets the current value of the slider +---@return number value The current value (0 to max) +function Slider:getValue() end + +---Sets the value of the Horizontal property. +---@param self Slider self +---@param Horizontal boolean Whether the slider is horizontal (false for vertical) +function Slider:setHorizontal(self, Horizontal) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param button number The mouse button that was clicked +---@param x number The x position of the click +---@param y number The y position of the click +---@return boolean handled Whether the event was handled +---@protected +function Slider:mouse_click(button, x, y) end + +---@class BigFontText +local BigFontText = {} + +---@class FlexBox : Container +---@field flexAlignItems string The alignment of flex items along the cross axis +---@field flexSpacing number The spacing between flex items +---@field flexWrap boolean Whether to wrap flex items onto multiple lines +---@field flexDirection string The direction of the flexbox layout "row" or "column" +---@field flexCrossPadding number The padding on both sides of the cross axis +---@field flexUpdateLayout boolean Whether to update the layout of the flexbox +---@field flexJustifyContent string The alignment of flex items along the main axis +local FlexBox = {} + +---Gets the value of the FlexUpdateLayout property. +---@param self FlexBox self +---@return boolean false Whether to update the layout of the flexbox +function FlexBox:getFlexUpdateLayout(self) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param props table The properties to initialize the element with +---@param basalt table The basalt instance +---@return FlexBox self The initialized instance +---@protected +function FlexBox:init(props, basalt) end + +---Sets the value of the FlexUpdateLayout property. +---@param self FlexBox self +---@param FlexUpdateLayout boolean Whether to update the layout of the flexbox +function FlexBox:setFlexUpdateLayout(self, FlexUpdateLayout) end + +---Gets the value of the FlexSpacing property. +---@param self FlexBox self +---@return number 1 The spacing between flex items +function FlexBox:getFlexSpacing(self) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@protected +function FlexBox:render() end + +---Gets the value of the FlexJustifyContent property. +---@param self FlexBox self +---@return string "flex-start" The alignment of flex items along the main axis +function FlexBox:getFlexJustifyContent(self) end + +---Sets the value of the FlexJustifyContent property. +---@param self FlexBox self +---@param FlexJustifyContent string The alignment of flex items along the main axis +function FlexBox:setFlexJustifyContent(self, FlexJustifyContent) end + +---Gets the value of the FlexDirection property. +---@param self FlexBox self +---@return string "row" The direction of the flexbox layout "row" or "column" +function FlexBox:getFlexDirection(self) end + +---Adds a new line break to the flexbox +---@param self FlexBox The element itself +---@return FlexBox +function FlexBox:addLineBreak(self) end + +---Sets the value of the FlexWrap property. +---@param self FlexBox self +---@param FlexWrap boolean Whether to wrap flex items onto multiple lines +function FlexBox:setFlexWrap(self, FlexWrap) end + +---Sets the value of the FlexDirection property. +---@param self FlexBox self +---@param FlexDirection string The direction of the flexbox layout "row" or "column" +function FlexBox:setFlexDirection(self, FlexDirection) end + +---Gets the value of the FlexCrossPadding property. +---@param self FlexBox self +---@return number 0 The padding on both sides of the cross axis +function FlexBox:getFlexCrossPadding(self) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param element Element The child element to remove +---@return FlexBox self The flexbox instance +---@protected +function FlexBox:removeChild(element) end + +---Adds a child element to the flexbox +---@param element Element The child element to add +---@return FlexBox self The flexbox instance +function FlexBox:addChild(element) end + +---Sets the value of the FlexAlignItems property. +---@param self FlexBox self +---@param FlexAlignItems string The alignment of flex items along the cross axis +function FlexBox:setFlexAlignItems(self, FlexAlignItems) end + +---Gets the value of the FlexWrap property. +---@param self FlexBox self +---@return boolean false Whether to wrap flex items onto multiple lines +function FlexBox:getFlexWrap(self) end + +---Sets the value of the FlexCrossPadding property. +---@param self FlexBox self +---@param FlexCrossPadding number The padding on both sides of the cross axis +function FlexBox:setFlexCrossPadding(self, FlexCrossPadding) end + +---Sets the value of the FlexSpacing property. +---@param self FlexBox self +---@param FlexSpacing number The spacing between flex items +function FlexBox:setFlexSpacing(self, FlexSpacing) end + +---Gets the value of the FlexAlignItems property. +---@param self FlexBox self +---@return string "flex-start" The alignment of flex items along the cross axis +function FlexBox:getFlexAlignItems(self) end + +---@class Graph : VisualElement +---@field minValue number The minimum value of the graph +---@field series table The series of the graph +---@field maxValue number The maximum value of the graph +local Graph = {} + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@protected +function Graph:render() end + +---@param name string The name of the series +---@param value number The value of the point +---@return Graph self The graph instance +function Graph:addPoint(name, value) end + +---@param name string The name of the series +---@param symbol string The symbol of the series +---@param bgCol number The background color of the series +---@param fgCol number The foreground color of the series +---@param pointCount number The number of points in the series +---@return Graph self The graph instance +function Graph:addSeries(name, symbol, bgCol, fgCol, pointCount) end + +---@param name string The name of the series +---@return table ? series The series +function Graph:getSeries(name) end + +---@param name string The name of the series +---@param count number The number of points in the series +---@return Graph self The graph instance +function Graph:setSeriesPointCount(name, count) end + +---@param name string The name of the series +---@return Graph self The graph instance +function Graph:focusSeries(name) end + +---Gets the value of the MinValue property. +---@param self Graph self +---@return number 0 The minimum value of the graph +function Graph:getMinValue(self) end + +---Sets the value of the MaxValue property. +---@param self Graph self +---@param MaxValue number The maximum value of the graph +function Graph:setMaxValue(self, MaxValue) end + +---Clears all points from a series +---@return Graph self The graph instance +function Graph:clear() end + +---@param name string The name of the series +---@param visible boolean Whether the series should be visible +---@return Graph self The graph instance +function Graph:changeSeriesVisibility(name, visible) end + +---@param name string The name of the series +---@return Graph self The graph instance +function Graph:removeSeries(name) end + +---Sets the value of the MinValue property. +---@param self Graph self +---@param MinValue number The minimum value of the graph +function Graph:setMinValue(self, MinValue) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param props table The properties to initialize the element with +---@param basalt table The basalt instance +---@return Graph self The initialized instance +---@protected +function Graph:init(props, basalt) end + +---Gets the value of the MaxValue property. +---@param self Graph self +---@return number 100 The maximum value of the graph +function Graph:getMaxValue(self) end + +---Sets the value of the Series property. +---@param self Graph self +---@param Series table The series of the graph +function Graph:setSeries(self, Series) end + +---@class Timer : BaseElement +---@field action function The action to be performed when the timer triggers. +---@field amount number The amount of time the timer should run. +---@field interval number The interval in seconds at which the timer will trigger its action. +---@field running boolean Indicates whether the timer is currently running or not. +local Timer = {} + +---Sets the value of the Running property. +---@param self Timer self +---@param Running boolean Indicates whether the timer is currently running or not. +function Timer:setRunning(self, Running) end + +---Sets the value of the Action property. +---@param self Timer self +---@param Action function The action to be performed when the timer triggers. +function Timer:setAction(self, Action) end + +---Stops the timer if it is currently running. +---@param self Timer The Timer instance to stop +---@return Timer self The Timer instance +function Timer:stop(self) end + +---Gets the value of the Running property. +---@param self Timer self +---@return boolean false Indicates whether the timer is currently running or not. +function Timer:getRunning(self) end + +---Sets the value of the Interval property. +---@param self Timer self +---@param Interval number The interval in seconds at which the timer will trigger its action. +function Timer:setInterval(self, Interval) end + +---Gets the value of the Interval property. +---@param self Timer self +---@return number 1 The interval in seconds at which the timer will trigger its action. +function Timer:getInterval(self) end + +---Gets the value of the Amount property. +---@param self Timer self +---@return number -1 The amount of time the timer should run. +function Timer:getAmount(self) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@protected +function Timer:dispatchEvent() end + +---Sets the value of the Amount property. +---@param self Timer self +---@param Amount number The amount of time the timer should run. +function Timer:setAmount(self, Amount) end + +---Starts the timer with the specified interval. +---@param self Timer The Timer instance to start +---@return Timer self The Timer instance +function Timer:start(self) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param props table The properties to initialize the element with +---@param basalt table The basalt instance +---@protected +function Timer:init(props, basalt) end + +---Gets the value of the Action property. +---@param self Timer self +---@return function function The action to be performed when the timer triggers. +function Timer:getAction(self) end + +---@class Frame : Container +---@field draggingMap table The map of dragging positions +---@field scrollable boolean Whether the frame is scrollable +---@field draggable boolean Whether the frame is draggable +local Frame = {} + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param button number The button that was clicked +---@param x number The x position of the click +---@param y number The y position of the click +---@return boolean handled Whether the event was handled +---@protected +function Frame:mouse_click(button, x, y) end + +---Sets the value of the DraggingMap property. +---@param self Frame self +---@param DraggingMap table The map of dragging positions +function Frame:setDraggingMap(self, DraggingMap) end + +---Gets the value of the Draggable property. +---@param self Frame self +---@return boolean false Whether the frame is draggable +function Frame:getDraggable(self) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param direction number The scroll direction +---@param x number The x position of the scroll +---@param y number The y position of the scroll +---@return boolean handled Whether the event was handled +---@protected +function Frame:mouse_scroll(direction, x, y) end + +---Gets the value of the Scrollable property. +---@param self Frame self +---@return boolean false Whether the frame is scrollable +function Frame:getScrollable(self) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@return number height The total height needed for all children +---@protected +function Frame:getChildrenHeight() end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param props table The properties to initialize the element with +---@param basalt table The basalt instance +---@return Frame self The initialized instance +---@protected +function Frame:init(props, basalt) end + +---Sets the value of the Draggable property. +---@param self Frame self +---@param Draggable boolean Whether the frame is draggable +function Frame:setDraggable(self, Draggable) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param button number The button that was clicked +---@param x number The x position of the drag position +---@param y number The y position of the drag position +---@return boolean handled Whether the event was handled +---@protected +function Frame:mouse_drag(button, x, y) end + +---Gets the value of the DraggingMap property. +---@param self Frame self +---@return table {} The map of dragging positions +function Frame:getDraggingMap(self) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param button number The button that was released +---@param x number The x position of the release +---@param y number The y position of the release +---@return boolean handled Whether the event was handled +---@protected +function Frame:mouse_up(button, x, y) end + +---Sets the value of the Scrollable property. +---@param self Frame self +---@param Scrollable boolean Whether the frame is scrollable +function Frame:setScrollable(self, Scrollable) end + +---@class Input : VisualElement +---@field viewOffset number The horizontal scroll offset for viewing long text +---@field replaceChar string Character to replace the input with (for password fields) +---@field focusedBackground color Background color when input is focused +---@field maxLength number nil Maximum length of input text (optional) +---@field cursorColor number Color of the cursor +---@field text string The current text content of the input +---@field pattern string nil Regular expression pattern for input validation +---@field cursorPos number The current cursor position in the text +---@field focusedForeground color Foreground color when input is focused +---@field placeholder string Text to display when input is empty +---@field placeholderColor color Color of the placeholder text +local Input = {} + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param button number The button that was clicked +---@param x number The x position of the click +---@param y number The y position of the click +---@return boolean handled Whether the event was handled +---@protected +function Input:mouse_click(button, x, y) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@protected +function Input:paste() end + +---Sets the value of the ReplaceChar property. +---@param self Input self +---@param ReplaceChar string Character to replace the input with (for password fields) +function Input:setReplaceChar(self, ReplaceChar) end + +---Gets the value of the PlaceholderColor property. +---@param self Input self +---@return color gray Color of the placeholder text +function Input:getPlaceholderColor(self) end + +---Sets the value of the ViewOffset property. +---@param self Input self +---@param ViewOffset number The horizontal scroll offset for viewing long text +function Input:setViewOffset(self, ViewOffset) end + +---Gets the value of the Text property. +---@param self Input self +---@return string - The current text content of the input +function Input:getText(self) end + +---Gets the value of the ViewOffset property. +---@param self Input self +---@return number 0 The horizontal scroll offset for viewing long text +function Input:getViewOffset(self) end + +---Sets the cursor position and color +---@param x number The x position of the cursor +---@param y number The y position of the cursor +---@param blink boolean Whether the cursor should blink +---@param color number The color of the cursor +function Input:setCursor(x, y, blink, color) end + +---Sets the value of the Pattern property. +---@param self Input self +---@param Pattern string nil Regular expression pattern for input validation +function Input:setPattern(self, Pattern) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@protected +function Input:focus() end + +---Updates the input's viewport +---@return Input self The updated instance +function Input:updateViewport() end + +---Sets the value of the Text property. +---@param self Input self +---@param Text string The current text content of the input +function Input:setText(self, Text) end + +---Sets the value of the FocusedForeground property. +---@param self Input self +---@param FocusedForeground color Foreground color when input is focused +function Input:setFocusedForeground(self, FocusedForeground) end + +---Gets the value of the CursorColor property. +---@param self Input self +---@return number nil Color of the cursor +function Input:getCursorColor(self) end + +---Gets the value of the FocusedBackground property. +---@param self Input self +---@return color blue Background color when input is focused +function Input:getFocusedBackground(self) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param char string The character that was typed +---@return boolean handled Whether the event was handled +---@protected +function Input:char(char) end + +---Sets the value of the Placeholder property. +---@param self Input self +---@param Placeholder string Text to display when input is empty +function Input:setPlaceholder(self, Placeholder) end + +---Gets the value of the MaxLength property. +---@param self Input self +---@return number ? nil Maximum length of input text (optional) +function Input:getMaxLength(self) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@protected +function Input:render() end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param key number The key that was pressed +---@return boolean handled Whether the event was handled +---@protected +function Input:key(key) end + +---Sets the value of the MaxLength property. +---@param self Input self +---@param MaxLength number nil Maximum length of input text (optional) +function Input:setMaxLength(self, MaxLength) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@protected +function Input:blur() end + +---Gets the value of the FocusedForeground property. +---@param self Input self +---@return color white Foreground color when input is focused +function Input:getFocusedForeground(self) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param props table The properties to initialize the element with +---@param basalt table The basalt instance +---@return Input self The initialized instance +---@protected +function Input:init(props, basalt) end + +---Gets the value of the Pattern property. +---@param self Input self +---@return string ? nil Regular expression pattern for input validation +function Input:getPattern(self) end + +---Gets the value of the ReplaceChar property. +---@param self Input self +---@return string nil Character to replace the input with (for password fields) +function Input:getReplaceChar(self) end + +---Sets the value of the CursorColor property. +---@param self Input self +---@param CursorColor number Color of the cursor +function Input:setCursorColor(self, CursorColor) end + +---Sets the value of the FocusedBackground property. +---@param self Input self +---@param FocusedBackground color Background color when input is focused +function Input:setFocusedBackground(self, FocusedBackground) end + +---Sets the value of the CursorPos property. +---@param self Input self +---@param CursorPos number The current cursor position in the text +function Input:setCursorPos(self, CursorPos) end + +---Gets the value of the Placeholder property. +---@param self Input self +---@return string ... Text to display when input is empty +function Input:getPlaceholder(self) end + +---Gets the value of the CursorPos property. +---@param self Input self +---@return number 1 The current cursor position in the text +function Input:getCursorPos(self) end + +---Sets the value of the PlaceholderColor property. +---@param self Input self +---@param PlaceholderColor color Color of the placeholder text +function Input:setPlaceholderColor(self, PlaceholderColor) end + +---@class VisualElement : BaseElement +---@field background color The background color +---@field foreground color The text/foreground color +---@field width number The width of the element +---@field backgroundEnabled boolean Whether to render the background +---@field hover boolean Whether the mouse is currently hover over the element (Craftos-PC only) +---@field ignoreOffset boolean Whether to ignore the parent's offset +---@field x number The horizontal position relative to parent +---@field y number The vertical position relative to parent +---@field focused boolean Whether the element has input focus +---@field clicked boolean Whether the element is currently clicked +---@field visible boolean Whether the element is visible +---@field z number The z-index for layering elements +---@field height number The height of the element +local VisualElement = {} + +---Sets the value of the Height property. +---@param self VisualElement self +---@param Height number The height of the element +function VisualElement:setHeight(self, Height) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param x number The x position to draw +---@param y number The y position to draw +---@param text string The text char to draw +---@param fg color The foreground color +---@protected +function VisualElement:textFg(x, y, text, fg) end + +---Sets the value of the Hover property. +---@param self VisualElement self +---@param Hover boolean Whether the mouse is currently hover over the element (Craftos-PC only) +function VisualElement:setHover(self, Hover) end + +function VisualElement:destroy() end + +---Sets the value of the Y property. +---@param self VisualElement self +---@param Y number The vertical position relative to parent +function VisualElement:setY(self, Y) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param x number The x position to draw +---@param y number The y position to draw +---@param width number The width of the area to draw +---@param height number The height of the area to draw +---@param text string The text to draw +---@param fg string The foreground color +---@param bg string The background color +---@protected +function VisualElement:multiBlit(x, y, width, height, text, fg, bg) end + +---This function is used to prioritize the element by moving it to the top of its parent's children. It removes the element from its parent and adds it back, effectively changing its order. +---@return VisualElement self The VisualElement instance +function VisualElement:prioritize() end + +---Sets the value of the Z property. +---@param self VisualElement self +---@param Z number The z-index for layering elements +function VisualElement:setZ(self, Z) end + +---Registers a function to handle the onKey event. +---@param self VisualElement self +---@param func function The function to be called when the event fires +function VisualElement:onOnKey(self, func) end + +---Registers a function to handle the onEnter event. +---@param self VisualElement self +---@param func function The function to be called when the event fires +function VisualElement:onOnEnter(self, func) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param char string The character that was pressed +---@protected +function VisualElement:char(char) end + +---Registers a function to handle the onFocus event. +---@param self VisualElement self +---@param func function The function to be called when the event fires +function VisualElement:onOnFocus(self, func) end + +function VisualElement:drawText() end + +---Registers a function to handle the onBlur event. +---@param self VisualElement self +---@param func function The function to be called when the event fires +function VisualElement:onOnBlur(self, func) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@protected +function VisualElement:blur() end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param props table The properties to initialize the element with +---@param basalt table The basalt instance +---@protected +function VisualElement:init(props, basalt) end + +---Sets the value of the Foreground property. +---@param self VisualElement self +---@param Foreground color The text/foreground color +function VisualElement:setForeground(self, Foreground) end + +---Checks if the specified coordinates are within the bounds of the element +---@param x number The x position to check +---@param y number The y position to check +---@return boolean isInBounds Whether the coordinates are within the bounds of the element +function VisualElement:isInBounds(x, y) end + +---Gets the value of the Visible property. +---@param self VisualElement self +---@return boolean true Whether the element is visible +function VisualElement:getVisible(self) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@protected +function VisualElement:postRender() end + +---Sets the value of the Width property. +---@param self VisualElement self +---@param Width number The width of the element +function VisualElement:setWidth(self, Width) end + +---Returns the absolute position of the element or the given coordinates. +---@return number x The absolute x position +---@return number y The absolute y position +function VisualElement:getAbsolutePosition() end + +---Registers a function to handle the onChar event. +---@param self VisualElement self +---@param func function The function to be called when the event fires +function VisualElement:onOnChar(self, func) end + +---Gets the value of the X property. +---@param self VisualElement self +---@return number 1 The horizontal position relative to parent +function VisualElement:getX(self) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param x number The x position to draw +---@param y number The y position to draw +---@param text string The text char to draw +---@param fg string The foreground color +---@param bg string The background color +---@protected +function VisualElement:blit(x, y, text, fg, bg) end + +---Gets the value of the Clicked property. +---@param self VisualElement self +---@return boolean false Whether the element is currently clicked +function VisualElement:getClicked(self) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@protected +function VisualElement:render() end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param direction number The scroll direction +---@param x number The x position of the scroll +---@param y number The y position of the scroll +---@return boolean scroll Whether the element was scrolled +---@protected +function VisualElement:mouse_scroll(direction, x, y) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param _ number unknown +---@param x number The x position of the mouse +---@param y number The y position of the mouse +---@return boolean hover Whether the mouse has moved over the element +---@protected +function VisualElement:mouse_move(_, x, y) end + +---Sets the value of the BackgroundEnabled property. +---@param self VisualElement self +---@param BackgroundEnabled boolean Whether to render the background +function VisualElement:setBackgroundEnabled(self, BackgroundEnabled) end + +function VisualElement:drawBg() end + +---Gets the value of the Height property. +---@param self VisualElement self +---@return number 1 The height of the element +function VisualElement:getHeight(self) end + +---Registers a function to handle the onLeave event. +---@param self VisualElement self +---@param func function The function to be called when the event fires +function VisualElement:onOnLeave(self, func) end + +---Sets the value of the Focused property. +---@param self VisualElement self +---@param Focused boolean Whether the element has input focus +function VisualElement:setFocused(self, Focused) end + +function VisualElement:drawFg() end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param key number The key that was pressed +---@protected +function VisualElement:key(key) end + +---Gets the value of the Foreground property. +---@param self VisualElement self +---@return color white The text/foreground color +function VisualElement:getForeground(self) end + +---Gets the value of the Background property. +---@param self VisualElement self +---@return color black The background color +function VisualElement:getBackground(self) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param x number The x position to draw +---@param y number The y position to draw +---@param text string The text char to draw +---@param bg color The background color +---@protected +function VisualElement:textBg(x, y, text, bg) end + +---Gets the value of the Z property. +---@param self VisualElement self +---@return number 1 The z-index for layering elements +function VisualElement:getZ(self) end + +---Registers a function to handle the onKeyUp event. +---@param self VisualElement self +---@param func function The function to be called when the event fires +function VisualElement:onOnKeyUp(self, func) end + +---Gets the value of the Y property. +---@param self VisualElement self +---@return number 1 The vertical position relative to parent +function VisualElement:getY(self) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param x number The x position of the cursor +---@param y number The y position of the cursor +---@param blink boolean Whether the cursor should blink +---@param color number The color of the cursor +---@return VisualElement self The VisualElement instance +---@protected +function VisualElement:setCursor(x, y, blink, color) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param button number The button that was released +---@param x number The x position of the release +---@param y number The y position of the release +---@return boolean release Whether the element was released on the element +---@protected +function VisualElement:mouse_up(button, x, y) end + +---Creates a new Animation Object +---@return Animation animation The new animation +function VisualElement:animate() end + +---Gets the value of the Focused property. +---@param self VisualElement self +---@return boolean false Whether the element has input focus +function VisualElement:getFocused(self) end + +---Gets the value of the IgnoreOffset property. +---@param self VisualElement self +---@return boolean false Whether to ignore the parent's offset +function VisualElement:getIgnoreOffset(self) end + +---Returns the relative position of the element or the given coordinates. +---@return number x The relative x position +---@return number y The relative y position +function VisualElement:getRelativePosition() end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param button number The button that was clicked while dragging +---@param x number The x position of the drag +---@param y number The y position of the drag +---@return boolean drag Whether the element was dragged +---@protected +function VisualElement:mouse_drag(button, x, y) end + +---Gets the value of the Width property. +---@param self VisualElement self +---@return number 1 The width of the element +function VisualElement:getWidth(self) end + +---Sets the value of the Clicked property. +---@param self VisualElement self +---@param Clicked boolean Whether the element is currently clicked +function VisualElement:setClicked(self, Clicked) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param key number The key that was released +---@protected +function VisualElement:key_up(key) end + +---Registers a function to handle the onDrag event. +---@param self VisualElement self +---@param func function The function to be called when the event fires +function VisualElement:onOnDrag(self, func) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param button number The button that was clicked +---@param x number The x position of the click +---@param y number The y position of the click +---@return boolean clicked Whether the element was clicked +---@protected +function VisualElement:mouse_click(button, x, y) end + +---Registers a function to handle the onRelease event. +---@param self VisualElement self +---@param func function The function to be called when the event fires +function VisualElement:onOnRelease(self, func) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param button number The button that was released +---@param x number The x position of the release +---@param y number The y position of the release +---@protected +function VisualElement:mouse_release(button, x, y) end + +---Registers a function to handle the onClick event. +---@param button string +---@param x number +---@param y number +---@param self VisualElement self +---@param func function The function to be called when the event fires +function VisualElement:onOnClick(self, func) end + +---Sets the value of the X property. +---@param self VisualElement self +---@param X number The horizontal position relative to parent +function VisualElement:setX(self, X) end + +---Convenience to stop animations from the element +function VisualElement.stopAnimation() end + +---Sets the value of the Visible property. +---@param self VisualElement self +---@param Visible boolean Whether the element is visible +function VisualElement:setVisible(self, Visible) end + +---Gets the value of the BackgroundEnabled property. +---@param self VisualElement self +---@return boolean true Whether to render the background +function VisualElement:getBackgroundEnabled(self) end + +---Sets the value of the Background property. +---@param self VisualElement self +---@param Background color The background color +function VisualElement:setBackground(self, Background) end + +---Registers a function to handle the onScroll event. +---@param self VisualElement self +---@param func function The function to be called when the event fires +function VisualElement:onOnScroll(self, func) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@protected +function VisualElement:focus() end + +---Gets the value of the Hover property. +---@param self VisualElement self +---@return boolean false Whether the mouse is currently hover over the element (Craftos-PC only) +function VisualElement:getHover(self) end + +---Sets the value of the IgnoreOffset property. +---@param self VisualElement self +---@param IgnoreOffset boolean Whether to ignore the parent's offset +function VisualElement:setIgnoreOffset(self, IgnoreOffset) end + +---Calculates the position of the element relative to its parent +---@return number x The x position +---@return number y The y position +function VisualElement:calculatePosition() end + +---Registers a function to handle the onMouseUp event. +---@param self VisualElement self +---@param func function The function to be called when the event fires +function VisualElement:onOnMouseUp(self, func) end + +---@class Label : VisualElement +---@field autoSize boolean Whether the label should automatically resize its width based on the text content +---@field text string The text content to display. Can be a string or a function that returns a string +local Label = {} + +---Sets the value of the AutoSize property. +---@param self Label self +---@param AutoSize boolean Whether the label should automatically resize its width based on the text content +function Label:setAutoSize(self, AutoSize) end + +---Gets the value of the Text property. +---@param self Label self +---@return string Label The text content to display. Can be a string or a function that returns a string +function Label:getText(self) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@protected +function Label:render() end + +---Gets the value of the AutoSize property. +---@param self Label self +---@return boolean true Whether the label should automatically resize its width based on the text content +function Label:getAutoSize(self) end + +---Gets the wrapped lines of the Label +---@return table wrappedText The wrapped lines of the Label +function Label:getWrappedText() end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param props table The properties to initialize the element with +---@param basalt table The basalt instance +---@return Label self The initialized instance +---@protected +function Label:init(props, basalt) end + +---Sets the value of the Text property. +---@param self Label self +---@param Text string The text content to display. Can be a string or a function that returns a string +function Label:setText(self, Text) end + +---@class BaseFrame : Container +---@field term term term.current() The terminal or (monitor) peripheral object to render to +local BaseFrame = {} + +---Shows the debug log frame +---@param self BaseFrame The frame to show debug log in +function BaseFrame.openConsole(self) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param key number The key that was pressed +---@protected +function BaseFrame:key(key) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param button number The button that was released +---@param x number The x position of the mouse +---@param y number The y position of the mouse +---@protected +function BaseFrame:mouse_up(button, x, y) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@protected +function BaseFrame:term_resize() end + +---Toggles the debug log frame +---@param self BaseFrame The frame to toggle debug log for +function BaseFrame.toggleConsole(self) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param x number The x position to render to +---@param y number The y position to render to +---@param text string The text to render +---@param fg string The foreground color +---@param bg string The background color +---@protected +function BaseFrame:blit(x, y, text, fg, bg) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param char string The character that was pressed +---@protected +function BaseFrame:char(char) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param x number The x position to render to +---@param y number The y position to render to +---@param text string The text to render +---@param bg colors The background color +---@protected +function BaseFrame:textBg(x, y, text, bg) end + +---Gets the value of the Term property. +---@param self BaseFrame self +---@return term |peripheral term.current() The terminal or (monitor) peripheral object to render to +function BaseFrame:getTerm(self) end + +---Sets the cursor position +---@param x number The x position to set the cursor to +---@param y number The y position to set the cursor to +---@param blink boolean Whether the cursor should blink +function BaseFrame:setCursor(x, y, blink) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param props table The properties to initialize the element with +---@param basalt table The basalt instance +---@return table self The initialized instance +---@protected +function BaseFrame:init(props, basalt) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@protected +function BaseFrame:render() end + +function BaseFrame.setup() end + +---Initializes a new state for this element +---@param self BaseFrame The element to initialize state for +---@param name string The name of the state +---@param default any The default value of the state +---@return BaseFrame self The element instance +function BaseFrame:initializeState(self, name, default) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param key number The key that was released +---@protected +function BaseFrame:key_up(key) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param x number The x position to render to +---@param y number The y position to render to +---@param text string The text to render +---@param fg colors The foreground color +---@protected +function BaseFrame:textFg(x, y, text, fg) end + +---Sets the value of the Term property. +---@param self BaseFrame self +---@param Term term term.current() The terminal or (monitor) peripheral object to render to +function BaseFrame:setTerm(self, Term) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param x number The x position to render to +---@param y number The y position to render to +---@param width number The width of the text +---@param height number The height of the text +---@param text string The text to render +---@param fg string The foreground color +---@param bg string The background color +---@protected +function BaseFrame:multiBlit(x, y, width, height, text, fg, bg) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param name string The name of the monitor that was touched +---@param x number The x position of the mouse +---@param y number The y position of the mouse +---@protected +function BaseFrame:monitor_touch(name, x, y) end + +---Hides the debug log frame +---@param self BaseFrame The frame to hide debug log for +function BaseFrame.closeConsole(self) end + +function BaseFrame:drawFg() end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param button number The button that was clicked +---@param x number The x position of the mouse +---@param y number The y position of the mouse +---@protected +function BaseFrame:mouse_click(button, x, y) end + +function BaseFrame:drawBg() end + +function BaseFrame:dispatchEvent() end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param x number The x position to render to +---@param y number The y position to render to +---@param text string The text to render +---@param bg colors The background color +---@protected +function BaseFrame:drawText(x, y, text, bg) end + +---@class List : VisualElement +---@field selectedBackground color Background color for selected items +---@field selectedForeground color Text color for selected items +---@field items table List of items to display. Items can be tables with properties including selected state +---@field multiSelection boolean Whether multiple items can be selected at once +---@field selectable boolean Whether items in the list can be selected +---@field offset number Current scroll offset for viewing long lists +local List = {} + +---Sets the value of the Selectable property. +---@param self List self +---@param Selectable boolean Whether items in the list can be selected +function List:setSelectable(self, Selectable) end + +---Sets the value of the Items property. +---@param self List self +---@param Items table List of items to display. Items can be tables with properties including selected state +function List:setItems(self, Items) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param button number The mouse button that was clicked +---@param x number The x-coordinate of the click +---@param y number The y-coordinate of the click +---@return boolean Whether the event was handled +---@protected +function List:mouse_click(button, x, y) end + +---Sets the value of the SelectedBackground property. +---@param self List self +---@param SelectedBackground color Background color for selected items +function List:setSelectedBackground(self, SelectedBackground) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@protected +function List:render() end + +---Removes an item from the list +---@param index number The index of the item to remove +---@return List self The List instance +function List:removeItem(index) end + +---Gets first selected item +---@return table ? selected The first item +function List:getSelectedItem() end + +---Gets the value of the SelectedBackground property. +---@param self List self +---@return color blue Background color for selected items +function List:getSelectedBackground(self) end + +---Sets the value of the SelectedForeground property. +---@param self List self +---@param SelectedForeground color Text color for selected items +function List:setSelectedForeground(self, SelectedForeground) end + +---Scrolls the list to the bottom +---@return List self The List instance +function List:scrollToBottom() end + +---Gets the value of the MultiSelection property. +---@param self List self +---@return boolean false Whether multiple items can be selected at once +function List:getMultiSelection(self) end + +---Gets the value of the SelectedForeground property. +---@param self List self +---@return color white Text color for selected items +function List:getSelectedForeground(self) end + +---Registers a callback for the select event ---@param callback function The callback function to register ----@return Animation self The animation instance -function Animation:onComplete(callback) end +---@return List self The List instance +function List:onSelect(callback) end ----Stops the animation immediately: cancels timers, completes running anim instances and clears the element property -function Animation:stop() end +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param direction number The direction of the scroll (1 for down, -1 for up) +---@param x number The x-coordinate of the scroll +---@param y number The y-coordinate of the scroll +---@return boolean Whether the event was handled +---@protected +function List:mouse_scroll(direction, x, y) end ----Creates a new Animation ----@param element VisualElement The element to animate ----@return Animation The new animation -function Animation.new(element) end +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param props table The properties to initialize the element with +---@param basalt table The basalt instance +---@return List self The initialized instance +---@protected +function List:init(props, basalt) end ----Registers a new animation type ----@param name string The name of the animation ----@param handlers table Table containing start, update and complete handlers -function Animation.registerAnimation(name, handlers) end +---Clears all items from the list +---@return List self The List instance +function List:clear() end ----Starts the animation ----@return Animation self The animation instance -function Animation:start() end +---Sets the value of the MultiSelection property. +---@param self List self +---@param MultiSelection boolean Whether multiple items can be selected at once +function List:setMultiSelection(self, MultiSelection) end ----Registers a callback for the start event ----@param callback function The callback function to register -function Animation:onStart(callback) end +---Registers a function to handle the onSelect event. +---@param index number +---@param item table +---@param self List self +---@param func function The function to be called when the event fires +function List:onOnSelect(self, func) end ----Registers a new easing function ----@param name string The name of the easing function ----@param func function The easing function (takes progress 0-1, returns modified progress) -function Animation.registerEasing(name, func) end +---Sets the value of the Offset property. +---@param self List self +---@param Offset number Current scroll offset for viewing long lists +function List:setOffset(self, Offset) end ----The event handler for the animation (listens to timer events) ----@param event string The event type ----@param timerId number The timer ID -function Animation:event(event, timerId) end +---Gets the currently selected items +---@return table selected List of selected items +function List:getSelectedItems() end ----Registers a callback for the update event ----@param callback function The callback function to register ----@return Animation self The animation instance -function Animation:onUpdate(callback) end +---Gets the value of the Offset property. +---@param self List self +---@return number 0 Current scroll offset for viewing long lists +function List:getOffset(self) end ----Creates a new sequence ----@return Animation self The animation instance -function Animation:sequence() end +---Gets the value of the Selectable property. +---@param self List self +---@return boolean true Whether items in the list can be selected +function List:getSelectable(self) end + +---Scrolls the list to the top +---@return List self The List instance +function List:scrollToTop() end + +---Gets the value of the Items property. +---@param self List self +---@return table {} List of items to display. Items can be tables with properties including selected state +function List:getItems(self) end + +---Adds an item to the list +---@param text string |table The item to add (string or item table) +---@return List self The List instance +function List:addItem(text) end + +---@class Reactive +local Reactive = {} + +---@class ProgressBar : VisualElement +---@field direction string The direction of the progress bar ("up", "down", "left", "right") +---@field progress number Current progress value (0-100) +---@field progressColor color The color used for the filled portion of the progress bar +---@field showPercentage boolean Whether to show the percentage text in the center +local ProgressBar = {} + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@protected +function ProgressBar:render() end + +---Gets the value of the Direction property. +---@param self ProgressBar self +---@return string right The direction of the progress bar ("up", "down", "left", "right") +function ProgressBar:getDirection(self) end + +---Sets the value of the ProgressColor property. +---@param self ProgressBar self +---@param ProgressColor color The color used for the filled portion of the progress bar +function ProgressBar:setProgressColor(self, ProgressColor) end + +---Sets the value of the Direction property. +---@param self ProgressBar self +---@param Direction string The direction of the progress bar ("up", "down", "left", "right") +function ProgressBar:setDirection(self, Direction) end + +---Sets the value of the Progress property. +---@param self ProgressBar self +---@param Progress number Current progress value (0-100) +function ProgressBar:setProgress(self, Progress) end + +---Gets the value of the ShowPercentage property. +---@param self ProgressBar self +---@return boolean false Whether to show the percentage text in the center +function ProgressBar:getShowPercentage(self) end + +---Gets the value of the Progress property. +---@param self ProgressBar self +---@return number 0 Current progress value (0-100) +function ProgressBar:getProgress(self) end + +---Gets the value of the ProgressColor property. +---@param self ProgressBar self +---@return color lime The color used for the filled portion of the progress bar +function ProgressBar:getProgressColor(self) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param props table The properties to initialize the element with +---@param basalt table The basalt instance +---@return ProgressBar self The initialized instance +---@protected +function ProgressBar:init(props, basalt) end + +---Sets the value of the ShowPercentage property. +---@param self ProgressBar self +---@param ShowPercentage boolean Whether to show the percentage text in the center +function ProgressBar:setShowPercentage(self, ShowPercentage) end + +---@class CheckBox : VisualElement +---@field autoSize boolean Whether to automatically size the checkbox +---@field text string Text to display +---@field checkedText string when checked +---@field checked boolean checkbox is checked +local CheckBox = {} + +---Gets the value of the AutoSize property. +---@param self CheckBox self +---@return boolean true Whether to automatically size the checkbox +function CheckBox:getAutoSize(self) end + +---Sets the value of the AutoSize property. +---@param self CheckBox self +---@param AutoSize boolean Whether to automatically size the checkbox +function CheckBox:setAutoSize(self, AutoSize) end + +---Sets the value of the Checked property. +---@param self CheckBox self +---@param Checked boolean checkbox is checked +function CheckBox:setChecked(self, Checked) end + +---Gets the value of the CheckedText property. +---@param self CheckBox self +---@return string Text when checked +function CheckBox:getCheckedText(self) end + +---Gets the value of the Text property. +---@param self CheckBox self +---@return string empty Text to display +function CheckBox:getText(self) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@protected +function CheckBox:render() end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param button number The button that was clicked +---@param x number The x position of the click +---@param y number The y position of the click +---@return boolean Clicked Whether the event was handled +---@protected +function CheckBox:mouse_click(button, x, y) end + +---Sets the value of the CheckedText property. +---@param self CheckBox self +---@param CheckedText string when checked +function CheckBox:setCheckedText(self, CheckedText) end + +---Sets the value of the Text property. +---@param self CheckBox self +---@param Text string Text to display +function CheckBox:setText(self, Text) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param props table The properties to initialize the element with +---@param basalt table The basalt instance +---@protected +function CheckBox:init(props, basalt) end + +---Gets the value of the Checked property. +---@param self CheckBox self +---@return boolean Whether checkbox is checked +function CheckBox:getChecked(self) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@return CheckBox self The created instance +---@protected +function CheckBox.new() end + +---@class BarChart : Graph +local BarChart = {} + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@protected +function BarChart:render() end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param props table The properties to initialize the element with +---@param basalt table The basalt instance +---@return BarChart self The initialized instance +---@protected +function BarChart:init(props, basalt) end + +---@class Benchmark +local Benchmark = {} + +---Starts a custom benchmark +---@param name string The name of the benchmark +function API.start(name) end + +---Stops a custom benchmark +---@param name string The name of the benchmark to stop +function API.stop(name) end + +---Clears all custom benchmarks +function API.clearAll() end + +---Clears a specific benchmark +---@param name string The name of the benchmark to clear +function API.clear(name) end + +---Gets statistics for a benchmark +---@param name string The name of the benchmark +---@return table ? stats The benchmark statistics or nil +function API.getStats(name) end ---@class Render local Render = {} ----Blits text to the screen with a background color ----@param x number The x position to blit to ----@param y number The y position to blit to ----@param text string The text to blit ----@param bg colors The background color of the text ----@return Render -function Render:textBg(x, y, text, bg) end - ----Clears the screen ----@param bg colors The background color to clear the screen with ----@return Render -function Render:clear(bg) end - ---Checks if two rectangles overlap ---@param r1 table The first rectangle ---@param r2 table The second rectangle ---@return boolean function Render:rectOverlaps(r1, r2) end ----Blits a background color to the screen ----@param x number The x position ----@param y number The y position ----@param bg string The background color to blit +---Gets the size of the render +---@return number , number +function Render:getSize() end + +---Blits text to the screen with a foreground color +---@param x number The x position to blit to +---@param y number The y position to blit to +---@param text string The text to blit +---@param fg colors The foreground color of the text ---@return Render -function Render:bg(x, y, bg) end +function Render:textFg(x, y, text, fg) end ---Sets the cursor position ---@param x number The x position of the cursor @@ -95,6 +1993,24 @@ function Render:setCursor(x, y, blink) end ---@return Render function Render:render() end +---Sets the size of the render +---@param width number The width of the render +---@param height number The height of the render +---@return Render +function Render:setSize(width, height) end + +---Blits a background color to the screen +---@param x number The x position +---@param y number The y position +---@param bg string The background color to blit +---@return Render +function Render:bg(x, y, bg) end + +---Creates a new Render object +---@param terminal table The terminal object to render to +---@return Render +function Render.new(terminal) end + ---Blits text to the screen with multiple lines ---@param x number The x position to blit to ---@param y number The y position to blit to @@ -106,6 +2022,34 @@ function Render:render() end ---@return Render function Render:multiBlit(x, y, width, height, text, fg, bg) end +---Clears the screen +---@param bg colors The background color to clear the screen with +---@return Render +function Render:clear(bg) end + +---Blits text to the screen with a background color +---@param x number The x position to blit to +---@param y number The y position to blit to +---@param text string The text to blit +---@param bg colors The background color of the text +---@return Render +function Render:textBg(x, y, text, bg) end + +---Adds a dirty rectangle to the buffer +---@param x number The x position of the rectangle +---@param y number The y position of the rectangle +---@param width number The width of the rectangle +---@param height number The height of the rectangle +---@return Render +function Render:addDirtyRect(x, y, width, height) end + +---Blits a foreground color to the screen +---@param x number The x position +---@param y number The y position +---@param fg string The foreground color to blit +---@return Render +function Render:fg(x, y, fg) end + ---Blits text to the screen ---@param x number The x position to blit to ---@param y number The y position to blit to @@ -113,36 +2057,6 @@ function Render:multiBlit(x, y, width, height, text, fg, bg) end ---@return Render function Render:text(x, y, text) end ----Gets the size of the render ----@return number , number -function Render:getSize() end - ----Clears an area of the screen ----@param x number The x position of the area ----@param y number The y position of the area ----@param width number The width of the area ----@param height number The height of the area ----@param bg colors The background color to clear the area with ----@return Render -function Render:clearArea(x, y, width, height, bg) end - ----Merges two rectangles ----@param target table The target rectangle ----@param source table The source rectangle ----@return Render -function Render:mergeRects(target, source) end - ----Sets the size of the render ----@param width number The width of the render ----@param height number The height of the render ----@return Render -function Render:setSize(width, height) end - ----Creates a new Render object ----@param terminal table The terminal object to render to ----@return Render -function Render.new(terminal) end - ---Blits text to the screen ---@param x number The x position to blit to ---@param y number The y position to blit to @@ -152,96 +2066,450 @@ function Render.new(terminal) end ---@return Render function Render:blit(x, y, text, fg, bg) end ----Adds a dirty rectangle to the buffer ----@param x number The x position of the rectangle ----@param y number The y position of the rectangle ----@param width number The width of the rectangle ----@param height number The height of the rectangle +---Merges two rectangles +---@param target table The target rectangle +---@param source table The source rectangle ---@return Render -function Render:addDirtyRect(x, y, width, height) end +function Render:mergeRects(target, source) end ----Blits text to the screen with a foreground color ----@param x number The x position to blit to ----@param y number The y position to blit to ----@param text string The text to blit ----@param fg colors The foreground color of the text +---Clears an area of the screen +---@param x number The x position of the area +---@param y number The y position of the area +---@param width number The width of the area +---@param height number The height of the area +---@param bg colors The background color to clear the area with ---@return Render -function Render:textFg(x, y, text, fg) end +function Render:clearArea(x, y, width, height, bg) end ----Blits a foreground color to the screen ----@param x number The x position ----@param y number The y position ----@param fg string The foreground color to blit ----@return Render -function Render:fg(x, y, fg) end +---@class ThemeAPI +local ThemeAPI = {} ----@class Table : VisualElement ----@field selectedColor color Background color of selected row ----@field sortDirection string Sort direction ("asc" or "desc") ----@field customSortFunction table Custom sort functions for columns ----@field scrollOffset number Current scroll position ----@field gridColor color Color of grid lines ----@field selectedRow number nil Currently selected row index ----@field data table The table data as array of row arrays ----@field sortColumn number nil Currently sorted column index ----@field headerColor color Color of the column headers ----@field columns table List of column definitions with {name, width} properties -local Table = {} +---Gets the current theme configuration +---@return table theme The current theme configuration +function ThemeAPI.getTheme() end ----Gets the value of the SelectedColor property. ----@param self Table self ----@return color lightBlue Background color of selected row -function Table:getSelectedColor(self) end +---Loads a theme from a JSON file +---@param path string Path to the theme JSON file +function ThemeAPI.loadTheme(path) end ----Gets the value of the SortDirection property. ----@param self Table self ----@return string "asc" Sort direction ("asc" or "desc") -function Table:getSortDirection(self) end +---Sets the current theme +---@param newTheme table The theme configuration to set +function ThemeAPI.setTheme(newTheme) end ----Set data with automatic formatting ----@param rawData table The raw data array ----@param formatters table Optional formatter functions for columns {[2] = function(value) return value end} ----@return Table self The Table instance -function Table:setData(rawData, formatters) end - ----Gets the value of the GridColor property. ----@param self Table self ----@return color gray Color of grid lines -function Table:getGridColor(self) end - ----Sorts the table data by column ----@param columnIndex number The index of the column to sort by ----@param fn function ? Optional custom sorting function ----@return Table self The Table instance -function Table:sortData(columnIndex, fn) end - ----Gets the value of the Columns property. ----@param self Table self ----@return table {} List of column definitions with {name, width} properties -function Table:getColumns(self) end - ----Sets the value of the HeaderColor property. ----@param self Table self ----@param HeaderColor color Color of the column headers -function Table:setHeaderColor(self, HeaderColor) end +---@class Display : VisualElement +local Display = {} ---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param direction number The scroll direction (-1 up, 1 down) +---@protected +function Display:render() end + +---Writes text to the display at the given position with the given foreground and background colors +---@param x number The x position to write to +---@param y number The y position to write to +---@param text string The text to write +---@return Display self The display instance +function Display:write(x, y, text) end + +---Returns the current window object +---@return table window The current window object +function Display:getWindow() end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param props table The properties to initialize the element with +---@param basalt table The basalt instance +---@protected +function Display:init(props, basalt) end + +---@class Tree : VisualElement +---@field horizontalOffset number Current horizontal scroll position +---@field nodes table The tree structure containing node objects with {text, children} properties +---@field expandedNodes table Table of nodes that are currently expanded +---@field selectedColor color Background color of selected node +---@field nodeColor color Color of unselected nodes +---@field scrollOffset number Current vertical scroll position +---@field selectedNode table nil Currently selected node +local Tree = {} + +---Initializes the Tree instance +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param props table The properties to initialize the element with +---@param basalt table The basalt instance +---@return Tree self The initialized instance +---@protected +function Tree:init(props, basalt) end + +---Sets the value of the NodeColor property. +---@param self Tree self +---@param NodeColor color Color of unselected nodes +function Tree:setNodeColor(self, NodeColor) end + +---Gets the value of the ExpandedNodes property. +---@param self Tree self +---@return table {} Table of nodes that are currently expanded +function Tree:getExpandedNodes(self) end + +---Sets the value of the ExpandedNodes property. +---@param self Tree self +---@param ExpandedNodes table Table of nodes that are currently expanded +function Tree:setExpandedNodes(self, ExpandedNodes) end + +---Gets the size of the tree +---@return number width The width of the tree +---@return number height The height of the tree +function Tree:getNodeSize() end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@protected +function Tree:render() end + +---Sets the value of the SelectedNode property. +---@param self Tree self +---@param SelectedNode table nil Currently selected node +function Tree:setSelectedNode(self, SelectedNode) end + +---Gets the value of the ScrollOffset property. +---@param self Tree self +---@return number 0 Current vertical scroll position +function Tree:getScrollOffset(self) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param direction number The scroll direction (1 for up, -1 for down) ---@param x number The x position of the scroll ---@param y number The y position of the scroll ---@return boolean handled Whether the event was handled ---@protected -function Table:mouse_scroll(direction, x, y) end +function Tree:mouse_scroll(direction, x, y) end ----Sets the value of the GridColor property. ----@param self Table self ----@param GridColor color Color of grid lines -function Table:setGridColor(self, GridColor) end +---Sets the value of the ScrollOffset property. +---@param self Tree self +---@param ScrollOffset number Current vertical scroll position +function Tree:setScrollOffset(self, ScrollOffset) end ----Gets the value of the SelectedRow property. ----@param self Table self ----@return number ? nil Currently selected row index -function Table:getSelectedRow(self) end +---Gets the value of the NodeColor property. +---@param self Tree self +---@return color white Color of unselected nodes +function Tree:getNodeColor(self) end + +---Registers a callback for when a node is selected +---@param callback function The callback function +---@return Tree self The Tree instance +function Tree:onSelect(callback) end + +---Collapses a node +---@param node table The node to collapse +---@return Tree self The Tree instance +function Tree:collapseNode(node) end + +---Handles mouse click events +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param button number The button that was clicked +---@param x number The x position of the click +---@param y number The y position of the click +---@return boolean handled Whether the event was handled +---@protected +function Tree:mouse_click(button, x, y) end + +---Toggles a node's expanded state +---@param node table The node to toggle +---@return Tree self The Tree instance +function Tree:toggleNode(node) end + +---Gets the value of the Nodes property. +---@param self Tree self +---@return table {} The tree structure containing node objects with {text, children} properties +function Tree:getNodes(self) end + +---Expands a node +---@param node table The node to expand +---@return Tree self The Tree instance +function Tree:expandNode(node) end + +---Sets the value of the Nodes property. +---@param self Tree self +---@param Nodes table The tree structure containing node objects with {text, children} properties +function Tree:setNodes(self, Nodes) end + +---Gets the value of the SelectedColor property. +---@param self Tree self +---@return color lightBlue Background color of selected node +function Tree:getSelectedColor(self) end + +---Sets the value of the HorizontalOffset property. +---@param self Tree self +---@param HorizontalOffset number Current horizontal scroll position +function Tree:setHorizontalOffset(self, HorizontalOffset) end + +---Gets the value of the HorizontalOffset property. +---@param self Tree self +---@return number 0 Current horizontal scroll position +function Tree:getHorizontalOffset(self) end + +---Gets the value of the SelectedNode property. +---@param self Tree self +---@return table ? nil Currently selected node +function Tree:getSelectedNode(self) end + +---Sets the value of the SelectedColor property. +---@param self Tree self +---@param SelectedColor color Background color of selected node +function Tree:setSelectedColor(self, SelectedColor) end + +---@class Switch : VisualElement +---@field checked boolean switch is checked +---@field onBackground number color when ON +---@field text string to display next to switch +---@field offBackground number color when OFF +---@field autoSize boolean to automatically size the element to fit switch and text +local Switch = {} + +---Gets the value of the Text property. +---@param self Switch self +---@return string Text to display next to switch +function Switch:getText(self) end + +---Gets the value of the OffBackground property. +---@param self Switch self +---@return number Background color when OFF +function Switch:getOffBackground(self) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@protected +function Switch:render() end + +---Sets the value of the AutoSize property. +---@param self Switch self +---@param AutoSize boolean to automatically size the element to fit switch and text +function Switch:setAutoSize(self, AutoSize) end + +---Sets the value of the Text property. +---@param self Switch self +---@param Text string to display next to switch +function Switch:setText(self, Text) end + +---Gets the value of the OnBackground property. +---@param self Switch self +---@return number Background color when ON +function Switch:getOnBackground(self) end + +---Gets the value of the AutoSize property. +---@param self Switch self +---@return boolean Whether to automatically size the element to fit switch and text +function Switch:getAutoSize(self) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param props table The properties to initialize the element with +---@param basalt table The basalt instance +---@protected +function Switch:init(props, basalt) end + +---Sets the value of the OnBackground property. +---@param self Switch self +---@param OnBackground number color when ON +function Switch:setOnBackground(self, OnBackground) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param button number The button that was clicked +---@param x number The x position of the click +---@param y number The y position of the click +---@return boolean Whether the event was handled +---@protected +function Switch:mouse_click(button, x, y) end + +---Sets the value of the OffBackground property. +---@param self Switch self +---@param OffBackground number color when OFF +function Switch:setOffBackground(self, OffBackground) end + +---Gets the value of the Checked property. +---@param self Switch self +---@return boolean Whether switch is checked +function Switch:getChecked(self) end + +---Sets the value of the Checked property. +---@param self Switch self +---@param Checked boolean switch is checked +function Switch:setChecked(self, Checked) end + +---@class Log +local Log = {} + +---Sets if the logger should log +function Log.setEnabled() end + +---Sends an info message to the logger. +function Log.info() end + +---Sends a debug message to the logger. +function Log.debug() end + +---Sets if the logger should log to a file. +function Log.setLogToFile() end + +---Sends a warning message to the logger. +function Log.warn() end + +---Sends an error message to the logger. +function Log.error() end + +---@class LineChart : Graph +local LineChart = {} + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@protected +function LineChart:render() end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param props table The properties to initialize the element with +---@param basalt table The basalt instance +---@return LineChart self The initialized instance +---@protected +function LineChart:init(props, basalt) end + +---@class BigFont : VisualElement +---@field fontSize number The font size of the BigFont +---@field text string BigFont text +local BigFont = {} + +---Sets the value of the FontSize property. +---@param self BigFont self +---@param FontSize number The font size of the BigFont +function BigFont:setFontSize(self, FontSize) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param props table The properties to initialize the element with +---@param basalt table The basalt instance +---@protected +function BigFont:init(props, basalt) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@protected +function BigFont:render() end + +---Gets the value of the Text property. +---@param self BigFont self +---@return string BigFont BigFont text +function BigFont:getText(self) end + +---Sets the value of the Text property. +---@param self BigFont self +---@param Text string BigFont text +function BigFont:setText(self, Text) end + +---Gets the value of the FontSize property. +---@param self BigFont self +---@return number 1 The font size of the BigFont +function BigFont:getFontSize(self) end + +---@class Container : VisualElement +---@field focusedChild table The focused child of the container +---@field visibleChildrenEvents table The visible children events of the container +---@field visibleChildren table The visible children of the container +---@field childrenEvents table The children events of the container +---@field childrenSorted boolean Whether the children are sorted +---@field offsetX number Horizontal content offset +---@field offsetY number Vertical content offset +---@field childrenEventsSorted boolean Whether the children events are sorted +---@field children table The children of the container +---@field eventListenerCount table The event listener count of the container +local Container = {} + +---Sets the value of the ChildrenEventsSorted property. +---@param self Container self +---@param ChildrenEventsSorted boolean Whether the children events are sorted +function Container:setChildrenEventsSorted(self, ChildrenEventsSorted) end + +---Creates a new TextBox element. +---@param self Container self +---@param props? table Optional: properties for the element. +---@return TextBox element A new TextBox element. +function Container:addTextBox(self, props) end + +---Sets the value of the Children property. +---@param self Container self +---@param Children table The children of the container +function Container:setChildren(self, Children) end + +---Sets the value of the VisibleChildren property. +---@param self Container self +---@param VisibleChildren table The visible children of the container +function Container:setVisibleChildren(self, VisibleChildren) end + +---Creates a new Label element. +---@param self Container self +---@param props? table Optional: properties for the element. +---@return Label element A new Label element. +function Container:addLabel(self, props) end + +---Adds a child to the container +---@param child table The child to add +---@return Container self The container instance +function Container:addChild(child) end + +function Container:drawFg() end + +---Gets the value of the VisibleChildren property. +---@param self Container self +---@return table {} The visible children of the container +function Container:getVisibleChildren(self) end + +---Registers the children events of the container +---@param child table The child to register events for +---@param eventName string The event name to register +---@return Container self The container instance +function Container:registerChildEvent(child, eventName) end + +---Enables benchmarking for a container and all its children +---@param methodName string The method to benchmark +---@return Container self The container instance +function Container:benchmarkContainer(methodName) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param x number The x position to draw the text +---@param y number The y position to draw the text +---@param width number The width of the text +---@param height number The height of the text +---@param text string The text to draw +---@param fg string The foreground color of the text +---@param bg string The background color of the text +---@return Container self The container instance +---@protected +function Container:multiBlit(x, y, width, height, text, fg, bg) end + +---Creates a new CheckBox element. +---@param self Container self +---@param props? table Optional: properties for the element. +---@return CheckBox element A new CheckBox element. +function Container:addCheckBox(self, props) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param direction number The direction of the scroll +---@param x number The x position of the click +---@param y number The y position of the click +---@return boolean handled Whether the event was handled +---@protected +function Container:mouse_scroll(direction, x, y) end + +---Creates a new TabControl element. +---@param self Container self +---@param props? table Optional: properties for the element. +---@return TabControl element A new TabControl element. +function Container:addTabControl(self, props) end + +---Creates a new Timer element. +---@param self Container self +---@param props? table Optional: properties for the element. +---@return Timer element A new Timer element. +function Container:addTimer(self, props) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param x number The x position to draw the text +---@param y number The y position to draw the text +---@param text string The text to draw +---@param fg string The foreground color of the text +---@param bg string The background color of the text +---@return Container self The container instance +---@protected +function Container:blit(x, y, text, fg, bg) end ---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ---@param button number The button that was clicked @@ -249,135 +2517,477 @@ function Table:getSelectedRow(self) end ---@param y number The y position of the click ---@return boolean handled Whether the event was handled ---@protected -function Table:mouse_click(button, x, y) end +function Container:mouse_click(button, x, y) end ----Gets the value of the ScrollOffset property. ----@param self Table self ----@return number 0 Current scroll position -function Table:getScrollOffset(self) end +function Container:drawBg() end ----Sets the value of the ScrollOffset property. ----@param self Table self ----@param ScrollOffset number Current scroll position -function Table:setScrollOffset(self, ScrollOffset) end +---Creates a new Display element. +---@param self Container self +---@param props? table Optional: properties for the element. +---@return Display element A new Display element. +function Container:addDisplay(self, props) end ----Adds a new column to the table ----@param name string The name of the column ----@param width number The width of the column ----@return Table self The Table instance -function Table:addColumn(name, width) end +---Gets the value of the ChildrenEventsSorted property. +---@param self Container self +---@return boolean true Whether the children events are sorted +function Container:getChildrenEventsSorted(self) end ---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param key number The key that was released +---@return boolean handled Whether the event was handled ---@protected -function Table:render() end +function Container:key_up(key) end ----Gets the value of the SortColumn property. ----@param self Table self ----@return number ? nil Currently sorted column index -function Table:getSortColumn(self) end +---Gets the value of the EventListenerCount property. +---@param self Container self +---@return table {} The event listener count of the container +function Container:getEventListenerCount(self) end ----Adds data with both display and sort values ----@param displayData table The formatted data for display ----@param sortData table The raw data for sorting (optional) ----@return Table self The Table instance -function Table:setFormattedData(displayData, sortData) end +---Clears the container +---@return Container self The container instance +function Container:clear() end ----Gets the value of the HeaderColor property. ----@param self Table self ----@return color blue Color of the column headers -function Table:getHeaderColor(self) end +---Sorts the children events of the container +---@param eventName string The event name to sort +---@return Container self The container instance +function Container:sortChildrenEvents(eventName) end ----Sets the value of the SelectedRow property. ----@param self Table self ----@param SelectedRow number nil Currently selected row index -function Table:setSelectedRow(self, SelectedRow) end +---Creates a new Tree element. +---@param self Container self +---@param props? table Optional: properties for the element. +---@return Tree element A new Tree element. +function Container:addTree(self, props) end ----Sets the value of the SortColumn property. ----@param self Table self ----@param SortColumn number nil Currently sorted column index -function Table:setSortColumn(self, SortColumn) end +---Returns whether a child is visible +---@param child table The child to check +---@return boolean boolean the child is visible +function Container:isChildVisible(child) end ----Sets a custom sort function for a specific column ----@param columnIndex number The index of the column ----@param sortFn function Function that takes (rowA, rowB) and returns comparison result ----@return Table self The Table instance -function Table:setColumnSortFunction(columnIndex, sortFn) end - ----Sets the value of the SortDirection property. ----@param self Table self ----@param SortDirection string Sort direction ("asc" or "desc") -function Table:setSortDirection(self, SortDirection) end - ----Adds a new row of data to the table ----@return Table self The Table instance -function Table:addData() end - ----Gets the value of the Data property. ----@param self Table self ----@return table {} The table data as array of row arrays -function Table:getData(self) end +---Registers the children events of the container +---@param child table The child to register events for +---@return Container self The container instance +function Container:registerChildrenEvents(child) end ---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ---@param props table The properties to initialize the element with ---@param basalt table The basalt instance ----@return Table self The initialized instance ---@protected -function Table:init(props, basalt) end +function Container:init(props, basalt) end ----Gets the value of the CustomSortFunction property. ----@param self Table self ----@return table {} Custom sort functions for columns -function Table:getCustomSortFunction(self) end +---Creates a new Menu element. +---@param self Container self +---@param props? table Optional: properties for the element. +---@return Menu element A new Menu element. +function Container:addMenu(self, props) end ----Sets the value of the CustomSortFunction property. ----@param self Table self ----@param CustomSortFunction table Custom sort functions for columns -function Table:setCustomSortFunction(self, CustomSortFunction) end +---Creates a new Button element. +---@param self Container self +---@param props? table Optional: properties for the element. +---@return Button element A new Button element. +function Container:addButton(self, props) end ----Sets the value of the Columns property. ----@param self Table self ----@param Columns table List of column definitions with {name, width} properties -function Table:setColumns(self, Columns) end +---Creates a new Switch element. +---@param self Container self +---@param props? table Optional: properties for the element. +---@return Switch element A new Switch element. +function Container:addSwitch(self, props) end ----Sets the value of the SelectedColor property. ----@param self Table self ----@param SelectedColor color Background color of selected row -function Table:setSelectedColor(self, SelectedColor) end +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param char string The character that was pressed +---@return boolean handled Whether the event was handled +---@protected +function Container:char(char) end + +---Unregisters the children events of the container +---@param child table The child to unregister events for +---@param eventName string The event name to unregister +---@return Container self The container instance +function Container:unregisterChildEvent(child, eventName) end + +---Removes a child from the container +---@param path string The path to the child to remove +---@return Container ? self The container instance +function Container:getChild(path) end + +---Creates a new ProgressBar element. +---@param self Container self +---@param props? table Optional: properties for the element. +---@return ProgressBar element A new ProgressBar element. +function Container:addProgressBar(self, props) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param button number The button that was clicked +---@param x number The x position of the click +---@param y number The y position of the click +---@return boolean handled Whether the event was handled +---@protected +function Container:mouse_drag(button, x, y) end + +---Calls a event on all children +---@param visibleOnly boolean Whether to only call the event on visible children +---@param event string The event to call +---@return boolean handled Whether the event was handled +---@return table ? child The child that handled the event +function Container:callChildrenEvent(visibleOnly, event) end + +---Gets the value of the ChildrenEvents property. +---@param self Container self +---@return table {} The children events of the container +function Container:getChildrenEvents(self) end + +---Creates a new LineChart element. +---@param self Container self +---@param props? table Optional: properties for the element. +---@return LineChart element A new LineChart element. +function Container:addLineChart(self, props) end + +---Gets the value of the OffsetX property. +---@param self Container self +---@return number 0 Horizontal content offset +function Container:getOffsetX(self) end + +---Creates a new BaseFrame element. +---@param self Container self +---@param props? table Optional: properties for the element. +---@return BaseFrame element A new BaseFrame element. +function Container:addBaseFrame(self, props) end + +---Sets the value of the VisibleChildrenEvents property. +---@param self Container self +---@param VisibleChildrenEvents table The visible children events of the container +function Container:setVisibleChildrenEvents(self, VisibleChildrenEvents) end + +---Removes a child from the container +---@param child table The child to remove +---@return Container self The container instance +function Container:removeChild(child) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param button number The button that was clicked +---@param x number The x position of the click +---@param y number The y position of the click +---@protected +function Container:mouse_release(button, x, y) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param x number The x position to draw the text +---@param y number The y position to draw the text +---@param text string The text to draw +---@param bg color The background color of the text +---@return Container self The container instance +---@protected +function Container:textBg(x, y, text, bg) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param button number The button that was clicked +---@param x number The x position of the click +---@param y number The y position of the click +---@return boolean handled Whether the event was handled +---@protected +function Container:mouse_up(button, x, y) end + +---Creates a new Slider element. +---@param self Container self +---@param props? table Optional: properties for the element. +---@return Slider element A new Slider element. +function Container:addSlider(self, props) end + +---Creates a new BarChart element. +---@param self Container self +---@param props? table Optional: properties for the element. +---@return BarChart element A new BarChart element. +function Container:addBarChart(self, props) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param _ number unknown +---@param x number The x position of the click +---@param y number The y position of the click +---@return boolean handled Whether the event was handled +---@protected +function Container:mouse_move(_, x, y) end + +---Sets the value of the OffsetY property. +---@param self Container self +---@param OffsetY number Vertical content offset +function Container:setOffsetY(self, OffsetY) end + +---Sets the value of the EventListenerCount property. +---@param self Container self +---@param EventListenerCount table The event listener count of the container +function Container:setEventListenerCount(self, EventListenerCount) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param x number The x position to draw the text +---@param y number The y position to draw the text +---@param text string The text to draw +---@param fg color The foreground color of the text +---@return Container self The container instance +---@protected +function Container:textFg(x, y, text, fg) end + +---Sorts the children of the container +---@return Container self The container instance +function Container:sortChildren() end + +---Gets the value of the ChildrenSorted property. +---@param self Container self +---@return boolean true Whether the children are sorted +function Container:getChildrenSorted(self) end + +---Gets the value of the VisibleChildrenEvents property. +---@param self Container self +---@return table {} The visible children events of the container +function Container:getVisibleChildrenEvents(self) end + +---Creates a new DropDown element. +---@param self Container self +---@param props? table Optional: properties for the element. +---@return DropDown element A new DropDown element. +function Container:addDropDown(self, props) end + +function Container:drawText() end + +---Creates a new FlexBox element. +---@param self Container self +---@param props? table Optional: properties for the element. +---@return FlexBox element A new FlexBox element. +function Container:addFlexBox(self, props) end + +---Creates a new ComboBox element. +---@param self Container self +---@param props? table Optional: properties for the element. +---@return ComboBox element A new ComboBox element. +function Container:addComboBox(self, props) end + +---Unregisters the children events of the container +---@param child table The child to unregister events for +---@return Container self The container instance +function Container:removeChildrenEvents(child) end + +---Creates a new VisualElement element. +---@param self Container self +---@param props? table Optional: properties for the element. +---@return VisualElement element A new VisualElement element. +function Container:addVisualElement(self, props) end + +---Creates a new ScrollBar element. +---@param self Container self +---@param props? table Optional: properties for the element. +---@return ScrollBar element A new ScrollBar element. +function Container:addScrollBar(self, props) end + +---Creates a new Input element. +---@param self Container self +---@param props? table Optional: properties for the element. +---@return Input element A new Input element. +function Container:addInput(self, props) end + +---Gets the value of the OffsetY property. +---@param self Container self +---@return number 0 Vertical content offset +function Container:getOffsetY(self) end + +---Logs benchmark statistics for a container and all its children +---@param methodName string The method to log +---@return Container self The container instance +function Container:logContainerBenchmarks(methodName) end + +---Sets the value of the FocusedChild property. +---@param self Container self +---@param FocusedChild table The focused child of the container +function Container:setFocusedChild(self, FocusedChild) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param key number The key that was pressed +---@return boolean handled Whether the event was handled +---@protected +function Container:key(key) end + +---Gets the value of the FocusedChild property. +---@param self Container self +---@return table nil The focused child of the container +function Container:getFocusedChild(self) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@protected +function Container:render() end + +---Enables debugging for this container and all its children +---@param self Container The container to debug +---@param level number The debug level +function Container.debugChildren(self, level) end + +---Creates a new Image element. +---@param self Container self +---@param props? table Optional: properties for the element. +---@return Image element A new Image element. +function Container:addImage(self, props) end + +---Sets the value of the ChildrenSorted property. +---@param self Container self +---@param ChildrenSorted boolean Whether the children are sorted +function Container:setChildrenSorted(self, ChildrenSorted) end + +---Stops benchmarking for a container and all its children +---@param methodName string The method to stop benchmarking +---@return Container self The container instance +function Container:stopContainerBenchmark(methodName) end + +---Creates a new Container element. +---@param self Container self +---@param props? table Optional: properties for the element. +---@return Container element A new Container element. +function Container:addContainer(self, props) end + +---Gets the value of the Children property. +---@param self Container self +---@return table {} The children of the container +function Container:getChildren(self) end + +---Creates a new List element. +---@param self Container self +---@param props? table Optional: properties for the element. +---@return List element A new List element. +function Container:addList(self, props) end + +---Sets the value of the ChildrenEvents property. +---@param self Container self +---@param ChildrenEvents table The children events of the container +function Container:setChildrenEvents(self, ChildrenEvents) end + +---Creates a new Table element. +---@param self Container self +---@param props? table Optional: properties for the element. +---@return Table element A new Table element. +function Container:addTable(self, props) end + +---Creates a new Frame element. +---@param self Container self +---@param props? table Optional: properties for the element. +---@return Frame element A new Frame element. +function Container:addFrame(self, props) end + +---Creates a new BaseElement element. +---@param self Container self +---@param props? table Optional: properties for the element. +---@return BaseElement element A new BaseElement element. +function Container:addBaseElement(self, props) end + +---Sets the value of the OffsetX property. +---@param self Container self +---@param OffsetX number Horizontal content offset +function Container:setOffsetX(self, OffsetX) end + +---Creates a new BigFont element. +---@param self Container self +---@param props? table Optional: properties for the element. +---@return BigFont element A new BigFont element. +function Container:addBigFont(self, props) end + +---Creates a new Graph element. +---@param self Container self +---@param props? table Optional: properties for the element. +---@return Graph element A new Graph element. +function Container:addGraph(self, props) end + +---Creates a new Program element. +---@param self Container self +---@param props? table Optional: properties for the element. +---@return Program element A new Program element. +function Container:addProgram(self, props) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param event string The event to handle +---@return boolean handled Whether the event was handled +---@protected +function Container:handleEvent(event) end + +---@class AnimationInstance +local AnimationInstance = {} + +---Gets called when the animation is completed +function AnimationInstance:complete() end + +---Updates the animation +---@param elapsed number The elapsed time in seconds +---@return boolean Whether the animation is finished +function AnimationInstance:update(elapsed) end + +---Starts the animation +---@return AnimationInstance self The animation instance +function AnimationInstance:start() end + +---Creates a new AnimationInstance +---@param element VisualElement The element to animate +---@param animType string The type of animation +---@param args table The animation arguments +---@param duration number Duration in seconds +---@param easing string The easing function name +---@return AnimationInstance The new animation instance +function AnimationInstance.new(element, animType, args, duration, easing) end + +---@class Button : VisualElement +---@field text string Button text +local Button = {} + +---Gets the value of the Text property. +---@param self Button self +---@return string Button Button text +function Button:getText(self) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param props table The properties to initialize the element with +---@param basalt table The basalt instance +---@protected +function Button:init(props, basalt) end + +---Sets the value of the Text property. +---@param self Button self +---@param Text string Button text +function Button:setText(self, Text) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@protected +function Button:render() end ---@class ComboBox : DropDown ----@field placeholderColor color Color of the placeholder text ----@field editable boolean Whether the ComboBox allows text input ----@field focusedForeground color Foreground color when ComboBox is focused ----@field cursorPos number The current cursor position in the text ----@field manuallyOpened boolean Whether the dropdown was manually opened (not by auto-complete) +---@field viewOffset number The horizontal scroll offset for viewing long text ---@field focusedBackground color Background color when ComboBox is focused +---@field editable boolean Whether the ComboBox allows text input +---@field manuallyOpened boolean Whether the dropdown was manually opened (not by auto-complete) ---@field autoComplete boolean Whether to enable auto-complete filtering when typing ---@field placeholder string Text to display when input is empty +---@field cursorPos number The current cursor position in the text +---@field focusedForeground color Foreground color when ComboBox is focused ---@field text string The current text content of the ComboBox ----@field viewOffset number The horizontal scroll offset for viewing long text +---@field placeholderColor color Color of the placeholder text local ComboBox = {} ----Gets the current text content ----@return string text The current text -function ComboBox:getText() end - ----Sets whether the ComboBox is editable ----@param editable boolean Whether the ComboBox should be editable ----@return ComboBox self -function ComboBox:setEditable(editable) end - ----Gets the value of the FocusedBackground property. +---Gets the value of the Editable property. ---@param self ComboBox self ----@return color blue Background color when ComboBox is focused -function ComboBox:getFocusedBackground(self) end +---@return boolean true Whether the ComboBox allows text input +function ComboBox:getEditable(self) end + +---Sets the value of the ManuallyOpened property. +---@param self ComboBox self +---@param ManuallyOpened boolean Whether the dropdown was manually opened (not by auto-complete) +function ComboBox:setManuallyOpened(self, ManuallyOpened) end + +---Sets the value of the FocusedForeground property. +---@param self ComboBox self +---@param FocusedForeground color Foreground color when ComboBox is focused +function ComboBox:setFocusedForeground(self, FocusedForeground) end + +---Called when the ComboBox gains focus +function ComboBox:focus() end ---Called when the ComboBox loses focus function ComboBox:blur() end ----Gets the value of the ViewOffset property. +---Gets the value of the Placeholder property. ---@param self ComboBox self ----@return number 0 The horizontal scroll offset for viewing long text -function ComboBox:getViewOffset(self) end +---@return string "..." Text to display when input is empty +function ComboBox:getPlaceholder(self) end ---Renders the ComboBox function ComboBox:render() end @@ -396,33 +3006,45 @@ function ComboBox:mouse_click(button, x, y) end ---@return color gray Color of the placeholder text function ComboBox:getPlaceholderColor(self) end ----Sets the value of the FocusedBackground property. +---Gets the value of the CursorPos property. ---@param self ComboBox self ----@param FocusedBackground color Background color when ComboBox is focused -function ComboBox:setFocusedBackground(self, FocusedBackground) end +---@return number 1 The current cursor position in the text +function ComboBox:getCursorPos(self) end ----Sets the value of the Placeholder property. +---Gets the value of the FocusedBackground property. ---@param self ComboBox self ----@param Placeholder string Text to display when input is empty -function ComboBox:setPlaceholder(self, Placeholder) end - ----Called when the ComboBox gains focus -function ComboBox:focus() end - ----Creates a new ComboBox instance ----@return ComboBox self The newly created ComboBox instance -function ComboBox.new() end - ----Handles key input when editable ----@param key number The key code that was pressed ----@param held boolean Whether the key is being held -function ComboBox:key(key, held) end +---@return color blue Background color when ComboBox is focused +function ComboBox:getFocusedBackground(self) end ---Sets the value of the CursorPos property. ---@param self ComboBox self ---@param CursorPos number The current cursor position in the text function ComboBox:setCursorPos(self, CursorPos) end +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param props table The properties to initialize the element with +---@param basalt table The basalt instance +---@return ComboBox self The initialized instance +---@protected +function ComboBox:init(props, basalt) end + +---Gets the current text content +---@return string text The current text +function ComboBox:getText() end + +---Gets the value of the AutoComplete property. +---@param self ComboBox self +---@return boolean false Whether to enable auto-complete filtering when typing +function ComboBox:getAutoComplete(self) end + +---Handles character input when editable +---@param char string The character that was typed +function ComboBox:char(char) end + +---Creates a new ComboBox instance +---@return ComboBox self The newly created ComboBox instance +function ComboBox.new() end + ---Gets the value of the ManuallyOpened property. ---@param self ComboBox self ---@return boolean false Whether the dropdown was manually opened (not by auto-complete) @@ -433,3738 +3055,82 @@ function ComboBox:getManuallyOpened(self) end ---@param AutoComplete boolean Whether to enable auto-complete filtering when typing function ComboBox:setAutoComplete(self, AutoComplete) end ----Gets the value of the AutoComplete property. +---Handles key input when editable +---@param key number The key code that was pressed +---@param held boolean Whether the key is being held +function ComboBox:key(key, held) end + +---Sets the value of the Placeholder property. ---@param self ComboBox self ----@return boolean false Whether to enable auto-complete filtering when typing -function ComboBox:getAutoComplete(self) end +---@param Placeholder string Text to display when input is empty +function ComboBox:setPlaceholder(self, Placeholder) end ----Sets the value of the FocusedForeground property. +---Sets the value of the FocusedBackground property. ---@param self ComboBox self ----@param FocusedForeground color Foreground color when ComboBox is focused -function ComboBox:setFocusedForeground(self, FocusedForeground) end - ----Sets the value of the PlaceholderColor property. ----@param self ComboBox self ----@param PlaceholderColor color Color of the placeholder text -function ComboBox:setPlaceholderColor(self, PlaceholderColor) end - ----Handles character input when editable ----@param char string The character that was typed -function ComboBox:char(char) end - ----Gets the value of the CursorPos property. ----@param self ComboBox self ----@return number 1 The current cursor position in the text -function ComboBox:getCursorPos(self) end - ----Gets the value of the Placeholder property. ----@param self ComboBox self ----@return string "..." Text to display when input is empty -function ComboBox:getPlaceholder(self) end - ----Sets the value of the ManuallyOpened property. ----@param self ComboBox self ----@param ManuallyOpened boolean Whether the dropdown was manually opened (not by auto-complete) -function ComboBox:setManuallyOpened(self, ManuallyOpened) end - ----Gets the value of the Editable property. ----@param self ComboBox self ----@return boolean true Whether the ComboBox allows text input -function ComboBox:getEditable(self) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param props table The properties to initialize the element with ----@param basalt table The basalt instance ----@return ComboBox self The initialized instance ----@protected -function ComboBox:init(props, basalt) end - ----Gets the value of the FocusedForeground property. ----@param self ComboBox self ----@return color white Foreground color when ComboBox is focused -function ComboBox:getFocusedForeground(self) end - ----Sets the value of the ViewOffset property. ----@param self ComboBox self ----@param ViewOffset number The horizontal scroll offset for viewing long text -function ComboBox:setViewOffset(self, ViewOffset) end +---@param FocusedBackground color Background color when ComboBox is focused +function ComboBox:setFocusedBackground(self, FocusedBackground) end ---Sets the text content of the ComboBox ---@param text string The text to set ---@return ComboBox self function ComboBox:setText(text) end ----@class Container : VisualElement ----@field eventListenerCount table The event listener count of the container ----@field childrenEventsSorted boolean Whether the children events are sorted ----@field offsetX number Horizontal content offset ----@field offsetY number Vertical content offset ----@field children table The children of the container ----@field childrenEvents table The children events of the container ----@field visibleChildrenEvents table The visible children events of the container ----@field childrenSorted boolean Whether the children are sorted ----@field focusedChild table The focused child of the container ----@field visibleChildren table The visible children of the container -local Container = {} - ----Creates a new VisualElement element. ----@param self Container self ----@param props? table Optional: properties for the element. ----@return VisualElement element A new VisualElement element. -function Container:addVisualElement(self, props) end - ----Sets the value of the VisibleChildrenEvents property. ----@param self Container self ----@param VisibleChildrenEvents table The visible children events of the container -function Container:setVisibleChildrenEvents(self, VisibleChildrenEvents) end - ----Creates a new List element. ----@param self Container self ----@param props? table Optional: properties for the element. ----@return List element A new List element. -function Container:addList(self, props) end - ----Creates a new Tree element. ----@param self Container self ----@param props? table Optional: properties for the element. ----@return Tree element A new Tree element. -function Container:addTree(self, props) end - ----Creates a new Image element. ----@param self Container self ----@param props? table Optional: properties for the element. ----@return Image element A new Image element. -function Container:addImage(self, props) end - ----Creates a new Program element. ----@param self Container self ----@param props? table Optional: properties for the element. ----@return Program element A new Program element. -function Container:addProgram(self, props) end - ----Enables debugging for this container and all its children ----@param self Container The container to debug ----@param level number The debug level -function Container.debugChildren(self, level) end - ----Creates a new Container element. ----@param self Container self ----@param props? table Optional: properties for the element. ----@return Container element A new Container element. -function Container:addContainer(self, props) end - ----Sets the value of the Children property. ----@param self Container self ----@param Children table The children of the container -function Container:setChildren(self, Children) end - ----Sets the value of the EventListenerCount property. ----@param self Container self ----@param EventListenerCount table The event listener count of the container -function Container:setEventListenerCount(self, EventListenerCount) end - ----Sets the value of the OffsetX property. ----@param self Container self ----@param OffsetX number Horizontal content offset -function Container:setOffsetX(self, OffsetX) end - ----Calls a event on all children ----@param visibleOnly boolean Whether to only call the event on visible children ----@param event string The event to call ----@return boolean handled Whether the event was handled ----@return table ? child The child that handled the event -function Container:callChildrenEvent(visibleOnly, event) end - ----Creates a new Timer element. ----@param self Container self ----@param props? table Optional: properties for the element. ----@return Timer element A new Timer element. -function Container:addTimer(self, props) end - -function Container:drawFg() end - ----Adds a child to the container ----@param child table The child to add ----@return Container self The container instance -function Container:addChild(child) end - ----Creates a new Input element. ----@param self Container self ----@param props? table Optional: properties for the element. ----@return Input element A new Input element. -function Container:addInput(self, props) end - ----Creates a new BarChart element. ----@param self Container self ----@param props? table Optional: properties for the element. ----@return BarChart element A new BarChart element. -function Container:addBarChart(self, props) end - ----Creates a new BaseElement element. ----@param self Container self ----@param props? table Optional: properties for the element. ----@return BaseElement element A new BaseElement element. -function Container:addBaseElement(self, props) end - ----Creates a new BigFont element. ----@param self Container self ----@param props? table Optional: properties for the element. ----@return BigFont element A new BigFont element. -function Container:addBigFont(self, props) end - ----Creates a new Switch element. ----@param self Container self ----@param props? table Optional: properties for the element. ----@return Switch element A new Switch element. -function Container:addSwitch(self, props) end - ----Creates a new ComboBox element. ----@param self Container self ----@param props? table Optional: properties for the element. ----@return ComboBox element A new ComboBox element. -function Container:addComboBox(self, props) end - -function Container:drawText() end - ----Gets the value of the EventListenerCount property. ----@param self Container self ----@return table {} The event listener count of the container -function Container:getEventListenerCount(self) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param button number The button that was clicked ----@param x number The x position of the click ----@param y number The y position of the click ----@protected -function Container:mouse_release(button, x, y) end - ----Gets the value of the ChildrenEvents property. ----@param self Container self ----@return table {} The children events of the container -function Container:getChildrenEvents(self) end - ----Returns whether a child is visible ----@param child table The child to check ----@return boolean boolean the child is visible -function Container:isChildVisible(child) end - ----Creates a new FlexBox element. ----@param self Container self ----@param props? table Optional: properties for the element. ----@return FlexBox element A new FlexBox element. -function Container:addFlexBox(self, props) end - ----Registers the children events of the container ----@param child table The child to register events for ----@return Container self The container instance -function Container:registerChildrenEvents(child) end - ----Creates a new Button element. ----@param self Container self ----@param props? table Optional: properties for the element. ----@return Button element A new Button element. -function Container:addButton(self, props) end - ----Creates a new Graph element. ----@param self Container self ----@param props? table Optional: properties for the element. ----@return Graph element A new Graph element. -function Container:addGraph(self, props) end - ----Creates a new DropDown element. ----@param self Container self ----@param props? table Optional: properties for the element. ----@return DropDown element A new DropDown element. -function Container:addDropDown(self, props) end - ----Creates a new TabControl element. ----@param self Container self ----@param props? table Optional: properties for the element. ----@return TabControl element A new TabControl element. -function Container:addTabControl(self, props) end - ----Sets the value of the OffsetY property. ----@param self Container self ----@param OffsetY number Vertical content offset -function Container:setOffsetY(self, OffsetY) end - ----Gets the value of the ChildrenEventsSorted property. ----@param self Container self ----@return boolean true Whether the children events are sorted -function Container:getChildrenEventsSorted(self) end - ----Sorts the children of the container ----@return Container self The container instance -function Container:sortChildren() end - ----Gets the value of the FocusedChild property. ----@param self Container self ----@return table nil The focused child of the container -function Container:getFocusedChild(self) end - ----Sets the value of the ChildrenSorted property. ----@param self Container self ----@param ChildrenSorted boolean Whether the children are sorted -function Container:setChildrenSorted(self, ChildrenSorted) end - ----Sets the value of the VisibleChildren property. ----@param self Container self ----@param VisibleChildren table The visible children of the container -function Container:setVisibleChildren(self, VisibleChildren) end - ----Registers the children events of the container ----@param child table The child to register events for ----@param eventName string The event name to register ----@return Container self The container instance -function Container:registerChildEvent(child, eventName) end - -function Container:drawBg() end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param x number The x position to draw the text ----@param y number The y position to draw the text ----@param text string The text to draw ----@param bg color The background color of the text ----@return Container self The container instance ----@protected -function Container:textBg(x, y, text, bg) end - ----Gets the value of the OffsetX property. ----@param self Container self ----@return number 0 Horizontal content offset -function Container:getOffsetX(self) end - ----Sorts the children events of the container ----@param eventName string The event name to sort ----@return Container self The container instance -function Container:sortChildrenEvents(eventName) end - ----Unregisters the children events of the container ----@param child table The child to unregister events for ----@return Container self The container instance -function Container:removeChildrenEvents(child) end - ----Sets the value of the ChildrenEvents property. ----@param self Container self ----@param ChildrenEvents table The children events of the container -function Container:setChildrenEvents(self, ChildrenEvents) end - ----Creates a new Display element. ----@param self Container self ----@param props? table Optional: properties for the element. ----@return Display element A new Display element. -function Container:addDisplay(self, props) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param props table The properties to initialize the element with ----@param basalt table The basalt instance ----@protected -function Container:init(props, basalt) end - ----Creates a new Slider element. ----@param self Container self ----@param props? table Optional: properties for the element. ----@return Slider element A new Slider element. -function Container:addSlider(self, props) end - ----Clears the container ----@return Container self The container instance -function Container:clear() end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param button number The button that was clicked ----@param x number The x position of the click ----@param y number The y position of the click ----@return boolean handled Whether the event was handled ----@protected -function Container:mouse_drag(button, x, y) end - ----Removes a child from the container ----@param path string The path to the child to remove ----@return Container ? self The container instance -function Container:getChild(path) end - ----Gets the value of the VisibleChildrenEvents property. ----@param self Container self ----@return table {} The visible children events of the container -function Container:getVisibleChildrenEvents(self) end - ----Logs benchmark statistics for a container and all its children ----@param methodName string The method to log ----@return Container self The container instance -function Container:logContainerBenchmarks(methodName) end - ----Creates a new Table element. ----@param self Container self ----@param props? table Optional: properties for the element. ----@return Table element A new Table element. -function Container:addTable(self, props) end - ----Gets the value of the ChildrenSorted property. ----@param self Container self ----@return boolean true Whether the children are sorted -function Container:getChildrenSorted(self) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param button number The button that was clicked ----@param x number The x position of the click ----@param y number The y position of the click ----@return boolean handled Whether the event was handled ----@protected -function Container:mouse_up(button, x, y) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param x number The x position to draw the text ----@param y number The y position to draw the text ----@param text string The text to draw ----@param fg color The foreground color of the text ----@return Container self The container instance ----@protected -function Container:textFg(x, y, text, fg) end - ----Gets the value of the OffsetY property. ----@param self Container self ----@return number 0 Vertical content offset -function Container:getOffsetY(self) end - ----Gets the value of the VisibleChildren property. ----@param self Container self ----@return table {} The visible children of the container -function Container:getVisibleChildren(self) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param button number The button that was clicked ----@param x number The x position of the click ----@param y number The y position of the click ----@return boolean handled Whether the event was handled ----@protected -function Container:mouse_click(button, x, y) end - ----Enables benchmarking for a container and all its children ----@param methodName string The method to benchmark ----@return Container self The container instance -function Container:benchmarkContainer(methodName) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param key number The key that was released ----@return boolean handled Whether the event was handled ----@protected -function Container:key_up(key) end - ----Creates a new Menu element. ----@param self Container self ----@param props? table Optional: properties for the element. ----@return Menu element A new Menu element. -function Container:addMenu(self, props) end - ----Creates a new BaseFrame element. ----@param self Container self ----@param props? table Optional: properties for the element. ----@return BaseFrame element A new BaseFrame element. -function Container:addBaseFrame(self, props) end - ----Gets the value of the Children property. ----@param self Container self ----@return table {} The children of the container -function Container:getChildren(self) end - ----Sets the value of the FocusedChild property. ----@param self Container self ----@param FocusedChild table The focused child of the container -function Container:setFocusedChild(self, FocusedChild) end - ----Removes a child from the container ----@param child table The child to remove ----@return Container self The container instance -function Container:removeChild(child) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param direction number The direction of the scroll ----@param x number The x position of the click ----@param y number The y position of the click ----@return boolean handled Whether the event was handled ----@protected -function Container:mouse_scroll(direction, x, y) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param _ number unknown ----@param x number The x position of the click ----@param y number The y position of the click ----@return boolean handled Whether the event was handled ----@protected -function Container:mouse_move(_, x, y) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param x number The x position to draw the text ----@param y number The y position to draw the text ----@param width number The width of the text ----@param height number The height of the text ----@param text string The text to draw ----@param fg string The foreground color of the text ----@param bg string The background color of the text ----@return Container self The container instance ----@protected -function Container:multiBlit(x, y, width, height, text, fg, bg) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@protected -function Container:render() end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param key number The key that was pressed ----@return boolean handled Whether the event was handled ----@protected -function Container:key(key) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param char string The character that was pressed ----@return boolean handled Whether the event was handled ----@protected -function Container:char(char) end - ----Creates a new ScrollBar element. ----@param self Container self ----@param props? table Optional: properties for the element. ----@return ScrollBar element A new ScrollBar element. -function Container:addScrollBar(self, props) end - ----Creates a new CheckBox element. ----@param self Container self ----@param props? table Optional: properties for the element. ----@return CheckBox element A new CheckBox element. -function Container:addCheckBox(self, props) end - ----Creates a new Label element. ----@param self Container self ----@param props? table Optional: properties for the element. ----@return Label element A new Label element. -function Container:addLabel(self, props) end - ----Stops benchmarking for a container and all its children ----@param methodName string The method to stop benchmarking ----@return Container self The container instance -function Container:stopContainerBenchmark(methodName) end - ----Creates a new LineChart element. ----@param self Container self ----@param props? table Optional: properties for the element. ----@return LineChart element A new LineChart element. -function Container:addLineChart(self, props) end - ----Creates a new Frame element. ----@param self Container self ----@param props? table Optional: properties for the element. ----@return Frame element A new Frame element. -function Container:addFrame(self, props) end - ----Unregisters the children events of the container ----@param child table The child to unregister events for ----@param eventName string The event name to unregister ----@return Container self The container instance -function Container:unregisterChildEvent(child, eventName) end - ----Creates a new ProgressBar element. ----@param self Container self ----@param props? table Optional: properties for the element. ----@return ProgressBar element A new ProgressBar element. -function Container:addProgressBar(self, props) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param event string The event to handle ----@return boolean handled Whether the event was handled ----@protected -function Container:handleEvent(event) end - ----Sets the value of the ChildrenEventsSorted property. ----@param self Container self ----@param ChildrenEventsSorted boolean Whether the children events are sorted -function Container:setChildrenEventsSorted(self, ChildrenEventsSorted) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param x number The x position to draw the text ----@param y number The y position to draw the text ----@param text string The text to draw ----@param fg string The foreground color of the text ----@param bg string The background color of the text ----@return Container self The container instance ----@protected -function Container:blit(x, y, text, fg, bg) end - ----Creates a new TextBox element. ----@param self Container self ----@param props? table Optional: properties for the element. ----@return TextBox element A new TextBox element. -function Container:addTextBox(self, props) end - ----@class Program : VisualElement ----@field errorCallback function The error callback function ----@field path string The path to the program ----@field running boolean Whether the program is running ----@field program table The program instance ----@field doneCallback function The done callback function -local Program = {} - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param props table The properties to initialize the element with ----@param basalt table The basalt instance ----@return Program self The initialized instance ----@protected -function Program:init(props, basalt) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@protected -function Program:focus() end - ----Sets the value of the ErrorCallback property. ----@param self Program self ----@param ErrorCallback function The error callback function -function Program:setErrorCallback(self, ErrorCallback) end - ----Stops the program ----@return Program self The Program instance -function Program:stop() end - -function BasaltProgram:setArgs() end - ----Sets the value of the Program property. ----@param self Program self ----@param Program table The program instance -function Program:setProgram(self, Program) end - ----Gets the value of the Program property. ----@param self Program self ----@return table nil The program instance -function Program:getProgram(self) end - ----Executes a program ----@param path string The path to the program ----@return Program self The Program instance -function Program:execute(path) end - ----Sends an event to the program ----@param event string The event to send ----@return Program self The Program instance -function Program:sendEvent(event) end - ----Gets the value of the Running property. ----@param self Program self ----@return boolean false Whether the program is running -function Program:getRunning(self) end - ----Gets the value of the DoneCallback property. ----@param self Program self ----@return function nil The done callback function -function Program:getDoneCallback(self) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@protected -function Program:render() end - ----Gets the value of the ErrorCallback property. ----@param self Program self ----@return function nil The error callback function -function Program:getErrorCallback(self) end - ----Registers a callback for the program's error event, if the function returns false, the program won't stop ----@param fn function The callback function to register ----@return Program self The Program instance -function Program:onError(fn) end - ----Sets the value of the Running property. ----@param self Program self ----@param Running boolean Whether the program is running -function Program:setRunning(self, Running) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param event string The event to handle ----@return any result The event result ----@protected -function Program:dispatchEvent(event) end - ----Registers a callback for the program's done event ----@param fn function The callback function to register ----@return Program self The Program instance -function Program:onDone(fn) end - ----Gets the value of the Path property. ----@param self Program self ----@return string "" The path to the program -function Program:getPath(self) end - ----Sets the value of the Path property. ----@param self Program self ----@param Path string The path to the program -function Program:setPath(self, Path) end - ----Sets the value of the DoneCallback property. ----@param self Program self ----@param DoneCallback function The done callback function -function Program:setDoneCallback(self, DoneCallback) end - ----@class BaseElement : PropertySystem ----@field id string The unique identifier for the element ----@field eventCallbacks table The event callbacks for the element ----@field name string The name of the element ----@field enabled boolean Whether the element is enabled or not ----@field type string The type identifier of the element -local BaseElement = {} - -function BaseElement:computed() end - ----Binds a property to a state ----@param self BaseElement The element to bind ----@param propertyName string The property to bind ----@param stateName string The state to bind to (optional, uses propertyName if not provided) ----@return BaseElement self The element instance -function BaseElement:bind(self, propertyName, stateName) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param event string The event to handle ----@return boolean ? handled Whether the event was handled ----@protected -function BaseElement:handleEvent(event) end - ----Gets benchmark statistics for a method ----@param methodName string The name of the method to get statistics for ----@return table ? stats The benchmark statistics or nil -function BaseElement:getBenchmarkStats(methodName) end - ----Gets the value of the Enabled property. ----@param self BaseElement self ----@return boolean BaseElement Whether the element is enabled or not -function BaseElement:getEnabled(self) end - ----Registers a callback function for an event ----@param event string The event to register the callback for ----@param callback function The callback function to register ----@return table self The BaseElement instance -function BaseElement:registerCallback(event, callback) end - ----Registers a new event listener for the element (on class level) ----@param class table The class to register ----@param eventName string The name of the event to register -function BaseElement.defineEvent(class, eventName) end - ----Applies the current theme to this element ----@param self BaseElement The element to apply theme to ----@param applyToChildren boolean ? Whether to apply theme to child elements (default: true) ----@return BaseElement self The element instance -function BaseElement:applyTheme(self, applyToChildren) end - ----Registers a callback for state changes ----@param self BaseElement The element to watch ----@param stateName string The state to watch ----@param callback function Called with (element, newValue, oldValue) ----@return BaseElement self The element instance -function BaseElement:onStateChange(self, stateName, callback) end - ----Logs benchmark statistics for a method ----@param methodName string The name of the method to log ----@return BaseElement self The element instance -function BaseElement:logBenchmark(methodName) end - ----Sets the value of the Type property. ----@param self BaseElement self ----@param Type string The type identifier of the element -function BaseElement:setType(self, Type) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param props table The properties to initialize the element with ----@param basalt table The basalt instance ----@return table self The initialized instance ----@protected -function BaseElement:init(props, basalt) end - ----Triggers an event and calls all registered callbacks ----@param event string The event to fire ----@return table self The BaseElement instance -function BaseElement:fireEvent(event) end - ----Observes a property and calls a callback when it changes ----@param property string The property to observe ----@param callback function The callback to call when the property changes ----@return table self The BaseElement instance -function BaseElement:onChange(property, callback) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@return table self The BaseElement instance ----@protected -function BaseElement:postInit() end - ----Gets the theme properties for this element ----@param self BaseElement The element to get theme for ----@return table styles The theme properties -function BaseElement:getTheme(self) end - ----Gets the value of the Name property. ----@param self BaseElement self ----@return string BaseElement The name of the element -function BaseElement:getName(self) end - ----Gets the value of a state ----@param self BaseElement The element to get state from ----@param name string The name of the state ----@return any value The current state value -function BaseElement:getState(self, name) end - ----Sets the value of the Enabled property. ----@param self BaseElement self ----@param Enabled boolean Whether the element is enabled or not -function BaseElement:setEnabled(self, Enabled) end - ----Stops benchmarking for a method ----@param methodName string The name of the method to stop benchmarking ----@return BaseElement self The element instance -function BaseElement:stopBenchmark(methodName) end - ----Requests a render update for this element ----@return table self The BaseElement instance -function BaseElement:updateRender() end - ----Gets the value of the Type property. ----@param self BaseElement self ----@return string BaseElement The type identifier of the element -function BaseElement:getType(self) end - ----Ends profiling a method ----@param methodName string The name of the method to stop profiling ----@return BaseElement self The element instance -function BaseElement:endProfile(methodName) end - ----Registers a new event callback for the element (on class level) ----@param class table The class to register ----@param callbackName string The name of the callback to register -function BaseElement.registerEventCallback(class, callbackName) end - ----Gets the value of the Id property. ----@param self BaseElement self ----@return string BaseElement The unique identifier for the element -function BaseElement:getId(self) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param event string The event to handle ----@return boolean ? handled Whether the event was handled ----@protected -function BaseElement:dispatchEvent(event) end - ----Returns the base frame of the element ----@return BaseFrame BaseFrame The base frame of the element -function BaseElement:getBaseFrame() end - ----Sets the value of the Id property. ----@param self BaseElement self ----@param Id string The unique identifier for the element -function BaseElement:setId(self, Id) end - ----Enables benchmarking for a method ----@param methodName string The name of the method to benchmark ----@return BaseElement self The element instance -function BaseElement:benchmark(methodName) end - ----Sets the value of the Name property. ----@param self BaseElement self ----@param Name string The name of the element -function BaseElement:setName(self, Name) end - ----Gets the value of the EventCallbacks property. ----@param self BaseElement self ----@return table BaseElement The event callbacks for the element -function BaseElement:getEventCallbacks(self) end - ----Destroys the element and cleans up all references -function BaseElement:destroy() end - ----Enables debugging for this element ----@param self BaseElement The element to debug ----@param level number The debug level -function BaseElement.debug(self, level) end - ----Sets the value of the EventCallbacks property. ----@param self BaseElement self ----@param EventCallbacks table The event callbacks for the element -function BaseElement:setEventCallbacks(self, EventCallbacks) end - ----Enables or disables event listening for a specific event ----@param eventName string The name of the event to listen for ----@return table self The BaseElement instance -function BaseElement:listenEvent(eventName) end - ----Starts profiling a method ----@param methodName string The name of the method to profile ----@return BaseElement self The element instance -function BaseElement:startProfile(methodName) end - ----Checks if the element is a specific type ----@param type string The type to check for ----@return boolean isType Whether the element is of the specified type -function BaseElement:isType(type) end - ----Dumps debug information for this element ----@param self BaseElement The element to dump debug info for -function BaseElement.dumpDebug(self) end - ----Sets the value of a state ----@param self BaseElement The element to set state for ----@param name string The name of the state ----@param value any The new value for the state ----@return BaseElement self The element instance -function BaseElement:setState(self, name, value) end - ----Removes a state change observer ----@param self BaseElement The element to remove observer from ----@param stateName string The state to remove observer from ----@param callback function The callback function to remove ----@return BaseElement self The element instance -function BaseElement:removeStateChange(self, stateName, callback) end - ----@class ThemeAPI -local ThemeAPI = {} - ----Loads a theme from a JSON file ----@param path string Path to the theme JSON file -function ThemeAPI.loadTheme(path) end - ----Gets the current theme configuration ----@return table theme The current theme configuration -function ThemeAPI.getTheme() end - ----Sets the current theme ----@param newTheme table The theme configuration to set -function ThemeAPI.setTheme(newTheme) end - ----@class ErrorHandler -local ErrorHandler = {} - ----Handles an error ----@param errMsg string The error message -function errorHandler.error(errMsg) end - ----@class BarChart : Graph -local BarChart = {} - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param props table The properties to initialize the element with ----@param basalt table The basalt instance ----@return BarChart self The initialized instance ----@protected -function BarChart:init(props, basalt) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@protected -function BarChart:render() end - ----@class BigFont : VisualElement ----@field text string BigFont text ----@field fontSize number The font size of the BigFont -local BigFont = {} - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@protected -function BigFont:render() end - ----Gets the value of the FontSize property. ----@param self BigFont self ----@return number 1 The font size of the BigFont -function BigFont:getFontSize(self) end - ----Sets the value of the FontSize property. ----@param self BigFont self ----@param FontSize number The font size of the BigFont -function BigFont:setFontSize(self, FontSize) end - ----Gets the value of the Text property. ----@param self BigFont self ----@return string BigFont BigFont text -function BigFont:getText(self) end - ----Sets the value of the Text property. ----@param self BigFont self ----@param Text string BigFont text -function BigFont:setText(self, Text) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param props table The properties to initialize the element with ----@param basalt table The basalt instance ----@protected -function BigFont:init(props, basalt) end - ----@class PropertySystem -local PropertySystem = {} - ----Gets a property configuration ----@param name string The name of the property ----@return table config The configuration of the property -function PropertySystem:getPropertyConfig(name) end - ----Adds a setter hook to the PropertySystem. Setter hooks are functions that are called before a property is set. ----@param hook function The hook function to add -function PropertySystem.addSetterHook(hook) end - ----Defines a property for an element class ----@param class table The element class to define the property for ----@param name string The name of the property ----@param config table The configuration of the property -function PropertySystem.defineProperty(class, name, config) end - ----Removes all observers from a property ----@return table self The PropertySystem -function PropertySystem:removeAllObservers() end - ----Update call for a property IS USED INTERNALLY ----@param name string The name of the property ----@param value any The value of the property ----@return table self The PropertySystem -function PropertySystem:_updateProperty(name, value) end - ----Combines multiple properties into a single getter and setter ----@param class table The element class to combine the properties for ----@param name string The name of the combined property -function PropertySystem.combineProperties(class, name) end - ----Removes an observer from a property ----@param name string The name of the property ----@param callback function The callback function to remove ----@return table self The PropertySystem -function PropertySystem:removeObserver(name, callback) end - ----Observers a property ----@param name string The name of the property ----@param callback function The callback function to call when the property changes ----@return table self The PropertySystem -function PropertySystem:observe(name, callback) end - ----Creates an element from a blueprint ----@param elementClass table The element class to create from the blueprint ----@param blueprint table The blueprint to create the element from ----@return table element The created element -function PropertySystem.createFromBlueprint(elementClass, blueprint) end - ----Creates a blueprint of an element class with all its properties ----@param elementClass table The element class to create a blueprint from ----@return table blueprint A table containing all property definitions -function PropertySystem.blueprint(elementClass) end - ----Removes a property from the PropertySystem on instance level ----@param name string The name of the property ----@return table self The PropertySystem -function PropertySystem:removeProperty(name) end - ----Initializes the PropertySystem IS USED INTERNALLY ----@return table self The PropertySystem -function PropertySystem:__init() end - ----Adds a property to the PropertySystem on instance level ----@param name string The name of the property ----@param config table The configuration of the property ----@return table self The PropertySystem -function PropertySystem:instanceProperty(name, config) end - ----@class Menu : List ----@field separatorColor color The color used for separator items in the menu -local Menu = {} - ----Sets the value of the SeparatorColor property. ----@param self Menu self ----@param SeparatorColor color The color used for separator items in the menu -function Menu:setSeparatorColor(self, SeparatorColor) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param props table The properties to initialize the element with ----@param basalt table The basalt instance ----@return Menu self The initialized instance ----@protected -function Menu:init(props, basalt) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@protected -function Menu:render() end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param button number The button that was clicked ----@param x number The x position of the click ----@param y number The y position of the click ----@return boolean Whether the event was handled ----@protected -function Menu:mouse_click(button, x, y) end - ----Sets the menu items ----@param items table [] List of items with {text, separator, callback, foreground, background} properties ----@return Menu self The Menu instance -function Menu:setItems(items) end - ----Gets the value of the SeparatorColor property. ----@param self Menu self ----@return color gray The color used for separator items in the menu -function Menu:getSeparatorColor(self) end - ----@class Label : VisualElement ----@field text string The text content to display. Can be a string or a function that returns a string ----@field autoSize boolean Whether the label should automatically resize its width based on the text content -local Label = {} - ----Sets the value of the AutoSize property. ----@param self Label self ----@param AutoSize boolean Whether the label should automatically resize its width based on the text content -function Label:setAutoSize(self, AutoSize) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@protected -function Label:render() end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param props table The properties to initialize the element with ----@param basalt table The basalt instance ----@return Label self The initialized instance ----@protected -function Label:init(props, basalt) end - ----Sets the value of the Text property. ----@param self Label self ----@param Text string The text content to display. Can be a string or a function that returns a string -function Label:setText(self, Text) end - ----Gets the wrapped lines of the Label ----@return table wrappedText The wrapped lines of the Label -function Label:getWrappedText() end - ----Gets the value of the AutoSize property. ----@param self Label self ----@return boolean true Whether the label should automatically resize its width based on the text content -function Label:getAutoSize(self) end - ----Gets the value of the Text property. ----@param self Label self ----@return string Label The text content to display. Can be a string or a function that returns a string -function Label:getText(self) end - ----@class basalt -local basalt = {} - ----Starts the Basalt runtime -function basalt.run() end - ----Returns the focused frame ----@return BaseFrame ? BaseFrame The focused frame -function basalt.getFocus() end - ----Runs basalt once, can be used to update the UI manually, but you have to feed it the events -function basalt.update() end - ----Stops the Basalt runtime -function basalt.stop() end - ----Sets the active frame ----@param frame BaseFrame The frame to set as active -function basalt.setActiveFrame(frame) end - ----Gets or creates the main frame ----@return BaseFrame BaseFrame The main frame instance -function basalt.getMainFrame() end - ----Returns the element manager instance ----@return table ElementManager The element manager -function basalt.getElementManager() end - ----Returns the error manager instance ----@return table ErrorManager The error manager -function basalt.getErrorManager() end - ----Creates and returns a new UI element of the specified type. ----@param type string The type of element to create (e.g. "Button", "Label", "BaseFrame") ----@return table element The created element instance -function basalt.create(type) end - ----Removes a scheduled update ----@param func thread The scheduled function to remove ----@return boolean success Whether the scheduled function was removed -function basalt.removeSchedule(func) end - ----Returns the active frame ----@return BaseFrame ? BaseFrame The frame to set as active -function basalt.getActiveFrame() end - ----Returns an element's class without creating a instance ----@param name string The name of the element ----@return table Element The element class -function basalt.getElementClass(name) end - ----Registers a callback function for a specific event ----@param eventName string The name of the event to listen for (e.g. "mouse_click", "key", "timer") ----@param callback function The callback function to execute when the event occurs -function basalt.onEvent(eventName, callback) end - ----Sets a frame as focused ----@param frame BaseFrame The frame to set as focused -function basalt.setFocus(frame) end - ----Triggers a custom event and calls all registered callbacks ----@param eventName string The name of the event to trigger -function basalt.triggerEvent(eventName) end - ----Removes a callback function for a specific event ----@param eventName string The name of the event ----@param callback function The callback function to remove ----@return boolean success Whether the callback was found and removed -function basalt.removeEvent(eventName, callback) end - ----Returns a Plugin API ----@param name string The name of the plugin ----@return table Plugin The plugin API -function basalt.getAPI(name) end - ----Creates and returns a new BaseFrame ----@return BaseFrame BaseFrame The created frame instance -function basalt.createFrame() end - ----Schedules a function to run in a coroutine ----@param func function The function to schedule ----@return thread func The scheduled function -function basalt.schedule(func) end - ----@class BigFontText -local BigFontText = {} - ----@class Frame : Container ----@field draggingMap table The map of dragging positions ----@field draggable boolean Whether the frame is draggable ----@field scrollable boolean Whether the frame is scrollable -local Frame = {} - ----Gets the value of the Scrollable property. ----@param self Frame self ----@return boolean false Whether the frame is scrollable -function Frame:getScrollable(self) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param button number The button that was released ----@param x number The x position of the release ----@param y number The y position of the release ----@return boolean handled Whether the event was handled ----@protected -function Frame:mouse_up(button, x, y) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param button number The button that was clicked ----@param x number The x position of the click ----@param y number The y position of the click ----@return boolean handled Whether the event was handled ----@protected -function Frame:mouse_click(button, x, y) end - ----Gets the value of the Draggable property. ----@param self Frame self ----@return boolean false Whether the frame is draggable -function Frame:getDraggable(self) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param direction number The scroll direction ----@param x number The x position of the scroll ----@param y number The y position of the scroll ----@return boolean handled Whether the event was handled ----@protected -function Frame:mouse_scroll(direction, x, y) end - ----Sets the value of the DraggingMap property. ----@param self Frame self ----@param DraggingMap table The map of dragging positions -function Frame:setDraggingMap(self, DraggingMap) end - ----Sets the value of the Draggable property. ----@param self Frame self ----@param Draggable boolean Whether the frame is draggable -function Frame:setDraggable(self, Draggable) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@return number height The total height needed for all children ----@protected -function Frame:getChildrenHeight() end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param button number The button that was clicked ----@param x number The x position of the drag position ----@param y number The y position of the drag position ----@return boolean handled Whether the event was handled ----@protected -function Frame:mouse_drag(button, x, y) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param props table The properties to initialize the element with ----@param basalt table The basalt instance ----@return Frame self The initialized instance ----@protected -function Frame:init(props, basalt) end - ----Sets the value of the Scrollable property. ----@param self Frame self ----@param Scrollable boolean Whether the frame is scrollable -function Frame:setScrollable(self, Scrollable) end - ----Gets the value of the DraggingMap property. ----@param self Frame self ----@return table {} The map of dragging positions -function Frame:getDraggingMap(self) end - ----@class ProgressBar : VisualElement ----@field direction string The direction of the progress bar ("up", "down", "left", "right") ----@field progressColor color The color used for the filled portion of the progress bar ----@field progress number Current progress value (0-100) ----@field showPercentage boolean Whether to show the percentage text in the center -local ProgressBar = {} - ----Gets the value of the ShowPercentage property. ----@param self ProgressBar self ----@return boolean false Whether to show the percentage text in the center -function ProgressBar:getShowPercentage(self) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param props table The properties to initialize the element with ----@param basalt table The basalt instance ----@return ProgressBar self The initialized instance ----@protected -function ProgressBar:init(props, basalt) end - ----Gets the value of the Progress property. ----@param self ProgressBar self ----@return number 0 Current progress value (0-100) -function ProgressBar:getProgress(self) end - ----Sets the value of the ShowPercentage property. ----@param self ProgressBar self ----@param ShowPercentage boolean Whether to show the percentage text in the center -function ProgressBar:setShowPercentage(self, ShowPercentage) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@protected -function ProgressBar:render() end - ----Sets the value of the Progress property. ----@param self ProgressBar self ----@param Progress number Current progress value (0-100) -function ProgressBar:setProgress(self, Progress) end - ----Gets the value of the ProgressColor property. ----@param self ProgressBar self ----@return color lime The color used for the filled portion of the progress bar -function ProgressBar:getProgressColor(self) end - ----Sets the value of the Direction property. ----@param self ProgressBar self ----@param Direction string The direction of the progress bar ("up", "down", "left", "right") -function ProgressBar:setDirection(self, Direction) end - ----Gets the value of the Direction property. ----@param self ProgressBar self ----@return string right The direction of the progress bar ("up", "down", "left", "right") -function ProgressBar:getDirection(self) end - ----Sets the value of the ProgressColor property. ----@param self ProgressBar self ----@param ProgressColor color The color used for the filled portion of the progress bar -function ProgressBar:setProgressColor(self, ProgressColor) end - ----@class VisualElement : BaseElement ----@field backgroundEnabled boolean Whether to render the background ----@field clicked boolean Whether the element is currently clicked ----@field width number The width of the element ----@field x number The horizontal position relative to parent ----@field y number The vertical position relative to parent ----@field background color The background color ----@field hover boolean Whether the mouse is currently hover over the element (Craftos-PC only) ----@field z number The z-index for layering elements ----@field ignoreOffset boolean Whether to ignore the parent's offset ----@field visible boolean Whether the element is visible ----@field foreground color The text/foreground color ----@field height number The height of the element ----@field focused boolean Whether the element has input focus -local VisualElement = {} - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param _ number unknown ----@param x number The x position of the mouse ----@param y number The y position of the mouse ----@return boolean hover Whether the mouse has moved over the element ----@protected -function VisualElement:mouse_move(_, x, y) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param button number The button that was released ----@param x number The x position of the release ----@param y number The y position of the release ----@return boolean release Whether the element was released on the element ----@protected -function VisualElement:mouse_up(button, x, y) end - -function VisualElement:drawFg() end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param key number The key that was pressed ----@protected -function VisualElement:key(key) end - ----Registers a function to handle the onRelease event. ----@param self VisualElement self ----@param func function The function to be called when the event fires -function VisualElement:onOnRelease(self, func) end - ----Gets the value of the Visible property. ----@param self VisualElement self ----@return boolean true Whether the element is visible -function VisualElement:getVisible(self) end - ----Gets the value of the Background property. ----@param self VisualElement self ----@return color black The background color -function VisualElement:getBackground(self) end - ----Gets the value of the Width property. ----@param self VisualElement self ----@return number 1 The width of the element -function VisualElement:getWidth(self) end - ----Registers a function to handle the onDrag event. ----@param self VisualElement self ----@param func function The function to be called when the event fires -function VisualElement:onOnDrag(self, func) end - ----Registers a function to handle the onLeave event. ----@param self VisualElement self ----@param func function The function to be called when the event fires -function VisualElement:onOnLeave(self, func) end - ----Sets the value of the Hover property. ----@param self VisualElement self ----@param Hover boolean Whether the mouse is currently hover over the element (Craftos-PC only) -function VisualElement:setHover(self, Hover) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param x number The x position to draw ----@param y number The y position to draw ----@param text string The text char to draw ----@param bg color The background color ----@protected -function VisualElement:textBg(x, y, text, bg) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param x number The x position to draw ----@param y number The y position to draw ----@param text string The text char to draw ----@param fg color The foreground color ----@protected -function VisualElement:textFg(x, y, text, fg) end - ----Registers a function to handle the onFocus event. ----@param self VisualElement self ----@param func function The function to be called when the event fires -function VisualElement:onOnFocus(self, func) end - ----Sets the value of the Y property. ----@param self VisualElement self ----@param Y number The vertical position relative to parent -function VisualElement:setY(self, Y) end - ----Sets the value of the Width property. ----@param self VisualElement self ----@param Width number The width of the element -function VisualElement:setWidth(self, Width) end - ----Gets the value of the Height property. ----@param self VisualElement self ----@return number 1 The height of the element -function VisualElement:getHeight(self) end - ----Calculates the position of the element relative to its parent ----@return number x The x position ----@return number y The y position -function VisualElement:calculatePosition() end - ----Registers a function to handle the onScroll event. ----@param self VisualElement self ----@param func function The function to be called when the event fires -function VisualElement:onOnScroll(self, func) end - ----Registers a function to handle the onKeyUp event. ----@param self VisualElement self ----@param func function The function to be called when the event fires -function VisualElement:onOnKeyUp(self, func) end - ----Registers a function to handle the onChar event. ----@param self VisualElement self ----@param func function The function to be called when the event fires -function VisualElement:onOnChar(self, func) end - -function VisualElement:drawText() end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param x number The x position to draw ----@param y number The y position to draw ----@param text string The text char to draw ----@param fg string The foreground color ----@param bg string The background color ----@protected -function VisualElement:blit(x, y, text, fg, bg) end - ----Sets the value of the Background property. ----@param self VisualElement self ----@param Background color The background color -function VisualElement:setBackground(self, Background) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param button number The button that was clicked while dragging ----@param x number The x position of the drag ----@param y number The y position of the drag ----@return boolean drag Whether the element was dragged ----@protected -function VisualElement:mouse_drag(button, x, y) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@protected -function VisualElement:render() end - ----Registers a function to handle the onMouseUp event. ----@param self VisualElement self ----@param func function The function to be called when the event fires -function VisualElement:onOnMouseUp(self, func) end - ----This function is used to prioritize the element by moving it to the top of its parent's children. It removes the element from its parent and adds it back, effectively changing its order. ----@return VisualElement self The VisualElement instance -function VisualElement:prioritize() end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@protected -function VisualElement:postRender() end - ----Gets the value of the BackgroundEnabled property. ----@param self VisualElement self ----@return boolean true Whether to render the background -function VisualElement:getBackgroundEnabled(self) end - ----Gets the value of the Z property. ----@param self VisualElement self ----@return number 1 The z-index for layering elements -function VisualElement:getZ(self) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param direction number The scroll direction ----@param x number The x position of the scroll ----@param y number The y position of the scroll ----@return boolean scroll Whether the element was scrolled ----@protected -function VisualElement:mouse_scroll(direction, x, y) end - ----Creates a new Animation Object ----@return Animation animation The new animation -function VisualElement:animate() end - ----Gets the value of the Foreground property. ----@param self VisualElement self ----@return color white The text/foreground color -function VisualElement:getForeground(self) end - ----Sets the value of the Foreground property. ----@param self VisualElement self ----@param Foreground color The text/foreground color -function VisualElement:setForeground(self, Foreground) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@protected -function VisualElement:blur() end - ----Sets the value of the BackgroundEnabled property. ----@param self VisualElement self ----@param BackgroundEnabled boolean Whether to render the background -function VisualElement:setBackgroundEnabled(self, BackgroundEnabled) end - ----Gets the value of the Focused property. ----@param self VisualElement self ----@return boolean false Whether the element has input focus -function VisualElement:getFocused(self) end - ----Returns the relative position of the element or the given coordinates. ----@return number x The relative x position ----@return number y The relative y position -function VisualElement:getRelativePosition() end - -function VisualElement:destroy() end - ----Sets the value of the Clicked property. ----@param self VisualElement self ----@param Clicked boolean Whether the element is currently clicked -function VisualElement:setClicked(self, Clicked) end - ----Registers a function to handle the onKey event. ----@param self VisualElement self ----@param func function The function to be called when the event fires -function VisualElement:onOnKey(self, func) end - -function VisualElement:drawBg() end - ----Gets the value of the Clicked property. ----@param self VisualElement self ----@return boolean false Whether the element is currently clicked -function VisualElement:getClicked(self) end - ----Convenience to stop animations from the element -function VisualElement.stopAnimation() end - ----Gets the value of the Hover property. ----@param self VisualElement self ----@return boolean false Whether the mouse is currently hover over the element (Craftos-PC only) -function VisualElement:getHover(self) end - ----Registers a function to handle the onEnter event. ----@param self VisualElement self ----@param func function The function to be called when the event fires -function VisualElement:onOnEnter(self, func) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param props table The properties to initialize the element with ----@param basalt table The basalt instance ----@protected -function VisualElement:init(props, basalt) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param x number The x position to draw ----@param y number The y position to draw ----@param width number The width of the area to draw ----@param height number The height of the area to draw ----@param text string The text to draw ----@param fg string The foreground color ----@param bg string The background color ----@protected -function VisualElement:multiBlit(x, y, width, height, text, fg, bg) end - ----Sets the value of the IgnoreOffset property. ----@param self VisualElement self ----@param IgnoreOffset boolean Whether to ignore the parent's offset -function VisualElement:setIgnoreOffset(self, IgnoreOffset) end - ----Gets the value of the X property. ----@param self VisualElement self ----@return number 1 The horizontal position relative to parent -function VisualElement:getX(self) end - ----Sets the value of the Z property. ----@param self VisualElement self ----@param Z number The z-index for layering elements -function VisualElement:setZ(self, Z) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param char string The character that was pressed ----@protected -function VisualElement:char(char) end - ----Sets the value of the Height property. ----@param self VisualElement self ----@param Height number The height of the element -function VisualElement:setHeight(self, Height) end - ----Registers a function to handle the onBlur event. ----@param self VisualElement self ----@param func function The function to be called when the event fires -function VisualElement:onOnBlur(self, func) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param button number The button that was clicked ----@param x number The x position of the click ----@param y number The y position of the click ----@return boolean clicked Whether the element was clicked ----@protected -function VisualElement:mouse_click(button, x, y) end - ----Sets the value of the X property. ----@param self VisualElement self ----@param X number The horizontal position relative to parent -function VisualElement:setX(self, X) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param key number The key that was released ----@protected -function VisualElement:key_up(key) end - ----Sets the value of the Visible property. ----@param self VisualElement self ----@param Visible boolean Whether the element is visible -function VisualElement:setVisible(self, Visible) end - ----Checks if the specified coordinates are within the bounds of the element ----@param x number The x position to check ----@param y number The y position to check ----@return boolean isInBounds Whether the coordinates are within the bounds of the element -function VisualElement:isInBounds(x, y) end - ----Gets the value of the IgnoreOffset property. ----@param self VisualElement self ----@return boolean false Whether to ignore the parent's offset -function VisualElement:getIgnoreOffset(self) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@protected -function VisualElement:focus() end - ----Sets the value of the Focused property. ----@param self VisualElement self ----@param Focused boolean Whether the element has input focus -function VisualElement:setFocused(self, Focused) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param button number The button that was released ----@param x number The x position of the release ----@param y number The y position of the release ----@protected -function VisualElement:mouse_release(button, x, y) end - ----Registers a function to handle the onClick event. ----@param button string ----@param x number ----@param y number ----@param self VisualElement self ----@param func function The function to be called when the event fires -function VisualElement:onOnClick(self, func) end - ----Gets the value of the Y property. ----@param self VisualElement self ----@return number 1 The vertical position relative to parent -function VisualElement:getY(self) end - ----Returns the absolute position of the element or the given coordinates. ----@return number x The absolute x position ----@return number y The absolute y position -function VisualElement:getAbsolutePosition() end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param x number The x position of the cursor ----@param y number The y position of the cursor ----@param blink boolean Whether the cursor should blink ----@param color number The color of the cursor ----@return VisualElement self The VisualElement instance ----@protected -function VisualElement:setCursor(x, y, blink, color) end - ----@class Slider : VisualElement ----@field step number Current position of the slider handle (1 to width/height) ----@field barColor color Color of the slider track ----@field max number Maximum value for value conversion (maps slider position to this range) ----@field horizontal boolean Whether the slider is horizontal (false for vertical) ----@field sliderColor color Color of the slider handle -local Slider = {} - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@protected -function Slider:render() end - ----Sets the value of the Max property. ----@param self Slider self ----@param Max number Maximum value for value conversion (maps slider position to this range) -function Slider:setMax(self, Max) end - ----Gets the value of the Max property. ----@param self Slider self ----@return number 100 Maximum value for value conversion (maps slider position to this range) -function Slider:getMax(self) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param props table The properties to initialize the element with ----@param basalt table The basalt instance ----@return Slider self The initialized instance ----@protected -function Slider:init(props, basalt) end - ----Gets the value of the BarColor property. ----@param self Slider self ----@return color gray Color of the slider track -function Slider:getBarColor(self) end - ----Gets the current value of the slider ----@return number value The current value (0 to max) -function Slider:getValue() end - ----Sets the value of the SliderColor property. ----@param self Slider self ----@param SliderColor color Color of the slider handle -function Slider:setSliderColor(self, SliderColor) end - ----Sets the value of the Step property. ----@param self Slider self ----@param Step number Current position of the slider handle (1 to width/height) -function Slider:setStep(self, Step) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param button number The mouse button that was clicked ----@param x number The x position of the click ----@param y number The y position of the click ----@return boolean handled Whether the event was handled ----@protected -function Slider:mouse_click(button, x, y) end - ----Registers a function to handle the onChange event. ----@param value number ----@param self Slider self ----@param func function The function to be called when the event fires -function Slider:onOnChange(self, func) end - ----Gets the value of the Horizontal property. ----@param self Slider self ----@return boolean true Whether the slider is horizontal (false for vertical) -function Slider:getHorizontal(self) end - ----Gets the value of the SliderColor property. ----@param self Slider self ----@return color blue Color of the slider handle -function Slider:getSliderColor(self) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param button number The mouse button that was released ----@param x number The x position of the release ----@param y number The y position of the release ----@return boolean handled Whether the event was handled ----@protected -function Slider:mouse_scroll(button, x, y) end - ----Sets the value of the BarColor property. ----@param self Slider self ----@param BarColor color Color of the slider track -function Slider:setBarColor(self, BarColor) end - ----Gets the value of the Step property. ----@param self Slider self ----@return number 1 Current position of the slider handle (1 to width/height) -function Slider:getStep(self) end - ----Sets the value of the Horizontal property. ----@param self Slider self ----@param Horizontal boolean Whether the slider is horizontal (false for vertical) -function Slider:setHorizontal(self, Horizontal) end - ----@class Timer : BaseElement ----@field interval number The interval in seconds at which the timer will trigger its action. ----@field amount number The amount of time the timer should run. ----@field action function The action to be performed when the timer triggers. ----@field running boolean Indicates whether the timer is currently running or not. -local Timer = {} - ----Starts the timer with the specified interval. ----@param self Timer The Timer instance to start ----@return Timer self The Timer instance -function Timer:start(self) end - ----Sets the value of the Amount property. ----@param self Timer self ----@param Amount number The amount of time the timer should run. -function Timer:setAmount(self, Amount) end - ----Stops the timer if it is currently running. ----@param self Timer The Timer instance to stop ----@return Timer self The Timer instance -function Timer:stop(self) end - ----Gets the value of the Amount property. ----@param self Timer self ----@return number -1 The amount of time the timer should run. -function Timer:getAmount(self) end - ----Sets the value of the Interval property. ----@param self Timer self ----@param Interval number The interval in seconds at which the timer will trigger its action. -function Timer:setInterval(self, Interval) end - ----Sets the value of the Action property. ----@param self Timer self ----@param Action function The action to be performed when the timer triggers. -function Timer:setAction(self, Action) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param props table The properties to initialize the element with ----@param basalt table The basalt instance ----@protected -function Timer:init(props, basalt) end - ----Gets the value of the Interval property. ----@param self Timer self ----@return number 1 The interval in seconds at which the timer will trigger its action. -function Timer:getInterval(self) end - ----Sets the value of the Running property. ----@param self Timer self ----@param Running boolean Indicates whether the timer is currently running or not. -function Timer:setRunning(self, Running) end - ----Gets the value of the Action property. ----@param self Timer self ----@return function function The action to be performed when the timer triggers. -function Timer:getAction(self) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@protected -function Timer:dispatchEvent() end - ----Gets the value of the Running property. ----@param self Timer self ----@return boolean false Indicates whether the timer is currently running or not. -function Timer:getRunning(self) end - ----@class LineChart : Graph -local LineChart = {} - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@protected -function LineChart:render() end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param props table The properties to initialize the element with ----@param basalt table The basalt instance ----@return LineChart self The initialized instance ----@protected -function LineChart:init(props, basalt) end - ----@class Graph : VisualElement ----@field maxValue number The maximum value of the graph ----@field series table The series of the graph ----@field minValue number The minimum value of the graph -local Graph = {} - ----Sets the value of the MinValue property. ----@param self Graph self ----@param MinValue number The minimum value of the graph -function Graph:setMinValue(self, MinValue) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param props table The properties to initialize the element with ----@param basalt table The basalt instance ----@return Graph self The initialized instance ----@protected -function Graph:init(props, basalt) end - ----Clears all points from a series ----@return Graph self The graph instance -function Graph:clear() end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@protected -function Graph:render() end - ----@param name string The name of the series ----@param symbol string The symbol of the series ----@param bgCol number The background color of the series ----@param fgCol number The foreground color of the series ----@param pointCount number The number of points in the series ----@return Graph self The graph instance -function Graph:addSeries(name, symbol, bgCol, fgCol, pointCount) end - ----@param name string The name of the series ----@param count number The number of points in the series ----@return Graph self The graph instance -function Graph:setSeriesPointCount(name, count) end - ----@param name string The name of the series ----@return Graph self The graph instance -function Graph:removeSeries(name) end - ----Gets the value of the MinValue property. ----@param self Graph self ----@return number 0 The minimum value of the graph -function Graph:getMinValue(self) end - ----@param name string The name of the series ----@param value number The value of the point ----@return Graph self The graph instance -function Graph:addPoint(name, value) end - ----Sets the value of the MaxValue property. ----@param self Graph self ----@param MaxValue number The maximum value of the graph -function Graph:setMaxValue(self, MaxValue) end - ----@param name string The name of the series ----@return Graph self The graph instance -function Graph:focusSeries(name) end - ----Gets the value of the MaxValue property. ----@param self Graph self ----@return number 100 The maximum value of the graph -function Graph:getMaxValue(self) end - ----@param name string The name of the series ----@return table ? series The series -function Graph:getSeries(name) end - ----Sets the value of the Series property. ----@param self Graph self ----@param Series table The series of the graph -function Graph:setSeries(self, Series) end - ----@param name string The name of the series ----@param visible boolean Whether the series should be visible ----@return Graph self The graph instance -function Graph:changeSeriesVisibility(name, visible) end - ----@class CheckBox : VisualElement ----@field autoSize boolean Whether to automatically size the checkbox ----@field checkedText string when checked ----@field text string Text to display ----@field checked boolean checkbox is checked -local CheckBox = {} - ----Gets the value of the AutoSize property. ----@param self CheckBox self ----@return boolean true Whether to automatically size the checkbox -function CheckBox:getAutoSize(self) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param button number The button that was clicked ----@param x number The x position of the click ----@param y number The y position of the click ----@return boolean Clicked Whether the event was handled ----@protected -function CheckBox:mouse_click(button, x, y) end - ----Gets the value of the CheckedText property. ----@param self CheckBox self ----@return string Text when checked -function CheckBox:getCheckedText(self) end - ----Gets the value of the Text property. ----@param self CheckBox self ----@return string empty Text to display -function CheckBox:getText(self) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param props table The properties to initialize the element with ----@param basalt table The basalt instance ----@protected -function CheckBox:init(props, basalt) end - ----Sets the value of the CheckedText property. ----@param self CheckBox self ----@param CheckedText string when checked -function CheckBox:setCheckedText(self, CheckedText) end - ----Gets the value of the Checked property. ----@param self CheckBox self ----@return boolean Whether checkbox is checked -function CheckBox:getChecked(self) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@return CheckBox self The created instance ----@protected -function CheckBox.new() end - ----Sets the value of the AutoSize property. ----@param self CheckBox self ----@param AutoSize boolean Whether to automatically size the checkbox -function CheckBox:setAutoSize(self, AutoSize) end - ----Sets the value of the Text property. ----@param self CheckBox self ----@param Text string Text to display -function CheckBox:setText(self, Text) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@protected -function CheckBox:render() end - ----Sets the value of the Checked property. ----@param self CheckBox self ----@param Checked boolean checkbox is checked -function CheckBox:setChecked(self, Checked) end - ----@class FlexBox : Container ----@field flexAlignItems string The alignment of flex items along the cross axis ----@field flexSpacing number The spacing between flex items ----@field flexCrossPadding number The padding on both sides of the cross axis ----@field flexDirection string The direction of the flexbox layout "row" or "column" ----@field flexUpdateLayout boolean Whether to update the layout of the flexbox ----@field flexJustifyContent string The alignment of flex items along the main axis ----@field flexWrap boolean Whether to wrap flex items onto multiple lines -local FlexBox = {} - ----Sets the value of the FlexSpacing property. ----@param self FlexBox self ----@param FlexSpacing number The spacing between flex items -function FlexBox:setFlexSpacing(self, FlexSpacing) end - ----Sets the value of the FlexAlignItems property. ----@param self FlexBox self ----@param FlexAlignItems string The alignment of flex items along the cross axis -function FlexBox:setFlexAlignItems(self, FlexAlignItems) end - ----Adds a child element to the flexbox ----@param element Element The child element to add ----@return FlexBox self The flexbox instance -function FlexBox:addChild(element) end - ----Sets the value of the FlexUpdateLayout property. ----@param self FlexBox self ----@param FlexUpdateLayout boolean Whether to update the layout of the flexbox -function FlexBox:setFlexUpdateLayout(self, FlexUpdateLayout) end - ----Gets the value of the FlexCrossPadding property. ----@param self FlexBox self ----@return number 0 The padding on both sides of the cross axis -function FlexBox:getFlexCrossPadding(self) end - ----Sets the value of the FlexDirection property. ----@param self FlexBox self ----@param FlexDirection string The direction of the flexbox layout "row" or "column" -function FlexBox:setFlexDirection(self, FlexDirection) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param props table The properties to initialize the element with ----@param basalt table The basalt instance ----@return FlexBox self The initialized instance ----@protected -function FlexBox:init(props, basalt) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param element Element The child element to remove ----@return FlexBox self The flexbox instance ----@protected -function FlexBox:removeChild(element) end - ----Gets the value of the FlexJustifyContent property. ----@param self FlexBox self ----@return string "flex-start" The alignment of flex items along the main axis -function FlexBox:getFlexJustifyContent(self) end - ----Gets the value of the FlexDirection property. ----@param self FlexBox self ----@return string "row" The direction of the flexbox layout "row" or "column" -function FlexBox:getFlexDirection(self) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@protected -function FlexBox:render() end - ----Adds a new line break to the flexbox ----@param self FlexBox The element itself ----@return FlexBox -function FlexBox:addLineBreak(self) end - ----Sets the value of the FlexCrossPadding property. ----@param self FlexBox self ----@param FlexCrossPadding number The padding on both sides of the cross axis -function FlexBox:setFlexCrossPadding(self, FlexCrossPadding) end - ----Gets the value of the FlexAlignItems property. ----@param self FlexBox self ----@return string "flex-start" The alignment of flex items along the cross axis -function FlexBox:getFlexAlignItems(self) end - ----Sets the value of the FlexJustifyContent property. ----@param self FlexBox self ----@param FlexJustifyContent string The alignment of flex items along the main axis -function FlexBox:setFlexJustifyContent(self, FlexJustifyContent) end - ----Gets the value of the FlexUpdateLayout property. ----@param self FlexBox self ----@return boolean false Whether to update the layout of the flexbox -function FlexBox:getFlexUpdateLayout(self) end - ----Gets the value of the FlexSpacing property. ----@param self FlexBox self ----@return number 1 The spacing between flex items -function FlexBox:getFlexSpacing(self) end - ----Gets the value of the FlexWrap property. ----@param self FlexBox self ----@return boolean false Whether to wrap flex items onto multiple lines -function FlexBox:getFlexWrap(self) end - ----Sets the value of the FlexWrap property. ----@param self FlexBox self ----@param FlexWrap boolean Whether to wrap flex items onto multiple lines -function FlexBox:setFlexWrap(self, FlexWrap) end - ----@class ScrollBar : VisualElement ----@field symbol string " Symbol used for the ScrollBar handle ----@field attachedProperty string nil The property being controlled ----@field handleSize number Size of the ScrollBar handle in characters ----@field max number Maximum scroll value ----@field value number Current scroll value ----@field backgroundSymbol string Symbol used for the ScrollBar background ----@field min number Minimum scroll value ----@field step number Step size for scroll operations ----@field orientation string Orientation of the ScrollBar ("vertical" or "horizontal") ----@field maxValue number 100 Maximum value or function that returns it ----@field minValue number 0 Minimum value or function that returns it ----@field attachedElement table nil The element this ScrollBar is attached to ----@field dragMultiplier number How fast the ScrollBar moves when dragging ----@field symbolBackgroundColor color Background color of the ScrollBar handle -local ScrollBar = {} - ----Sets the value of the Max property. ----@param self ScrollBar self ----@param Max number Maximum scroll value -function ScrollBar:setMax(self, Max) end - ----Sets the value of the MinValue property. ----@param self ScrollBar self ----@param MinValue number 0 Minimum value or function that returns it -function ScrollBar:setMinValue(self, MinValue) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param direction number The scroll direction (1 for up, -1 for down) ----@param x number The x position of the scroll ----@param y number The y position of the scroll ----@return boolean Whether the event was handled ----@protected -function ScrollBar:mouse_scroll(direction, x, y) end - ----Sets the value of the SymbolBackgroundColor property. ----@param self ScrollBar self ----@param SymbolBackgroundColor color Background color of the ScrollBar handle -function ScrollBar:setSymbolBackgroundColor(self, SymbolBackgroundColor) end - ----Sets the value of the DragMultiplier property. ----@param self ScrollBar self ----@param DragMultiplier number How fast the ScrollBar moves when dragging -function ScrollBar:setDragMultiplier(self, DragMultiplier) end - ----Gets the value of the Symbol property. ----@param self ScrollBar self ----@return string " " Symbol used for the ScrollBar handle -function ScrollBar:getSymbol(self) end - ----Updates the attached element's property based on the ScrollBar value ----@return ScrollBar self The ScrollBar instance -function ScrollBar:updateAttachedElement() end - ----Gets the value of the MinValue property. ----@param self ScrollBar self ----@return number |function 0 Minimum value or function that returns it -function ScrollBar:getMinValue(self) end - ----Sets the value of the MaxValue property. ----@param self ScrollBar self ----@param MaxValue number 100 Maximum value or function that returns it -function ScrollBar:setMaxValue(self, MaxValue) end - ----Sets the value of the AttachedProperty property. ----@param self ScrollBar self ----@param AttachedProperty string nil The property being controlled -function ScrollBar:setAttachedProperty(self, AttachedProperty) end - ----Sets the value of the Value property. ----@param self ScrollBar self ----@param Value number Current scroll value -function ScrollBar:setValue(self, Value) end - ----Gets the value of the Value property. ----@param self ScrollBar self ----@return number 0 Current scroll value -function ScrollBar:getValue(self) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param props table The properties to initialize the element with ----@param basalt table The basalt instance ----@return ScrollBar self The initialized instance ----@protected -function ScrollBar:init(props, basalt) end - ----Gets the value of the AttachedProperty property. ----@param self ScrollBar self ----@return string ? nil The property being controlled -function ScrollBar:getAttachedProperty(self) end - ----Sets the value of the Step property. ----@param self ScrollBar self ----@param Step number Step size for scroll operations -function ScrollBar:setStep(self, Step) end - ----Gets the value of the Max property. ----@param self ScrollBar self ----@return number 100 Maximum scroll value -function ScrollBar:getMax(self) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@protected -function ScrollBar:render() end - ----Gets the value of the Min property. ----@param self ScrollBar self ----@return number 0 Minimum scroll value -function ScrollBar:getMin(self) end - ----Sets the value of the BackgroundSymbol property. ----@param self ScrollBar self ----@param BackgroundSymbol string Symbol used for the ScrollBar background -function ScrollBar:setBackgroundSymbol(self, BackgroundSymbol) end - ----Gets the value of the MaxValue property. ----@param self ScrollBar self ----@return number |function 100 Maximum value or function that returns it -function ScrollBar:getMaxValue(self) end - ----Gets the value of the Step property. ----@param self ScrollBar self ----@return number 1 Step size for scroll operations -function ScrollBar:getStep(self) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param button number The mouse button clicked ----@param x number The x position of the click ----@param y number The y position of the click ----@return boolean Whether the event was handled ----@protected -function ScrollBar:mouse_click(button, x, y) end - ----Gets the value of the Orientation property. ----@param self ScrollBar self ----@return string vertical Orientation of the ScrollBar ("vertical" or "horizontal") -function ScrollBar:getOrientation(self) end - ----Gets the value of the DragMultiplier property. ----@param self ScrollBar self ----@return number 1 How fast the ScrollBar moves when dragging -function ScrollBar:getDragMultiplier(self) end - ----Sets the value of the Min property. ----@param self ScrollBar self ----@param Min number Minimum scroll value -function ScrollBar:setMin(self, Min) end - ----Sets the value of the Symbol property. ----@param self ScrollBar self ----@param Symbol string " Symbol used for the ScrollBar handle -function ScrollBar:setSymbol(self, Symbol) end - ----Gets the value of the BackgroundSymbol property. ----@param self ScrollBar self ----@return string "\127" Symbol used for the ScrollBar background -function ScrollBar:getBackgroundSymbol(self) end - ----Gets the value of the AttachedElement property. ----@param self ScrollBar self ----@return table ? nil The element this ScrollBar is attached to -function ScrollBar:getAttachedElement(self) end - ----Attaches the ScrollBar to an element's property ----@param element BaseElement The element to attach to ----@param config table Configuration {property = "propertyName", min = number|function, max = number|function} ----@return ScrollBar self The ScrollBar instance -function ScrollBar:attach(element, config) end - ----Sets the value of the HandleSize property. ----@param self ScrollBar self ----@param HandleSize number Size of the ScrollBar handle in characters -function ScrollBar:setHandleSize(self, HandleSize) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param button number The mouse button being dragged ----@param x number The x position of the drag ----@param y number The y position of the drag ----@return boolean Whether the event was handled ----@protected -function ScrollBar:mouse_drag(button, x, y) end - ----Gets the value of the SymbolBackgroundColor property. ----@param self ScrollBar self ----@return color black Background color of the ScrollBar handle -function ScrollBar:getSymbolBackgroundColor(self) end - ----Sets the value of the AttachedElement property. ----@param self ScrollBar self ----@param AttachedElement table nil The element this ScrollBar is attached to -function ScrollBar:setAttachedElement(self, AttachedElement) end - ----Sets the value of the Orientation property. ----@param self ScrollBar self ----@param Orientation string Orientation of the ScrollBar ("vertical" or "horizontal") -function ScrollBar:setOrientation(self, Orientation) end - ----Gets the value of the HandleSize property. ----@param self ScrollBar self ----@return number 2 Size of the ScrollBar handle in characters -function ScrollBar:getHandleSize(self) end - ----@class Input : VisualElement ----@field placeholderColor color Color of the placeholder text ----@field replaceChar string Character to replace the input with (for password fields) ----@field pattern string nil Regular expression pattern for input validation ----@field maxLength number nil Maximum length of input text (optional) ----@field focusedForeground color Foreground color when input is focused ----@field cursorPos number The current cursor position in the text ----@field focusedBackground color Background color when input is focused ----@field viewOffset number The horizontal scroll offset for viewing long text ----@field placeholder string Text to display when input is empty ----@field text string The current text content of the input ----@field cursorColor number Color of the cursor -local Input = {} - ----Gets the value of the ReplaceChar property. ----@param self Input self ----@return string nil Character to replace the input with (for password fields) -function Input:getReplaceChar(self) end - ----Updates the input's viewport ----@return Input self The updated instance -function Input:updateViewport() end - ----Gets the value of the PlaceholderColor property. ----@param self Input self ----@return color gray Color of the placeholder text -function Input:getPlaceholderColor(self) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@protected -function Input:blur() end - ----Sets the value of the FocusedBackground property. ----@param self Input self ----@param FocusedBackground color Background color when input is focused -function Input:setFocusedBackground(self, FocusedBackground) end - ----Sets the value of the Placeholder property. ----@param self Input self ----@param Placeholder string Text to display when input is empty -function Input:setPlaceholder(self, Placeholder) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@protected -function Input:render() end - ----Gets the value of the CursorPos property. ----@param self Input self ----@return number 1 The current cursor position in the text -function Input:getCursorPos(self) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@protected -function Input:focus() end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@protected -function Input:paste() end +---Gets the value of the FocusedForeground property. +---@param self ComboBox self +---@return color white Foreground color when ComboBox is focused +function ComboBox:getFocusedForeground(self) end + +---Sets whether the ComboBox is editable +---@param editable boolean Whether the ComboBox should be editable +---@return ComboBox self +function ComboBox:setEditable(editable) end ---Sets the value of the ViewOffset property. ----@param self Input self +---@param self ComboBox self ---@param ViewOffset number The horizontal scroll offset for viewing long text -function Input:setViewOffset(self, ViewOffset) end - ----Sets the value of the ReplaceChar property. ----@param self Input self ----@param ReplaceChar string Character to replace the input with (for password fields) -function Input:setReplaceChar(self, ReplaceChar) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param key number The key that was pressed ----@return boolean handled Whether the event was handled ----@protected -function Input:key(key) end - ----Gets the value of the FocusedForeground property. ----@param self Input self ----@return color white Foreground color when input is focused -function Input:getFocusedForeground(self) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param char string The character that was typed ----@return boolean handled Whether the event was handled ----@protected -function Input:char(char) end - ----Gets the value of the Placeholder property. ----@param self Input self ----@return string ... Text to display when input is empty -function Input:getPlaceholder(self) end - ----Sets the cursor position and color ----@param x number The x position of the cursor ----@param y number The y position of the cursor ----@param blink boolean Whether the cursor should blink ----@param color number The color of the cursor -function Input:setCursor(x, y, blink, color) end - ----Gets the value of the CursorColor property. ----@param self Input self ----@return number nil Color of the cursor -function Input:getCursorColor(self) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param props table The properties to initialize the element with ----@param basalt table The basalt instance ----@return Input self The initialized instance ----@protected -function Input:init(props, basalt) end - ----Sets the value of the CursorColor property. ----@param self Input self ----@param CursorColor number Color of the cursor -function Input:setCursorColor(self, CursorColor) end - ----Sets the value of the Pattern property. ----@param self Input self ----@param Pattern string nil Regular expression pattern for input validation -function Input:setPattern(self, Pattern) end - ----Gets the value of the Pattern property. ----@param self Input self ----@return string ? nil Regular expression pattern for input validation -function Input:getPattern(self) end - ----Sets the value of the CursorPos property. ----@param self Input self ----@param CursorPos number The current cursor position in the text -function Input:setCursorPos(self, CursorPos) end - ----Gets the value of the ViewOffset property. ----@param self Input self ----@return number 0 The horizontal scroll offset for viewing long text -function Input:getViewOffset(self) end - ----Sets the value of the FocusedForeground property. ----@param self Input self ----@param FocusedForeground color Foreground color when input is focused -function Input:setFocusedForeground(self, FocusedForeground) end - ----Sets the value of the MaxLength property. ----@param self Input self ----@param MaxLength number nil Maximum length of input text (optional) -function Input:setMaxLength(self, MaxLength) end - ----Gets the value of the Text property. ----@param self Input self ----@return string - The current text content of the input -function Input:getText(self) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param button number The button that was clicked ----@param x number The x position of the click ----@param y number The y position of the click ----@return boolean handled Whether the event was handled ----@protected -function Input:mouse_click(button, x, y) end - ----Gets the value of the MaxLength property. ----@param self Input self ----@return number ? nil Maximum length of input text (optional) -function Input:getMaxLength(self) end - ----Sets the value of the Text property. ----@param self Input self ----@param Text string The current text content of the input -function Input:setText(self, Text) end +function ComboBox:setViewOffset(self, ViewOffset) end ---Sets the value of the PlaceholderColor property. ----@param self Input self +---@param self ComboBox self ---@param PlaceholderColor color Color of the placeholder text -function Input:setPlaceholderColor(self, PlaceholderColor) end +function ComboBox:setPlaceholderColor(self, PlaceholderColor) end ----Gets the value of the FocusedBackground property. ----@param self Input self ----@return color blue Background color when input is focused -function Input:getFocusedBackground(self) end - ----@class Switch : VisualElement ----@field offBackground number color when OFF ----@field onBackground number color when ON ----@field checked boolean switch is checked ----@field text string to display next to switch ----@field autoSize boolean to automatically size the element to fit switch and text -local Switch = {} - ----Gets the value of the AutoSize property. ----@param self Switch self ----@return boolean Whether to automatically size the element to fit switch and text -function Switch:getAutoSize(self) end - ----Sets the value of the Checked property. ----@param self Switch self ----@param Checked boolean switch is checked -function Switch:setChecked(self, Checked) end - ----Gets the value of the Text property. ----@param self Switch self ----@return string Text to display next to switch -function Switch:getText(self) end - ----Sets the value of the OnBackground property. ----@param self Switch self ----@param OnBackground number color when ON -function Switch:setOnBackground(self, OnBackground) end - ----Sets the value of the OffBackground property. ----@param self Switch self ----@param OffBackground number color when OFF -function Switch:setOffBackground(self, OffBackground) end - ----Gets the value of the Checked property. ----@param self Switch self ----@return boolean Whether switch is checked -function Switch:getChecked(self) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param props table The properties to initialize the element with ----@param basalt table The basalt instance ----@protected -function Switch:init(props, basalt) end - ----Sets the value of the Text property. ----@param self Switch self ----@param Text string to display next to switch -function Switch:setText(self, Text) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@protected -function Switch:render() end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param button number The button that was clicked ----@param x number The x position of the click ----@param y number The y position of the click ----@return boolean Whether the event was handled ----@protected -function Switch:mouse_click(button, x, y) end - ----Sets the value of the AutoSize property. ----@param self Switch self ----@param AutoSize boolean to automatically size the element to fit switch and text -function Switch:setAutoSize(self, AutoSize) end - ----Gets the value of the OffBackground property. ----@param self Switch self ----@return number Background color when OFF -function Switch:getOffBackground(self) end - ----Gets the value of the OnBackground property. ----@param self Switch self ----@return number Background color when ON -function Switch:getOnBackground(self) end - ----@class TabControl : Container ----@field activeTabTextColor color color for the active tab text ----@field headerBackground color color for the tab header area ----@field activeTabBackground color color for the active tab ----@field tabHeight number of the tab header area ----@field tabs table of tab definitions ----@field activeTab number currently active tab ID -local TabControl = {} - ----Sets the value of the TabHeight property. ----@param self TabControl self ----@param TabHeight number of the tab header area -function TabControl:setTabHeight(self, TabHeight) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param button number The button that was clicked ----@param x number The x position of the click (global) ----@param y number The y position of the click (global) ----@return boolean Whether the event was handled ----@protected -function TabControl:mouse_click(button, x, y) end - ----@param elementType string The type of element to add ----@param tabId number Optional tab ID, defaults to active tab ----@return table element The created element -function TabControl:addElement(elementType, tabId) end - -function TabControl:_getHeaderMetrics() end - ----@param tabId number The ID of the tab to activate -function TabControl:setActiveTab(tabId) end - -function TabControl:getRelativePosition() end - ----Gets the value of the ActiveTabTextColor property. ----@param self TabControl self ----@return color Foreground color for the active tab text -function TabControl:getActiveTabTextColor(self) end - ----Gets the value of the ActiveTabBackground property. ----@param self TabControl self ----@return color Background color for the active tab -function TabControl:getActiveTabBackground(self) end - -function TabControl:drawBg() end - -function TabControl:blit() end - -function TabControl:mouse_release() end - ----Gets the value of the ActiveTab property. ----@param self TabControl self ----@return number The currently active tab ID -function TabControl:getActiveTab(self) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param props table The properties to initialize the element with ----@param basalt table The basalt instance ----@protected -function TabControl:init(props, basalt) end - ----returns a proxy for adding elements to the tab ----@param title string The title of the tab ----@return table tabHandler The tab handler proxy for adding elements to the new tab -function TabControl:newTab(title) end - ----Sets the value of the ActiveTabTextColor property. ----@param self TabControl self ----@param ActiveTabTextColor color color for the active tab text -function TabControl:setActiveTabTextColor(self, ActiveTabTextColor) end - ----Gets the value of the TabHeight property. ----@param self TabControl self ----@return number Height of the tab header area -function TabControl:getTabHeight(self) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param child table The child element to add ----@return Container self For method chaining ----@protected -function TabControl:addChild(child) end - -function TabControl:mouse_scroll() end - ----Sets the value of the Tabs property. ----@param self TabControl self ----@param Tabs table of tab definitions -function TabControl:setTabs(self, Tabs) end - -function TabControl:drawText() end - -function TabControl:mouse_up() end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@protected -function TabControl:sortChildrenEvents() end - -function TabControl:setCursor() end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@protected -function TabControl:render() end - -function TabControl:mouse_drag() end - ----Gets the value of the Tabs property. ----@param self TabControl self ----@return table List of tab definitions -function TabControl:getTabs(self) end - ----@param element table The element to assign to a tab ----@param tabId number The ID of the tab to assign the element to ----@return TabControl self For method chaining -function TabControl:setTab(element, tabId) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param child table The child element to check ----@return boolean Whether the child should be visible ----@protected -function TabControl:isChildVisible(child) end - -function TabControl:textBg() end - ----Gets the value of the HeaderBackground property. ----@param self TabControl self ----@return color Background color for the tab header area -function TabControl:getHeaderBackground(self) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@return number yOffset The Y offset for content ----@protected -function TabControl:getContentYOffset() end - ----Sets the value of the HeaderBackground property. ----@param self TabControl self ----@param HeaderBackground color color for the tab header area -function TabControl:setHeaderBackground(self, HeaderBackground) end - -function TabControl:multiBlit() end - -function TabControl:textFg() end - -function TabControl:mouse_move() end - ----Sets the value of the ActiveTabBackground property. ----@param self TabControl self ----@param ActiveTabBackground color color for the active tab -function TabControl:setActiveTabBackground(self, ActiveTabBackground) end - -function TabControl:drawFg() end - ----@class ElementManager -local ElementManager = {} - ----Gets an Plugin API by name ----@param name string The name of the API to get ----@return table API The API -function ElementManager.getAPI(name) end - ----Gets an element by name. If the element is not loaded, it will try to load it first. ----@param name string The name of the element to get ----@return table Element The element class -function ElementManager.getElement(name) end - ----Loads an element by name. This will load the element and apply any plugins to it. ----@param name string The name of the element to load -function ElementManager.loadElement(name) end - ----Gets a list of all elements ----@return table ElementList A list of all elements -function ElementManager.getElementList() end - ----@class List : VisualElement ----@field selectedForeground color Text color for selected items ----@field items table List of items to display. Items can be tables with properties including selected state ----@field selectable boolean Whether items in the list can be selected ----@field multiSelection boolean Whether multiple items can be selected at once ----@field offset number Current scroll offset for viewing long lists ----@field selectedBackground color Background color for selected items -local List = {} - ----Sets the value of the Selectable property. ----@param self List self ----@param Selectable boolean Whether items in the list can be selected -function List:setSelectable(self, Selectable) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param button number The mouse button that was clicked ----@param x number The x-coordinate of the click ----@param y number The y-coordinate of the click ----@return boolean Whether the event was handled ----@protected -function List:mouse_click(button, x, y) end - ----Clears all items from the list ----@return List self The List instance -function List:clear() end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param direction number The direction of the scroll (1 for down, -1 for up) ----@param x number The x-coordinate of the scroll ----@param y number The y-coordinate of the scroll ----@return boolean Whether the event was handled ----@protected -function List:mouse_scroll(direction, x, y) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@protected -function List:render() end - ----Scrolls the list to the top ----@return List self The List instance -function List:scrollToTop() end - ----Scrolls the list to the bottom ----@return List self The List instance -function List:scrollToBottom() end - ----Registers a callback for the select event ----@param callback function The callback function to register ----@return List self The List instance -function List:onSelect(callback) end - ----Sets the value of the SelectedForeground property. ----@param self List self ----@param SelectedForeground color Text color for selected items -function List:setSelectedForeground(self, SelectedForeground) end - ----Gets the value of the MultiSelection property. ----@param self List self ----@return boolean false Whether multiple items can be selected at once -function List:getMultiSelection(self) end - ----Gets first selected item ----@return table ? selected The first item -function List:getSelectedItem() end - ----Gets the currently selected items ----@return table selected List of selected items -function List:getSelectedItems() end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param props table The properties to initialize the element with ----@param basalt table The basalt instance ----@return List self The initialized instance ----@protected -function List:init(props, basalt) end - ----Adds an item to the list ----@param text string |table The item to add (string or item table) ----@return List self The List instance -function List:addItem(text) end - ----Sets the value of the MultiSelection property. ----@param self List self ----@param MultiSelection boolean Whether multiple items can be selected at once -function List:setMultiSelection(self, MultiSelection) end - ----Registers a function to handle the onSelect event. ----@param index number ----@param item table ----@param self List self ----@param func function The function to be called when the event fires -function List:onOnSelect(self, func) end - ----Removes an item from the list ----@param index number The index of the item to remove ----@return List self The List instance -function List:removeItem(index) end - ----Gets the value of the Items property. ----@param self List self ----@return table {} List of items to display. Items can be tables with properties including selected state -function List:getItems(self) end - ----Sets the value of the SelectedBackground property. ----@param self List self ----@param SelectedBackground color Background color for selected items -function List:setSelectedBackground(self, SelectedBackground) end - ----Gets the value of the SelectedForeground property. ----@param self List self ----@return color white Text color for selected items -function List:getSelectedForeground(self) end - ----Gets the value of the Offset property. ----@param self List self ----@return number 0 Current scroll offset for viewing long lists -function List:getOffset(self) end - ----Gets the value of the SelectedBackground property. ----@param self List self ----@return color blue Background color for selected items -function List:getSelectedBackground(self) end - ----Sets the value of the Offset property. ----@param self List self ----@param Offset number Current scroll offset for viewing long lists -function List:setOffset(self, Offset) end - ----Gets the value of the Selectable property. ----@param self List self ----@return boolean true Whether items in the list can be selected -function List:getSelectable(self) end - ----Sets the value of the Items property. ----@param self List self ----@param Items table List of items to display. Items can be tables with properties including selected state -function List:setItems(self, Items) end - ----@class Button : VisualElement ----@field text string Button text -local Button = {} - ----Gets the value of the Text property. ----@param self Button self ----@return string Button Button text -function Button:getText(self) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param props table The properties to initialize the element with ----@param basalt table The basalt instance ----@protected -function Button:init(props, basalt) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@protected -function Button:render() end - ----Sets the value of the Text property. ----@param self Button self ----@param Text string Button text -function Button:setText(self, Text) end - ----@class Benchmark -local Benchmark = {} - ----Starts a custom benchmark ----@param name string The name of the benchmark -function API.start(name) end - ----Stops a custom benchmark ----@param name string The name of the benchmark to stop -function API.stop(name) end - ----Gets statistics for a benchmark ----@param name string The name of the benchmark ----@return table ? stats The benchmark statistics or nil -function API.getStats(name) end - ----Clears all custom benchmarks -function API.clearAll() end - ----Clears a specific benchmark ----@param name string The name of the benchmark to clear -function API.clear(name) end - ----@class Tree : VisualElement ----@field horizontalOffset number Current horizontal scroll position ----@field selectedNode table nil Currently selected node ----@field expandedNodes table Table of nodes that are currently expanded ----@field nodes table The tree structure containing node objects with {text, children} properties ----@field scrollOffset number Current vertical scroll position ----@field selectedColor color Background color of selected node ----@field nodeColor color Color of unselected nodes -local Tree = {} - ----Gets the value of the ScrollOffset property. ----@param self Tree self ----@return number 0 Current vertical scroll position -function Tree:getScrollOffset(self) end - ----Gets the value of the SelectedNode property. ----@param self Tree self ----@return table ? nil Currently selected node -function Tree:getSelectedNode(self) end - ----Collapses a node ----@param node table The node to collapse ----@return Tree self The Tree instance -function Tree:collapseNode(node) end - ----Gets the value of the NodeColor property. ----@param self Tree self ----@return color white Color of unselected nodes -function Tree:getNodeColor(self) end - ----Gets the value of the ExpandedNodes property. ----@param self Tree self ----@return table {} Table of nodes that are currently expanded -function Tree:getExpandedNodes(self) end - ----Expands a node ----@param node table The node to expand ----@return Tree self The Tree instance -function Tree:expandNode(node) end - ----Gets the value of the SelectedColor property. ----@param self Tree self ----@return color lightBlue Background color of selected node -function Tree:getSelectedColor(self) end - ----Toggles a node's expanded state ----@param node table The node to toggle ----@return Tree self The Tree instance -function Tree:toggleNode(node) end - ----Sets the value of the HorizontalOffset property. ----@param self Tree self ----@param HorizontalOffset number Current horizontal scroll position -function Tree:setHorizontalOffset(self, HorizontalOffset) end - ----Sets the value of the SelectedNode property. ----@param self Tree self ----@param SelectedNode table nil Currently selected node -function Tree:setSelectedNode(self, SelectedNode) end - ----Sets the value of the Nodes property. ----@param self Tree self ----@param Nodes table The tree structure containing node objects with {text, children} properties -function Tree:setNodes(self, Nodes) end - ----Gets the value of the Nodes property. ----@param self Tree self ----@return table {} The tree structure containing node objects with {text, children} properties -function Tree:getNodes(self) end - ----Gets the size of the tree ----@return number width The width of the tree ----@return number height The height of the tree -function Tree:getNodeSize() end - ----Initializes the Tree instance ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param props table The properties to initialize the element with ----@param basalt table The basalt instance ----@return Tree self The initialized instance ----@protected -function Tree:init(props, basalt) end - ----Gets the value of the HorizontalOffset property. ----@param self Tree self ----@return number 0 Current horizontal scroll position -function Tree:getHorizontalOffset(self) end - ----Registers a callback for when a node is selected ----@param callback function The callback function ----@return Tree self The Tree instance -function Tree:onSelect(callback) end - ----Sets the value of the ExpandedNodes property. ----@param self Tree self ----@param ExpandedNodes table Table of nodes that are currently expanded -function Tree:setExpandedNodes(self, ExpandedNodes) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@protected -function Tree:render() end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param direction number The scroll direction (1 for up, -1 for down) ----@param x number The x position of the scroll ----@param y number The y position of the scroll ----@return boolean handled Whether the event was handled ----@protected -function Tree:mouse_scroll(direction, x, y) end - ----Handles mouse click events ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param button number The button that was clicked ----@param x number The x position of the click ----@param y number The y position of the click ----@return boolean handled Whether the event was handled ----@protected -function Tree:mouse_click(button, x, y) end - ----Sets the value of the SelectedColor property. ----@param self Tree self ----@param SelectedColor color Background color of selected node -function Tree:setSelectedColor(self, SelectedColor) end - ----Sets the value of the NodeColor property. ----@param self Tree self ----@param NodeColor color Color of unselected nodes -function Tree:setNodeColor(self, NodeColor) end - ----Sets the value of the ScrollOffset property. ----@param self Tree self ----@param ScrollOffset number Current vertical scroll position -function Tree:setScrollOffset(self, ScrollOffset) end - ----@class Log -local Log = {} - ----Sends a debug message to the logger. -function Log.debug() end - ----Sends an error message to the logger. -function Log.error() end - ----Sends a warning message to the logger. -function Log.warn() end - ----Sets if the logger should log to a file. -function Log.setLogToFile() end - ----Sends an info message to the logger. -function Log.info() end - ----Sets if the logger should log -function Log.setEnabled() end - ----@class AnimationInstance -local AnimationInstance = {} - ----Creates a new AnimationInstance ----@param element VisualElement The element to animate ----@param animType string The type of animation ----@param args table The animation arguments ----@param duration number Duration in seconds ----@param easing string The easing function name ----@return AnimationInstance The new animation instance -function AnimationInstance.new(element, animType, args, duration, easing) end - ----Gets called when the animation is completed -function AnimationInstance:complete() end - ----Starts the animation ----@return AnimationInstance self The animation instance -function AnimationInstance:start() end - ----Updates the animation ----@param elapsed number The elapsed time in seconds ----@return boolean Whether the animation is finished -function AnimationInstance:update(elapsed) end - ----@class Reactive -local Reactive = {} - ----@class Display : VisualElement -local Display = {} - ----Returns the current window object ----@return table window The current window object -function Display:getWindow() end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param props table The properties to initialize the element with ----@param basalt table The basalt instance ----@protected -function Display:init(props, basalt) end - ----Writes text to the display at the given position with the given foreground and background colors ----@param x number The x position to write to ----@param y number The y position to write to ----@param text string The text to write ----@return Display self The display instance -function Display:write(x, y, text) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@protected -function Display:render() end - ----@class TextBox : VisualElement ----@field cursorX number Cursor X position ----@field autoCompleteMinChars number Minimum characters required before showing suggestions ----@field autoCompleteMaxItems number Maximum number of visible suggestions ----@field autoCompleteEnabled boolean Whether autocomplete suggestions are enabled ----@field autoCompleteMaxWidth number Maximum width of the autocomplete popup (0 uses the textbox width) ----@field autoCompleteBackground color Background color of the suggestion popup ----@field autoCompleteZOffset number Z-index offset applied to the popup frame ----@field autoCompleteOffsetY number Vertical offset applied to the popup frame relative to the TextBox bottom edge ----@field autoCompleteAcceptOnClick boolean Whether clicking a suggestion accepts it immediately ----@field lines table Array of text lines ----@field autoCompleteTokenPattern string Pattern used to extract the current token for suggestions ----@field autoCompleteForeground color Foreground color of the suggestion popup ----@field autoCompleteSelectedForeground color Foreground color for the selected suggestion ----@field scrollX number Horizontal scroll offset ----@field autoCompleteSelectedBackground color Background color for the selected suggestion ----@field autoCompleteAcceptOnEnter boolean Whether pressing Enter accepts the current suggestion ----@field editable boolean Whether text can be edited ----@field autoCompleteBorderColor color Color of the popup border when enabled ----@field autoCompleteOffsetX number Horizontal offset applied to the popup frame relative to the TextBox ----@field autoCompleteShowBorder boolean Whether to render a character border around the popup ----@field autoCompleteCloseOnEscape boolean Whether pressing Escape closes the popup ----@field syntaxPatterns table Syntax highlighting patterns ----@field autoCompleteProvider function Optional suggestion provider returning a list for the current prefix ----@field scrollY number Vertical scroll offset ----@field autoCompleteItems table List of suggestions used when no provider is supplied ----@field cursorY number Cursor Y position (line number) ----@field autoCompleteCaseInsensitive boolean Whether suggestions should match case-insensitively ----@field cursorColor number Color of the cursor -local TextBox = {} - ----Sets the value of the AutoCompleteZOffset property. ----@param self TextBox self ----@param AutoCompleteZOffset number Z-index offset applied to the popup frame -function TextBox:setAutoCompleteZOffset(self, AutoCompleteZOffset) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param key number The key that was pressed ----@return boolean handled Whether the event was handled ----@protected -function TextBox:key(key) end - ----Sets the value of the Editable property. ----@param self TextBox self ----@param Editable boolean Whether text can be edited -function TextBox:setEditable(self, Editable) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@protected -function TextBox:render() end - ----Sets the value of the ScrollY property. ----@param self TextBox self ----@param ScrollY number Vertical scroll offset -function TextBox:setScrollY(self, ScrollY) end - ----Gets the value of the CursorY property. ----@param self TextBox self ----@return number 1 Cursor Y position (line number) -function TextBox:getCursorY(self) end - ----Gets the value of the AutoCompleteBorderColor property. ----@param self TextBox self ----@return color black Color of the popup border when enabled -function TextBox:getAutoCompleteBorderColor(self) end - ----Sets the value of the AutoCompleteAcceptOnClick property. ----@param self TextBox self ----@param AutoCompleteAcceptOnClick boolean Whether clicking a suggestion accepts it immediately -function TextBox:setAutoCompleteAcceptOnClick(self, AutoCompleteAcceptOnClick) end - ----Gets the value of the AutoCompleteItems property. ----@param self TextBox self ----@return table {} List of suggestions used when no provider is supplied -function TextBox:getAutoCompleteItems(self) end - ----Gets the value of the Editable property. ----@param self TextBox self ----@return boolean true Whether text can be edited -function TextBox:getEditable(self) end - ----Gets the value of the AutoCompleteMaxItems property. ----@param self TextBox self ----@return number 6 Maximum number of visible suggestions -function TextBox:getAutoCompleteMaxItems(self) end - ----Gets the value of the AutoCompleteBackground property. ----@param self TextBox self ----@return color lightGray Background color of the suggestion popup -function TextBox:getAutoCompleteBackground(self) end - ----Gets the value of the AutoCompleteAcceptOnClick property. ----@param self TextBox self ----@return boolean true Whether clicking a suggestion accepts it immediately -function TextBox:getAutoCompleteAcceptOnClick(self) end - ----Gets the value of the AutoCompleteZOffset property. ----@param self TextBox self ----@return number 1 Z-index offset applied to the popup frame -function TextBox:getAutoCompleteZOffset(self) end - ----Clears all syntax highlighting patterns ----@return TextBox self -function TextBox:clearSyntaxPatterns() end - ----Gets the value of the AutoCompleteCaseInsensitive property. ----@param self TextBox self ----@return boolean true Whether suggestions should match case-insensitively -function TextBox:getAutoCompleteCaseInsensitive(self) end - ----Sets the value of the AutoCompleteTokenPattern property. ----@param self TextBox self ----@param AutoCompleteTokenPattern string Pattern used to extract the current token for suggestions -function TextBox:setAutoCompleteTokenPattern(self, AutoCompleteTokenPattern) end - ----Sets the value of the AutoCompleteShowBorder property. ----@param self TextBox self ----@param AutoCompleteShowBorder boolean Whether to render a character border around the popup -function TextBox:setAutoCompleteShowBorder(self, AutoCompleteShowBorder) end - ----Gets the value of the AutoCompleteCloseOnEscape property. ----@param self TextBox self ----@return boolean true Whether pressing Escape closes the popup -function TextBox:getAutoCompleteCloseOnEscape(self) end - ----Sets the value of the AutoCompleteProvider property. ----@param self TextBox self ----@param AutoCompleteProvider function Optional suggestion provider returning a list for the current prefix -function TextBox:setAutoCompleteProvider(self, AutoCompleteProvider) end - ----Sets the value of the Lines property. ----@param self TextBox self ----@param Lines table Array of text lines -function TextBox:setLines(self, Lines) end - ----Updates the viewport to keep the cursor in view ----@return TextBox self The TextBox instance -function TextBox:updateViewport() end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param direction number The scroll direction ----@param x number The x position of the scroll ----@param y number The y position of the scroll ----@return boolean handled Whether the event was handled ----@protected -function TextBox:mouse_scroll(direction, x, y) end - ----Gets the value of the CursorX property. ----@param self TextBox self ----@return number 1 Cursor X position -function TextBox:getCursorX(self) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param props table The properties to initialize the element with ----@param basalt table The basalt instance ----@return TextBox self The initialized instance ----@protected -function TextBox:init(props, basalt) end - ----Gets the value of the AutoCompleteForeground property. ----@param self TextBox self ----@return color black Foreground color of the suggestion popup -function TextBox:getAutoCompleteForeground(self) end - ----Sets the value of the AutoCompleteSelectedBackground property. ----@param self TextBox self ----@param AutoCompleteSelectedBackground color Background color for the selected suggestion -function TextBox:setAutoCompleteSelectedBackground(self, AutoCompleteSelectedBackground) end - ----Sets the value of the AutoCompleteItems property. ----@param self TextBox self ----@param AutoCompleteItems table List of suggestions used when no provider is supplied -function TextBox:setAutoCompleteItems(self, AutoCompleteItems) end - ----Sets the value of the AutoCompleteAcceptOnEnter property. ----@param self TextBox self ----@param AutoCompleteAcceptOnEnter boolean Whether pressing Enter accepts the current suggestion -function TextBox:setAutoCompleteAcceptOnEnter(self, AutoCompleteAcceptOnEnter) end - ----Sets the value of the AutoCompleteBorderColor property. ----@param self TextBox self ----@param AutoCompleteBorderColor color Color of the popup border when enabled -function TextBox:setAutoCompleteBorderColor(self, AutoCompleteBorderColor) end - ----Sets the value of the CursorX property. ----@param self TextBox self ----@param CursorX number Cursor X position -function TextBox:setCursorX(self, CursorX) end - ----Gets the value of the AutoCompleteEnabled property. ----@param self TextBox self ----@return boolean false Whether autocomplete suggestions are enabled -function TextBox:getAutoCompleteEnabled(self) end - ----Sets the value of the AutoCompleteMaxItems property. ----@param self TextBox self ----@param AutoCompleteMaxItems number Maximum number of visible suggestions -function TextBox:setAutoCompleteMaxItems(self, AutoCompleteMaxItems) end - ----Gets the value of the AutoCompleteAcceptOnEnter property. ----@param self TextBox self ----@return boolean true Whether pressing Enter accepts the current suggestion -function TextBox:getAutoCompleteAcceptOnEnter(self) end - ----Gets the text of the TextBox ----@return string text The text of the TextBox -function TextBox:getText() end - ----Gets the value of the AutoCompleteProvider property. ----@param self TextBox self ----@return function nil Optional suggestion provider returning a list for the current prefix -function TextBox:getAutoCompleteProvider(self) end - ----Sets the value of the AutoCompleteOffsetY property. ----@param self TextBox self ----@param AutoCompleteOffsetY number Vertical offset applied to the popup frame relative to the TextBox bottom edge -function TextBox:setAutoCompleteOffsetY(self, AutoCompleteOffsetY) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@protected -function TextBox:paste() end - ----Sets the value of the SyntaxPatterns property. ----@param self TextBox self ----@param SyntaxPatterns table Syntax highlighting patterns -function TextBox:setSyntaxPatterns(self, SyntaxPatterns) end - ----Sets the text of the TextBox ----@param text string The text to set ----@return TextBox self The TextBox instance -function TextBox:setText(text) end - ----Sets the value of the AutoCompleteMaxWidth property. ----@param self TextBox self ----@param AutoCompleteMaxWidth number Maximum width of the autocomplete popup (0 uses the textbox width) -function TextBox:setAutoCompleteMaxWidth(self, AutoCompleteMaxWidth) end - -function TextBox:destroy() end - ----Sets the value of the AutoCompleteMinChars property. ----@param self TextBox self ----@param AutoCompleteMinChars number Minimum characters required before showing suggestions -function TextBox:setAutoCompleteMinChars(self, AutoCompleteMinChars) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param button number The button that was clicked ----@param x number The x position of the click ----@param y number The y position of the click ----@return boolean handled Whether the event was handled ----@protected -function TextBox:mouse_click(button, x, y) end - ----Sets the value of the AutoCompleteEnabled property. ----@param self TextBox self ----@param AutoCompleteEnabled boolean Whether autocomplete suggestions are enabled -function TextBox:setAutoCompleteEnabled(self, AutoCompleteEnabled) end - ----Sets the value of the CursorColor property. ----@param self TextBox self ----@param CursorColor number Color of the cursor -function TextBox:setCursorColor(self, CursorColor) end - ----Gets the value of the AutoCompleteShowBorder property. ----@param self TextBox self ----@return boolean true Whether to render a character border around the popup -function TextBox:getAutoCompleteShowBorder(self) end - ----Sets the value of the ScrollX property. ----@param self TextBox self ----@param ScrollX number Horizontal scroll offset -function TextBox:setScrollX(self, ScrollX) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param char string The character that was typed ----@return boolean handled Whether the event was handled ----@protected -function TextBox:char(char) end - ----Sets the value of the AutoCompleteCaseInsensitive property. ----@param self TextBox self ----@param AutoCompleteCaseInsensitive boolean Whether suggestions should match case-insensitively -function TextBox:setAutoCompleteCaseInsensitive(self, AutoCompleteCaseInsensitive) end - ----Gets the value of the AutoCompleteSelectedForeground property. ----@param self TextBox self ----@return color white Foreground color for the selected suggestion -function TextBox:getAutoCompleteSelectedForeground(self) end - ----Adds a new syntax highlighting pattern ----@param pattern string The regex pattern to match ----@param color number The color to apply ----@return TextBox self The TextBox instance -function TextBox:addSyntaxPattern(pattern, color) end - ----Gets the value of the AutoCompleteTokenPattern property. ----@param self TextBox self ----@return string "[%w_]+" Pattern used to extract the current token for suggestions -function TextBox:getAutoCompleteTokenPattern(self) end - ----Gets the value of the AutoCompleteMaxWidth property. ----@param self TextBox self ----@return number 0 Maximum width of the autocomplete popup (0 uses the textbox width) -function TextBox:getAutoCompleteMaxWidth(self) end - ----Gets the value of the AutoCompleteOffsetY property. ----@param self TextBox self ----@return number 1 Vertical offset applied to the popup frame relative to the TextBox bottom edge -function TextBox:getAutoCompleteOffsetY(self) end - ----Sets the value of the AutoCompleteOffsetX property. ----@param self TextBox self ----@param AutoCompleteOffsetX number Horizontal offset applied to the popup frame relative to the TextBox -function TextBox:setAutoCompleteOffsetX(self, AutoCompleteOffsetX) end - ----Gets the value of the CursorColor property. ----@param self TextBox self ----@return number nil Color of the cursor -function TextBox:getCursorColor(self) end - ----Gets the value of the ScrollX property. ----@param self TextBox self ----@return number 0 Horizontal scroll offset -function TextBox:getScrollX(self) end - ----Sets the value of the CursorY property. ----@param self TextBox self ----@param CursorY number Cursor Y position (line number) -function TextBox:setCursorY(self, CursorY) end - ----Gets the value of the SyntaxPatterns property. ----@param self TextBox self ----@return table {} Syntax highlighting patterns -function TextBox:getSyntaxPatterns(self) end - ----Gets the value of the AutoCompleteMinChars property. ----@param self TextBox self ----@return number 1 Minimum characters required before showing suggestions -function TextBox:getAutoCompleteMinChars(self) end - ----Sets the value of the AutoCompleteCloseOnEscape property. ----@param self TextBox self ----@param AutoCompleteCloseOnEscape boolean Whether pressing Escape closes the popup -function TextBox:setAutoCompleteCloseOnEscape(self, AutoCompleteCloseOnEscape) end - ----Gets the value of the AutoCompleteSelectedBackground property. ----@param self TextBox self ----@return color gray Background color for the selected suggestion -function TextBox:getAutoCompleteSelectedBackground(self) end - ----Gets the value of the Lines property. ----@param self TextBox self ----@return table {} Array of text lines -function TextBox:getLines(self) end - ----Sets the value of the AutoCompleteForeground property. ----@param self TextBox self ----@param AutoCompleteForeground color Foreground color of the suggestion popup -function TextBox:setAutoCompleteForeground(self, AutoCompleteForeground) end - ----Sets the value of the AutoCompleteBackground property. ----@param self TextBox self ----@param AutoCompleteBackground color Background color of the suggestion popup -function TextBox:setAutoCompleteBackground(self, AutoCompleteBackground) end - ----Sets the value of the AutoCompleteSelectedForeground property. ----@param self TextBox self ----@param AutoCompleteSelectedForeground color Foreground color for the selected suggestion -function TextBox:setAutoCompleteSelectedForeground(self, AutoCompleteSelectedForeground) end - ----Gets the value of the ScrollY property. ----@param self TextBox self ----@return number 0 Vertical scroll offset -function TextBox:getScrollY(self) end - ----Gets the value of the AutoCompleteOffsetX property. ----@param self TextBox self ----@return number 0 Horizontal offset applied to the popup frame relative to the TextBox -function TextBox:getAutoCompleteOffsetX(self) end - ----Removes a syntax pattern by index (1-based) ----@param index number The index of the pattern to remove ----@return TextBox self -function TextBox:removeSyntaxPattern(index) end - ----@class BaseFrame : Container ----@field term term term.current() The terminal or (monitor) peripheral object to render to -local BaseFrame = {} - ----Sets the value of the Term property. ----@param self BaseFrame self ----@param Term term term.current() The terminal or (monitor) peripheral object to render to -function BaseFrame:setTerm(self, Term) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param props table The properties to initialize the element with ----@param basalt table The basalt instance ----@return table self The initialized instance ----@protected -function BaseFrame:init(props, basalt) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param key number The key that was pressed ----@protected -function BaseFrame:key(key) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param char string The character that was pressed ----@protected -function BaseFrame:char(char) end - ----Gets the value of the Term property. ----@param self BaseFrame self ----@return term |peripheral term.current() The terminal or (monitor) peripheral object to render to -function BaseFrame:getTerm(self) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@protected -function BaseFrame:term_resize() end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param x number The x position to render to ----@param y number The y position to render to ----@param width number The width of the text ----@param height number The height of the text ----@param text string The text to render ----@param fg string The foreground color ----@param bg string The background color ----@protected -function BaseFrame:multiBlit(x, y, width, height, text, fg, bg) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param x number The x position to render to ----@param y number The y position to render to ----@param text string The text to render ----@param bg colors The background color ----@protected -function BaseFrame:drawText(x, y, text, bg) end - -function BaseFrame:drawBg() end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param x number The x position to render to ----@param y number The y position to render to ----@param text string The text to render ----@param fg colors The foreground color ----@protected -function BaseFrame:textFg(x, y, text, fg) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param key number The key that was released ----@protected -function BaseFrame:key_up(key) end - ----Initializes a new state for this element ----@param self BaseFrame The element to initialize state for ----@param name string The name of the state ----@param default any The default value of the state ----@return BaseFrame self The element instance -function BaseFrame:initializeState(self, name, default) end - ----Shows the debug log frame ----@param self BaseFrame The frame to show debug log in -function BaseFrame.openConsole(self) end - ----Toggles the debug log frame ----@param self BaseFrame The frame to toggle debug log for -function BaseFrame.toggleConsole(self) end - -function BaseFrame:dispatchEvent() end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param button number The button that was clicked ----@param x number The x position of the mouse ----@param y number The y position of the mouse ----@protected -function BaseFrame:mouse_click(button, x, y) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param x number The x position to render to ----@param y number The y position to render to ----@param text string The text to render ----@param bg colors The background color ----@protected -function BaseFrame:textBg(x, y, text, bg) end - ----Hides the debug log frame ----@param self BaseFrame The frame to hide debug log for -function BaseFrame.closeConsole(self) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@protected -function BaseFrame:render() end - ----Sets the cursor position ----@param x number The x position to set the cursor to ----@param y number The y position to set the cursor to ----@param blink boolean Whether the cursor should blink -function BaseFrame:setCursor(x, y, blink) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param x number The x position to render to ----@param y number The y position to render to ----@param text string The text to render ----@param fg string The foreground color ----@param bg string The background color ----@protected -function BaseFrame:blit(x, y, text, fg, bg) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param button number The button that was released ----@param x number The x position of the mouse ----@param y number The y position of the mouse ----@protected -function BaseFrame:mouse_up(button, x, y) end - -function BaseFrame:drawFg() end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param name string The name of the monitor that was touched ----@param x number The x position of the mouse ----@param y number The y position of the mouse ----@protected -function BaseFrame:monitor_touch(name, x, y) end - -function BaseFrame.setup() end +---Gets the value of the ViewOffset property. +---@param self ComboBox self +---@return number 0 The horizontal scroll offset for viewing long text +function ComboBox:getViewOffset(self) end ---@class DropDown : List ----@field dropSymbol string The symbol to show for DropDown indication ----@field isOpen boolean Whether the DropDown menu is currently open ---@field selectedText string The text to show when no item is selected +---@field isOpen boolean Whether the DropDown menu is currently open +---@field dropSymbol string The symbol to show for DropDown indication ---@field dropdownHeight number Maximum height of the DropDown menu when open local DropDown = {} ----Sets the value of the IsOpen property. ----@param self DropDown self ----@param IsOpen boolean Whether the DropDown menu is currently open -function DropDown:setIsOpen(self, IsOpen) end - ----Sets the value of the DropSymbol property. ----@param self DropDown self ----@param DropSymbol string The symbol to show for DropDown indication -function DropDown:setDropSymbol(self, DropSymbol) end - ----Gets the value of the IsOpen property. ----@param self DropDown self ----@return boolean false Whether the DropDown menu is currently open -function DropDown:getIsOpen(self) end - ----Sets the value of the SelectedText property. ----@param self DropDown self ----@param SelectedText string The text to show when no item is selected -function DropDown:setSelectedText(self, SelectedText) end - ----Gets the value of the SelectedText property. ----@param self DropDown self ----@return string "" The text to show when no item is selected -function DropDown:getSelectedText(self) end - ---Sets the value of the DropdownHeight property. ---@param self DropDown self ---@param DropdownHeight number Maximum height of the DropDown menu when open function DropDown:setDropdownHeight(self, DropdownHeight) end ----Gets the value of the DropSymbol property. +---Gets the value of the DropdownHeight property. ---@param self DropDown self ----@return string "\31" The symbol to show for DropDown indication -function DropDown:getDropSymbol(self) end +---@return number 5 Maximum height of the DropDown menu when open +function DropDown:getDropdownHeight(self) end ---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ---@protected function DropDown:render() end +---Sets the value of the DropSymbol property. +---@param self DropDown self +---@param DropSymbol string The symbol to show for DropDown indication +function DropDown:setDropSymbol(self, DropSymbol) end + +---Gets the value of the SelectedText property. +---@param self DropDown self +---@return string "" The text to show when no item is selected +function DropDown:getSelectedText(self) end + ---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ---@param button number The button that was clicked ---@param x number The x position of the click @@ -4180,24 +3146,108 @@ function DropDown:mouse_click(button, x, y) end ---@protected function DropDown:init(props, basalt) end ----Gets the value of the DropdownHeight property. +---Gets the value of the IsOpen property. ---@param self DropDown self ----@return number 5 Maximum height of the DropDown menu when open -function DropDown:getDropdownHeight(self) end +---@return boolean false Whether the DropDown menu is currently open +function DropDown:getIsOpen(self) end + +---Sets the value of the SelectedText property. +---@param self DropDown self +---@param SelectedText string The text to show when no item is selected +function DropDown:setSelectedText(self, SelectedText) end + +---Sets the value of the IsOpen property. +---@param self DropDown self +---@param IsOpen boolean Whether the DropDown menu is currently open +function DropDown:setIsOpen(self, IsOpen) end + +---Gets the value of the DropSymbol property. +---@param self DropDown self +---@return string "\31" The symbol to show for DropDown indication +function DropDown:getDropSymbol(self) end ---@class Image : VisualElement +---@field offsetX number Horizontal offset for viewing larger images ---@field currentFrame number Current animation frame +---@field offsetY number Vertical offset for viewing larger images ---@field bimg table The bimg image data ---@field autoResize boolean Whether to automatically resize the image when content exceeds bounds ----@field offsetX number Horizontal offset for viewing larger images ----@field offsetY number Vertical offset for viewing larger images local Image = {} +---Gets the foreground color at the specified position +---@param x number The x position +---@param y number The y position +---@param length number The length of the foreground color pattern to get +---@return string fg The foreground color pattern +function Image:getFg(x, y, length) end + +---Sets the text at the specified position +---@param x number The x position +---@param y number The y position +---@param text string The text to set +---@return Image self The Image instance +function Image:setText(x, y, text) end + +---Gets the value of the OffsetY property. +---@param self Image self +---@return number 0 Vertical offset for viewing larger images +function Image:getOffsetY(self) end + ---Gets the value of the Bimg property. ---@param self Image self ---@return table {} The bimg image data function Image:getBimg(self) end +---Sets the value of the Bimg property. +---@param self Image self +---@param Bimg table The bimg image data +function Image:setBimg(self, Bimg) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@protected +function Image:render() end + +---Sets the metadata of the image +---@param key string The key of the metadata to set +---@param value string The value of the metadata to set +---@return Image self The Image instance +function Image:setMetadata(key, value) end + +---Gets the value of the AutoResize property. +---@param self Image self +---@return boolean false Whether to automatically resize the image when content exceeds bounds +function Image:getAutoResize(self) end + +---Gets the metadata of the image +---@return table metadata The metadata of the image +function Image:getMetadata() end + +---Gets the value of the CurrentFrame property. +---@param self Image self +---@return number 1 Current animation frame +function Image:getCurrentFrame(self) end + +---Gets the specified frame +---@param frameIndex number The index of the frame to get +---@return table frame The frame data +function Image:getFrame(frameIndex) end + +---Sets the value of the OffsetY property. +---@param self Image self +---@param OffsetY number Vertical offset for viewing larger images +function Image:setOffsetY(self, OffsetY) end + +---Updates the specified frame with the provided data +---@param frameIndex number The index of the frame to update +---@param frame table The new frame data +---@return Image self The Image instance +function Image:updateFrame(frameIndex, frame) end + +---Gets the value of the OffsetX property. +---@param self Image self +---@return number 0 Horizontal offset for viewing larger images +function Image:getOffsetX(self) end + ---Gets pixel information at position ---@param x number X position ---@param y number Y position @@ -4210,87 +3260,21 @@ function Image:getPixelData(x, y) end ---@return Image self The Image instance function Image:nextFrame() end ----Adds a new frame to the image ----@return Image self The Image instance -function Image:addFrame() end - ----Sets the value of the Bimg property. ----@param self Image self ----@param Bimg table The bimg image data -function Image:setBimg(self, Bimg) end - ----Resizes the image to the specified width and height ----@param width number The new width of the image ----@param height number The new height of the image ----@return Image self The Image instance -function Image:resizeImage(width, height) end - ----Gets the text at the specified position ----@param x number The x position ----@param y number The y position ----@param length number The length of the text to get ----@return string text The text at the specified position -function Image:getText(x, y, length) end - ----Sets the value of the AutoResize property. ----@param self Image self ----@param AutoResize boolean Whether to automatically resize the image when content exceeds bounds -function Image:setAutoResize(self, AutoResize) end - ----Gets the value of the OffsetY property. ----@param self Image self ----@return number 0 Vertical offset for viewing larger images -function Image:getOffsetY(self) end - ----Gets the specified frame ----@param frameIndex number The index of the frame to get ----@return table frame The frame data -function Image:getFrame(frameIndex) end - ----Gets the foreground color at the specified position ----@param x number The x position ----@param y number The y position ----@param length number The length of the foreground color pattern to get ----@return string fg The foreground color pattern -function Image:getFg(x, y, length) end - ----Gets the background color at the specified position ----@param x number The x position ----@param y number The y position ----@param length number The length of the background color pattern to get ----@return string bg The background color pattern -function Image:getBg(x, y, length) end - ---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param props table The properties to initialize the element with +---@param basalt table The basalt instance +---@return Image self The initialized instance ---@protected -function Image:render() end - ----Sets the value of the OffsetY property. ----@param self Image self ----@param OffsetY number Vertical offset for viewing larger images -function Image:setOffsetY(self, OffsetY) end - ----Sets the background color at the specified position ----@param x number The x position ----@param y number The y position ----@param pattern string The background color pattern ----@return Image self The Image instance -function Image:setBg(x, y, pattern) end +function Image:init(props, basalt) end ---Sets the value of the OffsetX property. ---@param self Image self ---@param OffsetX number Horizontal offset for viewing larger images function Image:setOffsetX(self, OffsetX) end ----Gets the size of the image ----@return number width The width of the image ----@return number height The height of the image -function Image:getImageSize() end - ----Sets the value of the CurrentFrame property. ----@param self Image self ----@param CurrentFrame number Current animation frame -function Image:setCurrentFrame(self, CurrentFrame) end +---Adds a new frame to the image +---@return Image self The Image instance +function Image:addFrame() end ---Sets the pixel at the specified position ---@param x number The x position @@ -4301,22 +3285,42 @@ function Image:setCurrentFrame(self, CurrentFrame) end ---@return Image self The Image instance function Image:setPixel(x, y, char, fg, bg) end ----Gets the value of the CurrentFrame property. +---Gets the background color at the specified position +---@param x number The x position +---@param y number The y position +---@param length number The length of the background color pattern to get +---@return string bg The background color pattern +function Image:getBg(x, y, length) end + +---Resizes the image to the specified width and height +---@param width number The new width of the image +---@param height number The new height of the image +---@return Image self The Image instance +function Image:resizeImage(width, height) end + +---Sets the value of the CurrentFrame property. ---@param self Image self ----@return number 1 Current animation frame -function Image:getCurrentFrame(self) end +---@param CurrentFrame number Current animation frame +function Image:setCurrentFrame(self, CurrentFrame) end ----Updates the specified frame with the provided data ----@param frameIndex number The index of the frame to update ----@param frame table The new frame data ----@return Image self The Image instance -function Image:updateFrame(frameIndex, frame) end +---Gets the text at the specified position +---@param x number The x position +---@param y number The y position +---@param length number The length of the text to get +---@return string text The text at the specified position +function Image:getText(x, y, length) end ----Sets the metadata of the image ----@param key string The key of the metadata to set ----@param value string The value of the metadata to set +---Sets the background color at the specified position +---@param x number The x position +---@param y number The y position +---@param pattern string The background color pattern ---@return Image self The Image instance -function Image:setMetadata(key, value) end +function Image:setBg(x, y, pattern) end + +---Sets the value of the AutoResize property. +---@param self Image self +---@param AutoResize boolean Whether to automatically resize the image when content exceeds bounds +function Image:setAutoResize(self, AutoResize) end ---Sets the foreground color at the specified position ---@param x number The x position @@ -4325,31 +3329,1082 @@ function Image:setMetadata(key, value) end ---@return Image self The Image instance function Image:setFg(x, y, pattern) end ----Gets the value of the AutoResize property. ----@param self Image self ----@return boolean false Whether to automatically resize the image when content exceeds bounds -function Image:getAutoResize(self) end +---Gets the size of the image +---@return number width The width of the image +---@return number height The height of the image +function Image:getImageSize() end ----Sets the text at the specified position ----@param x number The x position ----@param y number The y position ----@param text string The text to set ----@return Image self The Image instance -function Image:setText(x, y, text) end +---@class PropertySystem +local PropertySystem = {} ----Gets the metadata of the image ----@return table metadata The metadata of the image -function Image:getMetadata() end +---Adds a setter hook to the PropertySystem. Setter hooks are functions that are called before a property is set. +---@param hook function The hook function to add +function PropertySystem.addSetterHook(hook) end + +---Gets a property configuration +---@param name string The name of the property +---@return table config The configuration of the property +function PropertySystem:getPropertyConfig(name) end + +---Observers a property +---@param name string The name of the property +---@param callback function The callback function to call when the property changes +---@return table self The PropertySystem +function PropertySystem:observe(name, callback) end + +---Creates a blueprint of an element class with all its properties +---@param elementClass table The element class to create a blueprint from +---@return table blueprint A table containing all property definitions +function PropertySystem.blueprint(elementClass) end + +---Removes all observers from a property +---@return table self The PropertySystem +function PropertySystem:removeAllObservers() end + +---Creates an element from a blueprint +---@param elementClass table The element class to create from the blueprint +---@param blueprint table The blueprint to create the element from +---@return table element The created element +function PropertySystem.createFromBlueprint(elementClass, blueprint) end + +---Adds a property to the PropertySystem on instance level +---@param name string The name of the property +---@param config table The configuration of the property +---@return table self The PropertySystem +function PropertySystem:instanceProperty(name, config) end + +---Removes an observer from a property +---@param name string The name of the property +---@param callback function The callback function to remove +---@return table self The PropertySystem +function PropertySystem:removeObserver(name, callback) end + +---Combines multiple properties into a single getter and setter +---@param class table The element class to combine the properties for +---@param name string The name of the combined property +function PropertySystem.combineProperties(class, name) end + +---Defines a property for an element class +---@param class table The element class to define the property for +---@param name string The name of the property +---@param config table The configuration of the property +function PropertySystem.defineProperty(class, name, config) end + +---Initializes the PropertySystem IS USED INTERNALLY +---@return table self The PropertySystem +function PropertySystem:__init() end + +---Removes a property from the PropertySystem on instance level +---@param name string The name of the property +---@return table self The PropertySystem +function PropertySystem:removeProperty(name) end + +---Update call for a property IS USED INTERNALLY +---@param name string The name of the property +---@param value any The value of the property +---@return table self The PropertySystem +function PropertySystem:_updateProperty(name, value) end + +---@class basalt +local basalt = {} + +---Returns a Plugin API +---@param name string The name of the plugin +---@return table Plugin The plugin API +function basalt.getAPI(name) end + +---Creates and returns a new BaseFrame +---@return BaseFrame BaseFrame The created frame instance +function basalt.createFrame() end + +---Gets or creates the main frame +---@return BaseFrame BaseFrame The main frame instance +function basalt.getMainFrame() end + +---Sets the active frame +---@param frame BaseFrame The frame to set as active +function basalt.setActiveFrame(frame) end + +---Returns the element manager instance +---@return table ElementManager The element manager +function basalt.getElementManager() end + +---Triggers a custom event and calls all registered callbacks +---@param eventName string The name of the event to trigger +function basalt.triggerEvent(eventName) end + +---Returns an element's class without creating a instance +---@param name string The name of the element +---@return table Element The element class +function basalt.getElementClass(name) end + +---Removes a scheduled update +---@param func thread The scheduled function to remove +---@return boolean success Whether the scheduled function was removed +function basalt.removeSchedule(func) end + +---Removes a callback function for a specific event +---@param eventName string The name of the event +---@param callback function The callback function to remove +---@return boolean success Whether the callback was found and removed +function basalt.removeEvent(eventName, callback) end + +---Returns the active frame +---@return BaseFrame ? BaseFrame The frame to set as active +function basalt.getActiveFrame() end + +---Runs basalt once, can be used to update the UI manually, but you have to feed it the events +function basalt.update() end + +---Creates and returns a new UI element of the specified type. +---@param type string The type of element to create (e.g. "Button", "Label", "BaseFrame") +---@return table element The created element instance +function basalt.create(type) end + +---Registers a callback function for a specific event +---@param eventName string The name of the event to listen for (e.g. "mouse_click", "key", "timer") +---@param callback function The callback function to execute when the event occurs +function basalt.onEvent(eventName, callback) end + +---Sets a frame as focused +---@param frame BaseFrame The frame to set as focused +function basalt.setFocus(frame) end + +---Starts the Basalt runtime +function basalt.run() end + +---Schedules a function to run in a coroutine +---@param func function The function to schedule +---@return thread func The scheduled function +function basalt.schedule(func) end + +---Returns the error manager instance +---@return table ErrorManager The error manager +function basalt.getErrorManager() end + +---Stops the Basalt runtime +function basalt.stop() end + +---Returns the focused frame +---@return BaseFrame ? BaseFrame The focused frame +function basalt.getFocus() end + +---@class ScrollBar : VisualElement +---@field attachedElement table nil The element this ScrollBar is attached to +---@field handleSize number Size of the ScrollBar handle in characters +---@field min number Minimum scroll value +---@field max number Maximum scroll value +---@field orientation string Orientation of the ScrollBar ("vertical" or "horizontal") +---@field step number Step size for scroll operations +---@field symbol string " Symbol used for the ScrollBar handle +---@field dragMultiplier number How fast the ScrollBar moves when dragging +---@field maxValue number 100 Maximum value or function that returns it +---@field attachedProperty string nil The property being controlled +---@field value number Current scroll value +---@field minValue number 0 Minimum value or function that returns it +---@field backgroundSymbol string Symbol used for the ScrollBar background +---@field symbolBackgroundColor color Background color of the ScrollBar handle +local ScrollBar = {} + +---Gets the value of the AttachedElement property. +---@param self ScrollBar self +---@return table ? nil The element this ScrollBar is attached to +function ScrollBar:getAttachedElement(self) end + +---Gets the value of the HandleSize property. +---@param self ScrollBar self +---@return number 2 Size of the ScrollBar handle in characters +function ScrollBar:getHandleSize(self) end + +---Gets the value of the BackgroundSymbol property. +---@param self ScrollBar self +---@return string "\127" Symbol used for the ScrollBar background +function ScrollBar:getBackgroundSymbol(self) end + +---Gets the value of the DragMultiplier property. +---@param self ScrollBar self +---@return number 1 How fast the ScrollBar moves when dragging +function ScrollBar:getDragMultiplier(self) end + +---Sets the value of the Orientation property. +---@param self ScrollBar self +---@param Orientation string Orientation of the ScrollBar ("vertical" or "horizontal") +function ScrollBar:setOrientation(self, Orientation) end + +---Sets the value of the Min property. +---@param self ScrollBar self +---@param Min number Minimum scroll value +function ScrollBar:setMin(self, Min) end + +---Gets the value of the Min property. +---@param self ScrollBar self +---@return number 0 Minimum scroll value +function ScrollBar:getMin(self) end + +---Gets the value of the Step property. +---@param self ScrollBar self +---@return number 1 Step size for scroll operations +function ScrollBar:getStep(self) end + +---Sets the value of the SymbolBackgroundColor property. +---@param self ScrollBar self +---@param SymbolBackgroundColor color Background color of the ScrollBar handle +function ScrollBar:setSymbolBackgroundColor(self, SymbolBackgroundColor) end + +---Sets the value of the MinValue property. +---@param self ScrollBar self +---@param MinValue number 0 Minimum value or function that returns it +function ScrollBar:setMinValue(self, MinValue) end + +---Sets the value of the Value property. +---@param self ScrollBar self +---@param Value number Current scroll value +function ScrollBar:setValue(self, Value) end + +---Gets the value of the Orientation property. +---@param self ScrollBar self +---@return string vertical Orientation of the ScrollBar ("vertical" or "horizontal") +function ScrollBar:getOrientation(self) end + +---Sets the value of the HandleSize property. +---@param self ScrollBar self +---@param HandleSize number Size of the ScrollBar handle in characters +function ScrollBar:setHandleSize(self, HandleSize) end + +---Gets the value of the AttachedProperty property. +---@param self ScrollBar self +---@return string ? nil The property being controlled +function ScrollBar:getAttachedProperty(self) end + +---Gets the value of the MinValue property. +---@param self ScrollBar self +---@return number |function 0 Minimum value or function that returns it +function ScrollBar:getMinValue(self) end + +---Sets the value of the AttachedElement property. +---@param self ScrollBar self +---@param AttachedElement table nil The element this ScrollBar is attached to +function ScrollBar:setAttachedElement(self, AttachedElement) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param direction number The scroll direction (1 for up, -1 for down) +---@param x number The x position of the scroll +---@param y number The y position of the scroll +---@return boolean Whether the event was handled +---@protected +function ScrollBar:mouse_scroll(direction, x, y) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param button number The mouse button clicked +---@param x number The x position of the click +---@param y number The y position of the click +---@return boolean Whether the event was handled +---@protected +function ScrollBar:mouse_click(button, x, y) end + +---Gets the value of the SymbolBackgroundColor property. +---@param self ScrollBar self +---@return color black Background color of the ScrollBar handle +function ScrollBar:getSymbolBackgroundColor(self) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param button number The mouse button being dragged +---@param x number The x position of the drag +---@param y number The y position of the drag +---@return boolean Whether the event was handled +---@protected +function ScrollBar:mouse_drag(button, x, y) end + +---Gets the value of the MaxValue property. +---@param self ScrollBar self +---@return number |function 100 Maximum value or function that returns it +function ScrollBar:getMaxValue(self) end + +---Sets the value of the Symbol property. +---@param self ScrollBar self +---@param Symbol string " Symbol used for the ScrollBar handle +function ScrollBar:setSymbol(self, Symbol) end + +---Sets the value of the MaxValue property. +---@param self ScrollBar self +---@param MaxValue number 100 Maximum value or function that returns it +function ScrollBar:setMaxValue(self, MaxValue) end + +---Sets the value of the AttachedProperty property. +---@param self ScrollBar self +---@param AttachedProperty string nil The property being controlled +function ScrollBar:setAttachedProperty(self, AttachedProperty) end + +---Gets the value of the Max property. +---@param self ScrollBar self +---@return number 100 Maximum scroll value +function ScrollBar:getMax(self) end + +---Attaches the ScrollBar to an element's property +---@param element BaseElement The element to attach to +---@param config table Configuration {property = "propertyName", min = number|function, max = number|function} +---@return ScrollBar self The ScrollBar instance +function ScrollBar:attach(element, config) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@protected +function ScrollBar:render() end + +---Sets the value of the Step property. +---@param self ScrollBar self +---@param Step number Step size for scroll operations +function ScrollBar:setStep(self, Step) end + +---Sets the value of the DragMultiplier property. +---@param self ScrollBar self +---@param DragMultiplier number How fast the ScrollBar moves when dragging +function ScrollBar:setDragMultiplier(self, DragMultiplier) end + +---Sets the value of the Max property. +---@param self ScrollBar self +---@param Max number Maximum scroll value +function ScrollBar:setMax(self, Max) end + +---Updates the attached element's property based on the ScrollBar value +---@return ScrollBar self The ScrollBar instance +function ScrollBar:updateAttachedElement() end + +---Gets the value of the Symbol property. +---@param self ScrollBar self +---@return string " " Symbol used for the ScrollBar handle +function ScrollBar:getSymbol(self) end + +---Sets the value of the BackgroundSymbol property. +---@param self ScrollBar self +---@param BackgroundSymbol string Symbol used for the ScrollBar background +function ScrollBar:setBackgroundSymbol(self, BackgroundSymbol) end + +---Gets the value of the Value property. +---@param self ScrollBar self +---@return number 0 Current scroll value +function ScrollBar:getValue(self) end ---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ---@param props table The properties to initialize the element with ---@param basalt table The basalt instance ----@return Image self The initialized instance +---@return ScrollBar self The initialized instance ---@protected -function Image:init(props, basalt) end +function ScrollBar:init(props, basalt) end ----Gets the value of the OffsetX property. ----@param self Image self ----@return number 0 Horizontal offset for viewing larger images -function Image:getOffsetX(self) end +---@class BaseElement : PropertySystem +---@field enabled boolean Whether the element is enabled or not +---@field id string The unique identifier for the element +---@field eventCallbacks table The event callbacks for the element +---@field name string The name of the element +---@field type string The type identifier of the element +local BaseElement = {} + +---Starts profiling a method +---@param methodName string The name of the method to profile +---@return BaseElement self The element instance +function BaseElement:startProfile(methodName) end + +---Checks if the element is a specific type +---@param type string The type to check for +---@return boolean isType Whether the element is of the specified type +function BaseElement:isType(type) end + +---Destroys the element and cleans up all references +function BaseElement:destroy() end + +---Enables or disables event listening for a specific event +---@param eventName string The name of the event to listen for +---@return table self The BaseElement instance +function BaseElement:listenEvent(eventName) end + +---Gets benchmark statistics for a method +---@param methodName string The name of the method to get statistics for +---@return table ? stats The benchmark statistics or nil +function BaseElement:getBenchmarkStats(methodName) end + +---Sets the value of the Name property. +---@param self BaseElement self +---@param Name string The name of the element +function BaseElement:setName(self, Name) end + +---Gets the value of the Type property. +---@param self BaseElement self +---@return string BaseElement The type identifier of the element +function BaseElement:getType(self) end + +---Registers a new event listener for the element (on class level) +---@param class table The class to register +---@param eventName string The name of the event to register +function BaseElement.defineEvent(class, eventName) end + +---Requests a render update for this element +---@return table self The BaseElement instance +function BaseElement:updateRender() end + +---Sets the value of the Type property. +---@param self BaseElement self +---@param Type string The type identifier of the element +function BaseElement:setType(self, Type) end + +---Binds a property to a state +---@param self BaseElement The element to bind +---@param propertyName string The property to bind +---@param stateName string The state to bind to (optional, uses propertyName if not provided) +---@return BaseElement self The element instance +function BaseElement:bind(self, propertyName, stateName) end + +---Sets the value of the EventCallbacks property. +---@param self BaseElement self +---@param EventCallbacks table The event callbacks for the element +function BaseElement:setEventCallbacks(self, EventCallbacks) end + +---Gets the value of the Enabled property. +---@param self BaseElement self +---@return boolean BaseElement Whether the element is enabled or not +function BaseElement:getEnabled(self) end + +---Removes a state change observer +---@param self BaseElement The element to remove observer from +---@param stateName string The state to remove observer from +---@param callback function The callback function to remove +---@return BaseElement self The element instance +function BaseElement:removeStateChange(self, stateName, callback) end + +---Triggers an event and calls all registered callbacks +---@param event string The event to fire +---@return table self The BaseElement instance +function BaseElement:fireEvent(event) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param event string The event to handle +---@return boolean ? handled Whether the event was handled +---@protected +function BaseElement:dispatchEvent(event) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param event string The event to handle +---@return boolean ? handled Whether the event was handled +---@protected +function BaseElement:handleEvent(event) end + +---Enables debugging for this element +---@param self BaseElement The element to debug +---@param level number The debug level +function BaseElement.debug(self, level) end + +---Registers a new event callback for the element (on class level) +---@param class table The class to register +---@param callbackName string The name of the callback to register +function BaseElement.registerEventCallback(class, callbackName) end + +---Ends profiling a method +---@param methodName string The name of the method to stop profiling +---@return BaseElement self The element instance +function BaseElement:endProfile(methodName) end + +---Returns the base frame of the element +---@return BaseFrame BaseFrame The base frame of the element +function BaseElement:getBaseFrame() end + +---Stops benchmarking for a method +---@param methodName string The name of the method to stop benchmarking +---@return BaseElement self The element instance +function BaseElement:stopBenchmark(methodName) end + +---Sets the value of the Enabled property. +---@param self BaseElement self +---@param Enabled boolean Whether the element is enabled or not +function BaseElement:setEnabled(self, Enabled) end + +---Gets the value of a state +---@param self BaseElement The element to get state from +---@param name string The name of the state +---@return any value The current state value +function BaseElement:getState(self, name) end + +---Sets the value of the Id property. +---@param self BaseElement self +---@param Id string The unique identifier for the element +function BaseElement:setId(self, Id) end + +---Observes a property and calls a callback when it changes +---@param property string The property to observe +---@param callback function The callback to call when the property changes +---@return table self The BaseElement instance +function BaseElement:onChange(property, callback) end + +---Registers a callback for state changes +---@param self BaseElement The element to watch +---@param stateName string The state to watch +---@param callback function Called with (element, newValue, oldValue) +---@return BaseElement self The element instance +function BaseElement:onStateChange(self, stateName, callback) end + +function BaseElement:computed() end + +---Sets the value of a state +---@param self BaseElement The element to set state for +---@param name string The name of the state +---@param value any The new value for the state +---@return BaseElement self The element instance +function BaseElement:setState(self, name, value) end + +---Gets the value of the EventCallbacks property. +---@param self BaseElement self +---@return table BaseElement The event callbacks for the element +function BaseElement:getEventCallbacks(self) end + +---Registers a callback function for an event +---@param event string The event to register the callback for +---@param callback function The callback function to register +---@return table self The BaseElement instance +function BaseElement:registerCallback(event, callback) end + +---Applies the current theme to this element +---@param self BaseElement The element to apply theme to +---@param applyToChildren boolean ? Whether to apply theme to child elements (default: true) +---@return BaseElement self The element instance +function BaseElement:applyTheme(self, applyToChildren) end + +---Logs benchmark statistics for a method +---@param methodName string The name of the method to log +---@return BaseElement self The element instance +function BaseElement:logBenchmark(methodName) end + +---Gets the value of the Id property. +---@param self BaseElement self +---@return string BaseElement The unique identifier for the element +function BaseElement:getId(self) end + +---Gets the theme properties for this element +---@param self BaseElement The element to get theme for +---@return table styles The theme properties +function BaseElement:getTheme(self) end + +---Enables benchmarking for a method +---@param methodName string The name of the method to benchmark +---@return BaseElement self The element instance +function BaseElement:benchmark(methodName) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@return table self The BaseElement instance +---@protected +function BaseElement:postInit() end + +---Gets the value of the Name property. +---@param self BaseElement self +---@return string BaseElement The name of the element +function BaseElement:getName(self) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param props table The properties to initialize the element with +---@param basalt table The basalt instance +---@return table self The initialized instance +---@protected +function BaseElement:init(props, basalt) end + +---Dumps debug information for this element +---@param self BaseElement The element to dump debug info for +function BaseElement.dumpDebug(self) end + +---@class Animation +local Animation = {} + +---Stops the animation immediately: cancels timers, completes running anim instances and clears the element property +function Animation:stop() end + +---Creates a new Animation +---@param element VisualElement The element to animate +---@return Animation The new animation +function Animation.new(element) end + +---Registers a callback for the start event +---@param callback function The callback function to register +function Animation:onStart(callback) end + +---Registers a callback for the complete event +---@param callback function The callback function to register +---@return Animation self The animation instance +function Animation:onComplete(callback) end + +---Registers a new easing function +---@param name string The name of the easing function +---@param func function The easing function (takes progress 0-1, returns modified progress) +function Animation.registerEasing(name, func) end + +---Starts the animation +---@return Animation self The animation instance +function Animation:start() end + +---Creates a new sequence +---@return Animation self The animation instance +function Animation:sequence() end + +---The event handler for the animation (listens to timer events) +---@param event string The event type +---@param timerId number The timer ID +function Animation:event(event, timerId) end + +---Adds a new animation to the sequence +---@param type string The type of animation +---@param args table The animation arguments +---@param duration number The duration in seconds +---@param easing string The easing function name +function Animation:addAnimation(type, args, duration, easing) end + +---Registers a callback for the update event +---@param callback function The callback function to register +---@return Animation self The animation instance +function Animation:onUpdate(callback) end + +---Registers a new animation type +---@param name string The name of the animation +---@param handlers table Table containing start, update and complete handlers +function Animation.registerAnimation(name, handlers) end + +---@class Program : VisualElement +---@field path string The path to the program +---@field running boolean Whether the program is running +---@field doneCallback function The done callback function +---@field program table The program instance +---@field errorCallback function The error callback function +local Program = {} + +---Sets the value of the Path property. +---@param self Program self +---@param Path string The path to the program +function Program:setPath(self, Path) end + +---Sends an event to the program +---@param event string The event to send +---@return Program self The Program instance +function Program:sendEvent(event) end + +---Sets the value of the DoneCallback property. +---@param self Program self +---@param DoneCallback function The done callback function +function Program:setDoneCallback(self, DoneCallback) end + +---Gets the value of the Running property. +---@param self Program self +---@return boolean false Whether the program is running +function Program:getRunning(self) end + +function BasaltProgram:setArgs() end + +---Registers a callback for the program's done event +---@param fn function The callback function to register +---@return Program self The Program instance +function Program:onDone(fn) end + +---Sets the value of the Running property. +---@param self Program self +---@param Running boolean Whether the program is running +function Program:setRunning(self, Running) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@protected +function Program:render() end + +---Registers a callback for the program's error event, if the function returns false, the program won't stop +---@param fn function The callback function to register +---@return Program self The Program instance +function Program:onError(fn) end + +---Sets the value of the ErrorCallback property. +---@param self Program self +---@param ErrorCallback function The error callback function +function Program:setErrorCallback(self, ErrorCallback) end + +---Gets the value of the Program property. +---@param self Program self +---@return table nil The program instance +function Program:getProgram(self) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@protected +function Program:focus() end + +---Gets the value of the DoneCallback property. +---@param self Program self +---@return function nil The done callback function +function Program:getDoneCallback(self) end + +---Stops the program +---@return Program self The Program instance +function Program:stop() end + +---Gets the value of the Path property. +---@param self Program self +---@return string "" The path to the program +function Program:getPath(self) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param props table The properties to initialize the element with +---@param basalt table The basalt instance +---@return Program self The initialized instance +---@protected +function Program:init(props, basalt) end + +---Gets the value of the ErrorCallback property. +---@param self Program self +---@return function nil The error callback function +function Program:getErrorCallback(self) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param event string The event to handle +---@return any result The event result +---@protected +function Program:dispatchEvent(event) end + +---Sets the value of the Program property. +---@param self Program self +---@param Program table The program instance +function Program:setProgram(self, Program) end + +---Executes a program +---@param path string The path to the program +---@return Program self The Program instance +function Program:execute(path) end + +---@class TabControl : Container +---@field tabHeight number of the tab header area +---@field activeTabBackground color color for the active tab +---@field activeTab number currently active tab ID +---@field tabs table of tab definitions +---@field activeTabTextColor color color for the active tab text +---@field headerBackground color color for the tab header area +local TabControl = {} + +function TabControl:drawFg() end + +function TabControl:getRelativePosition() end + +---Sets the value of the TabHeight property. +---@param self TabControl self +---@param TabHeight number of the tab header area +function TabControl:setTabHeight(self, TabHeight) end + +---@param element table The element to assign to a tab +---@param tabId number The ID of the tab to assign the element to +---@return TabControl self For method chaining +function TabControl:setTab(element, tabId) end + +function TabControl:mouse_drag() end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param button number The button that was clicked +---@param x number The x position of the click (global) +---@param y number The y position of the click (global) +---@return boolean Whether the event was handled +---@protected +function TabControl:mouse_click(button, x, y) end + +---Gets the value of the TabHeight property. +---@param self TabControl self +---@return number Height of the tab header area +function TabControl:getTabHeight(self) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param props table The properties to initialize the element with +---@param basalt table The basalt instance +---@protected +function TabControl:init(props, basalt) end + +function TabControl:mouse_release() end + +function TabControl:setCursor() end + +function TabControl:mouse_move() end + +---Sets the value of the HeaderBackground property. +---@param self TabControl self +---@param HeaderBackground color color for the tab header area +function TabControl:setHeaderBackground(self, HeaderBackground) end + +---Gets the value of the HeaderBackground property. +---@param self TabControl self +---@return color Background color for the tab header area +function TabControl:getHeaderBackground(self) end + +---@param elementType string The type of element to add +---@param tabId number Optional tab ID, defaults to active tab +---@return table element The created element +function TabControl:addElement(elementType, tabId) end + +---Gets the value of the ActiveTabBackground property. +---@param self TabControl self +---@return color Background color for the active tab +function TabControl:getActiveTabBackground(self) end + +---Gets the value of the ActiveTabTextColor property. +---@param self TabControl self +---@return color Foreground color for the active tab text +function TabControl:getActiveTabTextColor(self) end + +---@param tabId number The ID of the tab to activate +function TabControl:setActiveTab(tabId) end + +---returns a proxy for adding elements to the tab +---@param title string The title of the tab +---@return table tabHandler The tab handler proxy for adding elements to the new tab +function TabControl:newTab(title) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@protected +function TabControl:sortChildrenEvents() end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@protected +function TabControl:render() end + +function TabControl:mouse_scroll() end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param child table The child element to check +---@return boolean Whether the child should be visible +---@protected +function TabControl:isChildVisible(child) end + +---Sets the value of the ActiveTabBackground property. +---@param self TabControl self +---@param ActiveTabBackground color color for the active tab +function TabControl:setActiveTabBackground(self, ActiveTabBackground) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@return number yOffset The Y offset for content +---@protected +function TabControl:getContentYOffset() end + +---Sets the value of the ActiveTabTextColor property. +---@param self TabControl self +---@param ActiveTabTextColor color color for the active tab text +function TabControl:setActiveTabTextColor(self, ActiveTabTextColor) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param child table The child element to add +---@return Container self For method chaining +---@protected +function TabControl:addChild(child) end + +function TabControl:_getHeaderMetrics() end + +---Gets the value of the ActiveTab property. +---@param self TabControl self +---@return number The currently active tab ID +function TabControl:getActiveTab(self) end + +function TabControl:mouse_up() end + +---Sets the value of the Tabs property. +---@param self TabControl self +---@param Tabs table of tab definitions +function TabControl:setTabs(self, Tabs) end + +---Gets the value of the Tabs property. +---@param self TabControl self +---@return table List of tab definitions +function TabControl:getTabs(self) end + +function TabControl:textFg() end + +function TabControl:multiBlit() end + +function TabControl:textBg() end + +function TabControl:drawBg() end + +function TabControl:drawText() end + +function TabControl:blit() end + +---@class Table : VisualElement +---@field data table The table data as array of row arrays +---@field scrollOffset number Current scroll position +---@field customSortFunction table Custom sort functions for columns +---@field columns table List of column definitions with {name, width} properties +---@field selectedRow number nil Currently selected row index +---@field selectedColor color Background color of selected row +---@field sortColumn number nil Currently sorted column index +---@field gridColor color Color of grid lines +---@field sortDirection string Sort direction ("asc" or "desc") +---@field headerColor color Color of the column headers +local Table = {} + +---Gets the value of the Columns property. +---@param self Table self +---@return table {} List of column definitions with {name, width} properties +function Table:getColumns(self) end + +---Adds a new row of data to the table +---@return Table self The Table instance +function Table:addData() end + +---Gets the value of the SelectedColor property. +---@param self Table self +---@return color lightBlue Background color of selected row +function Table:getSelectedColor(self) end + +---Gets the value of the SortDirection property. +---@param self Table self +---@return string "asc" Sort direction ("asc" or "desc") +function Table:getSortDirection(self) end + +---Gets the value of the SelectedRow property. +---@param self Table self +---@return number ? nil Currently selected row index +function Table:getSelectedRow(self) end + +---Gets the value of the HeaderColor property. +---@param self Table self +---@return color blue Color of the column headers +function Table:getHeaderColor(self) end + +---Sets the value of the SelectedColor property. +---@param self Table self +---@param SelectedColor color Background color of selected row +function Table:setSelectedColor(self, SelectedColor) end + +---Sets the value of the HeaderColor property. +---@param self Table self +---@param HeaderColor color Color of the column headers +function Table:setHeaderColor(self, HeaderColor) end + +---Sets the value of the Columns property. +---@param self Table self +---@param Columns table List of column definitions with {name, width} properties +function Table:setColumns(self, Columns) end + +---Sets the value of the CustomSortFunction property. +---@param self Table self +---@param CustomSortFunction table Custom sort functions for columns +function Table:setCustomSortFunction(self, CustomSortFunction) end + +---Sets the value of the SortDirection property. +---@param self Table self +---@param SortDirection string Sort direction ("asc" or "desc") +function Table:setSortDirection(self, SortDirection) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param button number The button that was clicked +---@param x number The x position of the click +---@param y number The y position of the click +---@return boolean handled Whether the event was handled +---@protected +function Table:mouse_click(button, x, y) end + +---Set data with automatic formatting +---@param rawData table The raw data array +---@param formatters table Optional formatter functions for columns {[2] = function(value) return value end} +---@return Table self The Table instance +function Table:setData(rawData, formatters) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param props table The properties to initialize the element with +---@param basalt table The basalt instance +---@return Table self The initialized instance +---@protected +function Table:init(props, basalt) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param direction number The scroll direction (-1 up, 1 down) +---@param x number The x position of the scroll +---@param y number The y position of the scroll +---@return boolean handled Whether the event was handled +---@protected +function Table:mouse_scroll(direction, x, y) end + +---Gets the value of the SortColumn property. +---@param self Table self +---@return number ? nil Currently sorted column index +function Table:getSortColumn(self) end + +---Gets the value of the GridColor property. +---@param self Table self +---@return color gray Color of grid lines +function Table:getGridColor(self) end + +---Sorts the table data by column +---@param columnIndex number The index of the column to sort by +---@param fn function ? Optional custom sorting function +---@return Table self The Table instance +function Table:sortData(columnIndex, fn) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@protected +function Table:render() end + +---Sets a custom sort function for a specific column +---@param columnIndex number The index of the column +---@param sortFn function Function that takes (rowA, rowB) and returns comparison result +---@return Table self The Table instance +function Table:setColumnSortFunction(columnIndex, sortFn) end + +---Adds a new column to the table +---@param name string The name of the column +---@param width number The width of the column +---@return Table self The Table instance +function Table:addColumn(name, width) end + +---Gets the value of the ScrollOffset property. +---@param self Table self +---@return number 0 Current scroll position +function Table:getScrollOffset(self) end + +---Gets the value of the Data property. +---@param self Table self +---@return table {} The table data as array of row arrays +function Table:getData(self) end + +---Adds data with both display and sort values +---@param displayData table The formatted data for display +---@param sortData table The raw data for sorting (optional) +---@return Table self The Table instance +function Table:setFormattedData(displayData, sortData) end + +---Sets the value of the SortColumn property. +---@param self Table self +---@param SortColumn number nil Currently sorted column index +function Table:setSortColumn(self, SortColumn) end + +---Sets the value of the ScrollOffset property. +---@param self Table self +---@param ScrollOffset number Current scroll position +function Table:setScrollOffset(self, ScrollOffset) end + +---Gets the value of the CustomSortFunction property. +---@param self Table self +---@return table {} Custom sort functions for columns +function Table:getCustomSortFunction(self) end + +---Sets the value of the SelectedRow property. +---@param self Table self +---@param SelectedRow number nil Currently selected row index +function Table:setSelectedRow(self, SelectedRow) end + +---Sets the value of the GridColor property. +---@param self Table self +---@param GridColor color Color of grid lines +function Table:setGridColor(self, GridColor) end + +---@class ElementManager +local ElementManager = {} + +---Loads an element by name. This will load the element and apply any plugins to it. +---@param name string The name of the element to load +function ElementManager.loadElement(name) end + +---Gets a list of all elements +---@return table ElementList A list of all elements +function ElementManager.getElementList() end + +---Gets an element by name. If the element is not loaded, it will try to load it first. +---@param name string The name of the element to get +---@return table Element The element class +function ElementManager.getElement(name) end + +---Gets an Plugin API by name +---@param name string The name of the API to get +---@return table API The API +function ElementManager.getAPI(name) end diff --git a/config.lua b/config.lua index bfbf751..e9e6c85 100644 --- a/config.lua +++ b/config.lua @@ -1,75 +1,94 @@ return { ["metadata"] = { + ["generated"] = "Sun Sep 28 13:05:58 2025", ["version"] = "2.0", - ["generated"] = "Sat Sep 27 20:42:39 2025", }, ["categories"] = { - ["plugins"] = { - ["description"] = "Plugins", + ["libraries"] = { + ["description"] = "Libraries", ["files"] = { - ["benchmark"] = { - ["description"] = "", - ["size"] = 12581, - ["path"] = "plugins/benchmark.lua", + ["utils"] = { + ["path"] = "libraries/utils.lua", ["default"] = true, - ["requires"] = { - [1] = "VisualElement", - }, - }, - ["theme"] = { ["description"] = "", - ["size"] = 7042, - ["path"] = "plugins/theme.lua", - ["default"] = true, + ["size"] = 2661, ["requires"] = { }, }, - ["state"] = { - ["description"] = "", - ["size"] = 6896, - ["path"] = "plugins/state.lua", + ["colorHex"] = { + ["path"] = "libraries/colorHex.lua", ["default"] = true, - ["requires"] = { - [1] = "Container", - }, - }, - ["reactive"] = { ["description"] = "", - ["size"] = 7580, - ["path"] = "plugins/reactive.lua", - ["default"] = true, + ["size"] = 132, ["requires"] = { }, }, - ["xml"] = { - ["description"] = "", - ["size"] = 9940, - ["path"] = "plugins/xml.lua", + ["expect"] = { + ["path"] = "libraries/expect.lua", ["default"] = true, + ["description"] = "", + ["size"] = 846, ["requires"] = { }, }, - ["canvas"] = { - ["description"] = "", - ["size"] = 7873, - ["path"] = "plugins/canvas.lua", + }, + }, + ["core"] = { + ["description"] = "Core Files", + ["files"] = { + ["log"] = { + ["path"] = "log.lua", ["default"] = true, + ["description"] = "", + ["size"] = 3142, ["requires"] = { }, }, - ["debug"] = { - ["description"] = "", - ["size"] = 6250, - ["path"] = "plugins/debug.lua", + ["render"] = { + ["path"] = "render.lua", ["default"] = true, + ["description"] = "", + ["size"] = 12422, ["requires"] = { }, }, - ["animation"] = { - ["description"] = "", - ["size"] = 18421, - ["path"] = "plugins/animation.lua", + ["main"] = { + ["path"] = "main.lua", ["default"] = true, + ["description"] = "", + ["size"] = 14085, + ["requires"] = { + }, + }, + ["errorManager"] = { + ["path"] = "errorManager.lua", + ["default"] = true, + ["description"] = "", + ["size"] = 3789, + ["requires"] = { + }, + }, + ["elementManager"] = { + ["path"] = "elementManager.lua", + ["default"] = true, + ["description"] = "", + ["size"] = 6297, + ["requires"] = { + }, + }, + ["propertySystem"] = { + ["path"] = "propertySystem.lua", + ["default"] = true, + ["description"] = "", + ["size"] = 15524, + ["requires"] = { + }, + }, + ["init"] = { + ["path"] = "init.lua", + ["default"] = true, + ["description"] = "", + ["size"] = 622, ["requires"] = { }, }, @@ -78,360 +97,341 @@ return { ["elements"] = { ["description"] = "UI Elements", ["files"] = { - ["TabControl"] = { - ["description"] = "A TabControl element that provides tabbed interface with multiple content areas.", - ["size"] = 15300, - ["path"] = "elements/TabControl.lua", - ["default"] = true, - ["requires"] = { - [1] = "Container", - }, - }, ["List"] = { - ["description"] = "A scrollable list of selectable items", - ["size"] = 8758, ["path"] = "elements/List.lua", ["default"] = true, - ["requires"] = { - [1] = "VisualElement", - }, - }, - ["BarChart"] = { - ["description"] = "", - ["size"] = 3190, - ["path"] = "elements/BarChart.lua", - ["default"] = false, - ["requires"] = { - }, - }, - ["BaseFrame"] = { - ["description"] = "This is the base frame class. It is the root element of all elements and the only element without a parent.", - ["size"] = 8466, - ["path"] = "elements/BaseFrame.lua", - ["default"] = true, - ["requires"] = { - [1] = "Container", - }, - }, - ["Container"] = { - ["description"] = "The container class. It is a visual element that can contain other elements. It is the base class for all containers", - ["size"] = 25383, - ["path"] = "elements/Container.lua", - ["default"] = true, - ["requires"] = { - [1] = "VisualElement", - }, - }, - ["Program"] = { - ["description"] = "", - ["size"] = 11430, - ["path"] = "elements/Program.lua", - ["default"] = true, - ["requires"] = { - [1] = "VisualElement", - }, - }, - ["Table"] = { - ["description"] = "", - ["size"] = 16214, - ["path"] = "elements/Table.lua", - ["default"] = true, - ["requires"] = { - [1] = "VisualElement", - }, - }, - ["Menu"] = { - ["description"] = "A horizontal menu bar with selectable items.", - ["size"] = 4679, - ["path"] = "elements/Menu.lua", - ["default"] = true, - ["requires"] = { - [1] = "List", - }, - }, - ["FlexBox"] = { - ["description"] = "A flexbox container that arranges its children in a flexible layout.", - ["size"] = 32431, - ["path"] = "elements/FlexBox.lua", - ["default"] = true, - ["requires"] = { - [1] = "Container", - }, - }, - ["Tree"] = { - ["description"] = "", - ["size"] = 7942, - ["path"] = "elements/Tree.lua", - ["default"] = true, - ["requires"] = { - [1] = "VisualElement", - }, - }, - ["VisualElement"] = { - ["description"] = "The Visual Element class which is the base class for all visual UI elements", - ["size"] = 18564, - ["path"] = "elements/VisualElement.lua", - ["default"] = true, - ["requires"] = { - [1] = "BaseElement", - }, - }, - ["ScrollBar"] = { - ["description"] = "A ScrollBar element that can be attached to other elements to control their scroll properties.", - ["size"] = 9665, - ["path"] = "elements/ScrollBar.lua", - ["default"] = true, - ["requires"] = { - [1] = "VisualElement", - }, - }, - ["Button"] = { - ["description"] = "", - ["size"] = 1656, - ["path"] = "elements/Button.lua", - ["default"] = true, - ["requires"] = { - [1] = "VisualElement", - }, - }, - ["Image"] = { - ["description"] = "An element that displays an image in bimg format", - ["size"] = 15125, - ["path"] = "elements/Image.lua", - ["default"] = false, - ["requires"] = { - [1] = "VisualElement", - }, - }, - ["Switch"] = { - ["description"] = "The Switch is a standard Switch element with click handling and state management.", - ["size"] = 3269, - ["path"] = "elements/Switch.lua", - ["default"] = true, - ["requires"] = { - [1] = "VisualElement", - }, - }, - ["Timer"] = { - ["description"] = "", - ["size"] = 2914, - ["path"] = "elements/Timer.lua", - ["default"] = true, - ["requires"] = { - [1] = "BaseElement", - }, - }, - ["CheckBox"] = { - ["description"] = "", - ["size"] = 2928, - ["path"] = "elements/CheckBox.lua", - ["default"] = true, - ["requires"] = { - [1] = "VisualElement", - }, - }, - ["BigFont"] = { - ["description"] = "", - ["size"] = 21049, - ["path"] = "elements/BigFont.lua", - ["default"] = false, - ["requires"] = { - [1] = "VisualElement", - }, - }, - ["BaseElement"] = { - ["description"] = "The base class for all UI elements in Basalt.", - ["size"] = 9686, - ["path"] = "elements/BaseElement.lua", - ["default"] = true, - ["requires"] = { - }, - }, - ["LineChart"] = { - ["description"] = "", - ["size"] = 3227, - ["path"] = "elements/LineChart.lua", - ["default"] = false, - ["requires"] = { - }, - }, - ["Input"] = { - ["description"] = "A text input field with various features", - ["size"] = 9558, - ["path"] = "elements/Input.lua", - ["default"] = true, + ["description"] = "A scrollable list of selectable items", + ["size"] = 8758, ["requires"] = { [1] = "VisualElement", }, }, ["ProgressBar"] = { - ["description"] = "", - ["size"] = 3397, ["path"] = "elements/ProgressBar.lua", ["default"] = true, + ["description"] = "", + ["size"] = 3397, + ["requires"] = { + [1] = "VisualElement", + }, + }, + ["Image"] = { + ["path"] = "elements/Image.lua", + ["default"] = false, + ["description"] = "An element that displays an image in bimg format", + ["size"] = 15125, + ["requires"] = { + [1] = "VisualElement", + }, + }, + ["Input"] = { + ["path"] = "elements/Input.lua", + ["default"] = true, + ["description"] = "A text input field with various features", + ["size"] = 9558, ["requires"] = { [1] = "VisualElement", }, }, ["TextBox"] = { - ["description"] = "A multi-line text editor component with cursor support and text manipulation features", - ["size"] = 38993, ["path"] = "elements/TextBox.lua", ["default"] = false, + ["description"] = "A multi-line text editor component with cursor support and text manipulation features", + ["size"] = 43466, ["requires"] = { [1] = "VisualElement", }, }, - ["DropDown"] = { - ["description"] = "A DropDown menu that shows a list of selectable items", - ["size"] = 6359, - ["path"] = "elements/DropDown.lua", - ["default"] = false, + ["Program"] = { + ["path"] = "elements/Program.lua", + ["default"] = true, + ["description"] = "", + ["size"] = 11430, ["requires"] = { - [1] = "List", + [1] = "VisualElement", + }, + }, + ["VisualElement"] = { + ["path"] = "elements/VisualElement.lua", + ["default"] = true, + ["description"] = "The Visual Element class which is the base class for all visual UI elements", + ["size"] = 18564, + ["requires"] = { + [1] = "BaseElement", + }, + }, + ["ScrollBar"] = { + ["path"] = "elements/ScrollBar.lua", + ["default"] = true, + ["description"] = "A ScrollBar element that can be attached to other elements to control their scroll properties.", + ["size"] = 9665, + ["requires"] = { + [1] = "VisualElement", + }, + }, + ["LineChart"] = { + ["path"] = "elements/LineChart.lua", + ["default"] = false, + ["description"] = "", + ["size"] = 3227, + ["requires"] = { + }, + }, + ["Display"] = { + ["path"] = "elements/Display.lua", + ["default"] = false, + ["description"] = "The Display is a special element which uses the cc window API which you can use.", + ["size"] = 4243, + ["requires"] = { + [1] = "VisualElement", }, }, ["Slider"] = { - ["description"] = "", - ["size"] = 4977, ["path"] = "elements/Slider.lua", ["default"] = true, + ["description"] = "", + ["size"] = 4977, + ["requires"] = { + [1] = "VisualElement", + }, + }, + ["Timer"] = { + ["path"] = "elements/Timer.lua", + ["default"] = true, + ["description"] = "", + ["size"] = 2914, + ["requires"] = { + [1] = "BaseElement", + }, + }, + ["BarChart"] = { + ["path"] = "elements/BarChart.lua", + ["default"] = false, + ["description"] = "", + ["size"] = 3190, + ["requires"] = { + }, + }, + ["Label"] = { + ["path"] = "elements/Label.lua", + ["default"] = true, + ["description"] = "A simple text display element that automatically resizes its width based on the text content.", + ["size"] = 3092, ["requires"] = { [1] = "VisualElement", }, }, ["Graph"] = { - ["description"] = "A point based graph element", - ["size"] = 6989, ["path"] = "elements/Graph.lua", ["default"] = false, + ["description"] = "A point based graph element", + ["size"] = 6989, ["requires"] = { }, }, - ["Display"] = { - ["description"] = "The Display is a special element which uses the cc window API which you can use.", - ["size"] = 4243, - ["path"] = "elements/Display.lua", + ["FlexBox"] = { + ["path"] = "elements/FlexBox.lua", + ["default"] = true, + ["description"] = "A flexbox container that arranges its children in a flexible layout.", + ["size"] = 32431, + ["requires"] = { + [1] = "Container", + }, + }, + ["Table"] = { + ["path"] = "elements/Table.lua", + ["default"] = true, + ["description"] = "", + ["size"] = 16214, + ["requires"] = { + [1] = "VisualElement", + }, + }, + ["BaseFrame"] = { + ["path"] = "elements/BaseFrame.lua", + ["default"] = true, + ["description"] = "This is the base frame class. It is the root element of all elements and the only element without a parent.", + ["size"] = 8466, + ["requires"] = { + [1] = "Container", + }, + }, + ["BigFont"] = { + ["path"] = "elements/BigFont.lua", ["default"] = false, + ["description"] = "", + ["size"] = 21049, + ["requires"] = { + [1] = "VisualElement", + }, + }, + ["Menu"] = { + ["path"] = "elements/Menu.lua", + ["default"] = true, + ["description"] = "A horizontal menu bar with selectable items.", + ["size"] = 4679, + ["requires"] = { + [1] = "List", + }, + }, + ["DropDown"] = { + ["path"] = "elements/DropDown.lua", + ["default"] = false, + ["description"] = "A DropDown menu that shows a list of selectable items", + ["size"] = 6359, + ["requires"] = { + [1] = "List", + }, + }, + ["ComboBox"] = { + ["path"] = "elements/ComboBox.lua", + ["default"] = false, + ["description"] = "A ComboBox that combines dropdown selection with editable text input", + ["size"] = 14649, + ["requires"] = { + [1] = "DropDown", + }, + }, + ["Switch"] = { + ["path"] = "elements/Switch.lua", + ["default"] = true, + ["description"] = "The Switch is a standard Switch element with click handling and state management.", + ["size"] = 3269, + ["requires"] = { + [1] = "VisualElement", + }, + }, + ["Tree"] = { + ["path"] = "elements/Tree.lua", + ["default"] = true, + ["description"] = "", + ["size"] = 7942, + ["requires"] = { + [1] = "VisualElement", + }, + }, + ["TabControl"] = { + ["path"] = "elements/TabControl.lua", + ["default"] = true, + ["description"] = "A TabControl element that provides tabbed interface with multiple content areas.", + ["size"] = 15300, + ["requires"] = { + [1] = "Container", + }, + }, + ["CheckBox"] = { + ["path"] = "elements/CheckBox.lua", + ["default"] = true, + ["description"] = "", + ["size"] = 2928, ["requires"] = { [1] = "VisualElement", }, }, ["Frame"] = { - ["description"] = "A frame element that serves as a grouping container for other elements.", - ["size"] = 6508, ["path"] = "elements/Frame.lua", ["default"] = true, + ["description"] = "A frame element that serves as a grouping container for other elements.", + ["size"] = 6508, ["requires"] = { [1] = "Container", }, }, - ["ComboBox"] = { - ["description"] = "A ComboBox that combines dropdown selection with editable text input", - ["size"] = 14649, - ["path"] = "elements/ComboBox.lua", - ["default"] = false, + ["Button"] = { + ["path"] = "elements/Button.lua", + ["default"] = true, + ["description"] = "", + ["size"] = 1656, ["requires"] = { - [1] = "DropDown", + [1] = "VisualElement", }, }, - ["Label"] = { - ["description"] = "A simple text display element that automatically resizes its width based on the text content.", - ["size"] = 3092, - ["path"] = "elements/Label.lua", + ["BaseElement"] = { + ["path"] = "elements/BaseElement.lua", ["default"] = true, + ["description"] = "The base class for all UI elements in Basalt.", + ["size"] = 9686, + ["requires"] = { + }, + }, + ["Container"] = { + ["path"] = "elements/Container.lua", + ["default"] = true, + ["description"] = "The container class. It is a visual element that can contain other elements. It is the base class for all containers", + ["size"] = 25383, ["requires"] = { [1] = "VisualElement", }, }, }, }, - ["core"] = { - ["description"] = "Core Files", + ["plugins"] = { + ["description"] = "Plugins", ["files"] = { - ["errorManager"] = { - ["description"] = "", - ["size"] = 3789, - ["path"] = "errorManager.lua", + ["canvas"] = { + ["path"] = "plugins/canvas.lua", ["default"] = true, + ["description"] = "", + ["size"] = 7873, ["requires"] = { }, }, - ["main"] = { - ["description"] = "", - ["size"] = 14085, - ["path"] = "main.lua", + ["theme"] = { + ["path"] = "plugins/theme.lua", ["default"] = true, + ["description"] = "", + ["size"] = 7042, ["requires"] = { }, }, - ["elementManager"] = { - ["description"] = "", - ["size"] = 6297, - ["path"] = "elementManager.lua", + ["reactive"] = { + ["path"] = "plugins/reactive.lua", ["default"] = true, + ["description"] = "", + ["size"] = 7580, ["requires"] = { }, }, - ["init"] = { - ["description"] = "", - ["size"] = 622, - ["path"] = "init.lua", + ["xml"] = { + ["path"] = "plugins/xml.lua", ["default"] = true, + ["description"] = "", + ["size"] = 9940, ["requires"] = { }, }, - ["render"] = { - ["description"] = "", - ["size"] = 12422, - ["path"] = "render.lua", + ["animation"] = { + ["path"] = "plugins/animation.lua", ["default"] = true, + ["description"] = "", + ["size"] = 18421, ["requires"] = { }, }, - ["propertySystem"] = { - ["description"] = "", - ["size"] = 15524, - ["path"] = "propertySystem.lua", + ["state"] = { + ["path"] = "plugins/state.lua", ["default"] = true, + ["description"] = "", + ["size"] = 6896, + ["requires"] = { + [1] = "Container", + }, + }, + ["debug"] = { + ["path"] = "plugins/debug.lua", + ["default"] = true, + ["description"] = "", + ["size"] = 6250, ["requires"] = { }, }, - ["log"] = { - ["description"] = "", - ["size"] = 3142, - ["path"] = "log.lua", + ["benchmark"] = { + ["path"] = "plugins/benchmark.lua", ["default"] = true, - ["requires"] = { - }, - }, - }, - }, - ["libraries"] = { - ["description"] = "Libraries", - ["files"] = { - ["utils"] = { ["description"] = "", - ["size"] = 2661, - ["path"] = "libraries/utils.lua", - ["default"] = true, - ["requires"] = { - }, - }, - ["colorHex"] = { - ["description"] = "", - ["size"] = 132, - ["path"] = "libraries/colorHex.lua", - ["default"] = true, - ["requires"] = { - }, - }, - ["expect"] = { - ["description"] = "", - ["size"] = 846, - ["path"] = "libraries/expect.lua", - ["default"] = true, + ["size"] = 12581, ["requires"] = { + [1] = "VisualElement", }, }, }, diff --git a/release/basalt.lua b/release/basalt.lua index 08b7787..0ea15ce 100644 --- a/release/basalt.lua +++ b/release/basalt.lua @@ -721,231 +721,237 @@ local bc=ac.get("z")local cc=i-1 while cc>0 do local dc=_c[cc].get("z")if dc>bc then _c[cc+1]=_c[cc] cc=cc-1 else break end end;_c[cc+1]=ac end self._values.visibleChildrenEvents=self._values.visibleChildrenEvents or{}self._values.visibleChildrenEvents[cb]=_c end;self.set("childrenEventsSorted",true)return self end;return bb end -project["elements/TextBox.lua"] = function(...) local a_a=require("elements/VisualElement") -local b_a=require("libraries/colorHex")local c_a=setmetatable({},a_a)c_a.__index=c_a -c_a.defineProperty(c_a,"lines",{default={""},type="table",canTriggerRender=true}) -c_a.defineProperty(c_a,"cursorX",{default=1,type="number"}) -c_a.defineProperty(c_a,"cursorY",{default=1,type="number"}) -c_a.defineProperty(c_a,"scrollX",{default=0,type="number",canTriggerRender=true}) -c_a.defineProperty(c_a,"scrollY",{default=0,type="number",canTriggerRender=true}) -c_a.defineProperty(c_a,"editable",{default=true,type="boolean"}) -c_a.defineProperty(c_a,"syntaxPatterns",{default={},type="table"}) -c_a.defineProperty(c_a,"cursorColor",{default=nil,type="color"}) -c_a.defineProperty(c_a,"autoCompleteEnabled",{default=false,type="boolean"}) -c_a.defineProperty(c_a,"autoCompleteItems",{default={},type="table"}) -c_a.defineProperty(c_a,"autoCompleteProvider",{default=nil,type="function",allowNil=true}) -c_a.defineProperty(c_a,"autoCompleteMinChars",{default=1,type="number"}) -c_a.defineProperty(c_a,"autoCompleteMaxItems",{default=6,type="number"}) -c_a.defineProperty(c_a,"autoCompleteCaseInsensitive",{default=true,type="boolean"}) -c_a.defineProperty(c_a,"autoCompleteTokenPattern",{default="[%w_]+",type="string"}) -c_a.defineProperty(c_a,"autoCompleteOffsetX",{default=0,type="number"}) -c_a.defineProperty(c_a,"autoCompleteOffsetY",{default=1,type="number"}) -c_a.defineProperty(c_a,"autoCompleteZOffset",{default=1,type="number"}) -c_a.defineProperty(c_a,"autoCompleteMaxWidth",{default=0,type="number"}) -c_a.defineProperty(c_a,"autoCompleteShowBorder",{default=true,type="boolean"}) -c_a.defineProperty(c_a,"autoCompleteBorderColor",{default=colors.black,type="color"}) -c_a.defineProperty(c_a,"autoCompleteBackground",{default=colors.lightGray,type="color"}) -c_a.defineProperty(c_a,"autoCompleteForeground",{default=colors.black,type="color"}) -c_a.defineProperty(c_a,"autoCompleteSelectedBackground",{default=colors.gray,type="color"}) -c_a.defineProperty(c_a,"autoCompleteSelectedForeground",{default=colors.white,type="color"}) -c_a.defineProperty(c_a,"autoCompleteAcceptOnEnter",{default=true,type="boolean"}) -c_a.defineProperty(c_a,"autoCompleteAcceptOnClick",{default=true,type="boolean"}) -c_a.defineProperty(c_a,"autoCompleteCloseOnEscape",{default=true,type="boolean"})c_a.defineEvent(c_a,"mouse_click") -c_a.defineEvent(c_a,"key")c_a.defineEvent(c_a,"char") -c_a.defineEvent(c_a,"mouse_scroll")c_a.defineEvent(c_a,"paste") -c_a.defineEvent(c_a,"auto_complete_open")c_a.defineEvent(c_a,"auto_complete_close") -c_a.defineEvent(c_a,"auto_complete_accept")local d_a;local _aa;local function aaa(a_b)local b_b=a_b._autoCompleteFrame +project["elements/TextBox.lua"] = function(...) local b_a=require("elements/VisualElement") +local c_a=require("libraries/colorHex")local d_a=setmetatable({},b_a)d_a.__index=d_a +d_a.defineProperty(d_a,"lines",{default={""},type="table",canTriggerRender=true}) +d_a.defineProperty(d_a,"cursorX",{default=1,type="number"}) +d_a.defineProperty(d_a,"cursorY",{default=1,type="number"}) +d_a.defineProperty(d_a,"scrollX",{default=0,type="number",canTriggerRender=true}) +d_a.defineProperty(d_a,"scrollY",{default=0,type="number",canTriggerRender=true}) +d_a.defineProperty(d_a,"editable",{default=true,type="boolean"}) +d_a.defineProperty(d_a,"syntaxPatterns",{default={},type="table"}) +d_a.defineProperty(d_a,"cursorColor",{default=nil,type="color"}) +d_a.defineProperty(d_a,"autoPairEnabled",{default=true,type="boolean"}) +d_a.defineProperty(d_a,"autoPairCharacters",{default={["("]=")",["["]="]",["{"]="}",['"']='"',['\'']='\'',['`']='`'},type="table"}) +d_a.defineProperty(d_a,"autoPairSkipClosing",{default=true,type="boolean"}) +d_a.defineProperty(d_a,"autoPairOverType",{default=true,type="boolean"}) +d_a.defineProperty(d_a,"autoPairNewlineIndent",{default=true,type="boolean"}) +d_a.defineProperty(d_a,"autoCompleteEnabled",{default=false,type="boolean"}) +d_a.defineProperty(d_a,"autoCompleteItems",{default={},type="table"}) +d_a.defineProperty(d_a,"autoCompleteProvider",{default=nil,type="function",allowNil=true}) +d_a.defineProperty(d_a,"autoCompleteMinChars",{default=1,type="number"}) +d_a.defineProperty(d_a,"autoCompleteMaxItems",{default=6,type="number"}) +d_a.defineProperty(d_a,"autoCompleteCaseInsensitive",{default=true,type="boolean"}) +d_a.defineProperty(d_a,"autoCompleteTokenPattern",{default="[%w_]+",type="string"}) +d_a.defineProperty(d_a,"autoCompleteOffsetX",{default=0,type="number"}) +d_a.defineProperty(d_a,"autoCompleteOffsetY",{default=1,type="number"}) +d_a.defineProperty(d_a,"autoCompleteZOffset",{default=1,type="number"}) +d_a.defineProperty(d_a,"autoCompleteMaxWidth",{default=0,type="number"}) +d_a.defineProperty(d_a,"autoCompleteShowBorder",{default=true,type="boolean"}) +d_a.defineProperty(d_a,"autoCompleteBorderColor",{default=colors.black,type="color"}) +d_a.defineProperty(d_a,"autoCompleteBackground",{default=colors.lightGray,type="color"}) +d_a.defineProperty(d_a,"autoCompleteForeground",{default=colors.black,type="color"}) +d_a.defineProperty(d_a,"autoCompleteSelectedBackground",{default=colors.gray,type="color"}) +d_a.defineProperty(d_a,"autoCompleteSelectedForeground",{default=colors.white,type="color"}) +d_a.defineProperty(d_a,"autoCompleteAcceptOnEnter",{default=true,type="boolean"}) +d_a.defineProperty(d_a,"autoCompleteAcceptOnClick",{default=true,type="boolean"}) +d_a.defineProperty(d_a,"autoCompleteCloseOnEscape",{default=true,type="boolean"})d_a.defineEvent(d_a,"mouse_click") +d_a.defineEvent(d_a,"key")d_a.defineEvent(d_a,"char") +d_a.defineEvent(d_a,"mouse_scroll")d_a.defineEvent(d_a,"paste") +d_a.defineEvent(d_a,"auto_complete_open")d_a.defineEvent(d_a,"auto_complete_close") +d_a.defineEvent(d_a,"auto_complete_accept")local _aa;local aaa;local function baa(c_b)local d_b=c_b._autoCompleteFrame return -b_b and not b_b._destroyed and b_b.get and b_b.get("visible")end -local function baa(a_b)return -a_b.get("autoCompleteShowBorder")and 1 or 0 end -local function caa(a_b)local b_b=a_b._autoCompleteFrame;local c_b=a_b._autoCompleteList;if -not b_b or b_b._destroyed then return end -b_b:setBackground(a_b.get("autoCompleteBackground")) -b_b:setForeground(a_b.get("autoCompleteForeground")) -if c_b and not c_b._destroyed then -c_b:setBackground(a_b.get("autoCompleteBackground")) -c_b:setForeground(a_b.get("autoCompleteForeground")) -c_b:setSelectedBackground(a_b.get("autoCompleteSelectedBackground")) -c_b:setSelectedForeground(a_b.get("autoCompleteSelectedForeground"))c_b:updateRender()end;_aa(a_b)d_a(a_b)b_b:updateRender()end -local function daa(a_b,b_b,c_b)local d_b=a_b._autoCompleteList -if not d_b or d_b._destroyed then return end;local _ab=d_b.get("items")local aab=#_ab;if aab==0 then return end -if b_b<1 then b_b=1 end;if b_b>aab then b_b=aab end;a_b._autoCompleteIndex=b_b -for dab,_bb in ipairs(_ab)do if -type(_bb)=="table"then _bb.selected=(dab==b_b)end end;local bab=d_b.get("height")or 0 -local cab=d_b.get("offset")or 0;if not c_b and bab>0 then -if b_b>cab+bab then -d_b:setOffset(math.max(0,b_b-bab))elseif b_b<=cab then d_b:setOffset(math.max(0,b_b-1))end end -d_b:updateRender()end -local function _ba(a_b,b_b)if aaa(a_b)then -a_b._autoCompleteFrame:setVisible(false) -if not b_b then a_b:fireEvent("auto_complete_close")end end -a_b._autoCompleteIndex=nil;a_b._autoCompleteSuggestions=nil;a_b._autoCompleteToken=nil -a_b._autoCompleteTokenStart=nil;a_b._autoCompletePopupWidth=nil end -local function aba(a_b,b_b)local c_b=a_b._autoCompleteSuggestions or{} -local d_b=a_b._autoCompleteIndex or 1;local _ab=b_b or c_b[d_b]if not _ab then return end -local aab=_ab.insert or _ab.text or""if aab==""then return end;local bab=a_b.get("lines") -local cab=a_b.get("cursorY")local dab=a_b.get("cursorX")local _bb=bab[cab]or"" -local abb=a_b._autoCompleteTokenStart or dab;if abb<1 then abb=1 end;local bbb=_bb:sub(1,abb-1)local cbb=_bb:sub(dab)bab[cab]= -bbb..aab..cbb;a_b.set("cursorX",abb+#aab) -a_b:updateViewport()a_b:updateRender()_ba(a_b,true) -a_b:fireEvent("auto_complete_accept",aab,_ab.source or _ab)end -local function bba(a_b) -if not a_b.get("autoCompleteEnabled")then return nil end;local b_b=a_b._autoCompleteFrame;if b_b and not b_b._destroyed then -return a_b._autoCompleteList end;local c_b=a_b:getBaseFrame()if not c_b or not -c_b.addFrame then return nil end -b_b=c_b:addFrame({width=a_b.get("width"),height=1,x=1,y=1,visible=false,background=a_b.get("autoCompleteBackground"),foreground=a_b.get("autoCompleteForeground"),ignoreOffset=true,z= -a_b.get("z")+a_b.get("autoCompleteZOffset")})b_b:setIgnoreOffset(true)b_b:setVisible(false) -local d_b=baa(a_b) -local _ab=b_b:addList({x=d_b+1,y=d_b+1,width=math.max(1,b_b.get("width")-d_b*2),height=math.max(1, -b_b.get("height")-d_b*2),selectable=true,multiSelection=false,background=a_b.get("autoCompleteBackground"),foreground=a_b.get("autoCompleteForeground")}) -_ab:setSelectedBackground(a_b.get("autoCompleteSelectedBackground")) -_ab:setSelectedForeground(a_b.get("autoCompleteSelectedForeground"))_ab:setOffset(0) -_ab:onSelect(function(aab,bab,cab)if not aaa(a_b)then return end -daa(a_b,bab) -if a_b.get("autoCompleteAcceptOnClick")then aba(a_b,cab)end end)a_b._autoCompleteFrame=b_b;a_b._autoCompleteList=_ab;caa(a_b)return _ab end -_aa=function(a_b,b_b,c_b)local d_b=a_b._autoCompleteFrame;local _ab=a_b._autoCompleteList +d_b and not d_b._destroyed and d_b.get and d_b.get("visible")end +local function caa(c_b)return +c_b.get("autoCompleteShowBorder")and 1 or 0 end +local function daa(c_b)local d_b=c_b._autoCompleteFrame;local _ab=c_b._autoCompleteList;if +not d_b or d_b._destroyed then return end +d_b:setBackground(c_b.get("autoCompleteBackground")) +d_b:setForeground(c_b.get("autoCompleteForeground")) +if _ab and not _ab._destroyed then +_ab:setBackground(c_b.get("autoCompleteBackground")) +_ab:setForeground(c_b.get("autoCompleteForeground")) +_ab:setSelectedBackground(c_b.get("autoCompleteSelectedBackground")) +_ab:setSelectedForeground(c_b.get("autoCompleteSelectedForeground"))_ab:updateRender()end;aaa(c_b)_aa(c_b)d_b:updateRender()end +local function _ba(c_b,d_b,_ab)local aab=c_b._autoCompleteList +if not aab or aab._destroyed then return end;local bab=aab.get("items")local cab=#bab;if cab==0 then return end +if d_b<1 then d_b=1 end;if d_b>cab then d_b=cab end;c_b._autoCompleteIndex=d_b +for abb,bbb in ipairs(bab)do if +type(bbb)=="table"then bbb.selected=(abb==d_b)end end;local dab=aab.get("height")or 0 +local _bb=aab.get("offset")or 0;if not _ab and dab>0 then +if d_b>_bb+dab then +aab:setOffset(math.max(0,d_b-dab))elseif d_b<=_bb then aab:setOffset(math.max(0,d_b-1))end end +aab:updateRender()end +local function aba(c_b,d_b)if baa(c_b)then +c_b._autoCompleteFrame:setVisible(false) +if not d_b then c_b:fireEvent("auto_complete_close")end end +c_b._autoCompleteIndex=nil;c_b._autoCompleteSuggestions=nil;c_b._autoCompleteToken=nil +c_b._autoCompleteTokenStart=nil;c_b._autoCompletePopupWidth=nil end +local function bba(c_b,d_b)local _ab=c_b._autoCompleteSuggestions or{} +local aab=c_b._autoCompleteIndex or 1;local bab=d_b or _ab[aab]if not bab then return end +local cab=bab.insert or bab.text or""if cab==""then return end;local dab=c_b.get("lines") +local _bb=c_b.get("cursorY")local abb=c_b.get("cursorX")local bbb=dab[_bb]or"" +local cbb=c_b._autoCompleteTokenStart or abb;if cbb<1 then cbb=1 end;local dbb=bbb:sub(1,cbb-1)local _cb=bbb:sub(abb)dab[_bb]= +dbb..cab.._cb;c_b.set("cursorX",cbb+#cab) +c_b:updateViewport()c_b:updateRender()aba(c_b,true) +c_b:fireEvent("auto_complete_accept",cab,bab.source or bab)end +local function cba(c_b) +if not c_b.get("autoCompleteEnabled")then return nil end;local d_b=c_b._autoCompleteFrame;if d_b and not d_b._destroyed then +return c_b._autoCompleteList end;local _ab=c_b:getBaseFrame()if not _ab or not +_ab.addFrame then return nil end +d_b=_ab:addFrame({width=c_b.get("width"),height=1,x=1,y=1,visible=false,background=c_b.get("autoCompleteBackground"),foreground=c_b.get("autoCompleteForeground"),ignoreOffset=true,z= +c_b.get("z")+c_b.get("autoCompleteZOffset")})d_b:setIgnoreOffset(true)d_b:setVisible(false) +local aab=caa(c_b) +local bab=d_b:addList({x=aab+1,y=aab+1,width=math.max(1,d_b.get("width")-aab*2),height=math.max(1, +d_b.get("height")-aab*2),selectable=true,multiSelection=false,background=c_b.get("autoCompleteBackground"),foreground=c_b.get("autoCompleteForeground")}) +bab:setSelectedBackground(c_b.get("autoCompleteSelectedBackground")) +bab:setSelectedForeground(c_b.get("autoCompleteSelectedForeground"))bab:setOffset(0) +bab:onSelect(function(cab,dab,_bb)if not baa(c_b)then return end +_ba(c_b,dab) +if c_b.get("autoCompleteAcceptOnClick")then bba(c_b,_bb)end end)c_b._autoCompleteFrame=d_b;c_b._autoCompleteList=bab;daa(c_b)return bab end +aaa=function(c_b,d_b,_ab)local aab=c_b._autoCompleteFrame;local bab=c_b._autoCompleteList if -not d_b or d_b._destroyed or not _ab or _ab._destroyed then return end;local aab=baa(a_b) -local bab= -tonumber(b_b)or rawget(a_b,"_autoCompletePopupWidth")or _ab.get("width")or d_b.get("width") -local cab=tonumber(c_b)or(_ab.get and _ab.get("height"))or(# ( -rawget(a_b,"_autoCompleteSuggestions")or{}))bab=math.max(1,bab or 1)cab=math.max(1,cab or 1)local dab= -d_b.get and d_b.get("width")or bab;local _bb= -d_b.get and d_b.get("height")or cab;local abb=math.max(1, -dab-aab*2) -local bbb=math.max(1,_bb-aab*2)if bab>abb then bab=abb end;if cab>bbb then cab=bbb end -_ab:setPosition(aab+1,aab+1)_ab:setWidth(math.max(1,bab)) -_ab:setHeight(math.max(1,cab))end -d_a=function(a_b)local b_b=a_b._autoCompleteFrame -if not b_b or b_b._destroyed then return end;local c_b=b_b.get and b_b.get("canvas") -if not c_b then return end;c_b:setType("post") -if b_b._autoCompleteBorderCommand then -c_b:removeCommand(b_b._autoCompleteBorderCommand)b_b._autoCompleteBorderCommand=nil end;if not a_b.get("autoCompleteShowBorder")then -b_b:updateRender()return end;local d_b=a_b.get("autoCompleteBorderColor")or +not aab or aab._destroyed or not bab or bab._destroyed then return end;local cab=caa(c_b) +local dab= +tonumber(d_b)or rawget(c_b,"_autoCompletePopupWidth")or bab.get("width")or aab.get("width") +local _bb=tonumber(_ab)or(bab.get and bab.get("height"))or(# ( +rawget(c_b,"_autoCompleteSuggestions")or{}))dab=math.max(1,dab or 1)_bb=math.max(1,_bb or 1)local abb= +aab.get and aab.get("width")or dab;local bbb= +aab.get and aab.get("height")or _bb;local cbb=math.max(1, +abb-cab*2) +local dbb=math.max(1,bbb-cab*2)if dab>cbb then dab=cbb end;if _bb>dbb then _bb=dbb end +bab:setPosition(cab+1,cab+1)bab:setWidth(math.max(1,dab)) +bab:setHeight(math.max(1,_bb))end +_aa=function(c_b)local d_b=c_b._autoCompleteFrame +if not d_b or d_b._destroyed then return end;local _ab=d_b.get and d_b.get("canvas") +if not _ab then return end;_ab:setType("post") +if d_b._autoCompleteBorderCommand then +_ab:removeCommand(d_b._autoCompleteBorderCommand)d_b._autoCompleteBorderCommand=nil end;if not c_b.get("autoCompleteShowBorder")then +d_b:updateRender()return end;local aab=c_b.get("autoCompleteBorderColor")or colors.black -local _ab=c_b:addCommand(function(aab)local bab= -aab.get("width")or 0;local cab=aab.get("height")or 0;if bab<1 or -cab<1 then return end -local dab=aab.get("background")or colors.black;local _bb=b_a[dab]or b_a[colors.black]local abb=b_a[d_b]or -b_a[colors.black] -aab:textFg(1,1,("\131"):rep(bab),d_b)aab:multiBlit(1,cab,bab,1,"\143",_bb,abb) -aab:multiBlit(1,1,1,cab,"\149",abb,_bb)aab:multiBlit(bab,1,1,cab,"\149",_bb,abb) -aab:blit(1,1,"\151",abb,_bb)aab:blit(bab,1,"\148",_bb,abb) -aab:blit(1,cab,"\138",_bb,abb)aab:blit(bab,cab,"\133",_bb,abb)end)b_b._autoCompleteBorderCommand=_ab;b_b:updateRender()end -local function cba(a_b)local b_b=a_b.get("lines")local c_b=a_b.get("cursorY") -local d_b=a_b.get("cursorX")local _ab=b_b[c_b]or"" -local aab=_ab:sub(1,math.max(d_b-1,0)) -local bab=a_b.get("autoCompleteTokenPattern")or"[%w_]+"local cab=""if bab~=""then -cab=aab:match("("..bab..")$")or""end;local dab=d_b-#cab;if dab<1 then dab=1 end;return cab,dab end -local function dba(a_b) -if type(a_b)=="string"then return{text=a_b,insert=a_b,source=a_b}elseif -type(a_b)=="table"then local b_b= -a_b.text or a_b.label or a_b.value or a_b.insert or a_b[1]if not b_b then return +local bab=_ab:addCommand(function(cab)local dab= +cab.get("width")or 0;local _bb=cab.get("height")or 0;if dab<1 or +_bb<1 then return end +local abb=cab.get("background")or colors.black;local bbb=c_a[abb]or c_a[colors.black]local cbb=c_a[aab]or +c_a[colors.black] +cab:textFg(1,1,("\131"):rep(dab),aab)cab:multiBlit(1,_bb,dab,1,"\143",bbb,cbb) +cab:multiBlit(1,1,1,_bb,"\149",cbb,bbb)cab:multiBlit(dab,1,1,_bb,"\149",bbb,cbb) +cab:blit(1,1,"\151",cbb,bbb)cab:blit(dab,1,"\148",bbb,cbb) +cab:blit(1,_bb,"\138",bbb,cbb)cab:blit(dab,_bb,"\133",bbb,cbb)end)d_b._autoCompleteBorderCommand=bab;d_b:updateRender()end +local function dba(c_b)local d_b=c_b.get("lines")local _ab=c_b.get("cursorY") +local aab=c_b.get("cursorX")local bab=d_b[_ab]or"" +local cab=bab:sub(1,math.max(aab-1,0)) +local dab=c_b.get("autoCompleteTokenPattern")or"[%w_]+"local _bb=""if dab~=""then +_bb=cab:match("("..dab..")$")or""end;local abb=aab-#_bb;if abb<1 then abb=1 end;return _bb,abb end +local function _ca(c_b) +if type(c_b)=="string"then return{text=c_b,insert=c_b,source=c_b}elseif +type(c_b)=="table"then local d_b= +c_b.text or c_b.label or c_b.value or c_b.insert or c_b[1]if not d_b then return nil end -local c_b={text=b_b,insert=a_b.insert or a_b.value or b_b,source=a_b}if a_b.foreground then c_b.foreground=a_b.foreground end;if -a_b.background then c_b.background=a_b.background end;if a_b.selectedForeground then -c_b.selectedForeground=a_b.selectedForeground end;if a_b.selectedBackground then -c_b.selectedBackground=a_b.selectedBackground end -if a_b.icon then c_b.icon=a_b.icon end;if a_b.info then c_b.info=a_b.info end;return c_b end end -local function _ca(a_b,b_b)if type(a_b)~="table"then return end;local c_b=#a_b -if c_b>0 then for index=1,c_b do -b_b(a_b[index])end else for d_b,_ab in pairs(a_b)do b_b(_ab)end end end -local function aca(a_b,b_b)local c_b=a_b.get("autoCompleteProvider")local d_b={} -if c_b then -local dab,_bb=pcall(c_b,a_b,b_b)if dab and type(_bb)=="table"then d_b=_bb end else d_b= -a_b.get("autoCompleteItems")or{}end;local _ab={}local aab=a_b.get("autoCompleteCaseInsensitive")local bab=aab and -b_b:lower()or b_b -_ca(d_b,function(dab)local _bb=dba(dab) -if _bb and _bb.text then -local abb= -aab and _bb.text:lower()or _bb.text;if bab==""or abb:find(bab,1,true)==1 then -table.insert(_ab,_bb)end end end)local cab=a_b.get("autoCompleteMaxItems")if#_ab>cab then while#_ab>cab do -table.remove(_ab)end end;return _ab end -local function bca(a_b,b_b)local c_b=0 -for cab,dab in ipairs(b_b)do local _bb=dab;if type(dab)=="table"then -_bb= -dab.text or dab.label or dab.value or dab.insert or dab[1]end;if _bb~=nil then -local abb=#tostring(_bb)if abb>c_b then c_b=abb end end end;local d_b=a_b.get("autoCompleteMaxWidth") -local _ab=a_b.get("width")if d_b and d_b>0 then _ab=math.min(_ab,d_b)end -local aab=baa(a_b)local bab=a_b:getBaseFrame() -if bab and bab.get then -local cab=bab.get("width")if cab and cab>0 then local dab=cab-aab*2;if dab<1 then dab=1 end -_ab=math.min(_ab,dab)end end;c_b=math.min(c_b,_ab)return math.max(1,c_b)end -local function cca(a_b,b_b,c_b)local d_b=a_b._autoCompleteFrame;local _ab=a_b._autoCompleteList;if -not d_b or d_b._destroyed then return end;local aab=baa(a_b) -local bab=math.max(1,c_b or a_b.get("width"))local cab=math.max(1,b_b or 1)local dab=a_b:getBaseFrame()if not dab then -return end;local _bb=dab.get and dab.get("width")local abb=dab.get and -dab.get("height") -if _bb and _bb>0 then local _ac=_bb-aab*2;if _ac<1 then -_ac=1 end;if bab>_ac then bab=_ac end end;if abb and abb>0 then local _ac=abb-aab*2;if _ac<1 then _ac=1 end -if cab>_ac then cab=_ac end end;local bbb=bab+aab*2 -local cbb=cab+aab*2;local dbb,_cb=a_b:calculatePosition() -local acb=a_b.get("scrollX")or 0;local bcb=a_b.get("scrollY")or 0;local ccb=(a_b._autoCompleteTokenStart or -a_b.get("cursorX"))local dcb=ccb-acb -dcb=math.max(1,math.min(a_b.get("width"),dcb))local _db=a_b.get("cursorY")-bcb -_db=math.max(1,math.min(a_b.get("height"),_db))local adb=a_b.get("autoCompleteOffsetX") -local bdb=a_b.get("autoCompleteOffsetY")local cdb=dbb+dcb-1 +adb;local ddb=cdb-aab -if aab>0 then ddb=ddb+1 end;local __c=_cb+_db+bdb;local a_c=_cb+_db-bdb-1;local b_c=__c-aab;local c_c= -a_c-cab+1 -aab;local d_c=b_c -if _bb and _bb>0 then if bbb>_bb then bbb=_bb -bab=math.max(1,bbb-aab*2)end;if ddb+bbb-1 >_bb then -ddb=math.max(1,_bb-bbb+1)end;if ddb<1 then ddb=1 end else if ddb<1 then ddb=1 end end -if abb and abb>0 then if d_c+cbb-1 >abb then d_c=c_c;if d_c<1 then -d_c=math.max(1,abb-cbb+1)end end -if d_c<1 then d_c=1 end else if d_c<1 then d_c=1 end end;d_b:setPosition(ddb,d_c)d_b:setWidth(bbb) -d_b:setHeight(cbb) -d_b:setZ(a_b.get("z")+a_b.get("autoCompleteZOffset"))_aa(a_b,bab,cab)if _ab and not _ab._destroyed then -_ab:updateRender()end;d_b:updateRender()end -local function dca(a_b) -if not a_b.get("autoCompleteEnabled")then _ba(a_b,true)return end -if not a_b.get("focused")then _ba(a_b,true)return end;local b_b,c_b=cba(a_b)a_b._autoCompleteToken=b_b -a_b._autoCompleteTokenStart=c_b -if#b_b=1 and _bb<=bab then -daa(a_b,_bb)else c_b:updateRender()end;return true end -function c_a.new()local a_b=setmetatable({},c_a):__init() -a_b.class=c_a;a_b.set("width",20)a_b.set("height",10)return a_b end -function c_a:init(a_b,b_b)a_a.init(self,a_b,b_b) +local _ab={text=d_b,insert=c_b.insert or c_b.value or d_b,source=c_b}if c_b.foreground then _ab.foreground=c_b.foreground end;if +c_b.background then _ab.background=c_b.background end;if c_b.selectedForeground then +_ab.selectedForeground=c_b.selectedForeground end;if c_b.selectedBackground then +_ab.selectedBackground=c_b.selectedBackground end +if c_b.icon then _ab.icon=c_b.icon end;if c_b.info then _ab.info=c_b.info end;return _ab end end +local function aca(c_b,d_b)if type(c_b)~="table"then return end;local _ab=#c_b +if _ab>0 then for index=1,_ab do +d_b(c_b[index])end else for aab,bab in pairs(c_b)do d_b(bab)end end end +local function bca(c_b,d_b)local _ab=c_b.get("autoCompleteProvider")local aab={} +if _ab then +local abb,bbb=pcall(_ab,c_b,d_b)if abb and type(bbb)=="table"then aab=bbb end else aab= +c_b.get("autoCompleteItems")or{}end;local bab={}local cab=c_b.get("autoCompleteCaseInsensitive")local dab=cab and +d_b:lower()or d_b +aca(aab,function(abb)local bbb=_ca(abb) +if bbb and bbb.text then +local cbb= +cab and bbb.text:lower()or bbb.text;if dab==""or cbb:find(dab,1,true)==1 then +table.insert(bab,bbb)end end end)local _bb=c_b.get("autoCompleteMaxItems")if#bab>_bb then while#bab>_bb do +table.remove(bab)end end;return bab end +local function cca(c_b,d_b)local _ab=0 +for _bb,abb in ipairs(d_b)do local bbb=abb;if type(abb)=="table"then +bbb= +abb.text or abb.label or abb.value or abb.insert or abb[1]end;if bbb~=nil then +local cbb=#tostring(bbb)if cbb>_ab then _ab=cbb end end end;local aab=c_b.get("autoCompleteMaxWidth") +local bab=c_b.get("width")if aab and aab>0 then bab=math.min(bab,aab)end +local cab=caa(c_b)local dab=c_b:getBaseFrame() +if dab and dab.get then +local _bb=dab.get("width")if _bb and _bb>0 then local abb=_bb-cab*2;if abb<1 then abb=1 end +bab=math.min(bab,abb)end end;_ab=math.min(_ab,bab)return math.max(1,_ab)end +local function dca(c_b,d_b,_ab)local aab=c_b._autoCompleteFrame;local bab=c_b._autoCompleteList;if +not aab or aab._destroyed then return end;local cab=caa(c_b) +local dab=math.max(1,_ab or c_b.get("width"))local _bb=math.max(1,d_b or 1)local abb=c_b:getBaseFrame()if not abb then +return end;local bbb=abb.get and abb.get("width")local cbb=abb.get and +abb.get("height") +if bbb and bbb>0 then local bac=bbb-cab*2;if bac<1 then +bac=1 end;if dab>bac then dab=bac end end;if cbb and cbb>0 then local bac=cbb-cab*2;if bac<1 then bac=1 end +if _bb>bac then _bb=bac end end;local dbb=dab+cab*2 +local _cb=_bb+cab*2;local acb,bcb=c_b:calculatePosition() +local ccb=c_b.get("scrollX")or 0;local dcb=c_b.get("scrollY")or 0;local _db=(c_b._autoCompleteTokenStart or +c_b.get("cursorX"))local adb=_db-ccb +adb=math.max(1,math.min(c_b.get("width"),adb))local bdb=c_b.get("cursorY")-dcb +bdb=math.max(1,math.min(c_b.get("height"),bdb))local cdb=c_b.get("autoCompleteOffsetX") +local ddb=c_b.get("autoCompleteOffsetY")local __c=acb+adb-1 +cdb;local a_c=__c-cab +if cab>0 then a_c=a_c+1 end;local b_c=bcb+bdb+ddb;local c_c=bcb+bdb-ddb-1;local d_c=b_c-cab;local _ac= +c_c-_bb+1 -cab;local aac=d_c +if bbb and bbb>0 then if dbb>bbb then dbb=bbb +dab=math.max(1,dbb-cab*2)end;if a_c+dbb-1 >bbb then +a_c=math.max(1,bbb-dbb+1)end;if a_c<1 then a_c=1 end else if a_c<1 then a_c=1 end end +if cbb and cbb>0 then +if aac+_cb-1 >cbb then aac=_ac;if cab>0 then aac=aac-cab end;if +aac<1 then aac=math.max(1,cbb-_cb+1)end end;if aac<1 then aac=1 end else if aac<1 then aac=1 end;if aac==_ac and cab>0 then +aac=math.max(1,aac-cab)end end;aab:setPosition(a_c,aac)aab:setWidth(dbb) +aab:setHeight(_cb) +aab:setZ(c_b.get("z")+c_b.get("autoCompleteZOffset"))aaa(c_b,dab,_bb)if bab and not bab._destroyed then +bab:updateRender()end;aab:updateRender()end +local function _da(c_b) +if not c_b.get("autoCompleteEnabled")then aba(c_b,true)return end +if not c_b.get("focused")then aba(c_b,true)return end;local d_b,_ab=dba(c_b)c_b._autoCompleteToken=d_b +c_b._autoCompleteTokenStart=_ab +if#d_b=1 and bbb<=dab then +_ba(c_b,bbb)else _ab:updateRender()end;return true end +function d_a.new()local c_b=setmetatable({},d_a):__init() +c_b.class=d_a;c_b.set("width",20)c_b.set("height",10)return c_b end +function d_a:init(c_b,d_b)b_a.init(self,c_b,d_b) self.set("type","TextBox") -local function c_b()if -self.get("autoCompleteEnabled")and self.get("focused")then dca(self)end end;local function d_b()caa(self)end -local function _ab() -if aaa(self)then -local aab=rawget(self,"_autoCompleteSuggestions")or{} -cca(self,math.max(#aab,1),rawget(self,"_autoCompletePopupWidth")or +local function _ab()if +self.get("autoCompleteEnabled")and self.get("focused")then _da(self)end end;local function aab()daa(self)end +local function bab() +if baa(self)then +local cab=rawget(self,"_autoCompleteSuggestions")or{} +dca(self,math.max(#cab,1),rawget(self,"_autoCompletePopupWidth")or self.get("width"))end end -self:observe("autoCompleteEnabled",function(aab,bab)if not bab then _ba(self,true)elseif self.get("focused")then -dca(self)end end) -self:observe("focused",function(aab,bab)if bab then c_b()else _ba(self,true)end end)self:observe("foreground",d_b) -self:observe("background",d_b)self:observe("autoCompleteBackground",d_b) -self:observe("autoCompleteForeground",d_b) -self:observe("autoCompleteSelectedBackground",d_b) -self:observe("autoCompleteSelectedForeground",d_b)self:observe("autoCompleteBorderColor",d_b) +self:observe("autoCompleteEnabled",function(cab,dab)if not dab then aba(self,true)elseif self.get("focused")then +_da(self)end end) +self:observe("focused",function(cab,dab)if dab then _ab()else aba(self,true)end end)self:observe("foreground",aab) +self:observe("background",aab)self:observe("autoCompleteBackground",aab) +self:observe("autoCompleteForeground",aab) +self:observe("autoCompleteSelectedBackground",aab) +self:observe("autoCompleteSelectedForeground",aab)self:observe("autoCompleteBorderColor",aab) self:observe("autoCompleteZOffset",function() if @@ -955,121 +961,144 @@ self:observe("z",function() if self._autoCompleteFrame and not self._autoCompleteFrame._destroyed then self._autoCompleteFrame:setZ(self.get("z")+self.get("autoCompleteZOffset"))end end) -self:observe("autoCompleteShowBorder",function()d_b()_ab()end) -for aab,bab in -ipairs({"autoCompleteItems","autoCompleteProvider","autoCompleteMinChars","autoCompleteMaxItems","autoCompleteCaseInsensitive","autoCompleteTokenPattern","autoCompleteOffsetX","autoCompleteOffsetY"})do self:observe(bab,c_b)end;self:observe("x",_ab)self:observe("y",_ab)self:observe("width",function() -_ab()c_b()end) -self:observe("height",_ab)self:observe("cursorX",_ab) -self:observe("cursorY",_ab)self:observe("scrollX",_ab) -self:observe("scrollY",_ab)self:observe("autoCompleteOffsetX",_ab) -self:observe("autoCompleteOffsetY",_ab) +self:observe("autoCompleteShowBorder",function()aab()bab()end) +for cab,dab in +ipairs({"autoCompleteItems","autoCompleteProvider","autoCompleteMinChars","autoCompleteMaxItems","autoCompleteCaseInsensitive","autoCompleteTokenPattern","autoCompleteOffsetX","autoCompleteOffsetY"})do self:observe(dab,_ab)end;self:observe("x",bab)self:observe("y",bab)self:observe("width",function() +bab()_ab()end) +self:observe("height",bab)self:observe("cursorX",bab) +self:observe("cursorY",bab)self:observe("scrollX",bab) +self:observe("scrollY",bab)self:observe("autoCompleteOffsetX",bab) +self:observe("autoCompleteOffsetY",bab) self:observe("autoCompleteMaxWidth",function() -if aaa(self)then -local aab=rawget(self,"_autoCompleteSuggestions")or{}if#aab>0 then local bab=bca(self,aab)self._autoCompletePopupWidth=bab -cca(self,math.max(#aab,1),bab)end end end)return self end;function c_a:addSyntaxPattern(a_b,b_b) -table.insert(self.get("syntaxPatterns"),{pattern=a_b,color=b_b})return self end -function c_a:removeSyntaxPattern(a_b)local b_b= +if baa(self)then +local cab=rawget(self,"_autoCompleteSuggestions")or{}if#cab>0 then local dab=cca(self,cab)self._autoCompletePopupWidth=dab +dca(self,math.max(#cab,1),dab)end end end)return self end;function d_a:addSyntaxPattern(c_b,d_b) +table.insert(self.get("syntaxPatterns"),{pattern=c_b,color=d_b})return self end +function d_a:removeSyntaxPattern(c_b)local d_b= self.get("syntaxPatterns")or{} -if type(a_b)~="number"then return self end -if a_b>=1 and a_b<=#b_b then table.remove(b_b,a_b) -self.set("syntaxPatterns",b_b)self:updateRender()end;return self end;function c_a:clearSyntaxPatterns()self.set("syntaxPatterns",{}) +if type(c_b)~="number"then return self end +if c_b>=1 and c_b<=#d_b then table.remove(d_b,c_b) +self.set("syntaxPatterns",d_b)self:updateRender()end;return self end;function d_a:clearSyntaxPatterns()self.set("syntaxPatterns",{}) self:updateRender()return self end -local function bda(a_b,b_b) -local c_b=a_b.get("lines")local d_b=a_b.get("cursorX")local _ab=a_b.get("cursorY") -local aab=c_b[_ab] -c_b[_ab]=aab:sub(1,d_b-1)..b_b..aab:sub(d_b)a_b.set("cursorX",d_b+1)a_b:updateViewport() -a_b:updateRender()end -local function cda(a_b)local b_b=a_b.get("lines")local c_b=a_b.get("cursorX") -local d_b=a_b.get("cursorY")local _ab=b_b[d_b]local aab=_ab:sub(c_b) -b_b[d_b]=_ab:sub(1,c_b-1)table.insert(b_b,d_b+1,aab)a_b.set("cursorX",1)a_b.set("cursorY", -d_b+1)a_b:updateViewport() -a_b:updateRender()end -local function dda(a_b)local b_b=a_b.get("lines")local c_b=a_b.get("cursorX") -local d_b=a_b.get("cursorY")local _ab=b_b[d_b] -if c_b>1 then -b_b[d_b]=_ab:sub(1,c_b-2).._ab:sub(c_b)a_b.set("cursorX",c_b-1)elseif d_b>1 then local aab=b_b[d_b-1]a_b.set("cursorX", -#aab+1)a_b.set("cursorY",d_b-1)b_b[d_b-1]= -aab.._ab;table.remove(b_b,d_b)end;a_b:updateViewport()a_b:updateRender()end -function c_a:updateViewport()local a_b=self.get("cursorX") -local b_b=self.get("cursorY")local c_b=self.get("scrollX")local d_b=self.get("scrollY") -local _ab=self.get("width")local aab=self.get("height") -if a_b-c_b>_ab then -self.set("scrollX",a_b-_ab)elseif a_b-c_b<1 then self.set("scrollX",a_b-1)end -if b_b-d_b>aab then self.set("scrollY",b_b-aab)elseif b_b-d_b<1 then self.set("scrollY", -b_b-1)end;return self end;function c_a:char(a_b)if -not self.get("editable")or not self.get("focused")then return false end;bda(self,a_b) -dca(self)return true end -function c_a:key(a_b)if - +local function cda(c_b,d_b) +local _ab=c_b.get("lines")local aab=c_b.get("cursorX")local bab=c_b.get("cursorY") +local cab=_ab[bab] +_ab[bab]=cab:sub(1,aab-1)..d_b..cab:sub(aab)c_b.set("cursorX",aab+1)c_b:updateViewport() +c_b:updateRender()end +local function dda(c_b,d_b)for i=1,#d_b do cda(c_b,d_b:sub(i,i))end end +local function __b(c_b)local d_b=c_b.get("lines")local _ab=c_b.get("cursorX") +local aab=c_b.get("cursorY")local bab=d_b[aab]local cab=bab:sub(_ab) +d_b[aab]=bab:sub(1,_ab-1)table.insert(d_b,aab+1,cab)c_b.set("cursorX",1)c_b.set("cursorY", +aab+1)c_b:updateViewport() +c_b:updateRender()end +local function a_b(c_b)local d_b=c_b.get("lines")local _ab=c_b.get("cursorX") +local aab=c_b.get("cursorY")local bab=d_b[aab] +if _ab>1 then +d_b[aab]=bab:sub(1,_ab-2)..bab:sub(_ab)c_b.set("cursorX",_ab-1)elseif aab>1 then local cab=d_b[aab-1]c_b.set("cursorX", +#cab+1)c_b.set("cursorY",aab-1)d_b[aab-1]= +cab..bab;table.remove(d_b,aab)end;c_b:updateViewport()c_b:updateRender()end +function d_a:updateViewport()local c_b=self.get("cursorX") +local d_b=self.get("cursorY")local _ab=self.get("scrollX")local aab=self.get("scrollY") +local bab=self.get("width")local cab=self.get("height") +if c_b-_ab>bab then +self.set("scrollX",c_b-bab)elseif c_b-_ab<1 then self.set("scrollX",c_b-1)end +if d_b-aab>cab then self.set("scrollY",d_b-cab)elseif d_b-aab<1 then self.set("scrollY", +d_b-1)end;return self end +function d_a:char(c_b)if not self.get("editable")or not self.get("focused")then return false end -if _da(self,a_b)then return true end;local b_b=self.get("lines")local c_b=self.get("cursorX") -local d_b=self.get("cursorY") -if a_b==keys.enter then cda(self)elseif a_b==keys.backspace then dda(self)elseif -a_b==keys.left then -if c_b>1 then self.set("cursorX",c_b-1)elseif d_b>1 then -self.set("cursorY",d_b-1)self.set("cursorX",#b_b[d_b-1]+1)end elseif a_b==keys.right then if c_b<=#b_b[d_b]then -self.set("cursorX",c_b+1)elseif d_b<#b_b then self.set("cursorY",d_b+1) -self.set("cursorX",1)end elseif a_b==keys.up and -d_b>1 then self.set("cursorY",d_b-1) -self.set("cursorX",math.min(c_b,# -b_b[d_b-1]+1))elseif a_b==keys.down and d_b<#b_b then -self.set("cursorY",d_b+1) -self.set("cursorX",math.min(c_b,#b_b[d_b+1]+1))end;self:updateRender()self:updateViewport()dca(self)return +local d_b=self.get("autoPairEnabled") +if d_b and#c_b==1 then +local _ab=self.get("autoPairCharacters")or{}local aab=self.get("lines")local bab=self.get("cursorX") +local cab=self.get("cursorY")local dab=aab[cab]or""local _bb=dab:sub(bab,bab)local abb=_ab[c_b] +if abb then +cda(self,c_b) +if self.get("autoPairSkipClosing")then +if _bb~=abb then cda(self,abb)self.set("cursorX", +self.get("cursorX")-1)end else cda(self,abb) +self.set("cursorX",self.get("cursorX")-1)end;_da(self)return true end +if self.get("autoPairOverType")then +for bbb,cbb in pairs(_ab)do if c_b==cbb and _bb==cbb then +self.set("cursorX",bab+1)_da(self)return true end end end end;cda(self,c_b)_da(self)return true end +function d_a:key(c_b)if +not self.get("editable")or not self.get("focused")then return false end +if ada(self,c_b)then return true end;local d_b=self.get("lines")local _ab=self.get("cursorX") +local aab=self.get("cursorY") +if c_b==keys.enter then +if self.get("autoPairEnabled")and +self.get("autoPairNewlineIndent")then local bab=self.get("lines") +local cab=self.get("cursorX")local dab=self.get("cursorY")local _bb=bab[dab]or"" +local abb=_bb:sub(1,cab-1)local bbb=_bb:sub(cab) +local cbb=self.get("autoPairCharacters")or{}local dbb={}for bcb,ccb in pairs(cbb)do dbb[ccb]=bcb end;local _cb=abb:sub(-1) +local acb=bbb:sub(1,1) +if _cb~=""and acb~=""and cbb[_cb]==acb then bab[dab]=abb;table.insert(bab, +dab+1,"")table.insert(bab,dab+2,bbb)self.set("cursorY", +dab+1)self.set("cursorX",1) +self:updateViewport()self:updateRender()_da(self)return true end end;__b(self)elseif c_b==keys.backspace then a_b(self)elseif c_b==keys.left then +if _ab>1 then self.set("cursorX", +_ab-1)elseif aab>1 then self.set("cursorY",aab-1)self.set("cursorX", +#d_b[aab-1]+1)end elseif c_b==keys.right then if _ab<=#d_b[aab]then +self.set("cursorX",_ab+1)elseif aab<#d_b then self.set("cursorY",aab+1) +self.set("cursorX",1)end elseif c_b==keys.up and +aab>1 then self.set("cursorY",aab-1) +self.set("cursorX",math.min(_ab,# +d_b[aab-1]+1))elseif c_b==keys.down and aab<#d_b then +self.set("cursorY",aab+1) +self.set("cursorX",math.min(_ab,#d_b[aab+1]+1))end;self:updateRender()self:updateViewport()_da(self)return true end -function c_a:mouse_scroll(a_b,b_b,c_b)if ada(self,a_b)then return true end -if self:isInBounds(b_b,c_b)then -local d_b=self.get("scrollY")local _ab=self.get("height")local aab=self.get("lines")local bab=math.max(0,#aab- -_ab+2) -local cab=math.max(0,math.min(bab,d_b+a_b))self.set("scrollY",cab)self:updateRender()return true end;return false end -function c_a:mouse_click(a_b,b_b,c_b) -if a_a.mouse_click(self,a_b,b_b,c_b)then -local d_b,_ab=self:getRelativePosition(b_b,c_b)local aab=self.get("scrollX")local bab=self.get("scrollY")local cab= -(_ab or 0)+ (bab or 0) -local dab=self.get("lines")or{}if cab<1 then cab=1 end -if cab<=#dab and dab[cab]~=nil then -self.set("cursorY",cab)local _bb=#tostring(dab[cab]) -self.set("cursorX",math.min((d_b or 1)+ (aab or 0), -_bb+1))end;self:updateRender()dca(self)return true end -if aaa(self)then local d_b=self._autoCompleteFrame;if +function d_a:mouse_scroll(c_b,d_b,_ab)if bda(self,c_b)then return true end +if self:isInBounds(d_b,_ab)then +local aab=self.get("scrollY")local bab=self.get("height")local cab=self.get("lines")local dab=math.max(0,#cab- +bab+2) +local _bb=math.max(0,math.min(dab,aab+c_b))self.set("scrollY",_bb)self:updateRender()return true end;return false end +function d_a:mouse_click(c_b,d_b,_ab) +if b_a.mouse_click(self,c_b,d_b,_ab)then +local aab,bab=self:getRelativePosition(d_b,_ab)local cab=self.get("scrollX")local dab=self.get("scrollY")local _bb= +(bab or 0)+ (dab or 0) +local abb=self.get("lines")or{}if _bb<1 then _bb=1 end +if _bb<=#abb and abb[_bb]~=nil then +self.set("cursorY",_bb)local bbb=#tostring(abb[_bb]) +self.set("cursorX",math.min((aab or 1)+ (cab or 0), +bbb+1))end;self:updateRender()_da(self)return true end +if baa(self)then local aab=self._autoCompleteFrame;if not -(d_b and d_b:isInBounds(b_b,c_b))and not self:isInBounds(b_b,c_b)then _ba(self)end end;return false end -function c_a:paste(a_b)if +(aab and aab:isInBounds(d_b,_ab))and not self:isInBounds(d_b,_ab)then aba(self)end end;return false end +function d_a:paste(c_b)if not self.get("editable")or not self.get("focused")then return false end -for b_b in a_b:gmatch(".")do if b_b=="\n"then -cda(self)else bda(self,b_b)end end;dca(self)return true end -function c_a:setText(a_b)local b_b={} -if a_b==""then b_b={""}else for c_b in(a_b.."\n"):gmatch("([^\n]*)\n")do -table.insert(b_b,c_b)end end;self.set("lines",b_b)_ba(self,true)return self end -function c_a:getText()return table.concat(self.get("lines"),"\n")end -local function __b(a_b,b_b)local c_b=b_b -local d_b=string.rep(b_a[a_b.get("foreground")],#c_b)local _ab=a_b.get("syntaxPatterns") -for aab,bab in ipairs(_ab)do local cab=1 +for d_b in c_b:gmatch(".")do if d_b=="\n"then +__b(self)else cda(self,d_b)end end;_da(self)return true end +function d_a:setText(c_b)local d_b={} +if c_b==""then d_b={""}else for _ab in(c_b.."\n"):gmatch("([^\n]*)\n")do +table.insert(d_b,_ab)end end;self.set("lines",d_b)aba(self,true)return self end +function d_a:getText()return table.concat(self.get("lines"),"\n")end +local function b_b(c_b,d_b)local _ab=d_b +local aab=string.rep(c_a[c_b.get("foreground")],#_ab)local bab=c_b.get("syntaxPatterns") +for cab,dab in ipairs(bab)do local _bb=1 while true do -local dab,_bb=c_b:find(bab.pattern,cab)if not dab then break end;local abb=_bb-dab+1 -if abb<=0 then -d_b=d_b:sub(1,dab-1).. -string.rep(b_a[bab.color],1)..d_b:sub(dab+1)cab=dab+1 else -d_b=d_b:sub(1,dab-1)..string.rep(b_a[bab.color],abb)..d_b:sub( -_bb+1)cab=_bb+1 end end end;return c_b,d_b end -function c_a:render()a_a.render(self)local a_b=self.get("lines") -local b_b=self.get("scrollX")local c_b=self.get("scrollY")local d_b=self.get("width") -local _ab=self.get("height")local aab=b_a[self.get("foreground")] -local bab=b_a[self.get("background")] -for y=1,_ab do local cab=y+c_b;local dab=a_b[cab]or""local _bb,abb=__b(self,dab)local bbb=_bb:sub(b_b+1,b_b+ -d_b)local cbb=abb:sub(b_b+1,b_b+d_b)local dbb= -d_b-#bbb -if dbb>0 then bbb=bbb..string.rep(" ",dbb)cbb=cbb.. -string.rep(b_a[self.get("foreground")],dbb)end -self:blit(1,y,bbb,cbb,string.rep(bab,#bbb))end -if self.get("focused")then local cab=self.get("cursorX")-b_b;local dab= -self.get("cursorY")-c_b;if cab>=1 and cab<=d_b and dab>=1 and -dab<=_ab then -self:setCursor(cab,dab,true,self.get("cursorColor")or +local abb,bbb=_ab:find(dab.pattern,_bb)if not abb then break end;local cbb=bbb-abb+1 +if cbb<=0 then +aab=aab:sub(1,abb-1).. +string.rep(c_a[dab.color],1)..aab:sub(abb+1)_bb=abb+1 else +aab=aab:sub(1,abb-1)..string.rep(c_a[dab.color],cbb)..aab:sub( +bbb+1)_bb=bbb+1 end end end;return _ab,aab end +function d_a:render()b_a.render(self)local c_b=self.get("lines") +local d_b=self.get("scrollX")local _ab=self.get("scrollY")local aab=self.get("width") +local bab=self.get("height")local cab=c_a[self.get("foreground")] +local dab=c_a[self.get("background")] +for y=1,bab do local _bb=y+_ab;local abb=c_b[_bb]or""local bbb,cbb=b_b(self,abb)local dbb=bbb:sub(d_b+1,d_b+ +aab)local _cb=cbb:sub(d_b+1,d_b+aab)local acb= +aab-#dbb +if acb>0 then dbb=dbb..string.rep(" ",acb)_cb=_cb.. +string.rep(c_a[self.get("foreground")],acb)end +self:blit(1,y,dbb,_cb,string.rep(dab,#dbb))end +if self.get("focused")then local _bb=self.get("cursorX")-d_b;local abb= +self.get("cursorY")-_ab;if _bb>=1 and _bb<=aab and abb>=1 and +abb<=bab then +self:setCursor(_bb,abb,true,self.get("cursorColor")or self.get("foreground"))end end end -function c_a:destroy() +function d_a:destroy() if self._autoCompleteFrame and not self._autoCompleteFrame._destroyed then self._autoCompleteFrame:destroy()end;self._autoCompleteFrame=nil;self._autoCompleteList=nil -self._autoCompletePopupWidth=nil;a_a.destroy(self)end;return c_a end +self._autoCompletePopupWidth=nil;b_a.destroy(self)end;return d_a end project["elements/Button.lua"] = function(...) local _a=require("elementManager") local aa=_a.getElement("VisualElement") local ba=require("libraries/utils").getCenteredPosition;local ca=setmetatable({},aa)ca.__index=ca