diff --git a/docs/references/elementManager.md b/docs/references/elementManager.md
index 778def2..5128288 100644
--- a/docs/references/elementManager.md
+++ b/docs/references/elementManager.md
@@ -1,27 +1,30 @@
# ElementManager
-This class manages elements and plugins. It loads elements and plugins from the elements and plugins directories
-and then applies the plugins to the elements. It also provides a way to get elements and APIs.
+_This class manages elements and plugins. It loads elements and plugins from the elements and plugins directories
+and then applies the plugins to the elements. It also provides a way to get elements and APIs._
## Functions
|Method|Returns|Description|
|---|---|---|
-|[ElementManager.getAPI](#elementmanager-getapi)|table|
-|[ElementManager.getElement](#elementmanager-getelement)|table|
-|[ElementManager.getElementList](#elementmanager-getelementlist)|table|
-|[ElementManager.loadElement](#elementmanager-loadelement)|-|
+|[ElementManager.loadElement](#elementmanager-loadelement-name)|-|Loads an element by name. This will load the element and apply any plugins to it.|
+|[ElementManager.getElement](#elementmanager-getelement-name)|table|Gets an element by name. If the element is not loaded, it will try to load it first.|
+|[ElementManager.getElementList](#elementmanager-getelementlist)|table|Gets a list of all elements|
+|[ElementManager.getAPI](#elementmanager-getapi-name)|table|Gets an Plugin API by name|
+## ElementManager.loadElement(name)
-## ElementManager.getAPI(name)
-Gets an Plugin API by name
+Loads an element by name. This will load the element and apply any plugins to it.
### Parameters
-* `name` `string` The name of the API to get
+* `name` `string` The name of the element to load
-### Returns
-* `table` `API` The API
+### Usage
+```lua
+ElementManager.loadElement("Button")
+```
## ElementManager.getElement(name)
+
Gets an element by name. If the element is not loaded, it will try to load it first.
### Parameters
@@ -31,20 +34,18 @@ Gets an element by name. If the element is not loaded, it will try to load it fi
* `table` `Element` The element class
## ElementManager.getElementList()
+
Gets a list of all elements
### Returns
* `table` `ElementList` A list of all elements
-## ElementManager.loadElement(name)
-Loads an element by name. This will load the element and apply any plugins to it.
+## ElementManager.getAPI(name)
+
+Gets an Plugin API by name
### Parameters
-* `name` `string` The name of the element to load
-
-### Usage
- ```lua
-ElementManager.loadElement("Button")
-```
-
+* `name` `string` The name of the API to get
+### Returns
+* `table` `API` The API
diff --git a/docs/references/elements/BarChart.md b/docs/references/elements/BarChart.md
index dc32974..18ae979 100644
--- a/docs/references/elements/BarChart.md
+++ b/docs/references/elements/BarChart.md
@@ -1,28 +1,29 @@
-# BarChart : Graph
-The Bar Chart element is designed for visualizing data series as vertical bars. It displays multiple values as side-by-side bars where each bar's height represents its value.
+# BarChart
+_The Bar Chart element is designed for visualizing data series as vertical bars. It displays multiple values as side-by-side bars where each bar's height represents its value._
-### Usage
- ```lua
-local chart = main:addBarChart()
-:addSeries("input", " ", colors.green, colors.green, 5)
-:addSeries("output", " ", colors.red, colors.red, 5)
+Extends: `Graph`
-basalt.schedule(function()
-while true do
-chart:addPoint("input", math.random(1,100))
-chart:addPoint("output", math.random(1,100))
-sleep(2)
-end
-end)
-```
-
-
-
-## Protected Functions
+## Functions
|Method|Returns|Description|
|---|---|---|
-|BarChart:init|BarChart|Initializes the BarChart instance
-|BarChart:render|-|Renders the BarChart
+|[BarChart.new](#barchart-new)|BarChart|Creates a new BarChart instance|
+|[BarChart:init](#barchart-init-props-basalt)|BarChart|Initializes the BarChart instance|
+|[BarChart:render](#barchart-render)|-|Renders the BarChart|
+## BarChart.new()
+Creates a new BarChart instance
+
+### Returns
+* `BarChart` `self` The newly created BarChart instance
+
+## BarChart:init(props, basalt)
+### Parameters
+* `props` `table` The properties to initialize the element with
+* `basalt` `table` The basalt instance
+
+### Returns
+* `BarChart` `self` The initialized instance
+
+## BarChart:render()
\ No newline at end of file
diff --git a/docs/references/elements/BaseElement.md b/docs/references/elements/BaseElement.md
index bd67a0c..995a21e 100644
--- a/docs/references/elements/BaseElement.md
+++ b/docs/references/elements/BaseElement.md
@@ -1,41 +1,40 @@
-# BaseElement : PropertySystem
-The base class for all UI elements in Basalt. This class provides basic properties and event handling functionality.
+# BaseElement
+_The base class for all UI elements in Basalt. This class provides basic properties and event handling functionality._
+
+Extends: `PropertySystem`
## Properties
|Property|Type|Default|Description|
|---|---|---|---|
-|type|string|BaseElement|The type identifier of the element
-|id|string|BaseElement|The unique identifier for the element
-|name|string|BaseElement|The name of the element
-|eventCallbacks|table|BaseElement|The event callbacks for the element
+|type|string|BaseElement|The type identifier of the element|
+|id|string|BaseElement|The unique identifier for the element|
+|name|string|BaseElement|The name of the element|
+|eventCallbacks|table|BaseElement|The event callbacks for the element|
+|enabled|boolean|BaseElement|Whether the element is enabled or not|
## Functions
|Method|Returns|Description|
|---|---|---|
-|[BaseElement.defineEvent](#baseelement-defineevent)|-|Registers a new event listener for the element (on class level)
-|[BaseElement.registerEventCallback](#baseelement-registereventcallback)|-|Registers a new event callback for the element (on class level)
-|[BaseElement:destroy](#baseelement-destroy)|-|Destroys the element and cleans up all references
-|[BaseElement:fireEvent](#baseelement-fireevent)|table|Triggers an event and calls all registered callbacks
-|[BaseElement:getBaseFrame](#baseelement-getbaseframe)|BaseFrame|Returns the base frame of the element
-|[BaseElement:isType](#baseelement-istype)|boolean|Checks if the element is a specific type
-|[BaseElement:listenEvent](#baseelement-listenevent)|table|Enables or disables event listening for a specific event
-|[BaseElement:onChange](#baseelement-onchange)|table|Observes a property and calls a callback when it changes
-|[BaseElement:registerCallback](#baseelement-registercallback)|table|Registers a callback function
-|[BaseElement:updateRender](#baseelement-updaterender)|table|Requests a render update for this element
-
-
-## Protected Functions
-
-|Method|Returns|Description|
-|---|---|---|
-|BaseElement:dispatchEvent|boolean?|Handles all events
-|BaseElement:handleEvent|boolean?|The default event handler for all events
-|BaseElement:init|table|Initializes the BaseElement instance
-|BaseElement:postInit|table|Post initialization
+|[BaseElement.defineEvent](#baseelement-defineevent-class-eventname-requiredevent)|-|Registers a new event listener for the element (on class level)|
+|[BaseElement.registerEventCallback](#baseelement-registereventcallback-class-callbackname-string)|-|Registers a new event callback for the element (on class level)|
+|[BaseElement.new](#baseelement-new)|table|Creates a new BaseElement instance|
+|[BaseElement:init](#baseelement-init-props-basalt)|table|Initializes the BaseElement instance|
+|[BaseElement:postInit](#baseelement-postinit)|table|Post initialization|
+|[BaseElement:isType](#baseelement-istype-type)|boolean|Checks if the element is a specific type|
+|[BaseElement:listenEvent](#baseelement-listenevent-eventname-enable)|table|Enables or disables event listening for a specific event|
+|[BaseElement:registerCallback](#baseelement-registercallback-event-callback)|table|Registers a callback function|
+|[BaseElement:fireEvent](#baseelement-fireevent-event-any)|table|Triggers an event and calls all registered callbacks|
+|[BaseElement:dispatchEvent](#baseelement-dispatchevent-event)|handled|Handles all events|
+|[BaseElement:handleEvent](#baseelement-handleevent-event)|handled|The default event handler for all events|
+|[BaseElement:onChange](#baseelement-onchange-property-callback)|table|Observes a property and calls a callback when it changes|
+|[BaseElement:getBaseFrame](#baseelement-getbaseframe)|BaseFrame|Returns the base frame of the element|
+|[BaseElement:destroy](#baseelement-destroy)|-|Destroys the element and cleans up all references|
+|[BaseElement:updateRender](#baseelement-updaterender)|table|Requests a render update for this element|
## BaseElement.defineEvent(class, eventName, requiredEvent?)
+
Registers a new event listener for the element (on class level)
### Parameters
@@ -43,34 +42,33 @@ Registers a new event listener for the element (on class level)
* `eventName` `string` The name of the event to register
* `requiredEvent` *(optional)* `string` The name of the required event (optional)
-## BaseElement.registerEventCallback(class, callbackName, ...)
+## BaseElement.registerEventCallback(class, callbackName, string)
+
Registers a new event callback for the element (on class level)
### Parameters
* `class` `table` The class to register
* `callbackName` `string` The name of the callback to register
-* `...` `string` The names of the events to register the callback for
+* `string` `The` names of the events to register the callback for
-## BaseElement:destroy()
-Destroys the element and cleans up all references
-
-## BaseElement:fireEvent(event, ...)
-Triggers an event and calls all registered callbacks
+## BaseElement.new()
+### Returns
+* `table` `The` newly created BaseElement instance
+## BaseElement:init(props, basalt)
### Parameters
-* `event` `string` The event to fire
-* `...` `any` Additional arguments to pass to the callbacks
+* `props` `table` The properties to initialize the element with
+* `basalt` `table` The basalt instance
+### Returns
+* `table` `self` The initialized instance
+
+## BaseElement:postInit()
### Returns
* `table` `self` The BaseElement instance
-## BaseElement:getBaseFrame()
-Returns the base frame of the element
-
-### Returns
-* `BaseFrame` `BaseFrame` The base frame of the element
-
## BaseElement:isType(type)
+
Checks if the element is a specific type
### Parameters
@@ -80,6 +78,7 @@ Checks if the element is a specific type
* `boolean` `isType` Whether the element is of the specified type
## BaseElement:listenEvent(eventName, enable?)
+
Enables or disables event listening for a specific event
### Parameters
@@ -89,17 +88,8 @@ Enables or disables event listening for a specific event
### Returns
* `table` `self` The BaseElement instance
-## BaseElement:onChange(property, callback)
-Observes a property and calls a callback when it changes
-
-### Parameters
-* `property` `string` The property to observe
-* `callback` `function` The callback to call when the property changes
-
-### Returns
-* `table` `self` The BaseElement instance
-
## BaseElement:registerCallback(event, callback)
+
Registers a callback function for an event
### Parameters
@@ -109,10 +99,56 @@ Registers a callback function for an event
### Returns
* `table` `self` The BaseElement instance
-## BaseElement:updateRender()
-Requests a render update for this element
+## BaseElement:fireEvent(event, any)
+
+Triggers an event and calls all registered callbacks
+
+### Parameters
+* `event` `string` The event to fire
+* `any` `Additional` arguments to pass to the callbacks
### Returns
* `table` `self` The BaseElement instance
+## BaseElement:dispatchEvent(event)
+### Parameters
+* `event` `string` The event to handle
+### Returns
+* `handled` `Whether` the event was handled
+
+## BaseElement:handleEvent(event)
+### Parameters
+* `event` `string` The event to handle
+
+### Returns
+* `handled` `Whether` the event was handled
+
+## BaseElement:onChange(property, callback)
+
+Observes a property and calls a callback when it changes
+
+### Parameters
+* `property` `string` The property to observe
+* `callback` `function` The callback to call when the property changes
+
+### Returns
+* `table` `self` The BaseElement instance
+
+## BaseElement:getBaseFrame()
+
+Returns the base frame of the element
+
+### Returns
+* `BaseFrame` `BaseFrame` The base frame of the element
+
+## BaseElement:destroy()
+
+Destroys the element and cleans up all references
+
+## BaseElement:updateRender()
+
+Requests a render update for this element
+
+### Returns
+* `table` `self` The BaseElement instance
diff --git a/docs/references/elements/BaseFrame.md b/docs/references/elements/BaseFrame.md
index b54e50e..b4a4d2d 100644
--- a/docs/references/elements/BaseFrame.md
+++ b/docs/references/elements/BaseFrame.md
@@ -1,56 +1,96 @@
-# BaseFrame : Container
-This is the base frame class. It is the root element of all elements and the only element without a parent.
+# BaseFrame
+_This is the base frame class. It is the root element of all elements and the only element without a parent._
-## Fields
-
-|Field|Type|Description|
-|---|---|---|
-|_render|`Render`|The render object|
-|_renderUpdate|`boolean`|Whether the render object needs to be updated|
-|_peripheralName|`string`|The name of a peripheral|
+Extends: `Container`
## Properties
|Property|Type|Default|Description|
|---|---|---|---|
-|term|term|peripheral|term.current()|The terminal or (monitor) peripheral object to render to
+|term|term|peripheral|term.current()|The terminal or (monitor) peripheral object to render to|
## Functions
|Method|Returns|Description|
|---|---|---|
-|[BaseFrame:dispatchEvent](#baseframe-dispatchevent)|-|
-|[BaseFrame:drawBg](#baseframe-drawbg)|-|
-|[BaseFrame:drawFg](#baseframe-drawfg)|-|
-|[BaseFrame:setCursor](#baseframe-setcursor)|-|Sets the cursor position
+|[BaseFrame.new](#baseframe-new)|BaseFrame|Creates a new Frame instance|
+|[BaseFrame:init](#baseframe-init-props-basalt)|table|Initializes the Frame instance|
+|[BaseFrame:multiBlit](#baseframe-multiblit-x-y-width-height-text-fg-bg)|-|Renders a multiBlit to the render Object|
+|[BaseFrame:textFg](#baseframe-textfg-x-y-text-fg)|-|Renders a text with a foreground color to the render Object|
+|[BaseFrame:textBg](#baseframe-textbg-x-y-text-bg)|-|Renders a text with a background color to the render Object|
+|[BaseFrame:drawText](#baseframe-drawtext-x-y-text-bg)|-|Renders a text with a background color to the render Object|
+|[BaseFrame:blit](#baseframe-blit-x-y-text-fg-bg)|-|Renders a text with a foreground and background color to the render Object|
+|[BaseFrame:setCursor](#baseframe-setcursor-x-y-blink)|-|Sets the cursor position|
+|[BaseFrame:monitor_touch](#baseframe-monitor-touch-name-x-y)|-|Handles monitor touch events|
+|[BaseFrame:mouse_click](#baseframe-mouse-click-button-x-y)|-|Handles mouse click events|
+|[BaseFrame:mouse_up](#baseframe-mouse-up-button-x-y)|-|Handles mouse up events|
+|[BaseFrame:term_resize](#baseframe-term-resize)|-|Resizes the Frame|
+|[BaseFrame:key](#baseframe-key-key)|-|Handles key events|
+|[BaseFrame:key_up](#baseframe-key-up-key)|-|Handles key up events|
+|[BaseFrame:char](#baseframe-char-char)|-|Handles character events|
+|[BaseFrame:render](#baseframe-render)|-|Renders the Frame|
+## BaseFrame.new()
-## Protected Functions
+Creates a new Frame instance
-|Method|Returns|Description|
-|---|---|---|
-|BaseFrame:blit|-|Renders a text with a foreground and background color to the render Object
-|BaseFrame:char|-|Handles character events
-|BaseFrame:drawText|-|Renders a text with a background color to the render Object
-|BaseFrame:init|table|Initializes the Frame instance
-|BaseFrame:key|-|Handles key events
-|BaseFrame:key_up|-|Handles key up events
-|BaseFrame:monitor_touch|-|Handles monitor touch events
-|BaseFrame:mouse_click|-|Handles mouse click events
-|BaseFrame:mouse_up|-|Handles mouse up events
-|BaseFrame:multiBlit|-|Renders a multiBlit to the render Object
-|BaseFrame:render|-|Renders the Frame
-|BaseFrame:term_resize|-|Resizes the Frame
-|BaseFrame:textBg|-|Renders a text with a background color to the render Object
-|BaseFrame:textFg|-|Renders a text with a foreground color to the render Object
+### Returns
+* `BaseFrame` `object` The newly created Frame instance
-## BaseFrame:dispatchEvent()
+### Usage
+```lua
+local element = BaseFrame.new()
+```
-## BaseFrame:drawBg()
+## BaseFrame:init(props, basalt)
+### Parameters
+* `props` `table` The properties to initialize the element with
+* `basalt` `table` The basalt instance
-## BaseFrame:drawFg()
+### Returns
+* `table` `self` The initialized instance
+
+## BaseFrame:multiBlit(x, y, width, height, text, fg, bg)
+### Parameters
+* `x` `number` The x position to render to
+* `y` `number` The y position to render to
+* `width` `number` The width of the text
+* `height` `number` The height of the text
+* `text` `string` The text to render
+* `fg` `string` The foreground color
+* `bg` `string` The background color
+
+## BaseFrame:textFg(x, y, text, fg)
+### Parameters
+* `x` `number` The x position to render to
+* `y` `number` The y position to render to
+* `text` `string` The text to render
+* `fg` `colors` The foreground color
+
+## BaseFrame:textBg(x, y, text, bg)
+### Parameters
+* `x` `number` The x position to render to
+* `y` `number` The y position to render to
+* `text` `string` The text to render
+* `bg` `colors` The background color
+
+## BaseFrame:drawText(x, y, text, bg)
+### Parameters
+* `x` `number` The x position to render to
+* `y` `number` The y position to render to
+* `text` `string` The text to render
+* `bg` `colors` The background color
+
+## BaseFrame:blit(x, y, text, fg, bg)
+### Parameters
+* `x` `number` The x position to render to
+* `y` `number` The y position to render to
+* `text` `string` The text to render
+* `fg` `string` The foreground color
+* `bg` `string` The background color
## BaseFrame:setCursor(x, y, blink)
+
Sets the cursor position
### Parameters
@@ -58,4 +98,35 @@ Sets the cursor position
* `y` `number` The y position to set the cursor to
* `blink` `boolean` Whether the cursor should blink
+## BaseFrame:monitor_touch(name, x, y)
+### Parameters
+* `name` `string` The name of the monitor that was touched
+* `x` `number` The x position of the mouse
+* `y` `number` The y position of the mouse
+## BaseFrame:mouse_click(button, x, y)
+### Parameters
+* `button` `number` The button that was clicked
+* `x` `number` The x position of the mouse
+* `y` `number` The y position of the mouse
+
+## BaseFrame:mouse_up(button, x, y)
+### Parameters
+* `button` `number` The button that was released
+* `x` `number` The x position of the mouse
+* `y` `number` The y position of the mouse
+
+## BaseFrame:term_resize()
+## BaseFrame:key(key)
+### Parameters
+* `key` `number` The key that was pressed
+
+## BaseFrame:key_up(key)
+### Parameters
+* `key` `number` The key that was released
+
+## BaseFrame:char(char)
+### Parameters
+* `char` `string` The character that was pressed
+
+## BaseFrame:render()
\ No newline at end of file
diff --git a/docs/references/elements/BigFont.md b/docs/references/elements/BigFont.md
index b3d8deb..d274fe0 100644
--- a/docs/references/elements/BigFont.md
+++ b/docs/references/elements/BigFont.md
@@ -1,26 +1,34 @@
-# BigFont : VisualElement
-The BigFont element is a text element that displays larger text. It uses Wojbie's BigFont API to render the text in a larger font size. Credits to Wojbie for the original API.
+# BigFontText
+_Basalt - Nyorie: Please don't copy paste this code to your projects, this code is slightly changed (to fit the way basalt draws elements), if you want the original code, checkout this:
+http://www.computercraft.info/forums2/index.php?/topic/25367-bigfont-api-write-bigger-letters-v10/_
-### Usage
- ```lua
-local font = main:addBigFont()
-font:setText("Hello World!")
-```
+# BigFont
+_The BigFont element is a text element that displays larger text. It uses Wojbie's BigFont API to render the text in a larger font size. Credits to Wojbie for the original API._
+Extends: `VisualElement`
## Properties
|Property|Type|Default|Description|
|---|---|---|---|
-|text|string|BigFont|BigFont text
-|fontSize|number|1|The font size of the BigFont
+|text|string|BigFont|BigFont text|
+|fontSize|number|1|The font size of the BigFont|
-
-## Protected Functions
+## Functions
|Method|Returns|Description|
|---|---|---|
-|BigFont:init|-|Initializes the BigFont instance
-|BigFont:render|-|Renders the BigFont
+|[BigFont.new](#bigfont-new)|table|Creates a new BigFont instance|
+|[BigFont:init](#bigfont-init-props-basalt)|-|Initializes the BigFont instance|
+|[BigFont:render](#bigfont-render)|-|Renders the BigFont|
+## BigFont.new()
+### Returns
+* `table` `self` The created instance
+## BigFont:init(props, basalt)
+### Parameters
+* `props` `table` The properties to initialize the element with
+* `basalt` `table` The basalt instance
+
+## BigFont:render()
\ No newline at end of file
diff --git a/docs/references/elements/Button.md b/docs/references/elements/Button.md
index ad43953..e227a32 100644
--- a/docs/references/elements/Button.md
+++ b/docs/references/elements/Button.md
@@ -1,18 +1,29 @@
-# Button : VisualElement
-The Button is a standard button element with click handling and state management.
+# Button
+_The Button is a standard button element with click handling and state management._
+
+Extends: `VisualElement`
## Properties
|Property|Type|Default|Description|
|---|---|---|---|
-|text|string|Button|Button text
+|text|string|Button|Button text|
-
-## Protected Functions
+## Functions
|Method|Returns|Description|
|---|---|---|
-|Button:init|-|Initializes the Button instance
-|Button:render|-|Renders the Button
+|[Button.new](#button-new)|table|Creates a new Button instance|
+|[Button:init](#button-init-props-basalt)|-|Initializes the Button instance|
+|[Button:render](#button-render)|-|Renders the Button|
+## Button.new()
+### Returns
+* `table` `self` The created instance
+## Button:init(props, basalt)
+### Parameters
+* `props` `table` The properties to initialize the element with
+* `basalt` `table` The basalt instance
+
+## Button:render()
\ No newline at end of file
diff --git a/docs/references/elements/Checkbox.md b/docs/references/elements/Checkbox.md
index 82e87a1..4a5bdc1 100644
--- a/docs/references/elements/Checkbox.md
+++ b/docs/references/elements/Checkbox.md
@@ -1,23 +1,42 @@
-# Checkbox : VisualElement
-The Checkbox is a visual element that can be checked.
+# Checkbox
+_The Checkbox is a visual element that can be checked._
+
+Extends: `VisualElement`
## Properties
|Property|Type|Default|Description|
|---|---|---|---|
-|checked|boolean|Whether|checkbox is checked
-|text|string|empty|Text to display
-|checkedText|string|Text|when checked
-|autoSize|boolean|true|Whether to automatically size the checkbox
+|checked|boolean|Whether|checkbox is checked|
+|text|string|empty|Text to display|
+|checkedText|string|Text|when checked|
+|autoSize|boolean|true|Whether to automatically size the checkbox|
-
-## Protected Functions
+## Functions
|Method|Returns|Description|
|---|---|---|
-|Checkbox.new|Checkbox|Creates a new Checkbox instance
-|Checkbox:init|-|Initializes the Checkbox instance
-|Checkbox:mouse_click|boolean|Handles mouse click events
-|Checkbox:render|-|Renders the Checkbox
+|[Checkbox.new](#checkbox-new)|Checkbox|Creates a new Checkbox instance|
+|[Checkbox:init](#checkbox-init-props-basalt)|-|Initializes the Checkbox instance|
+|[Checkbox:mouse_click](#checkbox-mouse-click-button-x-y)|boolean|Handles mouse click events|
+|[Checkbox:render](#checkbox-render)|-|Renders the Checkbox|
+## Checkbox.new()
+### Returns
+* `Checkbox` `self` The created instance
+## Checkbox:init(props, basalt)
+### Parameters
+* `props` `table` The properties to initialize the element with
+* `basalt` `table` The basalt instance
+
+## Checkbox:mouse_click(button, x, y)
+### Parameters
+* `button` `number` The button that was clicked
+* `x` `number` The x position of the click
+* `y` `number` The y position of the click
+
+### Returns
+* `boolean` `Clicked` Whether the event was handled
+
+## Checkbox:render()
\ No newline at end of file
diff --git a/docs/references/elements/ComboBox.md b/docs/references/elements/ComboBox.md
index e69de29..6c15e07 100644
--- a/docs/references/elements/ComboBox.md
+++ b/docs/references/elements/ComboBox.md
@@ -0,0 +1,129 @@
+# ComboBox
+_This is the ComboBox class. It extends the dropdown functionality with editable text input,
+allowing users to either select from a list or type their own custom text._
+
+Extends: `Dropdown`
+
+## Properties
+
+|Property|Type|Default|Description|
+|---|---|---|---|
+|editable|boolean|true|Whether the ComboBox allows text input|
+|text|string|""|The current text content of the ComboBox|
+|cursorPos|number|1|The current cursor position in the text|
+|viewOffset|number|0|The horizontal scroll offset for viewing long text|
+|placeholder|string|"..."|Text to display when input is empty|
+|placeholderColor|color|gray|Color of the placeholder text|
+|focusedBackground|color|blue|Background color when ComboBox is focused|
+|focusedForeground|color|white|Foreground color when ComboBox is focused |
+|autoComplete|boolean|false|Whether to enable auto-complete filtering when typing|
+|manuallyOpened|boolean|false|Whether the dropdown was manually opened (not by auto-complete)|
+
+## Functions
+
+|Method|Returns|Description|
+|---|---|---|
+|[ComboBox.new](#combobox-new)|ComboBox|Creates a new ComboBox instance|
+|[ComboBox:init](#combobox-init-props-basalt)|ComboBox|Initializes the ComboBox instance|
+|[ComboBox:setText](#combobox-settext-text)|ComboBox|Sets the text content|
+|[ComboBox:getText](#combobox-gettext)|string|Gets the text content|
+|[ComboBox:setEditable](#combobox-seteditable-editable)|ComboBox|Sets editable state|
+|[ComboBox:getFilteredItems](#combobox-getfiltereditems)|-|Filters items for auto-complete|
+|[ComboBox:updateFilteredDropdown](#combobox-updatefiltereddropdown)|-|Updates dropdown with filtered items|
+|[ComboBox:updateViewport](#combobox-updateviewport)|-|Updates the viewport|
+|[ComboBox:char](#combobox-char-char)|-|Handles character input|
+|[ComboBox:key](#combobox-key-key-held)|-|Handles key input|
+|[ComboBox:mouse_click](#combobox-mouse-click-button-x-y)|boolean|Handles mouse clicks|
+|[ComboBox:render](#combobox-render)|-|Renders the ComboBox|
+|[ComboBox:focus](#combobox-focus)|-|Called when gaining focus|
+|[ComboBox:blur](#combobox-blur)|-|Called when losing focus|
+
+## ComboBox.new()
+
+Creates a new ComboBox instance
+
+### Returns
+* `ComboBox` `self` The newly created ComboBox instance
+
+## ComboBox:init(props, basalt)
+### Parameters
+* `props` `table` The properties to initialize the element with
+* `basalt` `table` The basalt instance
+
+### Returns
+* `ComboBox` `self` The initialized instance
+
+## ComboBox:setText(text)
+
+Sets the text content of the ComboBox
+
+### Parameters
+* `text` `string` The text to set
+
+### Returns
+* `ComboBox` self
+
+## ComboBox:getText()
+
+Gets the current text content
+
+### Returns
+* `string` `text` The current text
+
+## ComboBox:setEditable(editable)
+
+Sets whether the ComboBox is editable
+
+### Parameters
+* `editable` `boolean` Whether the ComboBox should be editable
+
+### Returns
+* `ComboBox` self
+
+## ComboBox:getFilteredItems()
+
+Filters items based on current text for auto-complete
+
+## ComboBox:updateFilteredDropdown()
+
+Updates the dropdown with filtered items
+
+## ComboBox:updateViewport()
+## ComboBox:char(char)
+
+Handles character input when editable
+
+### Parameters
+* `char` `string` The character that was typed
+
+## ComboBox:key(key, held)
+
+Handles key input when editable
+
+### Parameters
+* `key` `number` The key code that was pressed
+* `held` `boolean` Whether the key is being held
+
+## ComboBox:mouse_click(button, x, y)
+
+Handles mouse clicks
+
+### Parameters
+* `button` `number` The mouse button (1 = left, 2 = right, 3 = middle)
+* `x` `number` The x coordinate of the click
+* `y` `number` The y coordinate of the click
+
+### Returns
+* `boolean` `handled` Whether the event was handled
+
+## ComboBox:render()
+
+Renders the ComboBox
+
+## ComboBox:focus()
+
+Called when the ComboBox gains focus
+
+## ComboBox:blur()
+
+Called when the ComboBox loses focus
diff --git a/docs/references/elements/Container.md b/docs/references/elements/Container.md
index 10308e8..42eaf8a 100644
--- a/docs/references/elements/Container.md
+++ b/docs/references/elements/Container.md
@@ -1,119 +1,72 @@
-# Container : VisualElement
-The Container class serves as a fundamental building block for organizing UI elements. It acts as a parent element that can hold and manage child elements.
-
-### Usage
- ```lua
-local container = basalt.getMainFrame()
-container:addButton() -- Add a child element
-```
+# Container
+_The Container class serves as a fundamental building block for organizing UI elements. It acts as a parent element that can hold and manage child elements._
+Extends: `VisualElement`
## Properties
|Property|Type|Default|Description|
|---|---|---|---|
-|children|table|{}|The children of the container
-|childrenSorted|boolean|true|Whether the children are sorted
-|childrenEventsSorted|boolean|true|Whether the children events are sorted
-|childrenEvents|table|{}|The children events of the container
-|eventListenerCount|table|{}|The event listener count of the container
-|focusedChild|table|nil|The focused child of the container
-|visibleChildren|table|{}|The visible children of the container
-|visibleChildrenEvents|table|{}|The visible children events of the container
-|offsetX|number|0|Horizontal content offset
-|offsetY|number|0|Vertical content offset
-
-## Combined Properties
-
-|Name|Properties|Description|
-|---|---|---|
-|offset|`offsetX number, offsetY number`|Combined property for offsetX and offsetY|
+|children|table|{}|The children of the container|
+|childrenSorted|boolean|true|Whether the children are sorted|
+|childrenEventsSorted|boolean|true|Whether the children events are sorted|
+|childrenEvents|table|{}|The children events of the container|
+|eventListenerCount|table|{}|The event listener count of the container|
+|focusedChild|table|nil|The focused child of the container|
+|visibleChildren|table|{}|The visible children of the container|
+|visibleChildrenEvents|table|{}|The visible children events of the container|
+|offsetX|number|0|Horizontal content offset|
+|offsetY|number|0|Vertical content offset|
## Functions
|Method|Returns|Description|
|---|---|---|
-|[Container:addChild](#container-addchild)|Container|Adds a child to the container
-|[Container:callChildrenEvent](#container-callchildrenevent)|boolean|Calls a event on all children
-|[Container:clear](#container-clear)|Container|Clears the container
-|[Container:drawBg](#container-drawbg)|-|
-|[Container:drawFg](#container-drawfg)|-|
-|[Container:drawText](#container-drawtext)|-|
-|[Container:getChild](#container-getchild)|Container?|Removes a child from the container
-|[Container:isChildVisible](#container-ischildvisible)|boolean|Returns whether a child is visible
-|[Container:registerChildEvent](#container-registerchildevent)|Container|Registers the children events of the container
-|[Container:registerChildrenEvents](#container-registerchildrenevents)|Container|Registers the children events of the container
-|[Container:removeChild](#container-removechild)|Container|Removes a child from the container
-|[Container:removeChildrenEvents](#container-removechildrenevents)|Container|Unregisters the children events of the container
-|[Container:sortChildren](#container-sortchildren)|Container|Sorts the children of the container
-|[Container:sortChildrenEvents](#container-sortchildrenevents)|Container|Sorts the children events of the container
-|[Container:unregisterChildEvent](#container-unregisterchildevent)|Container|Unregisters the children events of the container
+|[Container.new](#container-new)|Container|Creates a new Container instance|
+|[Container:init](#container-init-props-basalt)|-|Initializes the Container instance|
+|[Container:isChildVisible](#container-ischildvisible-child)|boolean|Returns whether a child is visible|
+|[Container:addChild](#container-addchild-child)|Container|Adds a child to the container|
+|[Container:clear](#container-clear)|Container|Clears the container|
+|[Container:sortChildren](#container-sortchildren)|Container|Sorts the children of the container|
+|[Container:sortChildrenEvents](#container-sortchildrenevents-eventname)|Container|Sorts the children events of the container|
+|[Container:registerChildrenEvents](#container-registerchildrenevents-child)|Container|Registers the children events of the container|
+|[Container:registerChildEvent](#container-registerchildevent-child-eventname)|Container|Registers the children events of the container|
+|[Container:removeChildrenEvents](#container-removechildrenevents-child)|Container|Unregisters the children events of the container|
+|[Container:unregisterChildEvent](#container-unregisterchildevent-child-eventname)|Container|Unregisters the children events of the container|
+|[Container:removeChild](#container-removechild-child)|Container|Removes a child from the container|
+|[Container:getChild](#container-getchild-path)|self|Removes a child from the container|
+|[Container:callChildrenEvent](#container-callchildrenevent-visibleonly-event)|boolean, child|Calls a event on all children|
+|[Container:handleEvent](#container-handleevent-event)|boolean|Default handler for events|
+|[Container:mouse_click](#container-mouse-click-button-x-y)|boolean|Handles mouse click events|
+|[Container:mouse_up](#container-mouse-up-button-x-y)|boolean|Handles mouse up events|
+|[Container:mouse_release](#container-mouse-release-button-x-y)|-|Handles mouse release events|
+|[Container:mouse_move](#container-mouse-move---x-y)|boolean|Handles mouse move events|
+|[Container:mouse_drag](#container-mouse-drag-button-x-y)|boolean|Handles mouse drag events|
+|[Container:mouse_scroll](#container-mouse-scroll-direction-x-y)|boolean|Handles mouse scroll events|
+|[Container:key](#container-key-key)|boolean|Handles key events|
+|[Container:char](#container-char-char)|boolean|Handles char events|
+|[Container:key_up](#container-key-up-key)|boolean|Handles key up events|
+|[Container:multiBlit](#container-multiblit-x-y-width-height-text-fg-bg)|Container|Draws multiple lines of text, fg and bg strings|
+|[Container:textFg](#container-textfg-x-y-text-fg)|Container|Draws a line of text and fg as color|
+|[Container:textBg](#container-textbg-x-y-text-bg)|Container|Draws a line of text and bg as color|
+|[Container:blit](#container-blit-x-y-text-fg-bg)|Container|Draws a line of text and fg and bg as colors|
+|[Container:render](#container-render)|-|Renders the container|
+|[Container:destroy](#container-destroy)|-||
+## Container.new()
-## Protected Functions
+Creates a new Container instance
-|Method|Returns|Description|
-|---|---|---|
-|Container:blit|Container|Draws a line of text and fg and bg as colors
-|Container:char|boolean|Handles char events
-|Container:handleEvent|boolean|Default handler for events
-|Container:init|-|Initializes the Container instance
-|Container:key|boolean|Handles key events
-|Container:key_up|boolean|Handles key up events
-|Container:mouse_click|boolean|Handles mouse click events
-|Container:mouse_drag|boolean|Handles mouse drag events
-|Container:mouse_move|boolean|Handles mouse move events
-|Container:mouse_release|-|Handles mouse release events
-|Container:mouse_scroll|boolean|Handles mouse scroll events
-|Container:mouse_up|boolean|Handles mouse up events
-|Container:multiBlit|Container|Draws multiple lines of text, fg and bg strings
-|Container:render|-|Renders the container
-|Container:textBg|Container|Draws a line of text and bg as color
-|Container:textFg|Container|Draws a line of text and fg as color
-
-## Container:addChild(child)
-Adds a child to the container
+### Returns
+* `Container` `self` The new container instance
+## Container:init(props, basalt)
### Parameters
-* `child` `table` The child to add
-
-### Returns
-* `Container` `self` The container instance
-
-## Container:callChildrenEvent(visibleOnly, event...)
-Calls a event on all children
-
-### Parameters
-* `visibleOnly` `boolean` Whether to only call the event on visible children
-* `event` `string` The event to call
-* `...` *(vararg)* `any` The event arguments
-
-### Returns
-* `boolean` `handled` Whether the event was handled
-* `table?` `child` The child that handled the event
-
-## Container:clear()
-Clears the container
-
-### Returns
-* `Container` `self` The container instance
-
-## Container:drawBg()
-
-## Container:drawFg()
-
-## Container:drawText()
-
-## Container:getChild(path)
-Removes a child from the container
-
-### Parameters
-* `path` `string` The path to the child to remove
-
-### Returns
-* `Container?` `self` The container instance
+* `props` `table` The properties to initialize the element with
+* `basalt` `table` The basalt instance
## Container:isChildVisible(child)
+
Returns whether a child is visible
### Parameters
@@ -122,7 +75,52 @@ Returns whether a child is visible
### Returns
* `boolean` `boolean` the child is visible
+## Container:addChild(child)
+
+Adds a child to the container
+
+### Parameters
+* `child` `table` The child to add
+
+### Returns
+* `Container` `self` The container instance
+
+## Container:clear()
+
+Clears the container
+
+### Returns
+* `Container` `self` The container instance
+
+## Container:sortChildren()
+
+Sorts the children of the container
+
+### Returns
+* `Container` `self` The container instance
+
+## Container:sortChildrenEvents(eventName)
+
+Sorts the children events of the container
+
+### Parameters
+* `eventName` `string` The event name to sort
+
+### Returns
+* `Container` `self` The container instance
+
+## Container:registerChildrenEvents(child)
+
+Registers the children events of the container
+
+### Parameters
+* `child` `table` The child to register events for
+
+### Returns
+* `Container` `self` The container instance
+
## Container:registerChildEvent(child, eventName)
+
Registers the children events of the container
### Parameters
@@ -132,25 +130,8 @@ Registers the children events of the container
### Returns
* `Container` `self` The container instance
-## Container:registerChildrenEvents(child)
-Registers the children events of the container
-
-### Parameters
-* `child` `table` The child to register events for
-
-### Returns
-* `Container` `self` The container instance
-
-## Container:removeChild(child)
-Removes a child from the container
-
-### Parameters
-* `child` `table` The child to remove
-
-### Returns
-* `Container` `self` The container instance
-
## Container:removeChildrenEvents(child)
+
Unregisters the children events of the container
### Parameters
@@ -159,22 +140,8 @@ Unregisters the children events of the container
### Returns
* `Container` `self` The container instance
-## Container:sortChildren()
-Sorts the children of the container
-
-### Returns
-* `Container` `self` The container instance
-
-## Container:sortChildrenEvents(eventName)
-Sorts the children events of the container
-
-### Parameters
-* `eventName` `string` The event name to sort
-
-### Returns
-* `Container` `self` The container instance
-
## Container:unregisterChildEvent(child, eventName)
+
Unregisters the children events of the container
### Parameters
@@ -184,4 +151,160 @@ Unregisters the children events of the container
### Returns
* `Container` `self` The container instance
+## Container:removeChild(child)
+Removes a child from the container
+
+### Parameters
+* `child` `table` The child to remove
+
+### Returns
+* `Container` `self` The container instance
+
+## Container:getChild(path)
+
+Removes a child from the container
+
+### Parameters
+* `path` `string` The path to the child to remove
+
+### Returns
+* `self` `The` container instance
+
+## Container:callChildrenEvent(visibleOnly, event)
+
+Calls a event on all children
+
+### Parameters
+* `visibleOnly` `boolean` Whether to only call the event on visible children
+* `event` `string` The event to call
+
+### Returns
+* `boolean` `handled` Whether the event was handled
+* `child` `The` child that handled the event
+
+## Container:handleEvent(event)
+### Parameters
+* `event` `string` The event to handle
+
+### Returns
+* `boolean` `handled` Whether the event was handled
+
+## Container:mouse_click(button, x, y)
+### Parameters
+* `button` `number` The button that was clicked
+* `x` `number` The x position of the click
+* `y` `number` The y position of the click
+
+### Returns
+* `boolean` `handled` Whether the event was handled
+
+## Container:mouse_up(button, x, y)
+### Parameters
+* `button` `number` The button that was clicked
+* `x` `number` The x position of the click
+* `y` `number` The y position of the click
+
+### Returns
+* `boolean` `handled` Whether the event was handled
+
+## Container:mouse_release(button, x, y)
+### Parameters
+* `button` `number` The button that was clicked
+* `x` `number` The x position of the click
+* `y` `number` The y position of the click
+
+## Container:mouse_move(_, x, y)
+### Parameters
+* `_` `number` unknown
+* `x` `number` The x position of the click
+* `y` `number` The y position of the click
+
+### Returns
+* `boolean` `handled` Whether the event was handled
+
+## Container:mouse_drag(button, x, y)
+### Parameters
+* `button` `number` The button that was clicked
+* `x` `number` The x position of the click
+* `y` `number` The y position of the click
+
+### Returns
+* `boolean` `handled` Whether the event was handled
+
+## Container:mouse_scroll(direction, x, y)
+### Parameters
+* `direction` `number` The direction of the scroll
+* `x` `number` The x position of the click
+* `y` `number` The y position of the click
+
+### Returns
+* `boolean` `handled` Whether the event was handled
+
+## Container:key(key)
+### Parameters
+* `key` `number` The key that was pressed
+
+### Returns
+* `boolean` `handled` Whether the event was handled
+
+## Container:char(char)
+### Parameters
+* `char` `string` The character that was pressed
+
+### Returns
+* `boolean` `handled` Whether the event was handled
+
+## Container:key_up(key)
+### Parameters
+* `key` `number` The key that was released
+
+### Returns
+* `boolean` `handled` Whether the event was handled
+
+## Container:multiBlit(x, y, width, height, text, fg, bg)
+### Parameters
+* `x` `number` The x position to draw the text
+* `y` `number` The y position to draw the text
+* `width` `number` The width of the text
+* `height` `number` The height of the text
+* `text` `string` The text to draw
+* `fg` `string` The foreground color of the text
+* `bg` `string` The background color of the text
+
+### Returns
+* `Container` `self` The container instance
+
+## Container:textFg(x, y, text, fg)
+### Parameters
+* `x` `number` The x position to draw the text
+* `y` `number` The y position to draw the text
+* `text` `string` The text to draw
+* `fg` `color` The foreground color of the text
+
+### Returns
+* `Container` `self` The container instance
+
+## Container:textBg(x, y, text, bg)
+### Parameters
+* `x` `number` The x position to draw the text
+* `y` `number` The y position to draw the text
+* `text` `string` The text to draw
+* `bg` `color` The background color of the text
+
+### Returns
+* `Container` `self` The container instance
+
+## Container:blit(x, y, text, fg, bg)
+### Parameters
+* `x` `number` The x position to draw the text
+* `y` `number` The y position to draw the text
+* `text` `string` The text to draw
+* `fg` `string` The foreground color of the text
+* `bg` `string` The background color of the text
+
+### Returns
+* `Container` `self` The container instance
+
+## Container:render()
+## Container:destroy()
\ No newline at end of file
diff --git a/docs/references/elements/Display.md b/docs/references/elements/Display.md
index 9724530..db1f75c 100644
--- a/docs/references/elements/Display.md
+++ b/docs/references/elements/Display.md
@@ -1,36 +1,36 @@
-# Display : VisualElement
-The Display is a special element where you can use the window (term) API to draw on the display, useful when you need to use external APIs.
-
-### Usage
- ```lua
-local display = main:addDisplay() -- Create a display element
-local displayWindow = display:getWindow() -- Get the window object of the display
-displayWindow.write("Hello World!") -- Write "Hello World!" to the display
-```
+# Display
+_The Display is a special element where you can use the window (term) API to draw on the display, useful when you need to use external APIs._
+Extends: `VisualElement`
## Functions
|Method|Returns|Description|
|---|---|---|
-|[Display:getWindow](#display-getwindow)|table|Returns the current window object
-|[Display:write](#display-write)|Display|Writes text to the display
+|[Display.new](#display-new)|table|Creates a new Display instance|
+|[Display:init](#display-init-props-basalt)|-|Initializes the Display instance|
+|[Display:getWindow](#display-getwindow)|table|Returns the current window object|
+|[Display:write](#display-write-x-y-text-fg-bg)|Display|Writes text to the display|
+|[Display:render](#display-render)|-|Renders the Display|
+## Display.new()
+### Returns
+* `table` `self` The created instance
-## Protected Functions
-
-|Method|Returns|Description|
-|---|---|---|
-|Display:init|-|Initializes the Display instance
-|Display:render|-|Renders the Display
+## Display:init(props, basalt)
+### Parameters
+* `props` `table` The properties to initialize the element with
+* `basalt` `table` The basalt instance
## Display:getWindow()
+
Returns the current window object
### Returns
* `table` `window` The current window object
## Display:write(x, y, text, fg?, bg?)
+
Writes text to the display at the given position with the given foreground and background colors
### Parameters
@@ -43,4 +43,4 @@ Writes text to the display at the given position with the given foreground and b
### Returns
* `Display` `self` The display instance
-
+## Display:render()
\ No newline at end of file
diff --git a/docs/references/elements/Dropdown.md b/docs/references/elements/Dropdown.md
index 72d1ee3..3374613 100644
--- a/docs/references/elements/Dropdown.md
+++ b/docs/references/elements/Dropdown.md
@@ -1,33 +1,48 @@
-# Dropdown : List
-This is the dropdown class. It is a visual element that can show a list of selectable items in a dropdown menu.
-
-### Usage
- ```lua
-local dropdown = main:addDropdown()
-dropdown:setItems({
-{text = "Item 1", callback = function() basalt.LOGGER.debug("Item 1 selected") end},
-{text = "Item 2", callback = function() basalt.LOGGER.debug("Item 2 selected") end},
-{text = "Item 3", callback = function() basalt.LOGGER.debug("Item 3 selected") end},
-})
-```
+# Dropdown
+_This is the dropdown class. It is a visual element that can show a list of selectable items in a dropdown menu._
+Extends: `List`
## Properties
|Property|Type|Default|Description|
|---|---|---|---|
-|isOpen|boolean|false|Whether the dropdown menu is currently open
-|dropdownHeight|number|5|Maximum height of the dropdown menu when open
-|selectedText|string|""|The text to show when no item is selected
-|dropSymbol|string|"\31"|The symbol to show for dropdown indication
+|isOpen|boolean|false|Whether the dropdown menu is currently open|
+|dropdownHeight|number|5|Maximum height of the dropdown menu when open|
+|selectedText|string|""|The text to show when no item is selected|
+|dropSymbol|string|"\31"|The symbol to show for dropdown indication|
-
-## Protected Functions
+## Functions
|Method|Returns|Description|
|---|---|---|
-|Dropdown:init|Dropdown|Initializes the Dropdown instance
-|Dropdown:mouse_click|boolean|Handles mouse click events
-|Dropdown:render|-|Renders the Dropdown
+|[Dropdown.new](#dropdown-new)|Dropdown|Creates a new Dropdown instance|
+|[Dropdown:init](#dropdown-init-props-basalt)|Dropdown|Initializes the Dropdown instance|
+|[Dropdown:mouse_click](#dropdown-mouse-click-button-x-y)|boolean|Handles mouse click events|
+|[Dropdown:render](#dropdown-render)|-|Renders the Dropdown|
+## Dropdown.new()
+Creates a new Dropdown instance
+
+### Returns
+* `Dropdown` `self` The newly created Dropdown instance
+
+## Dropdown:init(props, basalt)
+### Parameters
+* `props` `table` The properties to initialize the element with
+* `basalt` `table` The basalt instance
+
+### Returns
+* `Dropdown` `self` The initialized instance
+
+## Dropdown:mouse_click(button, x, y)
+### Parameters
+* `button` `number` The button that was clicked
+* `x` `number` The x position of the click
+* `y` `number` The y position of the click
+
+### Returns
+* `boolean` `handled` Whether the event was handled
+
+## Dropdown:render()
\ No newline at end of file
diff --git a/docs/references/elements/Flexbox.md b/docs/references/elements/Flexbox.md
index 3ffcfe0..7e786e2 100644
--- a/docs/references/elements/Flexbox.md
+++ b/docs/references/elements/Flexbox.md
@@ -1,52 +1,46 @@
-# Flexbox : Container
-This is the Flexbox class. It is a container that arranges its children in a flexible layout.
-
-### Usage
- ```lua
-local flex = main:addFlexbox({background=colors.black, width=30, height=10})
-flex:addButton():setFlexGrow(1)
-flex:addButton():setFlexGrow(1)
-flex:addButton():setFlexGrow(1)
-```
-
+# Flexbox
+_This is the Flexbox class. It is a container that arranges its children in a flexible layout.
The flexbox element adds the following properties to its children:
+_
-### Usage
- ```lua
-flex:addButton():setFlexGrow(1) -- The flex-grow property defines the ability for a flex item to grow if necessary.
-flex:addButton():setFlexShrink(1) -- The flex-shrink property defines the ability for a flex item to shrink if necessary.
-flex:addButton():setFlexBasis(1) -- The flex-basis property defines the default size of an element before the remaining space is distributed.
-```
-
-
+Extends: `Container`
## Properties
|Property|Type|Default|Description|
|---|---|---|---|
-|flexDirection|string|"row"|The direction of the flexbox layout "row" or "column"
-|flexSpacing|number|1|The spacing between flex items
-|flexJustifyContent|string|"flex-start"|The alignment of flex items along the main axis
-|flexWrap|boolean|false|Whether to wrap flex items onto multiple lines
-|flexUpdateLayout|boolean|false|Whether to update the layout of the flexbox
+|flexDirection|string|"row"|The direction of the flexbox layout "row" or "column"|
+|flexSpacing|number|1|The spacing between flex items|
+|flexJustifyContent|string|"flex-start"|The alignment of flex items along the main axis|
+|flexAlignItems|string|"flex-start"|The alignment of flex items along the cross axis|
+|flexCrossPadding|number|0|The padding on both sides of the cross axis|
+|flexWrap|boolean|false|Whether to wrap flex items onto multiple lines|
## Functions
|Method|Returns|Description|
|---|---|---|
-|[Flexbox:addChild](#flexbox-addchild)|Flexbox|Adds a child element to the flexbox
-|[Flexbox:addLineBreak](#flexbox-addlinebreak)|Flexbox|Adds a new line break to the flexbox.
+|[Flexbox.new](#flexbox-new)|Flexbox|Creates a new Flexbox instance|
+|[Flexbox:init](#flexbox-init-props-basalt)|Flexbox|Initializes the Flexbox instance|
+|[Flexbox:addChild](#flexbox-addchild-element)|Flexbox|Adds a child element to the flexbox|
+|[Flexbox:removeChild](#flexbox-removechild-element)|Flexbox|Removes a child element from the flexbox|
+|[Flexbox:addLineBreak](#flexbox-addlinebreak-self)|Flexbox|Adds a new line break to the flexbox.|
+|[Flexbox:render](#flexbox-render)|-|Renders the flexbox and its children|
+## Flexbox.new()
+### Returns
+* `Flexbox` `object` The newly created Flexbox instance
-## Protected Functions
+## Flexbox:init(props, basalt)
+### Parameters
+* `props` `table` The properties to initialize the element with
+* `basalt` `table` The basalt instance
-|Method|Returns|Description|
-|---|---|---|
-|Flexbox:init|Flexbox|Initializes the Flexbox instance
-|Flexbox:removeChild|Flexbox|Removes a child element from the flexbox
-|Flexbox:render|-|Renders the flexbox and its children
+### Returns
+* `Flexbox` `self` The initialized instance
## Flexbox:addChild(element)
+
Adds a child element to the flexbox
### Parameters
@@ -55,13 +49,21 @@ Adds a child element to the flexbox
### Returns
* `Flexbox` `self` The flexbox instance
+## Flexbox:removeChild(element)
+### Parameters
+* `element` `Element` The child element to remove
+
+### Returns
+* `Flexbox` `self` The flexbox instance
+
## Flexbox:addLineBreak(self)
+
Adds a new line break to the flexbox
### Parameters
* `self` `Flexbox` The element itself
### Returns
-* `nil` `nil` nil
-
+* `Flexbox`
+## Flexbox:render()
\ No newline at end of file
diff --git a/docs/references/elements/Frame.md b/docs/references/elements/Frame.md
index f252f60..49a4931 100644
--- a/docs/references/elements/Frame.md
+++ b/docs/references/elements/Frame.md
@@ -1,21 +1,79 @@
-# Frame : Container
-This is the frame class. It serves as a grouping container for other elements.
+# Frame
+_This is the frame class. It serves as a grouping container for other elements._
+
+Extends: `Container`
## Properties
|Property|Type|Default|Description|
|---|---|---|---|
-|draggable|boolean|false|Whether the frame is draggable
-|draggingMap|table|{}|The map of dragging positions
+|draggable|boolean|false|Whether the frame is draggable|
+|draggingMap|table|{}|The map of dragging positions|
+|scrollable|boolean|false|Whether the frame is scrollable|
-
-## Protected Functions
+## Functions
|Method|Returns|Description|
|---|---|---|
-|Frame:init|Frame|Initializes the Frame instance
-|Frame:mouse_click|boolean|Handles mouse click events
-|Frame:mouse_drag|boolean|Handles mouse drag events
-|Frame:mouse_up|boolean|Handles mouse release events
+|[Frame.new](#frame-new)|Frame|Creates a new Frame instance|
+|[Frame:init](#frame-init-props-basalt)|Frame|Initializes the Frame instance|
+|[Frame:mouse_click](#frame-mouse-click-button-x-y)|boolean|Handles mouse click events|
+|[Frame:mouse_up](#frame-mouse-up-button-x-y)|boolean|Handles mouse release events|
+|[Frame:mouse_drag](#frame-mouse-drag-button-x-y)|boolean|Handles mouse drag events|
+|[Frame:getChildrenHeight](#frame-getchildrenheight)|number|Calculates the total height of all children elements|
+|[Frame:mouse_scroll](#frame-mouse-scroll-direction-x-y)|boolean|Handles mouse scroll events|
+## Frame.new()
+Creates a new Frame instance
+
+### Returns
+* `Frame` `self` The newly created Frame instance
+
+## Frame:init(props, basalt)
+### Parameters
+* `props` `table` The properties to initialize the element with
+* `basalt` `table` The basalt instance
+
+### Returns
+* `Frame` `self` The initialized instance
+
+## Frame:mouse_click(button, x, y)
+### Parameters
+* `button` `number` The button that was clicked
+* `x` `number` The x position of the click
+* `y` `number` The y position of the click
+
+### Returns
+* `boolean` `handled` Whether the event was handled
+
+## Frame:mouse_up(button, x, y)
+### Parameters
+* `button` `number` The button that was released
+* `x` `number` The x position of the release
+* `y` `number` The y position of the release
+
+### Returns
+* `boolean` `handled` Whether the event was handled
+
+## Frame:mouse_drag(button, x, y)
+### Parameters
+* `button` `number` The button that was clicked
+* `x` `number` The x position of the drag position
+* `y` `number` The y position of the drag position
+
+### Returns
+* `boolean` `handled` Whether the event was handled
+
+## Frame:getChildrenHeight()
+### Returns
+* `number` `height` The total height needed for all children
+
+## Frame:mouse_scroll(direction, x, y)
+### Parameters
+* `direction` `number` The scroll direction
+* `x` `number` The x position of the scroll
+* `y` `number` The y position of the scroll
+
+### Returns
+* `boolean` `handled` Whether the event was handled
diff --git a/docs/references/elements/Graph.md b/docs/references/elements/Graph.md
index e59f214..b19aafd 100644
--- a/docs/references/elements/Graph.md
+++ b/docs/references/elements/Graph.md
@@ -1,62 +1,48 @@
-# Graph : VisualElement
-This is the base class for all graph elements. It is a point based graph.
-
-### Usage
- ```lua
-local graph = main:addGraph()
-:addSeries("input", " ", colors.green, colors.green, 10)
-:addSeries("output", " ", colors.red, colors.red, 10)
-
-basalt.schedule(function()
-while true do
-graph:addPoint("input", math.random(1,100))
-graph:addPoint("output", math.random(1,100))
-sleep(2)
-end
-end)
-```
+# Graph
+_This is the base class for all graph elements. It is a point based graph._
+Extends: `VisualElement`
## Properties
|Property|Type|Default|Description|
|---|---|---|---|
-|minValue|number|0|The minimum value of the graph
-|maxValue|number|100|The maximum value of the graph
-|series|table|{}|The series of the graph
+|minValue|number|0|The minimum value of the graph|
+|maxValue|number|100|The maximum value of the graph|
+|series|table|{}|The series of the graph|
## Functions
|Method|Returns|Description|
|---|---|---|
-|[Graph:addPoint](#graph-addpoint)|Graph|Adds a point to a series
-|[Graph:addSeries](#graph-addseries)|Graph|Adds a series to the graph
-|[Graph:changeSeriesVisibility](#graph-changeseriesvisibility)|Graph|Changes the visibility of a series
-|[Graph:clear](#graph-clear)|Graph|Clears all points from a series
-|[Graph:focusSeries](#graph-focusseries)|Graph|Focuses a series
-|[Graph:getSeries](#graph-getseries)|table?|Gets a series from the graph
-|[Graph:removeSeries](#graph-removeseries)|Graph|Removes a series from the graph
-|[Graph:setSeriesPointCount](#graph-setseriespointcount)|Graph|Sets the point count of a series
+|[Graph.new](#graph-new)|Graph|Creates a new Graph instance|
+|[Graph:init](#graph-init-props-basalt)|Graph|Initializes the Graph instance|
+|[Graph:addSeries](#graph-addseries-name-symbol-bgcol-fgcol-pointcount)|Graph|Adds a series to the graph|
+|[Graph:removeSeries](#graph-removeseries-name)|Graph|Removes a series from the graph|
+|[Graph:getSeries](#graph-getseries-name)|series|Gets a series from the graph|
+|[Graph:changeSeriesVisibility](#graph-changeseriesvisibility-name-visible)|Graph|Changes the visibility of a series|
+|[Graph:addPoint](#graph-addpoint-name-value)|Graph|Adds a point to a series|
+|[Graph:focusSeries](#graph-focusseries-name)|Graph|Focuses a series|
+|[Graph:setSeriesPointCount](#graph-setseriespointcount-name-count)|Graph|Sets the point count of a series|
+|[Graph:clear](#graph-clear-name)|Graph|Clears all points from a series|
+|[Graph:render](#graph-render)|-|Renders the graph|
+## Graph.new()
-## Protected Functions
-
-|Method|Returns|Description|
-|---|---|---|
-|Graph:init|Graph|Initializes the Graph instance
-|Graph:render|-|Renders the graph
-
-## Graph:addPoint(name, value)
-
-### Parameters
-* `name` `string` The name of the series
-* `value` `number` The value of the point
+Creates a new Graph instance
### Returns
-* `Graph` `self` The graph instance
+* `Graph` `self` The newly created Graph instance
+
+## Graph:init(props, basalt)
+### Parameters
+* `props` `table` The properties to initialize the element with
+* `basalt` `table` The basalt instance
+
+### Returns
+* `Graph` `self` The initialized instance
## Graph:addSeries(name, symbol, bgCol, fgCol, pointCount)
-
### Parameters
* `name` `string` The name of the series
* `symbol` `string` The symbol of the series
@@ -67,8 +53,21 @@ end)
### Returns
* `Graph` `self` The graph instance
-## Graph:changeSeriesVisibility(name, visible)
+## Graph:removeSeries(name)
+### Parameters
+* `name` `string` The name of the series
+### Returns
+* `Graph` `self` The graph instance
+
+## Graph:getSeries(name)
+### Parameters
+* `name` `string` The name of the series
+
+### Returns
+* `series` `The` series
+
+## Graph:changeSeriesVisibility(name, visible)
### Parameters
* `name` `string` The name of the series
* `visible` `boolean` Whether the series should be visible
@@ -76,7 +75,31 @@ end)
### Returns
* `Graph` `self` The graph instance
+## Graph:addPoint(name, value)
+### Parameters
+* `name` `string` The name of the series
+* `value` `number` The value of the point
+
+### Returns
+* `Graph` `self` The graph instance
+
+## Graph:focusSeries(name)
+### Parameters
+* `name` `string` The name of the series
+
+### Returns
+* `Graph` `self` The graph instance
+
+## Graph:setSeriesPointCount(name, count)
+### Parameters
+* `name` `string` The name of the series
+* `count` `number` The number of points in the series
+
+### Returns
+* `Graph` `self` The graph instance
+
## Graph:clear(name?)
+
Clears all points from a series
### Parameters
@@ -85,37 +108,4 @@ Clears all points from a series
### Returns
* `Graph` `self` The graph instance
-## Graph:focusSeries(name)
-
-### Parameters
-* `name` `string` The name of the series
-
-### Returns
-* `Graph` `self` The graph instance
-
-## Graph:getSeries(name)
-
-### Parameters
-* `name` `string` The name of the series
-
-### Returns
-* `table?` `series` The series
-
-## Graph:removeSeries(name)
-
-### Parameters
-* `name` `string` The name of the series
-
-### Returns
-* `Graph` `self` The graph instance
-
-## Graph:setSeriesPointCount(name, count)
-
-### Parameters
-* `name` `string` The name of the series
-* `count` `number` The number of points in the series
-
-### Returns
-* `Graph` `self` The graph instance
-
-
+## Graph:render()
\ No newline at end of file
diff --git a/docs/references/elements/Image.md b/docs/references/elements/Image.md
index 956ea0f..29c86e6 100644
--- a/docs/references/elements/Image.md
+++ b/docs/references/elements/Image.md
@@ -1,104 +1,80 @@
-# Image : VisualElement
-This is the Image element class which can be used to display bimg formatted images.
+# Image
+_This is the Image element class which can be used to display bimg formatted images.
Bimg is a universal ComputerCraft image format.
-See: https://github.com/SkyTheCodeMaster/bimg
+See: https://github.com/SkyTheCodeMaster/bimg_
+
+Extends: `VisualElement`
## Properties
|Property|Type|Default|Description|
|---|---|---|---|
-|bimg|table|{}|The bimg image data
-|currentFrame|number|1|Current animation frame
-|autoResize|boolean|false|Whether to automatically resize the image when content exceeds bounds
-|offsetX|number|0|Horizontal offset for viewing larger images
-|offsetY|number|0|Vertical offset for viewing larger images
-
-## Combined Properties
-
-|Name|Properties|Description|
-|---|---|---|
-|offset|`offsetX offsetY`|Combined property for offsetX and offsetY|
+|bimg|table|{}|The bimg image data|
+|currentFrame|number|1|Current animation frame|
+|autoResize|boolean|false|Whether to automatically resize the image when content exceeds bounds|
+|offsetX|number|0|Horizontal offset for viewing larger images|
+|offsetY|number|0|Vertical offset for viewing larger images|
## Functions
|Method|Returns|Description|
|---|---|---|
-|[Image:addFrame](#image-addframe)|Image|Adds a new frame to the image
-|[Image:getBg](#image-getbg)|string|Gets the background color at the specified position
-|[Image:getFg](#image-getfg)|string|Gets the foreground color at the specified position
-|[Image:getFrame](#image-getframe)|table|Gets the specified frame
-|[Image:getImageSize](#image-getimagesize)|number|Gets the size of the image
-|[Image:getMetadata](#image-getmetadata)|table|Gets the metadata of the image
-|[Image:getPixelData](#image-getpixeldata)|number?|Gets pixel information at position
-|[Image:getText](#image-gettext)|string|Gets the text at the specified position
-|[Image:nextFrame](#image-nextframe)|Image|Advances to the next frame in the animation
-|[Image:resizeImage](#image-resizeimage)|Image|Resizes the image to the specified width and height
-|[Image:setBg](#image-setbg)|Image|Sets the background color at the specified position
-|[Image:setFg](#image-setfg)|Image|Sets the foreground color at the specified position
-|[Image:setMetadata](#image-setmetadata)|Image|Sets the metadata of the image
-|[Image:setPixel](#image-setpixel)|Image|Sets the pixel at the specified position
-|[Image:setText](#image-settext)|Image|Sets the text at the specified position
-|[Image:updateFrame](#image-updateframe)|Image|Updates the specified frame with the provided data
+|[Image.new](#image-new)|Image|Creates a new Image instance|
+|[Image:init](#image-init-props-basalt)|Image|Initializes the Image instance|
+|[Image:resizeImage](#image-resizeimage-width-height)|Image|Resizes the image to the specified width and height|
+|[Image:getImageSize](#image-getimagesize)|number, number|Gets the size of the image|
+|[Image:getPixelData](#image-getpixeldata-x-y)|fg, bg, char|Gets pixel information at position|
+|[Image:setText](#image-settext-x-y-text)|Image|Sets the text at the specified position|
+|[Image:getText](#image-gettext-x-y-length)|string|Gets the text at the specified position|
+|[Image:setFg](#image-setfg-x-y-pattern)|Image|Sets the foreground color at the specified position|
+|[Image:getFg](#image-getfg-x-y-length)|string|Gets the foreground color at the specified position|
+|[Image:setBg](#image-setbg-x-y-pattern)|Image|Sets the background color at the specified position|
+|[Image:getBg](#image-getbg-x-y-length)|string|Gets the background color at the specified position|
+|[Image:setPixel](#image-setpixel-x-y-char-fg-bg)|Image|Sets the pixel at the specified position|
+|[Image:nextFrame](#image-nextframe)|Image|Advances to the next frame in the animation|
+|[Image:addFrame](#image-addframe)|Image|Adds a new frame to the image|
+|[Image:updateFrame](#image-updateframe-frameindex-frame)|Image|Updates the specified frame with the provided data|
+|[Image:getFrame](#image-getframe-frameindex)|table|Gets the specified frame|
+|[Image:getMetadata](#image-getmetadata)|table|Gets the metadata of the image|
+|[Image:setMetadata](#image-setmetadata-key-value)|Image|Sets the metadata of the image|
+|[Image:render](#image-render)|-|Renders the Image|
+## Image.new()
-## Protected Functions
+Creates a new Image instance
-|Method|Returns|Description|
-|---|---|---|
-|Image:init|Image|Initializes the Image instance
-|Image:render|-|Renders the Image
+### Returns
+* `Image` `self` The newly created Image instance
-## Image:addFrame()
-Adds a new frame to the image
+## Image:init(props, basalt)
+### Parameters
+* `props` `table` The properties to initialize the element with
+* `basalt` `table` The basalt instance
+
+### Returns
+* `Image` `self` The initialized instance
+
+## Image:resizeImage(width, height)
+
+Resizes the image to the specified width and height
+
+### Parameters
+* `width` `number` The new width of the image
+* `height` `number` The new height of the image
### Returns
* `Image` `self` The Image instance
-## Image:getBg(x, y, length)
-Gets the background color at the specified position
-
-### Parameters
-* `x` `number` The x position
-* `y` `number` The y position
-* `length` `number` The length of the background color pattern to get
-
-### Returns
-* `string` `bg` The background color pattern
-
-## Image:getFg(x, y, length)
-Gets the foreground color at the specified position
-
-### Parameters
-* `x` `number` The x position
-* `y` `number` The y position
-* `length` `number` The length of the foreground color pattern to get
-
-### Returns
-* `string` `fg` The foreground color pattern
-
-## Image:getFrame(frameIndex)
-Gets the specified frame
-
-### Parameters
-* `frameIndex` `number` The index of the frame to get
-
-### Returns
-* `table` `frame` The frame data
-
## Image:getImageSize()
+
Gets the size of the image
### Returns
* `number` `width` The width of the image
* `number` `height` The height of the image
-## Image:getMetadata()
-Gets the metadata of the image
-
-### Returns
-* `table` `metadata` The metadata of the image
-
## Image:getPixelData(x, y)
+
Gets pixel information at position
### Parameters
@@ -106,11 +82,24 @@ Gets pixel information at position
* `y` `number` Y position
### Returns
-* `number?` `fg` Foreground color
-* `number?` `bg` Background color
-* `string?` `char` Character at position
+* `fg` `Foreground` color
+* `bg` `Background` color
+* `char` `Character` at position
+
+## Image:setText(x, y, text)
+
+Sets the text at the specified position
+
+### Parameters
+* `x` `number` The x position
+* `y` `number` The y position
+* `text` `string` The text to set
+
+### Returns
+* `Image` `self` The Image instance
## Image:getText(x, y, length)
+
Gets the text at the specified position
### Parameters
@@ -121,34 +110,8 @@ Gets the text at the specified position
### Returns
* `string` `text` The text at the specified position
-## Image:nextFrame()
-Advances to the next frame in the animation
-
-### Returns
-* `Image` `self` The Image instance
-
-## Image:resizeImage(width, height)
-Resizes the image to the specified width and height
-
-### Parameters
-* `width` `number` The new width of the image
-* `height` `number` The new height of the image
-
-### Returns
-* `Image` `self` The Image instance
-
-## Image:setBg(x, y, pattern)
-Sets the background color at the specified position
-
-### Parameters
-* `x` `number` The x position
-* `y` `number` The y position
-* `pattern` `string` The background color pattern
-
-### Returns
-* `Image` `self` The Image instance
-
## Image:setFg(x, y, pattern)
+
Sets the foreground color at the specified position
### Parameters
@@ -159,17 +122,44 @@ Sets the foreground color at the specified position
### Returns
* `Image` `self` The Image instance
-## Image:setMetadata(key, value)
-Sets the metadata of the image
+## Image:getFg(x, y, length)
+
+Gets the foreground color at the specified position
### Parameters
-* `key` `string` The key of the metadata to set
-* `value` `string` The value of the metadata to set
+* `x` `number` The x position
+* `y` `number` The y position
+* `length` `number` The length of the foreground color pattern to get
+
+### Returns
+* `string` `fg` The foreground color pattern
+
+## Image:setBg(x, y, pattern)
+
+Sets the background color at the specified position
+
+### Parameters
+* `x` `number` The x position
+* `y` `number` The y position
+* `pattern` `string` The background color pattern
### Returns
* `Image` `self` The Image instance
+## Image:getBg(x, y, length)
+
+Gets the background color at the specified position
+
+### Parameters
+* `x` `number` The x position
+* `y` `number` The y position
+* `length` `number` The length of the background color pattern to get
+
+### Returns
+* `string` `bg` The background color pattern
+
## Image:setPixel(x, y, char, fg, bg)
+
Sets the pixel at the specified position
### Parameters
@@ -182,18 +172,22 @@ Sets the pixel at the specified position
### Returns
* `Image` `self` The Image instance
-## Image:setText(x, y, text)
-Sets the text at the specified position
+## Image:nextFrame()
-### Parameters
-* `x` `number` The x position
-* `y` `number` The y position
-* `text` `string` The text to set
+Advances to the next frame in the animation
+
+### Returns
+* `Image` `self` The Image instance
+
+## Image:addFrame()
+
+Adds a new frame to the image
### Returns
* `Image` `self` The Image instance
## Image:updateFrame(frameIndex, frame)
+
Updates the specified frame with the provided data
### Parameters
@@ -203,4 +197,32 @@ Updates the specified frame with the provided data
### Returns
* `Image` `self` The Image instance
+## Image:getFrame(frameIndex)
+Gets the specified frame
+
+### Parameters
+* `frameIndex` `number` The index of the frame to get
+
+### Returns
+* `table` `frame` The frame data
+
+## Image:getMetadata()
+
+Gets the metadata of the image
+
+### Returns
+* `table` `metadata` The metadata of the image
+
+## Image:setMetadata(key, value)
+
+Sets the metadata of the image
+
+### Parameters
+* `key` `string` The key of the metadata to set
+* `value` `string` The value of the metadata to set
+
+### Returns
+* `Image` `self` The Image instance
+
+## Image:render()
\ No newline at end of file
diff --git a/docs/references/elements/Input.md b/docs/references/elements/Input.md
index e504848..1f7aa7b 100644
--- a/docs/references/elements/Input.md
+++ b/docs/references/elements/Input.md
@@ -1,44 +1,53 @@
-# Input : VisualElement
-This is the input class. It provides a text input field that can handle user input with various features like
-cursor movement, text manipulation, placeholder text, and input validation.
+# Input
+_This is the input class. It provides a text input field that can handle user input with various features like
+cursor movement, text manipulation, placeholder text, and input validation._
+
+Extends: `VisualElement`
## Properties
|Property|Type|Default|Description|
|---|---|---|---|
-|text|string|-|The current text content of the input
-|cursorPos|number|1|The current cursor position in the text
-|viewOffset|number|0|The horizontal scroll offset for viewing long text
-|maxLength|number?|nil|Maximum length of input text (optional)
-|placeholder|string|...|Text to display when input is empty
-|placeholderColor|color|gray|Color of the placeholder text
-|focusedBackground|color|blue|Background color when input is focused
-|focusedForeground|color|white|Foreground color when input is focused
-|pattern|string?|nil|Regular expression pattern for input validation
-|cursorColor|number|nil|Color of the cursor
-|replaceChar|string|nil|Character to replace the input with (for password fields)
+|text|string|-|The current text content of the input|
+|cursorPos|number|1|The current cursor position in the text|
+|viewOffset|number|0|The horizontal scroll offset for viewing long text|
+|placeholder|string|...|Text to display when input is empty|
+|placeholderColor|color|gray|Color of the placeholder text|
+|focusedBackground|color|blue|Background color when input is focused|
+|focusedForeground|color|white|Foreground color when input is focused|
+|cursorColor|number|nil|Color of the cursor|
+|replaceChar|string|nil|Character to replace the input with (for password fields)|
## Functions
|Method|Returns|Description|
|---|---|---|
-|[Input:setCursor](#input-setcursor)|-|Sets the cursor position and color
-|[Input:updateViewport](#input-updateviewport)|Input|Updates the input's viewport
+|[Input.new](#input-new)|Input|Creates a new Input instance|
+|[Input:init](#input-init-props-basalt)|Input|Initializes the Input instance|
+|[Input:setCursor](#input-setcursor-x-y-blink-color)|-|Sets the cursor position and color|
+|[Input:char](#input-char-char)|boolean|Handles char events|
+|[Input:key](#input-key-key)|boolean|Handles key events|
+|[Input:mouse_click](#input-mouse-click-button-x-y)|boolean|Handles mouse click events|
+|[Input:updateViewport](#input-updateviewport)|Input|Updates the input's viewport|
+|[Input:focus](#input-focus)|-|Handles a focus event|
+|[Input:blur](#input-blur)|-|Handles a blur event|
+|[Input:paste](#input-paste)|-|Handles paste events|
+|[Input:render](#input-render)|-|Renders the input element|
+## Input.new()
+### Returns
+* `Input` `object` The newly created Input instance
-## Protected Functions
+## Input:init(props, basalt)
+### Parameters
+* `props` `table` The properties to initialize the element with
+* `basalt` `table` The basalt instance
-|Method|Returns|Description|
-|---|---|---|
-|Input:blur|-|Handles a blur event
-|Input:char|boolean|Handles char events
-|Input:focus|-|Handles a focus event
-|Input:init|Input|Initializes the Input instance
-|Input:key|boolean|Handles key events
-|Input:mouse_click|boolean|Handles mouse click events
-|Input:render|-|Renders the input element
+### Returns
+* `Input` `self` The initialized instance
## Input:setCursor(x, y, blink, color)
+
Sets the cursor position and color
### Parameters
@@ -47,10 +56,37 @@ Sets the cursor position and color
* `blink` `boolean` Whether the cursor should blink
* `color` `number` The color of the cursor
+## Input:char(char)
+### Parameters
+* `char` `string` The character that was typed
+
+### Returns
+* `boolean` `handled` Whether the event was handled
+
+## Input:key(key)
+### Parameters
+* `key` `number` The key that was pressed
+
+### Returns
+* `boolean` `handled` Whether the event was handled
+
+## Input:mouse_click(button, x, y)
+### Parameters
+* `button` `number` The button that was clicked
+* `x` `number` The x position of the click
+* `y` `number` The y position of the click
+
+### Returns
+* `boolean` `handled` Whether the event was handled
+
## Input:updateViewport()
+
Updates the input's viewport
### Returns
* `Input` `self` The updated instance
-
+## Input:focus()
+## Input:blur()
+## Input:paste()
+## Input:render()
\ No newline at end of file
diff --git a/docs/references/elements/Label.md b/docs/references/elements/Label.md
index dcba3e3..88b1706 100644
--- a/docs/references/elements/Label.md
+++ b/docs/references/elements/Label.md
@@ -1,32 +1,45 @@
-# Label : VisualElement
-This is the label class. It provides a simple text display element that automatically
-resizes its width based on the text content.
+# Label
+_This is the label class. It provides a simple text display element that automatically
+resizes its width based on the text content._
+
+Extends: `VisualElement`
## Properties
|Property|Type|Default|Description|
|---|---|---|---|
-|text|string|Label|The text content to display. Can be a string or a function that returns a string
-|autoSize|boolean|true|Whether the label should automatically resize its width based on the text content
+|text|string|Label|The text content to display. Can be a string or a function that returns a string|
+|autoSize|boolean|true|Whether the label should automatically resize its width based on the text content|
## Functions
|Method|Returns|Description|
|---|---|---|
-|[Label:getWrappedText](#label-getwrappedtext)|table|Gets the wrapped lines of the Label
+|[Label.new](#label-new)|Label|Creates a new Label instance|
+|[Label:init](#label-init-props-basalt)|Label|Initializes the Label instance|
+|[Label:getWrappedText](#label-getwrappedtext)|table|Gets the wrapped lines of the Label|
+|[Label:render](#label-render)|-|Renders the Label by drawing its text content|
+## Label.new()
-## Protected Functions
+Creates a new Label instance
-|Method|Returns|Description|
-|---|---|---|
-|Label:init|Label|Initializes the Label instance
-|Label:render|-|Renders the Label by drawing its text content
+### Returns
+* `Label` `self` The newly created Label instance
+
+## Label:init(props, basalt)
+### Parameters
+* `props` `table` The properties to initialize the element with
+* `basalt` `table` The basalt instance
+
+### Returns
+* `Label` `self` The initialized instance
## Label:getWrappedText()
+
Gets the wrapped lines of the Label
### Returns
* `table` `wrappedText` The wrapped lines of the Label
-
+## Label:render()
\ No newline at end of file
diff --git a/docs/references/elements/LineChart.md b/docs/references/elements/LineChart.md
index 9ee4c28..90a9962 100644
--- a/docs/references/elements/LineChart.md
+++ b/docs/references/elements/LineChart.md
@@ -1,28 +1,29 @@
-# LineChart : Graph
-The Line Chart element visualizes data series as connected line graphs. It plots points on a coordinate system and connects them with lines.
+# LineChart
+_The Line Chart element visualizes data series as connected line graphs. It plots points on a coordinate system and connects them with lines._
-### Usage
- ```lua
-local chart = main:addLineChart()
-:addSeries("input", " ", colors.green, colors.green, 10)
-:addSeries("output", " ", colors.red, colors.red, 10)
+Extends: `Graph`
-basalt.schedule(function()
-while true do
-chart:addPoint("input", math.random(1,100))
-chart:addPoint("output", math.random(1,100))
-sleep(2)
-end
-end)
-```
-
-
-
-## Protected Functions
+## Functions
|Method|Returns|Description|
|---|---|---|
-|LineChart:init|LineChart|Initializes the LineChart instance
-|LineChart:render|-|Renders the LineChart
+|[LineChart.new](#linechart-new)|LineChart|Creates a new LineChart instance|
+|[LineChart:init](#linechart-init-props-basalt)|LineChart|Initializes the LineChart instance|
+|[LineChart:render](#linechart-render)|-|Renders the LineChart|
+## LineChart.new()
+Creates a new LineChart instance
+
+### Returns
+* `LineChart` `self` The newly created LineChart instance
+
+## LineChart:init(props, basalt)
+### Parameters
+* `props` `table` The properties to initialize the element with
+* `basalt` `table` The basalt instance
+
+### Returns
+* `LineChart` `self` The initialized instance
+
+## LineChart:render()
\ No newline at end of file
diff --git a/docs/references/elements/List.md b/docs/references/elements/List.md
index fc408b9..05cc4e2 100644
--- a/docs/references/elements/List.md
+++ b/docs/references/elements/List.md
@@ -1,17 +1,19 @@
-# List : VisualElement
-This is the list class. It provides a scrollable list of selectable items with support for
-custom item rendering, separators, and selection handling.
+# List
+_This is the list class. It provides a scrollable list of selectable items with support for
+custom item rendering, separators, and selection handling._
+
+Extends: `VisualElement`
## Properties
|Property|Type|Default|Description|
|---|---|---|---|
-|items|table|{}|List of items to display. Items can be tables with properties including selected state
-|selectable|boolean|true|Whether items in the list can be selected
-|multiSelection|boolean|false|Whether multiple items can be selected at once
-|offset|number|0|Current scroll offset for viewing long lists
-|selectedBackground|color|blue|Background color for selected items
-|selectedForeground|color|white|Text color for selected items
+|items|table|{}|List of items to display. Items can be tables with properties including selected state|
+|selectable|boolean|true|Whether items in the list can be selected|
+|multiSelection|boolean|false|Whether multiple items can be selected at once|
+|offset|number|0|Current scroll offset for viewing long lists|
+|selectedBackground|color|blue|Background color for selected items|
+|selectedForeground|color|white|Text color for selected items|
## Events
@@ -23,26 +25,37 @@ custom item rendering, separators, and selection handling.
|Method|Returns|Description|
|---|---|---|
-|[List:addItem](#list-additem)|List|Adds an item to the list
-|[List:clear](#list-clear)|List|Clears all items from the list
-|[List:getSelectedItem](#list-getselecteditem)|table?|Gets first selected item
-|[List:getSelectedItems](#list-getselecteditems)|table|Gets the currently selected items
-|[List:onSelect](#list-onselect)|List|Registers a callback for the select event
-|[List:removeItem](#list-removeitem)|List|Removes an item from the list
-|[List:scrollToBottom](#list-scrolltobottom)|List|Scrolls the list to the bottom
-|[List:scrollToTop](#list-scrolltotop)|List|Scrolls the list to the top
+|[List.new](#list-new)|List|Creates a new List instance|
+|[List:init](#list-init-props-basalt)|List|Initializes the List instance|
+|[List:addItem](#list-additem-text)|List|Adds an item to the list|
+|[List:removeItem](#list-removeitem-index)|List|Removes an item from the list|
+|[List:clear](#list-clear)|List|Clears all items from the list|
+|[List:getSelectedItems](#list-getselecteditems)|table|Gets the currently selected items|
+|[List:getSelectedItem](#list-getselecteditem)|selected|Gets first selected item|
+|[List:mouse_click](#list-mouse-click-button-x-y)|boolean|Handles mouse click events|
+|[List:mouse_scroll](#list-mouse-scroll-direction-x-y)|boolean|Handles mouse scroll events|
+|[List:onSelect](#list-onselect-callback)|List|Registers a callback for the select event|
+|[List:scrollToBottom](#list-scrolltobottom)|List|Scrolls the list to the bottom|
+|[List:scrollToTop](#list-scrolltotop)|List|Scrolls the list to the top|
+|[List:render](#list-render)|-|Renders the list|
+## List.new()
-## Protected Functions
+Creates a new List instance
-|Method|Returns|Description|
-|---|---|---|
-|List:init|List|Initializes the List instance
-|List:mouse_click|boolean|Handles mouse click events
-|List:mouse_scroll|boolean|Handles mouse scroll events
-|List:render|-|Renders the list
+### Returns
+* `List` `self` The newly created List instance
+
+## List:init(props, basalt)
+### Parameters
+* `props` `table` The properties to initialize the element with
+* `basalt` `table` The basalt instance
+
+### Returns
+* `List` `self` The initialized instance
## List:addItem(text)
+
Adds an item to the list
### Parameters
@@ -52,54 +65,13 @@ Adds an item to the list
* `List` `self` The List instance
### Usage
- ```lua
+```lua
list:addItem("New Item")
list:addItem({text="Item", callback=function() end})
```
-## List:clear()
-Clears all items from the list
-
-### Returns
-* `List` `self` The List instance
-
-### Usage
- ```lua
-list:clear()
-```
-
-## List:getSelectedItem()
-Gets first selected item
-
-### Returns
-* `table?` `selected` The first item
-
-## List:getSelectedItems()
-Gets the currently selected items
-
-### Returns
-* `table` `selected` List of selected items
-
-### Usage
- ```lua
-local selected = list:getSelectedItems()
-```
-
-## List:onSelect(callback)
-Registers a callback for the select event
-
-### Parameters
-* `callback` `function` The callback function to register
-
-### Returns
-* `List` `self` The List instance
-
-### Usage
- ```lua
-list:onSelect(function(index, item) print("Selected item:", index, item) end)
-```
-
## List:removeItem(index)
+
Removes an item from the list
### Parameters
@@ -109,20 +81,86 @@ Removes an item from the list
* `List` `self` The List instance
### Usage
- ```lua
+```lua
list:removeItem(1)
```
+## List:clear()
+
+Clears all items from the list
+
+### Returns
+* `List` `self` The List instance
+
+### Usage
+```lua
+list:clear()
+```
+
+## List:getSelectedItems()
+
+Gets the currently selected items
+
+### Returns
+* `table` `selected` List of selected items
+
+### Usage
+```lua
+local selected = list:getSelectedItems()
+```
+
+## List:getSelectedItem()
+
+Gets first selected item
+
+### Returns
+* `selected` `The` first item
+
+## List:mouse_click(button, x, y)
+### Parameters
+* `button` `number` The mouse button that was clicked
+* `x` `number` The x-coordinate of the click
+* `y` `number` The y-coordinate of the click
+
+### Returns
+* `boolean` `Whether` the event was handled
+
+## List:mouse_scroll(direction, x, y)
+### Parameters
+* `direction` `number` The direction of the scroll (1 for down, -1 for up)
+* `x` `number` The x-coordinate of the scroll
+* `y` `number` The y-coordinate of the scroll
+
+### Returns
+* `boolean` `Whether` the event was handled
+
+## List:onSelect(callback)
+
+Registers a callback for the select event
+
+### Parameters
+* `callback` `function` The callback function to register
+
+### Returns
+* `List` `self` The List instance
+
+### Usage
+```lua
+list:onSelect(function(index, item) print("Selected item:", index, item) end)
+```
+
## List:scrollToBottom()
+
Scrolls the list to the bottom
### Returns
* `List` `self` The List instance
## List:scrollToTop()
+
Scrolls the list to the top
### Returns
* `List` `self` The List instance
-
+## List:render()
\ No newline at end of file
diff --git a/docs/references/elements/Menu.md b/docs/references/elements/Menu.md
index 77c9a00..7f0e43a 100644
--- a/docs/references/elements/Menu.md
+++ b/docs/references/elements/Menu.md
@@ -1,40 +1,61 @@
-# Menu : List
-This is the menu class. It provides a horizontal menu bar with selectable items.
-Menu items are displayed in a single row and can have custom colors and callbacks.
+# Menu
+_This is the menu class. It provides a horizontal menu bar with selectable items.
+Menu items are displayed in a single row and can have custom colors and callbacks._
+
+Extends: `List`
## Properties
|Property|Type|Default|Description|
|---|---|---|---|
-|separatorColor|color|gray|The color used for separator items in the menu
+|separatorColor|color|gray|The color used for separator items in the menu|
## Functions
|Method|Returns|Description|
|---|---|---|
-|[Menu:setItems](#menu-setitems)|Menu|Sets the menu items and calculates total width
+|[Menu.new](#menu-new)|Menu|Creates a new Menu instance|
+|[Menu:init](#menu-init-props-basalt)|Menu|Initializes the Menu instance|
+|[Menu:setItems](#menu-setitems-items)|Menu|Sets the menu items and calculates total width|
+|[Menu:render](#menu-render)|-|Renders the menu horizontally with proper spacing and colors|
+|[Menu:mouse_click](#menu-mouse-click-button-x-y)|boolean|Handles mouse click events and item selection|
+## Menu.new()
-## Protected Functions
+Creates a new Menu instance
-|Method|Returns|Description|
-|---|---|---|
-|Menu:init|Menu|Initializes the Menu instance
-|Menu:mouse_click|boolean|Handles mouse click events and item selection
-|Menu:render|-|Renders the menu horizontally with proper spacing and colors
+### Returns
+* `Menu` `self` The newly created Menu instance
+
+## Menu:init(props, basalt)
+### Parameters
+* `props` `table` The properties to initialize the element with
+* `basalt` `table` The basalt instance
+
+### Returns
+* `Menu` `self` The initialized instance
## Menu:setItems(items)
+
Sets the menu items
### Parameters
-* `items` `table[]` List of items with {text, separator, callback, foreground, background} properties
+* `items` `table` [] List of items with {text, separator, callback, foreground, background} properties
### Returns
* `Menu` `self` The Menu instance
### Usage
- ```lua
+```lua
menu:setItems({{text="File"}, {separator=true}, {text="Edit"}})
```
+## Menu:render()
+## Menu:mouse_click(button, x, y)
+### Parameters
+* `button` `number` The button that was clicked
+* `x` `number` The x position of the click
+* `y` `number` The y position of the click
+### Returns
+* `boolean` `Whether` the event was handled
diff --git a/docs/references/elements/Program.md b/docs/references/elements/Program.md
index 569279a..f781e8f 100644
--- a/docs/references/elements/Program.md
+++ b/docs/references/elements/Program.md
@@ -1,37 +1,112 @@
-# Program : VisualElement
-This is the program class. It provides a program that runs in a window.
+# Program
+_This is the program class. It provides a program that runs in a window._
+
+Extends: `VisualElement`
## Properties
|Property|Type|Default|Description|
|---|---|---|---|
-|program|table|nil|The program instance
-|path|string|""|The path to the program
-|running|boolean|false|Whether the program is running
+|program|table|nil|The program instance|
+|path|string|""|The path to the program|
+|running|boolean|false|Whether the program is running|
+|errorCallback|function|nil|The error callback function|
+|doneCallback|function|nil|The done callback function|
## Functions
|Method|Returns|Description|
|---|---|---|
-|[Program:execute](#program-execute)|Program|Executes a program
+|[Program.new](#program-new)|-||
+|[Program:run](#program-run)|-||
+|[Program:resize](#program-resize)|-||
+|[Program:resume](#program-resume)|-||
+|[Program:stop](#program-stop)|-||
+|[Program.new](#program-new)|Program|Creates a new Program instance|
+|[Program:init](#program-init-props-basalt)|Program|Initializes the Program instance|
+|[Program:execute](#program-execute-path-env-addenvironment)|Program|Executes a program|
+|[Program:stop](#program-stop)|Program|Stops the program|
+|[Program:sendEvent](#program-sendevent-event-any)|Program|Sends an event to the program|
+|[Program:onError](#program-onerror-fn)|Program|Registers a callback for the program's error event|
+|[Program:onDone](#program-ondone-fn)|Program|Registers a callback for the program's done event|
+|[Program:dispatchEvent](#program-dispatchevent-event-any)|any|Handles all incomming events|
+|[Program:focus](#program-focus)|-|Gets called when the element gets focused|
+|[Program:render](#program-render)|-|Renders the program|
+## Program.new()
+## Program:run()
+## Program:resize()
+## Program:resume()
+## Program:stop()
+## Program.new()
+### Returns
+* `Program` `object` The newly created Program instance
-## Protected Functions
+## Program:init(props, basalt)
+### Parameters
+* `props` `table` The properties to initialize the element with
+* `basalt` `table` The basalt instance
-|Method|Returns|Description|
-|---|---|---|
-|Program:dispatchEvent|any|Handles all incomming events
-|Program:focus|-|Gets called when the element gets focused
-|Program:init|Program|Initializes the Program instance
-|Program:render|-|Renders the program
+### Returns
+* `Program` `self` The initialized instance
+
+## Program:execute(path, env?, addEnvironment?)
-## Program:execute(path)
Executes a program
### Parameters
* `path` `string` The path to the program
+* `env` *(optional)* `table` The environment to run the program in
+* `addEnvironment` *(optional)* `boolean` Whether to add the environment to the program's environment (false = overwrite instead of adding)
### Returns
* `Program` `self` The Program instance
+## Program:stop()
+Stops the program
+
+### Returns
+* `Program` `self` The Program instance
+
+## Program:sendEvent(event, any)
+
+Sends an event to the program
+
+### Parameters
+* `event` `string` The event to send
+* `any` `The` event arguments
+
+### Returns
+* `Program` `self` The Program instance
+
+## Program:onError(fn)
+
+Registers a callback for the program's error event, if the function returns false, the program won't stop
+
+### Parameters
+* `fn` `function` The callback function to register
+
+### Returns
+* `Program` `self` The Program instance
+
+## Program:onDone(fn)
+
+Registers a callback for the program's done event
+
+### Parameters
+* `fn` `function` The callback function to register
+
+### Returns
+* `Program` `self` The Program instance
+
+## Program:dispatchEvent(event, any)
+### Parameters
+* `event` `string` The event to handle
+* `any` `The` event arguments
+
+### Returns
+* `any` `result` The event result
+
+## Program:focus()
+## Program:render()
\ No newline at end of file
diff --git a/docs/references/elements/ProgressBar.md b/docs/references/elements/ProgressBar.md
index 8c3d800..d431da5 100644
--- a/docs/references/elements/ProgressBar.md
+++ b/docs/references/elements/ProgressBar.md
@@ -1,30 +1,39 @@
-# ProgressBar : VisualElement
-This is the progress bar class. It provides a visual representation of progress
-with optional percentage display and customizable colors.
-
-### Usage
- ```lua
-local progressBar = main:addProgressBar()
-progressBar:setDirection("up")
-progressBar:setProgress(50)
-```
+# ProgressBar
+_This is the progress bar class. It provides a visual representation of progress
+with optional percentage display and customizable colors._
+Extends: `VisualElement`
## Properties
|Property|Type|Default|Description|
|---|---|---|---|
-|progress|number|0|Current progress value (0-100)
-|showPercentage|boolean|false|Whether to show the percentage text in the center
-|progressColor|color|lime|The color used for the filled portion of the progress bar
-|direction|string|right|The direction of the progress bar ("up", "down", "left", "right")
+|progress|number|0|Current progress value (0-100)|
+|showPercentage|boolean|false|Whether to show the percentage text in the center|
+|progressColor|color|lime|The color used for the filled portion of the progress bar|
+|direction|string|right|The direction of the progress bar ("up", "down", "left", "right")|
-
-## Protected Functions
+## Functions
|Method|Returns|Description|
|---|---|---|
-|ProgressBar:init|ProgressBar|Initializes the ProgressBar instance
-|ProgressBar:render|-|Renders the progress bar with filled portion and optional percentage text
+|[ProgressBar.new](#progressbar-new)|ProgressBar|Creates a new ProgressBar instance|
+|[ProgressBar:init](#progressbar-init-props-basalt)|ProgressBar|Initializes the ProgressBar instance|
+|[ProgressBar:render](#progressbar-render)|-|Renders the progress bar with filled portion and optional percentage text|
+## ProgressBar.new()
+Creates a new ProgressBar instance
+
+### Returns
+* `ProgressBar` `self` The newly created ProgressBar instance
+
+## ProgressBar:init(props, basalt)
+### Parameters
+* `props` `table` The properties to initialize the element with
+* `basalt` `table` The basalt instance
+
+### Returns
+* `ProgressBar` `self` The initialized instance
+
+## ProgressBar:render()
\ No newline at end of file
diff --git a/docs/references/elements/Scrollbar.md b/docs/references/elements/Scrollbar.md
index 924fc53..a9ce79a 100644
--- a/docs/references/elements/Scrollbar.md
+++ b/docs/references/elements/Scrollbar.md
@@ -1,58 +1,97 @@
-# Scrollbar : VisualElement
-A scrollbar element that can be attached to other elements to control their scroll properties
+# ScrollBar
+_A ScrollBar element that can be attached to other elements to control their scroll properties_
+
+Extends: `VisualElement`
## Properties
|Property|Type|Default|Description|
|---|---|---|---|
-|value|number|0|Current scroll value
-|min|number|0|Minimum scroll value
-|max|number|100|Maximum scroll value
-|step|number|1|Step size for scroll operations
-|dragMultiplier|number|1|How fast the scrollbar moves when dragging
-|symbol|string|"|" Symbol used for the scrollbar handle
-|backgroundSymbol|string|"\127"|Symbol used for the scrollbar background
-|symbolBackgroundColor|color|black|Background color of the scrollbar handle
-|backgroundSymbol|string|"\127"|Symbol used for the scrollbar background
-|attachedElement|table?|nil|The element this scrollbar is attached to
-|attachedProperty|string?|nil|The property being controlled
-|minValue|number|function|0|Minimum value or function that returns it
-|maxValue|number|function|100|Maximum value or function that returns it
-|orientation|string|vertical|Orientation of the scrollbar ("vertical" or "horizontal")
-|handleSize|number|2|Size of the scrollbar handle in characters
+|value|number|0|Current scroll value|
+|min|number|0|Minimum scroll value|
+|max|number|100|Maximum scroll value|
+|step|number|1|Step size for scroll operations|
+|dragMultiplier|number|1|How fast the ScrollBar moves when dragging|
+|symbol|string|"|" Symbol used for the ScrollBar handle|
+|backgroundSymbol|string|"\127"|Symbol used for the ScrollBar background|
+|symbolBackgroundColor|color|black|Background color of the ScrollBar handle|
+|backgroundSymbol|string|"\127"|Symbol used for the ScrollBar background|
+|minValue|number|function|0|Minimum value or function that returns it|
+|maxValue|number|function|100|Maximum value or function that returns it|
+|orientation|string|vertical|Orientation of the ScrollBar ("vertical" or "horizontal")|
+|handleSize|number|2|Size of the ScrollBar handle in characters|
## Functions
|Method|Returns|Description|
|---|---|---|
-|[Scrollbar:attach](#scrollbar-attach)|Scrollbar|Attaches the scrollbar to an element's property
-|[Scrollbar:updateAttachedElement](#scrollbar-updateattachedelement)|Scrollbar|Updates the attached element's property based on the scrollbar value
+|[ScrollBar.new](#scrollbar-new)|ScrollBar|Creates a new ScrollBar instance|
+|[ScrollBar:init](#scrollbar-init-props-basalt)|ScrollBar|Initializes the ScrollBar instance|
+|[ScrollBar:attach](#scrollbar-attach-element-config)|ScrollBar|Attaches the ScrollBar to an element's property|
+|[ScrollBar:updateAttachedElement](#scrollbar-updateattachedelement)|ScrollBar|Updates the attached element's property based on the ScrollBar value|
+|[ScrollBar:mouse_click](#scrollbar-mouse-click-button-x-y)|boolean|Handles mouse click events|
+|[ScrollBar:mouse_drag](#scrollbar-mouse-drag-button-x-y)|boolean|Handles mouse drag events|
+|[ScrollBar:mouse_scroll](#scrollbar-mouse-scroll-direction-x-y)|boolean|Handles mouse scroll events|
+|[ScrollBar:render](#scrollbar-render)|-|Renders the ScrollBar|
+## ScrollBar.new()
-## Protected Functions
+Creates a new ScrollBar instance
-|Method|Returns|Description|
-|---|---|---|
-|Scrollbar:init|Scrollbar|Initializes the Scrollbar instance
-|Scrollbar:mouse_click|boolean|Handles mouse click events
-|Scrollbar:mouse_drag|boolean|Handles mouse drag events
-|Scrollbar:mouse_scroll|boolean|Handles mouse scroll events
-|Scrollbar:render|-|Renders the scrollbar
+### Returns
+* `ScrollBar` `self` The newly created ScrollBar instance
-## Scrollbar:attach(element, config)
-Attaches the scrollbar to an element's property
+## ScrollBar:init(props, basalt)
+### Parameters
+* `props` `table` The properties to initialize the element with
+* `basalt` `table` The basalt instance
+
+### Returns
+* `ScrollBar` `self` The initialized instance
+
+## ScrollBar:attach(element, config)
+
+Attaches the ScrollBar to an element's property
### Parameters
* `element` `BaseElement` The element to attach to
* `config` `table` Configuration {property = "propertyName", min = number|function, max = number|function}
### Returns
-* `Scrollbar` `self` The scrollbar instance
+* `ScrollBar` `self` The ScrollBar instance
-## Scrollbar:updateAttachedElement()
-Updates the attached element's property based on the scrollbar value
+## ScrollBar:updateAttachedElement()
+
+Updates the attached element's property based on the ScrollBar value
### Returns
-* `Scrollbar` `self` The scrollbar instance
+* `ScrollBar` `self` The ScrollBar instance
+## ScrollBar:mouse_click(button, x, y)
+### Parameters
+* `button` `number` The mouse button clicked
+* `x` `number` The x position of the click
+* `y` `number` The y position of the click
+### Returns
+* `boolean` `Whether` the event was handled
+
+## ScrollBar:mouse_drag(button, x, y)
+### Parameters
+* `button` `number` The mouse button being dragged
+* `x` `number` The x position of the drag
+* `y` `number` The y position of the drag
+
+### Returns
+* `boolean` `Whether` the event was handled
+
+## ScrollBar:mouse_scroll(direction, x, y)
+### Parameters
+* `direction` `number` The scroll direction (1 for up, -1 for down)
+* `x` `number` The x position of the scroll
+* `y` `number` The y position of the scroll
+
+### Returns
+* `boolean` `Whether` the event was handled
+
+## ScrollBar:render()
\ No newline at end of file
diff --git a/docs/references/elements/Slider.md b/docs/references/elements/Slider.md
index 0a8e289..24e5ac5 100644
--- a/docs/references/elements/Slider.md
+++ b/docs/references/elements/Slider.md
@@ -1,16 +1,18 @@
-# Slider : VisualElement
-This is the slider class. It provides a draggable slider control that can be either horizontal or vertical,
-with customizable colors and value ranges.
+# Slider
+_This is the slider class. It provides a draggable slider control that can be either horizontal or vertical,
+with customizable colors and value ranges._
+
+Extends: `VisualElement`
## Properties
|Property|Type|Default|Description|
|---|---|---|---|
-|step|number|1|Current position of the slider handle (1 to width/height)
-|max|number|100|Maximum value for value conversion (maps slider position to this range)
-|horizontal|boolean|true|Whether the slider is horizontal (false for vertical)
-|barColor|color|gray|Color of the slider track
-|sliderColor|color|blue|Color of the slider handle
+|step|number|1|Current position of the slider handle (1 to width/height)|
+|max|number|100|Maximum value for value conversion (maps slider position to this range)|
+|horizontal|boolean|true|Whether the slider is horizontal (false for vertical)|
+|barColor|color|gray|Color of the slider track|
+|sliderColor|color|blue|Color of the slider handle|
## Events
@@ -22,27 +24,56 @@ with customizable colors and value ranges.
|Method|Returns|Description|
|---|---|---|
-|[Slider:getValue](#slider-getvalue)|number|Gets the current value mapped to the max range
+|[Slider.new](#slider-new)|Slider|Creates a new Slider instance|
+|[Slider:init](#slider-init-props-basalt)|Slider|Initializes the Slider instance|
+|[Slider:getValue](#slider-getvalue)|number|Gets the current value mapped to the max range|
+|[Slider:mouse_click](#slider-mouse-click-button-x-y)|boolean|Updates slider position on mouse click|
+|[Slider:mouse_scroll](#slider-mouse-scroll-button-x-y)|boolean|Handles mouse release events|
+|[Slider:render](#slider-render)|-|Renders the slider with track and handle|
+## Slider.new()
-## Protected Functions
+Creates a new Slider instance
-|Method|Returns|Description|
-|---|---|---|
-|Slider:init|Slider|Initializes the Slider instance
-|Slider:mouse_click|boolean|Updates slider position on mouse click
-|Slider:mouse_scroll|boolean|Handles mouse release events
-|Slider:render|-|Renders the slider with track and handle
+### Returns
+* `Slider` `self` The newly created Slider instance
+
+## Slider:init(props, basalt)
+### Parameters
+* `props` `table` The properties to initialize the element with
+* `basalt` `table` The basalt instance
+
+### Returns
+* `Slider` `self` The initialized instance
## Slider:getValue()
+
Gets the current value of the slider
### Returns
* `number` `value` The current value (0 to max)
### Usage
- ```lua
+```lua
local value = slider:getValue()
```
+## Slider:mouse_click(button, x, y)
+### Parameters
+* `button` `number` The mouse button that was clicked
+* `x` `number` The x position of the click
+* `y` `number` The y position of the click
+### Returns
+* `boolean` `handled` Whether the event was handled
+
+## Slider:mouse_scroll(button, x, y)
+### Parameters
+* `button` `number` The mouse button that was released
+* `x` `number` The x position of the release
+* `y` `number` The y position of the release
+
+### Returns
+* `boolean` `handled` Whether the event was handled
+
+## Slider:render()
\ No newline at end of file
diff --git a/docs/references/elements/Switch.md b/docs/references/elements/Switch.md
index a7b4e96..3faa344 100644
--- a/docs/references/elements/Switch.md
+++ b/docs/references/elements/Switch.md
@@ -1,18 +1,43 @@
-# Switch : VisualElement
-The Switch is a standard Switch element with click handling and state management.
+# Switch
+_The Switch is a standard Switch element with click handling and state management._
+
+Extends: `VisualElement`
## Properties
|Property|Type|Default|Description|
|---|---|---|---|
-|checked|boolean|Whether|switch is checked
+|checked|boolean|Whether|switch is checked|
+|text|string|Text|to display next to switch|
+|autoSize|boolean|Whether|to automatically size the element to fit switch and text|
+|onBackground|number|Background|color when ON|
+|offBackground|number|Background|color when OFF|
-
-## Protected Functions
+## Functions
|Method|Returns|Description|
|---|---|---|
-|Switch:init|-|Initializes the Switch instance
-|Switch:render|-|Renders the Switch
+|[Switch.new](#switch-new)|table|Creates a new Switch instance|
+|[Switch:init](#switch-init-props-basalt)|-|Initializes the Switch instance|
+|[Switch:mouse_click](#switch-mouse-click-button-x-y)|boolean|Handles mouse click events|
+|[Switch:render](#switch-render)|-|Renders the Switch|
+## Switch.new()
+### Returns
+* `table` `self` The created instance
+## Switch:init(props, basalt)
+### Parameters
+* `props` `table` The properties to initialize the element with
+* `basalt` `table` The basalt instance
+
+## Switch:mouse_click(button, x, y)
+### Parameters
+* `button` `number` The button that was clicked
+* `x` `number` The x position of the click
+* `y` `number` The y position of the click
+
+### Returns
+* `boolean` `Whether` the event was handled
+
+## Switch:render()
\ No newline at end of file
diff --git a/docs/references/elements/TabControl.md b/docs/references/elements/TabControl.md
index e69de29..5df32db 100644
--- a/docs/references/elements/TabControl.md
+++ b/docs/references/elements/TabControl.md
@@ -0,0 +1,105 @@
+# TabControl
+_The TabControl is a container that provides tabbed interface functionality_
+
+Extends: `Container`
+
+## Properties
+
+|Property|Type|Default|Description|
+|---|---|---|---|
+|activeTab|number|The|currently active tab ID|
+|tabHeight|number|Height|of the tab header area|
+|tabs|table|List|of tab definitions|
+|headerBackground|color|Background|color for the tab header area|
+|activeTabBackground|color|Background|color for the active tab|
+|activeTabTextColor|color|Foreground|color for the active tab text|
+
+## Functions
+
+|Method|Returns|Description|
+|---|---|---|
+|[TabControl.new](#tabcontrol-new)|TabControl|Creates a new TabControl instance|
+|[TabControl:init](#tabcontrol-init-props-basalt)|-|Initializes the TabControl instance|
+|[TabControl:newTab](#tabcontrol-newtab-title)|table|Creates a new tab handler proxy|
+|[TabControl:setTab](#tabcontrol-settab-element-tabid)|TabControl|Sets an element to belong to a specific tab|
+|[TabControl:addElement](#tabcontrol-addelement-elementtype-tabid)|table|Adds an element to the TabControl and assigns it to the active tab|
+|[TabControl:addChild](#tabcontrol-addchild-child)|Container|Overrides Container's addChild to assign new elements to tab 1 by default|
+|[TabControl:updateTabVisibility](#tabcontrol-updatetabvisibility)|-|Updates visibility of tab containers|
+|[TabControl:setActiveTab](#tabcontrol-setactivetab-tabid)|-|Sets the active tab|
+|[TabControl:isChildVisible](#tabcontrol-ischildvisible-child)|boolean|Checks if a child should be visible (overrides Container)|
+|[TabControl:getContentYOffset](#tabcontrol-getcontentyoffset)|number|Gets the content area Y offset (below tab headers)|
+|[TabControl:mouse_click](#tabcontrol-mouse-click-button-x-y)|boolean|Handles mouse click events for tab switching|
+|[TabControl:setCursor](#tabcontrol-setcursor)|-|Sets the cursor position; accounts for tab header offset when delegating to parent|
+|[TabControl:render](#tabcontrol-render)|-|Renders the TabControl (header + children)|
+|[TabControl:sortChildrenEvents](#tabcontrol-sortchildrenevents)|-||
+
+## TabControl.new()
+### Returns
+* `TabControl` `self` The created instance
+
+## TabControl:init(props, basalt)
+### Parameters
+* `props` `table` The properties to initialize the element with
+* `basalt` `table` The basalt instance
+
+## TabControl:newTab(title)
+
+returns a proxy for adding elements to the tab
+
+### Parameters
+* `title` `string` The title of the tab
+
+### Returns
+* `table` `tabHandler` The tab handler proxy for adding elements to the new tab
+
+## TabControl:setTab(element, tabId)
+### Parameters
+* `element` `table` The element to assign to a tab
+* `tabId` `number` The ID of the tab to assign the element to
+
+### Returns
+* `TabControl` `self` For method chaining
+
+## TabControl:addElement(elementType, tabId)
+### Parameters
+* `elementType` `string` The type of element to add
+* `tabId` `number` Optional tab ID, defaults to active tab
+
+### Returns
+* `table` `element` The created element
+
+## TabControl:addChild(child)
+### Parameters
+* `child` `table` The child element to add
+
+### Returns
+* `Container` `self` For method chaining
+
+## TabControl:updateTabVisibility()
+## TabControl:setActiveTab(tabId)
+### Parameters
+* `tabId` `number` The ID of the tab to activate
+
+## TabControl:isChildVisible(child)
+### Parameters
+* `child` `table` The child element to check
+
+### Returns
+* `boolean` `Whether` the child should be visible
+
+## TabControl:getContentYOffset()
+### Returns
+* `number` `yOffset` The Y offset for content
+
+## TabControl:mouse_click(button, x, y)
+### Parameters
+* `button` `number` The button that was clicked
+* `x` `number` The x position of the click (global)
+* `y` `number` The y position of the click (global)
+
+### Returns
+* `boolean` `Whether` the event was handled
+
+## TabControl:setCursor()
+## TabControl:render()
+## TabControl:sortChildrenEvents()
\ No newline at end of file
diff --git a/docs/references/elements/Table.md b/docs/references/elements/Table.md
index b290768..dadb2d3 100644
--- a/docs/references/elements/Table.md
+++ b/docs/references/elements/Table.md
@@ -1,53 +1,143 @@
-# Table : VisualElement
-This is the table class. It provides a sortable data grid with customizable columns,
-row selection, and scrolling capabilities.
-
-### Usage
- ```lua
-local people = container:addTable():setWidth(40)
-people:setColumns({{name="Name",width=12}, {name="Age",width=10}, {name="Country",width=15}})
-people:setData({{"Alice", 30, "USA"}, {"Bob", 25, "UK"}})
-```
+# Table
+_This is the table class. It provides a sortable data grid with customizable columns,
+row selection, and scrolling capabilities._
+Extends: `VisualElement`
## Properties
|Property|Type|Default|Description|
|---|---|---|---|
-|columns|table|{}|List of column definitions with {name, width} properties
-|data|table|{}|The table data as array of row arrays
-|selectedRow|number?|nil|Currently selected row index
-|headerColor|color|blue|Color of the column headers
-|selectedColor|color|lightBlue|Background color of selected row
-|gridColor|color|gray|Color of grid lines
-|sortColumn|number?|nil|Currently sorted column index
-|sortDirection|string|"asc"|Sort direction ("asc" or "desc")
-|scrollOffset|number|0|Current scroll position
+|columns|table|{}|List of column definitions with {name, width} properties|
+|data|table|{}|The table data as array of row arrays|
+|headerColor|color|blue|Color of the column headers|
+|selectedColor|color|lightBlue|Background color of selected row|
+|gridColor|color|gray|Color of grid lines|
+|sortDirection|string|"asc"|Sort direction ("asc" or "desc")|
+|scrollOffset|number|0|Current scroll position|
+|customSortFunction|table|{}|Custom sort functions for columns|
## Functions
|Method|Returns|Description|
|---|---|---|
-|[Table:sortData](#table-sortdata)|Table|Sorts the table data by the specified column
+|[Table.new](#table-new)|Table|Creates a new Table instance|
+|[Table:init](#table-init-props-basalt)|Table|Initializes the Table instance|
+|[Table:addColumn](#table-addcolumn-name-width)|Table|Adds a new column to the table|
+|[Table:addData](#table-adddata-any)|Table|Adds a new row of data to the table|
+|[Table:setColumnSortFunction](#table-setcolumnsortfunction-columnindex-sortfn)|Table|Sets a custom sort function for a column|
+|[Table:setFormattedData](#table-setformatteddata-displaydata-sortdata)|Table|Adds formatted data with raw sort values|
+|[Table:setData](#table-setdata-rawdata-formatters)|Table|Sets table data with optional column formatters|
+|[Table:calculateColumnWidths](#table-calculatecolumnwidths-columns-totalwidth)|table|Calculates column widths for rendering|
+|[Table:sortData](#table-sortdata-columnindex-fn)|Table|Sorts the table data by the specified column|
+|[Table:mouse_click](#table-mouse-click-button-x-y)|boolean|Handles header clicks for sorting and row selection|
+|[Table:mouse_scroll](#table-mouse-scroll-direction-x-y)|boolean|Handles scrolling through the table data|
+|[Table:render](#table-render)|-|Renders the table with headers, data and scrollbar|
+## Table.new()
-## Protected Functions
+Creates a new Table instance
-|Method|Returns|Description|
-|---|---|---|
-|Table:init|Table|Initializes the Table instance
-|Table:mouse_click|boolean|Handles header clicks for sorting and row selection
-|Table:mouse_scroll|boolean|Handles scrolling through the table data
-|Table:render|-|Renders the table with headers, data and scrollbar
+### Returns
+* `Table` `self` The newly created Table instance
-## Table:sortData(columnIndex, fn)
-Sorts the table data by column
+## Table:init(props, basalt)
+### Parameters
+* `props` `table` The properties to initialize the element with
+* `basalt` `table` The basalt instance
+
+### Returns
+* `Table` `self` The initialized instance
+
+## Table:addColumn(name, width)
+
+Adds a new column to the table
### Parameters
-* `columnIndex` `number` The index of the column to sort by
-* `fn` `function?` Optional custom sorting function
+* `name` `string` The name of the column
+* `width` `number` The width of the column
### Returns
* `Table` `self` The Table instance
+## Table:addData(any)
+Adds a new row of data to the table
+
+### Parameters
+* `any` `The` data for the new row
+
+### Returns
+* `Table` `self` The Table instance
+
+## Table:setColumnSortFunction(columnIndex, sortFn)
+
+Sets a custom sort function for a specific column
+
+### Parameters
+* `columnIndex` `number` The index of the column
+* `sortFn` `function` Function that takes (rowA, rowB) and returns comparison result
+
+### Returns
+* `Table` `self` The Table instance
+
+## Table:setFormattedData(displayData, sortData)
+
+Adds data with both display and sort values
+
+### Parameters
+* `displayData` `table` The formatted data for display
+* `sortData` `table` The raw data for sorting (optional)
+
+### Returns
+* `Table` `self` The Table instance
+
+## Table:setData(rawData, formatters)
+
+Set data with automatic formatting
+
+### Parameters
+* `rawData` `table` The raw data array
+* `formatters` `table` Optional formatter functions for columns {[2] = function(value) return value end}
+
+### Returns
+* `Table` `self` The Table instance
+
+## Table:calculateColumnWidths(columns, totalWidth)
+### Parameters
+* `columns` `table` The column definitions
+* `totalWidth` `number` The total available width
+
+### Returns
+* `table` `The` columns with calculated visibleWidth
+
+## Table:sortData(columnIndex, fn)
+
+Sorts the table data by column
+
+### Parameters
+* `columnIndex` `number` The index of the column to sort by
+* `fn` `function` ? Optional custom sorting function
+
+### Returns
+* `Table` `self` The Table instance
+
+## Table:mouse_click(button, x, y)
+### Parameters
+* `button` `number` The button that was clicked
+* `x` `number` The x position of the click
+* `y` `number` The y position of the click
+
+### Returns
+* `boolean` `handled` Whether the event was handled
+
+## Table:mouse_scroll(direction, x, y)
+### Parameters
+* `direction` `number` The scroll direction (-1 up, 1 down)
+* `x` `number` The x position of the scroll
+* `y` `number` The y position of the scroll
+
+### Returns
+* `boolean` `handled` Whether the event was handled
+
+## Table:render()
\ No newline at end of file
diff --git a/docs/references/elements/TextBox.md b/docs/references/elements/TextBox.md
index 3058738..bc9893b 100644
--- a/docs/references/elements/TextBox.md
+++ b/docs/references/elements/TextBox.md
@@ -1,57 +1,125 @@
-# TextBox : VisualElement
-A multi-line text editor component with cursor support and text manipulation features
+# TextBox
+_A multi-line text editor component with cursor support and text manipulation features_
+
+Extends: `VisualElement`
## Properties
|Property|Type|Default|Description|
|---|---|---|---|
-|lines|table|{}|Array of text lines
-|cursorX|number|1|Cursor X position
-|cursorY|number|1|Cursor Y position (line number)
-|scrollX|number|0|Horizontal scroll offset
-|scrollY|number|0|Vertical scroll offset
-|editable|boolean|true|Whether text can be edited
-|syntaxPatterns|table|{}|Syntax highlighting patterns
-|cursorColor|number|nil|Color of the cursor
+|lines|table|{}|Array of text lines|
+|cursorX|number|1|Cursor X position|
+|cursorY|number|1|Cursor Y position (line number)|
+|scrollX|number|0|Horizontal scroll offset|
+|scrollY|number|0|Vertical scroll offset|
+|editable|boolean|true|Whether text can be edited|
+|syntaxPatterns|table|{}|Syntax highlighting patterns|
+|cursorColor|number|nil|Color of the cursor|
## Functions
|Method|Returns|Description|
|---|---|---|
-|[TextBox:addSyntaxPattern](#textbox-addsyntaxpattern)|TextBox|Adds a new syntax highlighting pattern
-|[TextBox:getText](#textbox-gettext)|string|Gets the text of the TextBox
-|[TextBox:setText](#textbox-settext)|TextBox|Sets the text of the TextBox
-|[TextBox:updateViewport](#textbox-updateviewport)|TextBox|Updates the viewport to keep the cursor in view
+|[TextBox.new](#textbox-new)|TextBox|Creates a new TextBox instance|
+|[TextBox:init](#textbox-init-props-basalt)|TextBox|Initializes the TextBox instance|
+|[TextBox:addSyntaxPattern](#textbox-addsyntaxpattern-pattern-color)|TextBox|Adds a new syntax highlighting pattern|
+|[TextBox:removeSyntaxPattern](#textbox-removesyntaxpattern-index)|TextBox|Removes a syntax pattern by index (1-based)|
+|[TextBox:clearSyntaxPatterns](#textbox-clearsyntaxpatterns)|TextBox|Clears all syntax highlighting patterns|
+|[TextBox:updateViewport](#textbox-updateviewport)|TextBox|Updates the viewport to keep the cursor in view|
+|[TextBox:char](#textbox-char-char)|boolean|Handles character input|
+|[TextBox:key](#textbox-key-key)|boolean|Handles key events|
+|[TextBox:mouse_scroll](#textbox-mouse-scroll-direction-x-y)|boolean|Handles mouse scroll events|
+|[TextBox:mouse_click](#textbox-mouse-click-button-x-y)|boolean|Handles mouse click events|
+|[TextBox:paste](#textbox-paste)|-|Handles paste events|
+|[TextBox:setText](#textbox-settext-text)|TextBox|Sets the text of the TextBox|
+|[TextBox:getText](#textbox-gettext)|string|Gets the text of the TextBox|
+|[TextBox:render](#textbox-render)|-|Renders the TextBox with syntax highlighting|
+## TextBox.new()
-## Protected Functions
+Creates a new TextBox instance
-|Method|Returns|Description|
-|---|---|---|
-|TextBox:char|boolean|Handles character input
-|TextBox:init|TextBox|Initializes the TextBox instance
-|TextBox:key|boolean|Handles key events
-|TextBox:mouse_click|boolean|Handles mouse click events
-|TextBox:mouse_scroll|boolean|Handles mouse scroll events
-|TextBox:render|-|Renders the TextBox with syntax highlighting
+### Returns
+* `TextBox` `self` The newly created TextBox instance
+
+## TextBox:init(props, basalt)
+### Parameters
+* `props` `table` The properties to initialize the element with
+* `basalt` `table` The basalt instance
+
+### Returns
+* `TextBox` `self` The initialized instance
## TextBox:addSyntaxPattern(pattern, color)
+
Adds a new syntax highlighting pattern
### Parameters
* `pattern` `string` The regex pattern to match
-* `color` `colors` The color to apply
+* `color` `number` The color to apply
### Returns
* `TextBox` `self` The TextBox instance
-## TextBox:getText()
-Gets the text of the TextBox
+## TextBox:removeSyntaxPattern(index)
+
+Removes a syntax pattern by index (1-based)
+
+### Parameters
+* `index` `number` The index of the pattern to remove
### Returns
-* `string` `text` The text of the TextBox
+* `TextBox` self
+## TextBox:clearSyntaxPatterns()
+
+Clears all syntax highlighting patterns
+
+### Returns
+* `TextBox` self
+
+## TextBox:updateViewport()
+
+Updates the viewport to keep the cursor in view
+
+### Returns
+* `TextBox` `self` The TextBox instance
+
+## TextBox:char(char)
+### Parameters
+* `char` `string` The character that was typed
+
+### Returns
+* `boolean` `handled` Whether the event was handled
+
+## TextBox:key(key)
+### Parameters
+* `key` `number` The key that was pressed
+
+### Returns
+* `boolean` `handled` Whether the event was handled
+
+## TextBox:mouse_scroll(direction, x, y)
+### Parameters
+* `direction` `number` The scroll direction
+* `x` `number` The x position of the scroll
+* `y` `number` The y position of the scroll
+
+### Returns
+* `boolean` `handled` Whether the event was handled
+
+## TextBox:mouse_click(button, x, y)
+### Parameters
+* `button` `number` The button that was clicked
+* `x` `number` The x position of the click
+* `y` `number` The y position of the click
+
+### Returns
+* `boolean` `handled` Whether the event was handled
+
+## TextBox:paste()
## TextBox:setText(text)
+
Sets the text of the TextBox
### Parameters
@@ -60,10 +128,11 @@ Sets the text of the TextBox
### Returns
* `TextBox` `self` The TextBox instance
-## TextBox:updateViewport()
-Updates the viewport to keep the cursor in view
+## TextBox:getText()
+
+Gets the text of the TextBox
### Returns
-* `TextBox` `self` The TextBox instance
-
+* `string` `text` The text of the TextBox
+## TextBox:render()
\ No newline at end of file
diff --git a/docs/references/elements/Timer.md b/docs/references/elements/Timer.md
index 3be3f12..b8d2335 100644
--- a/docs/references/elements/Timer.md
+++ b/docs/references/elements/Timer.md
@@ -17,21 +17,21 @@ Extends: `BaseElement`
|Method|Returns|Description|
|---|---|---|
|[Timer.new](#timer-new)|table|Creates a new Timer instance|
-|[Timer:Timer](#timer-timer-props-basalt)|-|Initializes the Timer instance|
-|[Timer:Timer](#timer-timer-self)|Timer|Starts the timer|
-|[Timer:Timer](#timer-timer-self)|Timer|Stops the timer|
-|[Timer:Timer](#timer-timer)|-|Dispatches events to the Timer instance|
+|[Timer:init](#timer-init-props-basalt)|-|Initializes the Timer instance|
+|[Timer:start](#timer-start-self)|Timer|Starts the timer|
+|[Timer:stop](#timer-stop-self)|Timer|Stops the timer|
+|[Timer:dispatchEvent](#timer-dispatchevent)|-|Dispatches events to the Timer instance|
## Timer.new()
### Returns
* `table` `self` The created instance
-## Timer:Timer(props, basalt)
+## Timer:init(props, basalt)
### Parameters
* `props` `table` The properties to initialize the element with
* `basalt` `table` The basalt instance
-## Timer:Timer(self)
+## Timer:start(self)
Starts the timer with the specified interval.
@@ -41,7 +41,7 @@ Starts the timer with the specified interval.
### Returns
* `Timer` `self` The Timer instance
-## Timer:Timer(self)
+## Timer:stop(self)
Stops the timer if it is currently running.
@@ -51,4 +51,4 @@ Stops the timer if it is currently running.
### Returns
* `Timer` `self` The Timer instance
-## Timer:Timer()
\ No newline at end of file
+## Timer:dispatchEvent()
\ No newline at end of file
diff --git a/docs/references/elements/Tree.md b/docs/references/elements/Tree.md
index 040025b..23b5f5b 100644
--- a/docs/references/elements/Tree.md
+++ b/docs/references/elements/Tree.md
@@ -1,49 +1,55 @@
-# Tree : VisualElement
-This is the tree class. It provides a hierarchical view of nodes that can be expanded and collapsed,
-with support for selection and scrolling.
+# Tree
+_This is the tree class. It provides a hierarchical view of nodes that can be expanded and collapsed,
+with support for selection and scrolling._
+
+Extends: `VisualElement`
## Properties
|Property|Type|Default|Description|
|---|---|---|---|
-|nodes|table|{}|The tree structure containing node objects with {text, children} properties
-|selectedNode|table?|nil|Currently selected node
-|expandedNodes|table|{}|Table of nodes that are currently expanded
-|scrollOffset|number|0|Current vertical scroll position
-|horizontalOffset|number|0|Current horizontal scroll position
-|nodeColor|color|white|Color of unselected nodes
-|selectedColor|color|lightBlue|Background color of selected node
+|nodes|table|{}|The tree structure containing node objects with {text, children} properties|
+|expandedNodes|table|{}|Table of nodes that are currently expanded|
+|scrollOffset|number|0|Current vertical scroll position|
+|horizontalOffset|number|0|Current horizontal scroll position|
+|nodeColor|color|white|Color of unselected nodes|
+|selectedColor|color|lightBlue|Background color of selected node|
## Functions
|Method|Returns|Description|
|---|---|---|
-|[Tree:collapseNode](#tree-collapsenode)|Tree|Collapses a node to hide its children
-|[Tree:expandNode](#tree-expandnode)|Tree|Expands a node to show its children
-|[Tree:getNodeSize](#tree-getnodesize)|number|Gets the size of the tree
-|[Tree:onSelect](#tree-onselect)|Tree|Registers a callback for when a node is selected
-|[Tree:toggleNode](#tree-togglenode)|Tree|Toggles between expanded and collapsed state
+|[Tree.new](#tree-new)|Tree|Creates a new Tree instance|
+|[Tree:init](#tree-init-props-basalt)|Tree|Initializes the Tree instance|
+|[Tree:expandNode](#tree-expandnode-node)|Tree|Expands a node to show its children|
+|[Tree:collapseNode](#tree-collapsenode-node)|Tree|Collapses a node to hide its children|
+|[Tree:toggleNode](#tree-togglenode-node)|Tree|Toggles between expanded and collapsed state|
+|[Tree:mouse_click](#tree-mouse-click-button-x-y)|boolean|Handles mouse click events for node selection and expansion|
+|[Tree:onSelect](#tree-onselect-callback)|Tree|Registers a callback for when a node is selected|
+|[Tree:mouse_scroll](#tree-mouse-scroll-direction-x-y)|boolean|Handles mouse scroll events for vertical scrolling|
+|[Tree:getNodeSize](#tree-getnodesize)|number, number|Gets the size of the tree|
+|[Tree:render](#tree-render)|-|Renders the tree with nodes, selection and scrolling|
+## Tree.new()
-## Protected Functions
-
-|Method|Returns|Description|
-|---|---|---|
-|Tree:init|Tree|Initializes the Tree instance
-|Tree:mouse_click|boolean|Handles mouse click events for node selection and expansion
-|Tree:mouse_scroll|boolean|Handles mouse scroll events for vertical scrolling
-|Tree:render|-|Renders the tree with nodes, selection and scrolling
-
-## Tree:collapseNode(node)
-Collapses a node
-
-### Parameters
-* `node` `table` The node to collapse
+Creates a new Tree instance
### Returns
-* `Tree` `self` The Tree instance
+* `Tree` `self` The newly created Tree instance
+
+## Tree:init(props, basalt)
+
+Initializes the Tree instance
+
+### Parameters
+* `props` `table` The properties to initialize the element with
+* `basalt` `table` The basalt instance
+
+### Returns
+* `Tree` `self` The initialized instance
## Tree:expandNode(node)
+
Expands a node
### Parameters
@@ -52,23 +58,18 @@ Expands a node
### Returns
* `Tree` `self` The Tree instance
-## Tree:getNodeSize()
-Gets the size of the tree
+## Tree:collapseNode(node)
-### Returns
-* `number` `width` The width of the tree
-* `number` `height` The height of the tree
-
-## Tree:onSelect(callback)
-Registers a callback for when a node is selected
+Collapses a node
### Parameters
-* `callback` `function` The callback function
+* `node` `table` The node to collapse
### Returns
* `Tree` `self` The Tree instance
## Tree:toggleNode(node)
+
Toggles a node's expanded state
### Parameters
@@ -77,4 +78,43 @@ Toggles a node's expanded state
### Returns
* `Tree` `self` The Tree instance
+## Tree:mouse_click(button, x, y)
+Handles mouse click events
+
+### Parameters
+* `button` `number` The button that was clicked
+* `x` `number` The x position of the click
+* `y` `number` The y position of the click
+
+### Returns
+* `boolean` `handled` Whether the event was handled
+
+## Tree:onSelect(callback)
+
+Registers a callback for when a node is selected
+
+### Parameters
+* `callback` `function` The callback function
+
+### Returns
+* `Tree` `self` The Tree instance
+
+## Tree:mouse_scroll(direction, x, y)
+### Parameters
+* `direction` `number` The scroll direction (1 for up, -1 for down)
+* `x` `number` The x position of the scroll
+* `y` `number` The y position of the scroll
+
+### Returns
+* `boolean` `handled` Whether the event was handled
+
+## Tree:getNodeSize()
+
+Gets the size of the tree
+
+### Returns
+* `number` `width` The width of the tree
+* `number` `height` The height of the tree
+
+## Tree:render()
\ No newline at end of file
diff --git a/docs/references/elements/VisualElement.md b/docs/references/elements/VisualElement.md
index ae5c797..974f138 100644
--- a/docs/references/elements/VisualElement.md
+++ b/docs/references/elements/VisualElement.md
@@ -1,102 +1,193 @@
-# VisualElement : BaseElement
-This is the visual element class. It serves as the base class for all visual UI elements
-and provides core functionality for positioning, sizing, colors, and rendering.
+# VisualElement
+_This is the visual element class. It serves as the base class for all visual UI elements
+and provides core functionality for positioning, sizing, colors, and rendering._
+
+Extends: `BaseElement`
## Properties
|Property|Type|Default|Description|
|---|---|---|---|
-|x|number|1|The horizontal position relative to parent
-|y|number|1|The vertical position relative to parent
-|z|number|1|The z-index for layering elements
-|width|number|1|The width of the element
-|height|number|1|The height of the element
-|background|color|black|The background color
-|foreground|color|white|The text/foreground color
-|clicked|boolean|false|Whether the element is currently clicked
-|hover|boolean|false|Whether the mouse is currently hover over the element (Craftos-PC only)
-|backgroundEnabled|boolean|true|Whether to render the background
-|focused|boolean|false|Whether the element has input focus
-|visible|boolean|true|Whether the element is visible
-|ignoreOffset|boolean|false|Whether to ignore the parent's offset
-
-## Combined Properties
-
-|Name|Properties|Description|
-|---|---|---|
-|position|`x number, y number`|Combined x, y position|
-|size|`width number, height number`|Combined width, height|
-|color|`foreground number, background number`|Combined foreground, background colors|
+|x|number|1|The horizontal position relative to parent|
+|y|number|1|The vertical position relative to parent|
+|z|number|1|The z-index for layering elements|
+|width|number|1|The width of the element|
+|height|number|1|The height of the element|
+|background|color|black|The background color|
+|foreground|color|white|The text/foreground color|
+|clicked|boolean|false|Whether the element is currently clicked|
+|hover|boolean|false|Whether the mouse is currently hover over the element (Craftos-PC only)|
+|backgroundEnabled|boolean|true|Whether to render the background|
+|focused|boolean|false|Whether the element has input focus|
+|visible|boolean|true|Whether the element is visible|
+|ignoreOffset|boolean|false|Whether to ignore the parent's offset|
## Events
|Event|Parameters|Description|
|---|---|---|
|onClick|`button string, x number, y number`|Fired on mouse click|
-|onMouseUp|`button, x, y`|Fired on mouse button release|
-|onRelease|`button, x, y`|Fired when mouse leaves while clicked|
-|onDrag|`button, x, y`|Fired when mouse moves while clicked|
-|onScroll|`direction, x, y`|Fired on mouse scroll|
-|onEnter|`-`|Fired when mouse enters element|
-|onLeave|`-`|Fired when mouse leaves element|
-|onFocus|`-`|Fired when element receives focus|
-|onBlur|`-`|Fired when element loses focus|
-|onKey|`key`|Fired on key press|
-|onKeyUp|`key`|Fired on key release|
-|onChar|`char`|Fired on character input|
## Functions
|Method|Returns|Description|
|---|---|---|
-|[VisualElement:calculatePosition](#visualelement-calculateposition)|number|Calculates the position of the element
-|[VisualElement:drawBg](#visualelement-drawbg)|-|
-|[VisualElement:drawFg](#visualelement-drawfg)|-|
-|[VisualElement:drawText](#visualelement-drawtext)|-|
-|[VisualElement:getAbsolutePosition](#visualelement-getabsoluteposition)|number|Returns the absolute position of the element
-|[VisualElement:getRelativePosition](#visualelement-getrelativeposition)|number|Returns the relative position of the element
-|[VisualElement:isInBounds](#visualelement-isinbounds)|boolean|Checks if point is within bounds
-|[VisualElement:prioritize](#visualelement-prioritize)|VisualElement|Prioritizes the element by moving it to the top of its parent's children
+|[VisualElement.new](#visualelement-new)|VisualElement|Creates a new visual element|
+|[VisualElement:init](#visualelement-init-props-basalt)|-|Initializes a new visual element with properties|
+|[VisualElement:multiBlit](#visualelement-multiblit-x-y-width-height-text-fg-bg)|-|Multi-character drawing with colors|
+|[VisualElement:textFg](#visualelement-textfg-x-y-text-fg)|-|Draws text with foreground color|
+|[VisualElement:textBg](#visualelement-textbg-x-y-text-bg)|-|Draws text with background color|
+|[VisualElement:blit](#visualelement-blit-x-y-text-fg-bg)|-|Draws text with both colors|
+|[VisualElement:isInBounds](#visualelement-isinbounds-x-y)|boolean|Checks if point is within bounds|
+|[VisualElement:mouse_click](#visualelement-mouse-click-button-x-y)|boolean|Handles a mouse click event|
+|[VisualElement:mouse_up](#visualelement-mouse-up-button-x-y)|boolean|Handles a mouse up event|
+|[VisualElement:mouse_release](#visualelement-mouse-release-button-x-y)|-|Handles a mouse release event|
+|[VisualElement:mouse_move](#visualelement-mouse-move---x-y)|boolean|Handles a mouse move event|
+|[VisualElement:mouse_scroll](#visualelement-mouse-scroll-direction-x-y)|boolean|Handles a mouse scroll event|
+|[VisualElement:mouse_drag](#visualelement-mouse-drag-button-x-y)|boolean|Handles a mouse drag event|
+|[VisualElement:focus](#visualelement-focus)|-|Handles a focus event|
+|[VisualElement:blur](#visualelement-blur)|-|Handles a blur event|
+|[VisualElement:key](#visualelement-key-key)|-|Handles a key event|
+|[VisualElement:key_up](#visualelement-key-up-key)|-|Handles a key up event|
+|[VisualElement:char](#visualelement-char-char)|-|Handles a character event|
+|[VisualElement:calculatePosition](#visualelement-calculateposition)|number, number|Calculates the position of the element|
+|[VisualElement:getAbsolutePosition](#visualelement-getabsoluteposition-x-y)|number, number|Returns the absolute position of the element|
+|[VisualElement:getRelativePosition](#visualelement-getrelativeposition-x-y)|number, number|Returns the relative position of the element|
+|[VisualElement:setCursor](#visualelement-setcursor-x-y-blink-color)|VisualElement|Sets the cursor position|
+|[VisualElement:prioritize](#visualelement-prioritize)|VisualElement|Prioritizes the element by moving it to the top of its parent's children|
+|[VisualElement:render](#visualelement-render)|-|Renders the element|
+|[VisualElement:postRender](#visualelement-postrender)|-|Post-rendering function for the element|
+## VisualElement.new()
-## Protected Functions
+Creates a new VisualElement instance
-|Method|Returns|Description|
-|---|---|---|
-|VisualElement:blit|-|Draws text with both colors
-|VisualElement:blur|-|Handles a blur event
-|VisualElement:char|-|Handles a character event
-|VisualElement:focus|-|Handles a focus event
-|VisualElement:init|-|Initializes a new visual element with properties
-|VisualElement:key|-|Handles a key event
-|VisualElement:key_up|-|Handles a key up event
-|VisualElement:mouse_click|boolean|Handles a mouse click event
-|VisualElement:mouse_drag|boolean|Handles a mouse drag event
-|VisualElement:mouse_move|boolean|Handles a mouse move event
-|VisualElement:mouse_release|-|Handles a mouse release event
-|VisualElement:mouse_scroll|boolean|Handles a mouse scroll event
-|VisualElement:mouse_up|boolean|Handles a mouse up event
-|VisualElement:multiBlit|-|Multi-character drawing with colors
-|VisualElement:postRender|-|Post-rendering function for the element
-|VisualElement:render|-|Renders the element
-|VisualElement:setCursor|VisualElement|Sets the cursor position
-|VisualElement:textBg|-|Draws text with background color
-|VisualElement:textFg|-|Draws text with foreground color
+### Returns
+* `VisualElement` `object` The newly created VisualElement instance
+
+## VisualElement:init(props, basalt)
+### Parameters
+* `props` `table` The properties to initialize the element with
+* `basalt` `table` The basalt instance
+
+## VisualElement:multiBlit(x, y, width, height, text, fg, bg)
+### Parameters
+* `x` `number` The x position to draw
+* `y` `number` The y position to draw
+* `width` `number` The width of the area to draw
+* `height` `number` The height of the area to draw
+* `text` `string` The text to draw
+* `fg` `string` The foreground color
+* `bg` `string` The background color
+
+## VisualElement:textFg(x, y, text, fg)
+### Parameters
+* `x` `number` The x position to draw
+* `y` `number` The y position to draw
+* `text` `string` The text char to draw
+* `fg` `color` The foreground color
+
+## VisualElement:textBg(x, y, text, bg)
+### Parameters
+* `x` `number` The x position to draw
+* `y` `number` The y position to draw
+* `text` `string` The text char to draw
+* `bg` `color` The background color
+
+## VisualElement:blit(x, y, text, fg, bg)
+### Parameters
+* `x` `number` The x position to draw
+* `y` `number` The y position to draw
+* `text` `string` The text char to draw
+* `fg` `string` The foreground color
+* `bg` `string` The background color
+
+## VisualElement:isInBounds(x, y)
+
+Checks if the specified coordinates are within the bounds of the element
+
+### Parameters
+* `x` `number` The x position to check
+* `y` `number` The y position to check
+
+### Returns
+* `boolean` `isInBounds` Whether the coordinates are within the bounds of the element
+
+## VisualElement:mouse_click(button, x, y)
+### Parameters
+* `button` `number` The button that was clicked
+* `x` `number` The x position of the click
+* `y` `number` The y position of the click
+
+### Returns
+* `boolean` `clicked` Whether the element was clicked
+
+## VisualElement:mouse_up(button, x, y)
+### Parameters
+* `button` `number` The button that was released
+* `x` `number` The x position of the release
+* `y` `number` The y position of the release
+
+### Returns
+* `boolean` `release` Whether the element was released on the element
+
+## VisualElement:mouse_release(button, x, y)
+### Parameters
+* `button` `number` The button that was released
+* `x` `number` The x position of the release
+* `y` `number` The y position of the release
+
+## VisualElement:mouse_move(_, x, y)
+### Parameters
+* `_` `number` unknown
+* `x` `number` The x position of the mouse
+* `y` `number` The y position of the mouse
+
+### Returns
+* `boolean` `hover` Whether the mouse has moved over the element
+
+## VisualElement:mouse_scroll(direction, x, y)
+### Parameters
+* `direction` `number` The scroll direction
+* `x` `number` The x position of the scroll
+* `y` `number` The y position of the scroll
+
+### Returns
+* `boolean` `scroll` Whether the element was scrolled
+
+## VisualElement:mouse_drag(button, x, y)
+### Parameters
+* `button` `number` The button that was clicked while dragging
+* `x` `number` The x position of the drag
+* `y` `number` The y position of the drag
+
+### Returns
+* `boolean` `drag` Whether the element was dragged
+
+## VisualElement:focus()
+## VisualElement:blur()
+## VisualElement:key(key)
+### Parameters
+* `key` `number` The key that was pressed
+
+## VisualElement:key_up(key)
+### Parameters
+* `key` `number` The key that was released
+
+## VisualElement:char(char)
+### Parameters
+* `char` `string` The character that was pressed
## VisualElement:calculatePosition()
+
Calculates the position of the element relative to its parent
### Returns
* `number` `x` The x position
* `number` `y` The y position
-## VisualElement:drawBg()
-
-## VisualElement:drawFg()
-
-## VisualElement:drawText()
-
## VisualElement:getAbsolutePosition(x?, y?)
+
Returns the absolute position of the element or the given coordinates.
### Parameters
@@ -108,6 +199,7 @@ Returns the absolute position of the element or the given coordinates.
* `number` `y` The absolute y position
## VisualElement:getRelativePosition(x?, y?)
+
Returns the relative position of the element or the given coordinates.
### Parameters
@@ -118,20 +210,22 @@ Returns the relative position of the element or the given coordinates.
* `number` `x` The relative x position
* `number` `y` The relative y position
-## VisualElement:isInBounds(x, y)
-Checks if the specified coordinates are within the bounds of the element
-
+## VisualElement:setCursor(x, y, blink, color)
### Parameters
-* `x` `number` The x position to check
-* `y` `number` The y position to check
+* `x` `number` The x position of the cursor
+* `y` `number` The y position of the cursor
+* `blink` `boolean` Whether the cursor should blink
+* `color` `number` The color of the cursor
### Returns
-* `boolean` `isInBounds` Whether the coordinates are within the bounds of the element
+* `VisualElement` `self` The VisualElement instance
## VisualElement:prioritize()
+
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.
### Returns
* `VisualElement` `self` The VisualElement instance
-
+## VisualElement:render()
+## VisualElement:postRender()
\ No newline at end of file
diff --git a/docs/references/errorManager.md b/docs/references/errorManager.md
index 20e1996..dcf14f9 100644
--- a/docs/references/errorManager.md
+++ b/docs/references/errorManager.md
@@ -1,29 +1,20 @@
# ErrorHandler
-This is Basalt's error handler. All the errors are handled by this module.
-
-## Fields
-
-|Field|Type|Description|
-|---|---|---|
-|tracebackEnabled|`boolean`|If the error handler should print a stack trace|
-|header|`string`|The header of the error message|
+_This is Basalt's error handler. All the errors are handled by this module._
## Functions
|Method|Returns|Description|
|---|---|---|
-|[errorHandler.error](#errorhandler-error)|-|
+|[ErrorHandler.error](#errorhandler-error-errmsg)|-|Handles an error|
+## ErrorHandler.error(errMsg)
-## errorHandler.error(errMsg)
Handles an error
### Parameters
* `errMsg` `string` The error message
### Usage
- ```lua
+```lua
errorHandler.error("An error occurred")
```
-
-
diff --git a/docs/references/init.md b/docs/references/init.md
index e69de29..84c33e9 100644
--- a/docs/references/init.md
+++ b/docs/references/init.md
@@ -0,0 +1 @@
+!! EMPTY MARKDOWN GENERATED !!
diff --git a/docs/references/libraries/colorHex.md b/docs/references/libraries/colorHex.md
index e69de29..84c33e9 100644
--- a/docs/references/libraries/colorHex.md
+++ b/docs/references/libraries/colorHex.md
@@ -0,0 +1 @@
+!! EMPTY MARKDOWN GENERATED !!
diff --git a/docs/references/libraries/expect.md b/docs/references/libraries/expect.md
index e69de29..84c33e9 100644
--- a/docs/references/libraries/expect.md
+++ b/docs/references/libraries/expect.md
@@ -0,0 +1 @@
+!! EMPTY MARKDOWN GENERATED !!
diff --git a/docs/references/libraries/utils.md b/docs/references/libraries/utils.md
index e69de29..84c33e9 100644
--- a/docs/references/libraries/utils.md
+++ b/docs/references/libraries/utils.md
@@ -0,0 +1 @@
+!! EMPTY MARKDOWN GENERATED !!
diff --git a/docs/references/log.md b/docs/references/log.md
index 86604b0..39c325d 100644
--- a/docs/references/log.md
+++ b/docs/references/log.md
@@ -1,76 +1,57 @@
# Log
-Logger module for Basalt. Logs messages to the console and optionally to a file.
-
-## Fields
-
-|Field|Type|Description|
-|---|---|---|
-|_logs|`table`|The complete log history|
-|_enabled|`boolean`|If the logger is enabled|
-|_logToFile|`boolean`|If the logger should log to a file|
-|_logFile|`string`|The file to log to|
-|LEVEL|`table`|The log levels|
+_Logger module for Basalt. Logs messages to the console and optionally to a file._
## Functions
|Method|Returns|Description|
|---|---|---|
-|[Log.debug](#log-debug)|-|Sends a debug message
-|[Log.error](#log-error)|-|Sends an error message
-|[Log.info](#log-info)|-|Sends an info message
-|[Log.setEnabled](#log-setenabled)|-|Sets if the logger should log
-|[Log.setLogToFile](#log-setlogtofile)|-|Sets if the logger should log to a file
-|[Log.warn](#log-warn)|-|Sends a warning message
+|[Log.setLogToFile](#log-setlogtofile)|-|Sets if the logger should log to a file|
+|[Log.setEnabled](#log-setenabled)|-|Sets if the logger should log|
+|[Log.debug](#log-debug)|-|Sends a debug message|
+|[Log.info](#log-info)|-|Sends an info message|
+|[Log.warn](#log-warn)|-|Sends a warning message|
+|[Log.error](#log-error)|-|Sends an error message|
+## Log.setLogToFile()
+
+Sets if the logger should log to a file.
+
+## Log.setEnabled()
+
+Sets if the logger should log
+
+## Log.debug()
-## Log.debug(...)
Sends a debug message to the logger.
-### Parameters
-* `...` *(vararg)* `string` The message to log
-
### Usage
- ```lua
+```lua
Log.debug("This is a debug message")
```
-## Log.error(...)
-Sends an error message to the logger.
+## Log.info()
-### Parameters
-* `...` *(vararg)* `string` The message to log
-
-### Usage
- ```lua
-Log.error("This is an error message")
-```
-
-## Log.info(...)
Sends an info message to the logger.
-### Parameters
-* `...` *(vararg)* `string` The message to log
-
### Usage
- ```lua
+```lua
Log.info("This is an info message")
```
-## Log.setEnabled()
-Sets if the logger should log
+## Log.warn()
-## Log.setLogToFile()
-Sets if the logger should log to a file.
-
-## Log.warn(...)
Sends a warning message to the logger.
-### Parameters
-* `...` *(vararg)* `string` The message to log
-
### Usage
- ```lua
+```lua
Log.warn("This is a warning message")
```
+## Log.error()
+Sends an error message to the logger.
+
+### Usage
+```lua
+Log.error("This is an error message")
+```
diff --git a/docs/references/main.md b/docs/references/main.md
index ae35fd0..17f8c97 100644
--- a/docs/references/main.md
+++ b/docs/references/main.md
@@ -1,50 +1,35 @@
# basalt
-This is the UI Manager and the starting point for your project. The following functions allow you to influence the default behavior of Basalt.
+_This is the UI Manager and the starting point for your project. The following functions allow you to influence the default behavior of Basalt.
Before you can access Basalt, you need to add the following code on top of your file:
-
-### Usage
- ```lua
-local basalt = require("basalt")
-```
-
-What this code does is it loads basalt into the project, and you can access it by using the variable defined as "basalt".
-
-## Fields
-
-|Field|Type|Description|
-|---|---|---|
-|traceback|`boolean`|Whether to show a traceback on errors|
-|_events|`table`|A table of events and their callbacks|
-|_schedule|`function[]`|A table of scheduled functions|
-|_plugins|`table`|A table of plugins|
-|isRunning|`boolean`|Whether the Basalt runtime is active|
-|LOGGER|`Log`|The logger instance|
-|path|`string`|The path to the Basalt library|
+What this code does is it loads basalt into the project, and you can access it by using the variable defined as "basalt"._
## Functions
|Method|Returns|Description|
|---|---|---|
-|[basalt.create](#basalt-create)|table|Creates a new UI element
-|[basalt.createFrame](#basalt-createframe)|BaseFrame|Creates a new BaseFrame
-|[basalt.getAPI](#basalt-getapi)|table|Returns a Plugin API
-|[basalt.getActiveFrame](#basalt-getactiveframe)|BaseFrame?|Returns the active frame
-|[basalt.getElementClass](#basalt-getelementclass)|table|Returns an element class
-|[basalt.getElementManager](#basalt-getelementmanager)|table|Returns the element manager
-|[basalt.getErrorManager](#basalt-geterrormanager)|table|Returns the error manager
-|[basalt.getFocus](#basalt-getfocus)|BaseFrame?|Returns the focused frame
-|[basalt.getMainFrame](#basalt-getmainframe)|BaseFrame|Gets or creates the main frame
-|[basalt.removeSchedule](#basalt-removeschedule)|boolean|Removes a scheduled update
-|[basalt.run](#basalt-run)|-|Starts the Basalt runtime
-|[basalt.schedule](#basalt-schedule)|thread|Schedules a function to run in a coroutine
-|[basalt.setActiveFrame](#basalt-setactiveframe)|-|Sets the active frame
-|[basalt.setFocus](#basalt-setfocus)|-|Sets a frame as focused
-|[basalt.stop](#basalt-stop)|-|Stops the Basalt runtime
-|[basalt.update](#basalt-update)|-|Runs basalt once
-
+|[basalt.create](#basalt-create-type-properties)|table|Creates a new UI element|
+|[basalt.createFrame](#basalt-createframe)|BaseFrame|Creates a new BaseFrame|
+|[basalt.getElementManager](#basalt-getelementmanager)|table|Returns the element manager|
+|[basalt.getErrorManager](#basalt-geterrormanager)|table|Returns the error manager|
+|[basalt.getMainFrame](#basalt-getmainframe)|BaseFrame|Gets or creates the main frame|
+|[basalt.setActiveFrame](#basalt-setactiveframe-frame-setactive)|-|Sets the active frame|
+|[basalt.getActiveFrame](#basalt-getactiveframe-t)|BaseFrame|Returns the active frame|
+|[basalt.setFocus](#basalt-setfocus-frame)|-|Sets a frame as focused|
+|[basalt.getFocus](#basalt-getfocus)|BaseFrame|Returns the focused frame|
+|[basalt.schedule](#basalt-schedule-func)|thread|Schedules a function to run in a coroutine|
+|[basalt.removeSchedule](#basalt-removeschedule-func)|boolean|Removes a scheduled update|
+|[basalt.update](#basalt-update)|-|Runs basalt once|
+|[basalt.stop](#basalt-stop)|-|Stops the Basalt runtime|
+|[basalt.run](#basalt-run-isactive)|-|Starts the Basalt runtime|
+|[basalt.getElementClass](#basalt-getelementclass-name)|table|Returns an element class|
+|[basalt.getAPI](#basalt-getapi-name)|table|Returns a Plugin API|
+|[basalt.onEvent](#basalt-onevent-eventname-callback)|-|Registers an event callback|
+|[basalt.removeEvent](#basalt-removeevent-eventname-callback)|boolean|Removes an event callback|
+|[basalt.triggerEvent](#basalt-triggerevent-eventname)|-|Triggers a custom event|
## basalt.create(type, properties?)
+
Creates and returns a new UI element of the specified type.
### Parameters
@@ -55,83 +40,72 @@ Creates and returns a new UI element of the specified type.
* `table` `element` The created element instance
### Usage
- ```lua
+```lua
local button = basalt.create("Button")
```
## basalt.createFrame()
+
Creates and returns a new BaseFrame
### Returns
* `BaseFrame` `BaseFrame` The created frame instance
-## basalt.getAPI(name)
-Returns a Plugin API
-
-### Parameters
-* `name` `string` The name of the plugin
-
-### Returns
-* `table` `Plugin` The plugin API
-
-## basalt.getActiveFrame(t?)
-Returns the active frame
-
-### Parameters
-* `t` *(optional)* `term` The term to get the active frame for (default: current term)
-
-### Returns
-* `BaseFrame?` `BaseFrame` The frame to set as active
-
-## basalt.getElementClass(name)
-Returns an element's class without creating a instance
-
-### Parameters
-* `name` `string` The name of the element
-
-### Returns
-* `table` `Element` The element class
-
## basalt.getElementManager()
+
Returns the element manager instance
### Returns
* `table` `ElementManager` The element manager
## basalt.getErrorManager()
+
Returns the error manager instance
### Returns
* `table` `ErrorManager` The error manager
-## basalt.getFocus()
-Returns the focused frame
-
-### Returns
-* `BaseFrame?` `BaseFrame` The focused frame
-
## basalt.getMainFrame()
+
Gets or creates the main frame
### Returns
* `BaseFrame` `BaseFrame` The main frame instance
-## basalt.removeSchedule(func)
-Removes a scheduled update
+## basalt.setActiveFrame(frame, setActive?)
+
+Sets the active frame
### Parameters
-* `func` `thread` The scheduled function to remove
+* `frame` `BaseFrame` The frame to set as active
+* `setActive` *(optional)* `boolean` Whether to set the frame as active (default: true)
+
+## basalt.getActiveFrame(t?)
+
+Returns the active frame
+
+### Parameters
+* `t` *(optional)* `term` The term to get the active frame for (default: current term)
### Returns
-* `boolean` `success` Whether the scheduled function was removed
+* `BaseFrame` `The` frame to set as active
-## basalt.run(isActive?)
-Starts the Basalt runtime
+## basalt.setFocus(frame)
+
+Sets a frame as focused
### Parameters
-* `isActive` *(optional)* `boolean` Whether to start active (default: true)
+* `frame` `BaseFrame` The frame to set as focused
+
+## basalt.getFocus()
+
+Returns the focused frame
+
+### Returns
+* `BaseFrame` `The` focused frame
## basalt.schedule(func)
+
Schedules a function to run in a coroutine
### Parameters
@@ -140,26 +114,83 @@ Schedules a function to run in a coroutine
### Returns
* `thread` `func` The scheduled function
-## basalt.setActiveFrame(frame, setActive?)
-Sets the active frame
+## basalt.removeSchedule(func)
+
+Removes a scheduled update
### Parameters
-* `frame` `BaseFrame` The frame to set as active
-* `setActive` *(optional)* `boolean` Whether to set the frame as active (default: true)
+* `func` `thread` The scheduled function to remove
-## basalt.setFocus(frame)
-Sets a frame as focused
+### Returns
+* `boolean` `success` Whether the scheduled function was removed
-### Parameters
-* `frame` `BaseFrame` The frame to set as focused
+## basalt.update()
-## basalt.stop()
-Stops the Basalt runtime
-
-## basalt.update(...)
Runs basalt once, can be used to update the UI manually, but you have to feed it the events
+## basalt.stop()
+
+Stops the Basalt runtime
+
+## basalt.run(isActive?)
+
+Starts the Basalt runtime
+
### Parameters
-* `...` *(vararg)* `any` The event to run with
+* `isActive` *(optional)* `boolean` Whether to start active (default: true)
+## basalt.getElementClass(name)
+Returns an element's class without creating a instance
+
+### Parameters
+* `name` `string` The name of the element
+
+### Returns
+* `table` `Element` The element class
+
+## basalt.getAPI(name)
+
+Returns a Plugin API
+
+### Parameters
+* `name` `string` The name of the plugin
+
+### Returns
+* `table` `Plugin` The plugin API
+
+## basalt.onEvent(eventName, callback)
+
+Registers a callback function for a specific event
+
+### Parameters
+* `eventName` `string` The name of the event to listen for (e.g. "mouse_click", "key", "timer")
+* `callback` `function` The callback function to execute when the event occurs
+
+### Usage
+```lua
+basalt.onEvent("mouse_click", function(button, x, y) basalt.debug("Clicked at", x, y) end)
+```
+
+## basalt.removeEvent(eventName, callback)
+
+Removes a callback function for a specific event
+
+### Parameters
+* `eventName` `string` The name of the event
+* `callback` `function` The callback function to remove
+
+### Returns
+* `boolean` `success` Whether the callback was found and removed
+
+## basalt.triggerEvent(eventName)
+
+Triggers a custom event and calls all registered callbacks
+
+### Parameters
+* `eventName` `string` The name of the event to trigger
+
+### Usage
+```lua
+basalt.triggerEvent("custom_event", "data1", "data2")
+```
diff --git a/docs/references/plugins/animation.md b/docs/references/plugins/animation.md
index e69de29..ce2ce8a 100644
--- a/docs/references/plugins/animation.md
+++ b/docs/references/plugins/animation.md
@@ -0,0 +1,185 @@
+# AnimationInstance
+_This is the AnimationInstance class. It represents a single animation instance_
+
+## Functions
+
+|Method|Returns|Description|
+|---|---|---|
+|[AnimationInstance.new](#animationinstance-new-element-animtype-args-duration-easing)|AnimationInstance|Creates a new animation instance|
+|[AnimationInstance:start](#animationinstance-start)|AnimationInstance|Starts the animation|
+|[AnimationInstance:update](#animationinstance-update-elapsed)|boolean|Updates the animation|
+|[AnimationInstance:complete](#animationinstance-complete)|-|Called when the animation is completed|
+
+## AnimationInstance.new(element, animType, args, duration, easing)
+
+Creates a new AnimationInstance
+
+### Parameters
+* `element` `VisualElement` The element to animate
+* `animType` `string` The type of animation
+* `args` `table` The animation arguments
+* `duration` `number` Duration in seconds
+* `easing` `string` The easing function name
+
+### Returns
+* `AnimationInstance` `The` new animation instance
+
+## AnimationInstance:start()
+
+Starts the animation
+
+### Returns
+* `AnimationInstance` `self` The animation instance
+
+## AnimationInstance:update(elapsed)
+
+Updates the animation
+
+### Parameters
+* `elapsed` `number` The elapsed time in seconds
+
+### Returns
+* `boolean` `Whether` the animation is finished
+
+## AnimationInstance:complete()
+
+Gets called when the animation is completed
+
+# Animation
+_This is the animation plugin. It provides a animation system for visual elements
+with support for sequences, easing functions, and multiple animation types._
+
+## Functions
+
+|Method|Returns|Description|
+|---|---|---|
+|[Animation.registerAnimation](#animation-registeranimation-name-handlers)|-|Registers a custom animation type|
+|[Animation.registerEasing](#animation-registereasing-name-func)|-|Adds a custom easing function|
+|[Animation.new](#animation-new-element)|Animation|Creates a new animation|
+|[Animation:sequence](#animation-sequence)|Animation|Creates a new sequence|
+|[Animation:onStart](#animation-onstart-callback)|-|Registers a callback for the start event|
+|[Animation:onUpdate](#animation-onupdate-callback)|Animation|Registers a callback for the update event|
+|[Animation:onComplete](#animation-oncomplete-callback)|Animation|Registers a callback for the complete event|
+|[Animation:addAnimation](#animation-addanimation-type-args-duration-easing)|-|Adds a new animation to the sequence|
+|[Animation:start](#animation-start)|Animation|Starts the animation|
+|[Animation:event](#animation-event-event-timerid)|-|The event handler for the animation|
+|[Animation:stop](#animation-stop)|-|Stops the animation|
+
+## Animation.registerAnimation(name, handlers)
+
+Registers a new animation type
+
+### Parameters
+* `name` `string` The name of the animation
+* `handlers` `table` Table containing start, update and complete handlers
+
+### Usage
+```lua
+Animation.registerAnimation("fade", {start=function(anim) end, update=function(anim,progress) end})
+```
+
+## Animation.registerEasing(name, func)
+
+Registers a new easing function
+
+### Parameters
+* `name` `string` The name of the easing function
+* `func` `function` The easing function (takes progress 0-1, returns modified progress)
+
+## Animation.new(element)
+
+Creates a new Animation
+
+### Parameters
+* `element` `VisualElement` The element to animate
+
+### Returns
+* `Animation` `The` new animation
+
+## Animation:sequence()
+
+Creates a new sequence
+
+### Returns
+* `Animation` `self` The animation instance
+
+## Animation:onStart(callback)
+
+Registers a callback for the start event
+
+### Parameters
+* `callback` `function` The callback function to register
+
+## Animation:onUpdate(callback)
+
+Registers a callback for the update event
+
+### Parameters
+* `callback` `function` The callback function to register
+
+### Returns
+* `Animation` `self` The animation instance
+
+## Animation:onComplete(callback)
+
+Registers a callback for the complete event
+
+### Parameters
+* `callback` `function` The callback function to register
+
+### Returns
+* `Animation` `self` The animation instance
+
+## Animation:addAnimation(type, args, duration, easing)
+
+Adds a new animation to the sequence
+
+### Parameters
+* `type` `string` The type of animation
+* `args` `table` The animation arguments
+* `duration` `number` The duration in seconds
+* `easing` `string` The easing function name
+
+## Animation:start()
+
+Starts the animation
+
+### Returns
+* `Animation` `self` The animation instance
+
+## Animation:event(event, timerId)
+
+The event handler for the animation (listens to timer events)
+
+### Parameters
+* `event` `string` The event type
+* `timerId` `number` The timer ID
+
+## Animation:stop()
+
+Stops the animation immediately: cancels timers, completes running anim instances and clears the element property
+
+# VisualElement
+_Adds additional methods for VisualElement when adding animation plugin_
+
+## Functions
+
+|Method|Returns|Description|
+|---|---|---|
+|[VisualElement.hooks](#visualelement-hooks)|-||
+|[VisualElement.setup](#visualelement-setup)|-||
+|[VisualElement.stopAnimation](#visualelement-stopanimation)|-|Convenience to stop animations from the element|
+|[VisualElement:animate](#visualelement-animate)|Animation|Creates a new animation|
+
+## VisualElement.hooks()
+## VisualElement.setup()
+## VisualElement.stopAnimation()
+
+Convenience to stop animations from the element
+
+## VisualElement:animate()
+
+Creates a new Animation Object
+
+### Returns
+* `Animation` `animation` The new animation
diff --git a/docs/references/plugins/benchmark.md b/docs/references/plugins/benchmark.md
index d28c6a9..fc1a4a0 100644
--- a/docs/references/plugins/benchmark.md
+++ b/docs/references/plugins/benchmark.md
@@ -1,48 +1,175 @@
-# Benchmark
-This is the benchmark plugin. It provides performance measurement tools for elements and methods,
-with support for hierarchical profiling and detailed statistics. The plugin is meant to be used for very big projects
-where performance is critical. It allows you to measure the time taken by specific methods and log the results.
+# BaseElement
## Functions
|Method|Returns|Description|
|---|---|---|
-|[API.clear](#api-clear)|-|Removes a benchmark's data
-|[API.clearAll](#api-clearall)|-|Removes all custom benchmark data
-|[API.getStats](#api-getstats)|table?|Retrieves benchmark statistics
-|[API.start](#api-start)|-|Starts timing a custom operation
-|[API.stop](#api-stop)|-|Stops timing and logs results
+|[BaseElement:startProfile](#baseelement-startprofile-methodname)|BaseElement|Starts timing a method call|
+|[BaseElement:endProfile](#baseelement-endprofile-methodname)|BaseElement|Ends timing a method call and records statistics|
+|[BaseElement:benchmark](#baseelement-benchmark-methodname)|BaseElement|Enables performance measurement for a method|
+|[BaseElement:logBenchmark](#baseelement-logbenchmark-methodname)|BaseElement|Logs benchmark statistics for a method|
+|[BaseElement:stopBenchmark](#baseelement-stopbenchmark-methodname)|BaseElement|Disables performance measurement for a method|
+|[BaseElement:getBenchmarkStats](#baseelement-getbenchmarkstats-methodname)|stats|Retrieves benchmark statistics for a method|
+## BaseElement:startProfile(methodName)
-## API.clear(name)
-Clears a specific benchmark
+Starts profiling a method
### Parameters
-* `name` `string` The name of the benchmark to clear
-
-## API.clearAll()
-Clears all custom benchmarks
-
-## API.getStats(name)
-Gets statistics for a benchmark
-
-### Parameters
-* `name` `string` The name of the benchmark
+* `methodName` `string` The name of the method to profile
### Returns
-* `table?` `stats` The benchmark statistics or nil
+* `BaseElement` `self` The element instance
+
+## BaseElement:endProfile(methodName)
+
+Ends profiling a method
+
+### Parameters
+* `methodName` `string` The name of the method to stop profiling
+
+### Returns
+* `BaseElement` `self` The element instance
+
+## BaseElement:benchmark(methodName)
+
+Enables benchmarking for a method
+
+### Parameters
+* `methodName` `string` The name of the method to benchmark
+
+### Returns
+* `BaseElement` `self` The element instance
+
+### Usage
+```lua
+element:benchmark("render")
+```
+
+## BaseElement:logBenchmark(methodName)
+
+Logs benchmark statistics for a method
+
+### Parameters
+* `methodName` `string` The name of the method to log
+
+### Returns
+* `BaseElement` `self` The element instance
+
+## BaseElement:stopBenchmark(methodName)
+
+Stops benchmarking for a method
+
+### Parameters
+* `methodName` `string` The name of the method to stop benchmarking
+
+### Returns
+* `BaseElement` `self` The element instance
+
+## BaseElement:getBenchmarkStats(methodName)
+
+Gets benchmark statistics for a method
+
+### Parameters
+* `methodName` `string` The name of the method to get statistics for
+
+### Returns
+* `stats` `The` benchmark statistics or nil
+
+# Container
+
+Extends: `VisualElement`
+
+## Functions
+
+|Method|Returns|Description|
+|---|---|---|
+|[Container:benchmarkContainer](#container-benchmarkcontainer-methodname)|Container|Recursively enables benchmarking|
+|[Container:logContainerBenchmarks](#container-logcontainerbenchmarks-methodname)|Container|Recursively logs benchmark statistics|
+|[Container:stopContainerBenchmark](#container-stopcontainerbenchmark-methodname)|Container|Recursively stops benchmarking|
+
+## Container:benchmarkContainer(methodName)
+
+Enables benchmarking for a container and all its children
+
+### Parameters
+* `methodName` `string` The method to benchmark
+
+### Returns
+* `Container` `self` The container instance
+
+### Usage
+```lua
+container:benchmarkContainer("render")
+```
+
+## Container:logContainerBenchmarks(methodName)
+
+Logs benchmark statistics for a container and all its children
+
+### Parameters
+* `methodName` `string` The method to log
+
+### Returns
+* `Container` `self` The container instance
+
+## Container:stopContainerBenchmark(methodName)
+
+Stops benchmarking for a container and all its children
+
+### Parameters
+* `methodName` `string` The method to stop benchmarking
+
+### Returns
+* `Container` `self` The container instance
+
+# Benchmark
+_This is the benchmark plugin. It provides performance measurement tools for elements and methods,
+with support for hierarchical profiling and detailed statistics. The plugin is meant to be used for very big projects
+where performance is critical. It allows you to measure the time taken by specific methods and log the results._
+
+## Functions
+
+|Method|Returns|Description|
+|---|---|---|
+|[Benchmark.start](#benchmark-start-name-options)|-|Starts timing a custom operation|
+|[Benchmark.stop](#benchmark-stop-name)|-|Stops timing and logs results|
+|[Benchmark.getStats](#benchmark-getstats-name)|stats|Retrieves benchmark statistics|
+|[Benchmark.clear](#benchmark-clear-name)|-|Removes a benchmark's data|
+|[Benchmark.clearAll](#benchmark-clearall)|-|Removes all custom benchmark data|
+
+## Benchmark.start(name, options?)
-## API.start(name, options?)
Starts a custom benchmark
### Parameters
* `name` `string` The name of the benchmark
* `options` *(optional)* `table` Optional configuration
-## API.stop(name)
+## Benchmark.stop(name)
+
Stops a custom benchmark
### Parameters
* `name` `string` The name of the benchmark to stop
+## Benchmark.getStats(name)
+Gets statistics for a benchmark
+
+### Parameters
+* `name` `string` The name of the benchmark
+
+### Returns
+* `stats` `The` benchmark statistics or nil
+
+## Benchmark.clear(name)
+
+Clears a specific benchmark
+
+### Parameters
+* `name` `string` The name of the benchmark to clear
+
+## Benchmark.clearAll()
+
+Clears all custom benchmarks
diff --git a/docs/references/plugins/canvas.md b/docs/references/plugins/canvas.md
index e69de29..84c33e9 100644
--- a/docs/references/plugins/canvas.md
+++ b/docs/references/plugins/canvas.md
@@ -0,0 +1 @@
+!! EMPTY MARKDOWN GENERATED !!
diff --git a/docs/references/plugins/debug.md b/docs/references/plugins/debug.md
index 5713bae..9544a62 100644
--- a/docs/references/plugins/debug.md
+++ b/docs/references/plugins/debug.md
@@ -1,15 +1,15 @@
# BaseElement
-No Description
+_No Description_
## Functions
|Method|Returns|Description|
|---|---|---|
-|[BaseElement.debug](#baseelement-debug)|-|Enables debugging for this element
-|[BaseElement.dumpDebug](#baseelement-dumpdebug)|-|Dumps debug information
-
+|[BaseElement.debug](#baseelement-debug-self-level)|-|Enables debugging for this element|
+|[BaseElement.dumpDebug](#baseelement-dumpdebug-self)|-|Dumps debug information|
## BaseElement.debug(self, level)
+
Enables debugging for this element
### Parameters
@@ -17,62 +17,55 @@ Enables debugging for this element
* `level` `number` The debug level
## BaseElement.dumpDebug(self)
+
Dumps debug information for this element
### Parameters
* `self` `BaseElement` The element to dump debug info for
-
----
-
-
# BaseFrame
## Functions
|Method|Returns|Description|
|---|---|---|
-|[BaseFrame.closeConsole](#baseframe-closeconsole)|-|Hides the debug log frame
-|[BaseFrame.openConsole](#baseframe-openconsole)|-|Shows the debug log frame
-|[BaseFrame.toggleConsole](#baseframe-toggleconsole)|-|Toggles the debug log frame
-
-
-## BaseFrame.closeConsole(self)
-Hides the debug log frame
-
-### Parameters
-* `self` `BaseFrame` The frame to hide debug log for
+|[BaseFrame.openConsole](#baseframe-openconsole-self)|-|Shows the debug log frame|
+|[BaseFrame.closeConsole](#baseframe-closeconsole-self)|-|Hides the debug log frame|
+|[BaseFrame.toggleConsole](#baseframe-toggleconsole-self)|-|Toggles the debug log frame|
## BaseFrame.openConsole(self)
+
Shows the debug log frame
### Parameters
* `self` `BaseFrame` The frame to show debug log in
+## BaseFrame.closeConsole(self)
+
+Hides the debug log frame
+
+### Parameters
+* `self` `BaseFrame` The frame to hide debug log for
+
## BaseFrame.toggleConsole(self)
+
Toggles the debug log frame
### Parameters
* `self` `BaseFrame` The frame to toggle debug log for
-
----
-
-
# Container
## Functions
|Method|Returns|Description|
|---|---|---|
-|[Container.debugChildren](#container-debugchildren)|-|Debug container and children
-
+|[Container.debugChildren](#container-debugchildren-self-level)|-|Debug container and children|
## Container.debugChildren(self, level)
+
Enables debugging for this container and all its children
### Parameters
* `self` `Container` The container to debug
* `level` `number` The debug level
-
-
diff --git a/docs/references/plugins/reactive.md b/docs/references/plugins/reactive.md
index 637d74c..6f50d0a 100644
--- a/docs/references/plugins/reactive.md
+++ b/docs/references/plugins/reactive.md
@@ -1,15 +1,3 @@
# Reactive
-This module provides reactive functionality for elements, it adds no new functionality for elements.
-It is used to evaluate expressions in property values and update the element when the expression changes.
-
-### Usage
- ```lua
-local button = main:addButton({text="Exit"})
-button:setX("{parent.x - 12}")
-button:setBackground("{self.clicked and colors.red or colors.green}")
-button:setWidth("{self.text:len() + 2}")
-```
-
-
-
-
+_This module provides reactive functionality for elements, it adds no new functionality for elements.
+It is used to evaluate expressions in property values and update the element when the expression changes._
diff --git a/docs/references/plugins/state.md b/docs/references/plugins/state.md
index 006b50a..3ec0e00 100644
--- a/docs/references/plugins/state.md
+++ b/docs/references/plugins/state.md
@@ -1,92 +1,15 @@
-# BaseElement
-This is the state plugin. It provides a state management system for UI elements with support for
-persistent states, computed states, and state sharing between elements.
+# BaseFrame
+
+Extends: `Container`
## Functions
|Method|Returns|Description|
|---|---|---|
-|[BaseElement:bind](#baseelement-bind)|BaseElement|
-|[BaseElement:computed](#baseelement-computed)|-|
-|[BaseElement:getState](#baseelement-getstate)|any|Gets a state value
-|[BaseElement:onStateChange](#baseelement-onstatechange)|BaseElement|Watches for state changes
-|[BaseElement:removeStateChange](#baseelement-removestatechange)|BaseElement|Removes a state change observer
-|[BaseElement:setState](#baseelement-setstate)|BaseElement|Sets a state value
-
-
-## BaseElement:bind(self, propertyName, stateName)
-Binds a property to a state
-
-### Parameters
-* `self` `BaseElement` The element to bind
-* `propertyName` `string` The property to bind
-* `stateName` `string` The state to bind to (optional, uses propertyName if not provided)
-
-### Returns
-* `BaseElement` `self` The element instance
-
-## BaseElement:computed()
-
-## BaseElement:getState(self, name)
-Gets the value of a state
-
-### Parameters
-* `self` `BaseElement` The element to get state from
-* `name` `string` The name of the state
-
-### Returns
-* `any` `value` The current state value
-
-## BaseElement:onStateChange(self, stateName, callback)
-Registers a callback for state changes
-
-### Parameters
-* `self` `BaseElement` The element to watch
-* `stateName` `string` The state to watch
-* `callback` `function` Called with (element, newValue, oldValue)
-
-### Returns
-* `BaseElement` `self` The element instance
-
-## BaseElement:removeStateChange(self, stateName, callback)
-Removes a state change observer
-
-### Parameters
-* `self` `BaseElement` The element to remove observer from
-* `stateName` `string` The state to remove observer from
-* `callback` `function` The callback function to remove
-
-### Returns
-* `BaseElement` `self` The element instance
-
-## BaseElement:setState(self, name, value)
-Sets the value of a state
-
-### Parameters
-* `self` `BaseElement` The element to set state for
-* `name` `string` The name of the state
-* `value` `any` The new value for the state
-
-### Returns
-* `BaseElement` `self` The element instance
-
-
----
-
-
-# BaseFrame : Container
-
-## Functions
-
-|Method|Returns|Description|
-|---|---|---|
-|[BaseFrame.setup](#baseframe-setup)|-|
-|[BaseFrame:initializeState](#baseframe-initializestate)|BaseFrame|Initializes a new state
-
-
-## BaseFrame.setup()
+|[BaseFrame:initializeState](#baseframe-initializestate-self-name-default-persist-path)|BaseFrame|Initializes a new state|
## BaseFrame:initializeState(self, name, default, persist?, path?)
+
Initializes a new state for this element
### Parameters
@@ -99,4 +22,75 @@ Initializes a new state for this element
### Returns
* `BaseFrame` `self` The element instance
+# BaseElement
+_This is the state plugin. It provides a state management system for UI elements with support for
+persistent states, computed states, and state sharing between elements._
+## Functions
+
+|Method|Returns|Description|
+|---|---|---|
+|[BaseElement:setState](#baseelement-setstate-self-name-value)|BaseElement|Sets a state value|
+|[BaseElement:getState](#baseelement-getstate-self-name)|any|Gets a state value|
+|[BaseElement:onStateChange](#baseelement-onstatechange-self-statename-callback)|BaseElement|Watches for state changes|
+|[BaseElement:removeStateChange](#baseelement-removestatechange-self-statename-callback)|BaseElement|Removes a state change observer|
+|[BaseElement:bind](#baseelement-bind-self-propertyname-statename)|BaseElement|Binds a property to a state|
+
+## BaseElement:setState(self, name, value)
+
+Sets the value of a state
+
+### Parameters
+* `self` `BaseElement` The element to set state for
+* `name` `string` The name of the state
+* `value` `any` The new value for the state
+
+### Returns
+* `BaseElement` `self` The element instance
+
+## BaseElement:getState(self, name)
+
+Gets the value of a state
+
+### Parameters
+* `self` `BaseElement` The element to get state from
+* `name` `string` The name of the state
+
+### Returns
+* `any` `value` The current state value
+
+## BaseElement:onStateChange(self, stateName, callback)
+
+Registers a callback for state changes
+
+### Parameters
+* `self` `BaseElement` The element to watch
+* `stateName` `string` The state to watch
+* `callback` `function` Called with (element, newValue, oldValue)
+
+### Returns
+* `BaseElement` `self` The element instance
+
+## BaseElement:removeStateChange(self, stateName, callback)
+
+Removes a state change observer
+
+### Parameters
+* `self` `BaseElement` The element to remove observer from
+* `stateName` `string` The state to remove observer from
+* `callback` `function` The callback function to remove
+
+### Returns
+* `BaseElement` `self` The element instance
+
+## BaseElement:bind(self, propertyName, stateName)
+
+Binds a property to a state
+
+### Parameters
+* `self` `BaseElement` The element to bind
+* `propertyName` `string` The property to bind
+* `stateName` `string` The state to bind to (optional, uses propertyName if not provided)
+
+### Returns
+* `BaseElement` `self` The element instance
diff --git a/docs/references/plugins/theme.md b/docs/references/plugins/theme.md
index a53f364..bb80ffc 100644
--- a/docs/references/plugins/theme.md
+++ b/docs/references/plugins/theme.md
@@ -1,26 +1,29 @@
# BaseElement
-This is the theme plugin. It provides a theming system that allows for consistent styling across elements
-with support for inheritance, named styles, and dynamic theme switching.
+_This is the theme plugin. It provides a theming system that allows for consistent styling across elements
+with support for inheritance, named styles, and dynamic theme switching._
## Functions
|Method|Returns|Description|
|---|---|---|
-|[BaseElement:applyTheme](#baseelement-applytheme)|BaseElement|Applies theme styles to the element
-|[BaseElement:getTheme](#baseelement-gettheme)|table|Gets theme properties for the element
-
+|[BaseElement.____getElementPath](#baseelement-----getelementpath)|-||
+|[BaseElement:applyTheme](#baseelement-applytheme-self-applytochildren)|BaseElement|Applies theme styles to the element|
+|[BaseElement:getTheme](#baseelement-gettheme-self)|table|Gets theme properties for the element|
+## BaseElement.____getElementPath()
## BaseElement:applyTheme(self, applyToChildren)
+
Applies the current theme to this element
### Parameters
* `self` `BaseElement` The element to apply theme to
-* `applyToChildren` `boolean?` Whether to apply theme to child elements (default: true)
+* `applyToChildren` `boolean` ? Whether to apply theme to child elements (default: true)
### Returns
* `BaseElement` `self` The element instance
## BaseElement:getTheme(self)
+
Gets the theme properties for this element
### Parameters
@@ -29,38 +32,34 @@ Gets the theme properties for this element
### Returns
* `table` `styles` The theme properties
-
----
-
-
# ThemeAPI
-The Theme API provides methods for managing themes globally
+_The Theme API provides methods for managing themes globally_
## Functions
|Method|Returns|Description|
|---|---|---|
-|[ThemeAPI.getTheme](#themeapi-gettheme)|table|Gets the current theme
-|[ThemeAPI.loadTheme](#themeapi-loadtheme)|-|Loads theme from JSON file
-|[ThemeAPI.setTheme](#themeapi-settheme)|-|Sets a new theme
+|[ThemeAPI.setTheme](#themeapi-settheme-newtheme)|-|Sets a new theme|
+|[ThemeAPI.getTheme](#themeapi-gettheme)|table|Gets the current theme|
+|[ThemeAPI.loadTheme](#themeapi-loadtheme-path)|-|Loads theme from JSON file|
+## ThemeAPI.setTheme(newTheme)
+
+Sets the current theme
+
+### Parameters
+* `newTheme` `table` The theme configuration to set
## ThemeAPI.getTheme()
+
Gets the current theme configuration
### Returns
* `table` `theme` The current theme configuration
## ThemeAPI.loadTheme(path)
+
Loads a theme from a JSON file
### Parameters
* `path` `string` Path to the theme JSON file
-
-## ThemeAPI.setTheme(newTheme)
-Sets the current theme
-
-### Parameters
-* `newTheme` `table` The theme configuration to set
-
-
diff --git a/docs/references/plugins/xml.md b/docs/references/plugins/xml.md
index e69de29..84c33e9 100644
--- a/docs/references/plugins/xml.md
+++ b/docs/references/plugins/xml.md
@@ -0,0 +1 @@
+!! EMPTY MARKDOWN GENERATED !!
diff --git a/docs/references/propertySystem.md b/docs/references/propertySystem.md
index b97c02e..5780b69 100644
--- a/docs/references/propertySystem.md
+++ b/docs/references/propertySystem.md
@@ -1,43 +1,51 @@
# PropertySystem
-PropertySystem is a class that allows Elements to have properties that can be observed and updated.
-It also allows for properties to have custom getters and setters. This is the base system for all Elements.
-
-## Fields
-
-|Field|Type|Description|
-|---|---|---|
-|_properties|`table`|A table containing all property configurations|
-|_values|`table`|A table containing all property values|
-|_observers|`table`|A table containing all property observers|
-|set|`function`|A function to set a property value|
-|get|`function`|A function to get a property value|
+_PropertySystem is a class that allows Elements to have properties that can be observed and updated.
+It also allows for properties to have custom getters and setters. This is the base system for all Elements._
## Functions
|Method|Returns|Description|
|---|---|---|
-|[PropertySystem.addSetterHook](#propertysystem-addsetterhook)|-|Adds a setter hook to the PropertySystem
-|[PropertySystem.blueprint](#propertysystem-blueprint)|table|Creates a blueprint of an element class
-|[PropertySystem.combineProperties](#propertysystem-combineproperties)|-|Combines multiple properties
-|[PropertySystem.createFromBlueprint](#propertysystem-createfromblueprint)|table|Creates an element from a blueprint
-|[PropertySystem.defineProperty](#propertysystem-defineproperty)|-|Defines a property for an element class
-|[PropertySystem:__init](#propertysystem-__init)|table|Initializes the PropertySystem
-|[PropertySystem:_updateProperty](#propertysystem-_updateproperty)|table|Update call for a property
-|[PropertySystem:getPropertyConfig](#propertysystem-getpropertyconfig)|table|Gets a property configuration
-|[PropertySystem:instanceProperty](#propertysystem-instanceproperty)|table|Adds a property to the PropertySystem on instance level
-|[PropertySystem:observe](#propertysystem-observe)|table|Observers a property
-|[PropertySystem:removeAllObservers](#propertysystem-removeallobservers)|table|Removes all observers from a property
-|[PropertySystem:removeObserver](#propertysystem-removeobserver)|table|Removes an observer from a property
-|[PropertySystem:removeProperty](#propertysystem-removeproperty)|table|Removes a property from the PropertySystem
-
+|[PropertySystem.addSetterHook](#propertysystem-addsetterhook-hook)|-|Adds a setter hook to the PropertySystem|
+|[PropertySystem.defineProperty](#propertysystem-defineproperty-class-name-config)|-|Defines a property for an element class|
+|[PropertySystem.combineProperties](#propertysystem-combineproperties-class-name)|-|Combines multiple properties|
+|[PropertySystem.blueprint](#propertysystem-blueprint-elementclass)|table|Creates a blueprint of an element class|
+|[PropertySystem.createFromBlueprint](#propertysystem-createfromblueprint-elementclass-blueprint)|table|Creates an element from a blueprint|
+|[PropertySystem:__init](#propertysystem---init)|table|Initializes the PropertySystem|
+|[PropertySystem:_updateProperty](#propertysystem--updateproperty-name-value)|table|Update call for a property|
+|[PropertySystem:observe](#propertysystem-observe-name-callback)|table|Observers a property|
+|[PropertySystem:removeObserver](#propertysystem-removeobserver-name-callback)|table|Removes an observer from a property|
+|[PropertySystem:removeAllObservers](#propertysystem-removeallobservers-name)|table|Removes all observers from a property|
+|[PropertySystem:instanceProperty](#propertysystem-instanceproperty-name-config)|table|Adds a property to the PropertySystem on instance level|
+|[PropertySystem:removeProperty](#propertysystem-removeproperty-name)|table|Removes a property from the PropertySystem|
+|[PropertySystem:getPropertyConfig](#propertysystem-getpropertyconfig-name)|table|Gets a property configuration|
## PropertySystem.addSetterHook(hook)
+
Adds a setter hook to the PropertySystem. Setter hooks are functions that are called before a property is set.
### Parameters
* `hook` `function` The hook function to add
+## PropertySystem.defineProperty(class, name, config)
+
+Defines a property for an element class
+
+### Parameters
+* `class` `table` The element class to define the property for
+* `name` `string` The name of the property
+* `config` `table` The configuration of the property
+
+## PropertySystem.combineProperties(class, name)
+
+Combines multiple properties into a single getter and setter
+
+### Parameters
+* `class` `table` The element class to combine the properties for
+* `name` `string` The name of the combined property
+
## PropertySystem.blueprint(elementClass)
+
Creates a blueprint of an element class with all its properties
### Parameters
@@ -46,15 +54,8 @@ Creates a blueprint of an element class with all its properties
### Returns
* `table` `blueprint` A table containing all property definitions
-## PropertySystem.combineProperties(class, name...)
-Combines multiple properties into a single getter and setter
-
-### Parameters
-* `class` `table` The element class to combine the properties for
-* `name` `string` The name of the combined property
-* `...` *(vararg)* `string` The names of the properties to combine
-
## PropertySystem.createFromBlueprint(elementClass, blueprint)
+
Creates an element from a blueprint
### Parameters
@@ -64,21 +65,15 @@ Creates an element from a blueprint
### Returns
* `table` `element` The created element
-## PropertySystem.defineProperty(class, name, config)
-Defines a property for an element class
-
-### Parameters
-* `class` `table` The element class to define the property for
-* `name` `string` The name of the property
-* `config` `table` The configuration of the property
-
## PropertySystem:__init()
+
Initializes the PropertySystem IS USED INTERNALLY
### Returns
* `table` `self` The PropertySystem
## PropertySystem:_updateProperty(name, value)
+
Update call for a property IS USED INTERNALLY
### Parameters
@@ -88,26 +83,8 @@ Update call for a property IS USED INTERNALLY
### Returns
* `table` `self` The PropertySystem
-## PropertySystem:getPropertyConfig(name)
-Gets a property configuration
-
-### Parameters
-* `name` `string` The name of the property
-
-### Returns
-* `table` `config` The configuration of the property
-
-## PropertySystem:instanceProperty(name, config)
-Adds a property to the PropertySystem on instance level
-
-### Parameters
-* `name` `string` The name of the property
-* `config` `table` The configuration of the property
-
-### Returns
-* `table` `self` The PropertySystem
-
## PropertySystem:observe(name, callback)
+
Observers a property
### Parameters
@@ -117,16 +94,8 @@ Observers a property
### Returns
* `table` `self` The PropertySystem
-## PropertySystem:removeAllObservers(name)
-Removes all observers from a property
-
-### Parameters
-* `name` `string` The name of the property
-
-### Returns
-* `table` `self` The PropertySystem
-
## PropertySystem:removeObserver(name, callback)
+
Removes an observer from a property
### Parameters
@@ -136,7 +105,29 @@ Removes an observer from a property
### Returns
* `table` `self` The PropertySystem
+## PropertySystem:removeAllObservers(name?)
+
+Removes all observers from a property
+
+### Parameters
+* `name` *(optional)* `string` The name of the property
+
+### Returns
+* `table` `self` The PropertySystem
+
+## PropertySystem:instanceProperty(name, config)
+
+Adds a property to the PropertySystem on instance level
+
+### Parameters
+* `name` `string` The name of the property
+* `config` `table` The configuration of the property
+
+### Returns
+* `table` `self` The PropertySystem
+
## PropertySystem:removeProperty(name)
+
Removes a property from the PropertySystem on instance level
### Parameters
@@ -145,4 +136,12 @@ Removes a property from the PropertySystem on instance level
### Returns
* `table` `self` The PropertySystem
+## PropertySystem:getPropertyConfig(name)
+Gets a property configuration
+
+### Parameters
+* `name` `string` The name of the property
+
+### Returns
+* `table` `config` The configuration of the property
diff --git a/docs/references/render.md b/docs/references/render.md
index 1d587ea..7166136 100644
--- a/docs/references/render.md
+++ b/docs/references/render.md
@@ -1,55 +1,44 @@
# Render
-This is the render module for Basalt. It tries to mimic the functionality of the `term` API. but with additional
-functionality. It also has a buffer system to reduce the number of calls
-
-## Fields
-
-|Field|Type|Description|
-|---|---|---|
-|terminal|`table`|The terminal object to render to|
-|width|`number`|The width of the render|
-|height|`number`|The height of the render|
-|buffer|`table`|The buffer to render|
-|xCursor|`number`|The x position of the cursor|
-|yCursor|`number`|The y position of the cursor|
-|blink|`boolean`|Whether the cursor should blink|
+_This is the render module for Basalt. It tries to mimic the functionality of the `term` API. but with additional
+functionality. It also has a buffer system to reduce the number of calls_
## Functions
|Method|Returns|Description|
|---|---|---|
-|[Render.new](#render-new)|Render|
-|[Render:addDirtyRect](#render-adddirtyrect)|Render|
-|[Render:bg](#render-bg)|Render|
-|[Render:bg](#render-bg)|Render|
-|[Render:blit](#render-blit)|Render|
-|[Render:clear](#render-clear)|Render|
-|[Render:clearArea](#render-cleararea)|Render|
-|[Render:fg](#render-fg)|Render|
-|[Render:fg](#render-fg)|Render|
-|[Render:getSize](#render-getsize)|number,|
-|[Render:mergeRects](#render-mergerects)|Render|
-|[Render:multiBlit](#render-multiblit)|Render|
-|[Render:rectOverlaps](#render-rectoverlaps)|boolean|
-|[Render:render](#render-render)|Render|
-|[Render:setCursor](#render-setcursor)|Render|
-|[Render:setSize](#render-setsize)|Render|
-|[Render:text](#render-text)|Render|
-|[Render:text](#render-text)|Render|
-|[Render:textBg](#render-textbg)|Render|
-|[Render:textFg](#render-textfg)|Render|
-
+|[Render.new](#render-new-terminal)|Render|Creates a new Render object|
+|[Render:addDirtyRect](#render-adddirtyrect-x-y-width-height)|Render|Adds a dirty rectangle to the buffer|
+|[Render:blit](#render-blit-x-y-text-fg-bg)|Render|Blits text to the screen|
+|[Render:multiBlit](#render-multiblit-x-y-width-height-text-fg-bg)|Render|Blits text to the screen with multiple lines|
+|[Render:textFg](#render-textfg-x-y-text-fg)|Render|Blits text to the screen with a foreground color|
+|[Render:textBg](#render-textbg-x-y-text-bg)|Render|Blits text to the screen with a background color|
+|[Render:text](#render-text-x-y-text)|Render|Renders the text to the screen|
+|[Render:fg](#render-fg-x-y-fg)|Render|Blits a foreground color to the screen|
+|[Render:bg](#render-bg-x-y-bg)|Render|Blits a background color to the screen|
+|[Render:text](#render-text-x-y-text)|Render|Blits text to the screen|
+|[Render:fg](#render-fg-x-y-fg)|Render|Blits a foreground color to the screen|
+|[Render:bg](#render-bg-x-y-bg)|Render|Blits a background color to the screen|
+|[Render:clear](#render-clear-bg)|Render|Clears the screen|
+|[Render:render](#render-render)|Render|Renders the buffer to the screen|
+|[Render:rectOverlaps](#render-rectoverlaps-r1-r2)|boolean|Checks if two rectangles overlap|
+|[Render:mergeRects](#render-mergerects-target-source)|Render|Merges two rectangles|
+|[Render:setCursor](#render-setcursor-x-y-blink)|Render|Sets the cursor position|
+|[Render:clearArea](#render-cleararea-x-y-width-height-bg)|Render|Clears an area of the screen|
+|[Render:getSize](#render-getsize)|number|Gets the size of the render|
+|[Render:setSize](#render-setsize-width-height)|Render|Sets the size of the render|
## Render.new(terminal)
+
Creates a new Render object
### Parameters
* `terminal` `table` The terminal object to render to
### Returns
-* `nil` `nil` nil
+* `Render`
## Render:addDirtyRect(x, y, width, height)
+
Adds a dirty rectangle to the buffer
### Parameters
@@ -59,31 +48,10 @@ Adds a dirty rectangle to the buffer
* `height` `number` The height of the rectangle
### Returns
-* `nil` `nil` nil
-
-## Render:bg(x, y, bg)
-Blits a background color to the screen
-
-### Parameters
-* `x` `number` The x position
-* `y` `number` The y position
-* `bg` `string` The background color to blit
-
-### Returns
-* `nil` `nil` nil
-
-## Render:bg(x, y, bg)
-Blits a background color to the screen
-
-### Parameters
-* `x` `number` The x position
-* `y` `number` The y position
-* `bg` `string` The background color to blit
-
-### Returns
-* `nil` `nil` nil
+* `Render`
## Render:blit(x, y, text, fg, bg)
+
Blits text to the screen
### Parameters
@@ -94,69 +62,10 @@ Blits text to the screen
* `bg` `string` The background color of the text
### Returns
-* `nil` `nil` nil
-
-## Render:clear(bg)
-Clears the screen
-
-### Parameters
-* `bg` `colors` The background color to clear the screen with
-
-### Returns
-* `nil` `nil` nil
-
-## Render:clearArea(x, y, width, height, bg)
-Clears an area of the screen
-
-### Parameters
-* `x` `number` The x position of the area
-* `y` `number` The y position of the area
-* `width` `number` The width of the area
-* `height` `number` The height of the area
-* `bg` `colors` The background color to clear the area with
-
-### Returns
-* `nil` `nil` nil
-
-## Render:fg(x, y, fg)
-Blits a foreground color to the screen
-
-### Parameters
-* `x` `number` The x position
-* `y` `number` The y position
-* `fg` `string` The foreground color to blit
-
-### Returns
-* `nil` `nil` nil
-
-## Render:fg(x, y, fg)
-Blits a foreground color to the screen
-
-### Parameters
-* `x` `number` The x position
-* `y` `number` The y position
-* `fg` `string` The foreground color to blit
-
-### Returns
-* `nil` `nil` nil
-
-## Render:getSize()
-Gets the size of the render
-
-### Returns
-* `nil` `nil` nil
-
-## Render:mergeRects(target, source)
-Merges two rectangles
-
-### Parameters
-* `target` `table` The target rectangle
-* `source` `table` The source rectangle
-
-### Returns
-* `nil` `nil` nil
+* `Render`
## Render:multiBlit(x, y, width, height, text, fg, bg)
+
Blits text to the screen with multiple lines
### Parameters
@@ -169,80 +78,10 @@ Blits text to the screen with multiple lines
* `bg` `colors` The background color of the text
### Returns
-* `nil` `nil` nil
-
-## Render:rectOverlaps(r1, r2)
-Checks if two rectangles overlap
-
-### Parameters
-* `r1` `table` The first rectangle
-* `r2` `table` The second rectangle
-
-### Returns
-* `nil` `nil` nil
-
-## Render:render()
-Renders the buffer to the screen
-
-### Returns
-* `nil` `nil` nil
-
-## Render:setCursor(x, y, blink)
-Sets the cursor position
-
-### Parameters
-* `x` `number` The x position of the cursor
-* `y` `number` The y position of the cursor
-* `blink` `boolean` Whether the cursor should blink
-
-### Returns
-* `nil` `nil` nil
-
-## Render:setSize(width, height)
-Sets the size of the render
-
-### Parameters
-* `width` `number` The width of the render
-* `height` `number` The height of the render
-
-### Returns
-* `nil` `nil` nil
-
-## Render:text(x, y, text)
-Blits text to the screen
-
-### Parameters
-* `x` `number` The x position to blit to
-* `y` `number` The y position to blit to
-* `text` `string` The text to blit
-
-### Returns
-* `nil` `nil` nil
-
-## Render:text(x, y, text)
-Renders the text to the screen
-
-### Parameters
-* `x` `number` The x position to blit to
-* `y` `number` The y position to blit to
-* `text` `string` The text to blit
-
-### Returns
-* `nil` `nil` nil
-
-## Render:textBg(x, y, text, bg)
-Blits text to the screen with a background color
-
-### Parameters
-* `x` `number` The x position to blit to
-* `y` `number` The y position to blit to
-* `text` `string` The text to blit
-* `bg` `colors` The background color of the text
-
-### Returns
-* `nil` `nil` nil
+* `Render`
## Render:textFg(x, y, text, fg)
+
Blits text to the screen with a foreground color
### Parameters
@@ -252,6 +91,172 @@ Blits text to the screen with a foreground color
* `fg` `colors` The foreground color of the text
### Returns
-* `nil` `nil` nil
+* `Render`
+## Render:textBg(x, y, text, bg)
+Blits text to the screen with a background color
+
+### Parameters
+* `x` `number` The x position to blit to
+* `y` `number` The y position to blit to
+* `text` `string` The text to blit
+* `bg` `colors` The background color of the text
+
+### Returns
+* `Render`
+
+## Render:text(x, y, text)
+
+Renders the text to the screen
+
+### Parameters
+* `x` `number` The x position to blit to
+* `y` `number` The y position to blit to
+* `text` `string` The text to blit
+
+### Returns
+* `Render`
+
+## Render:fg(x, y, fg)
+
+Blits a foreground color to the screen
+
+### Parameters
+* `x` `number` The x position
+* `y` `number` The y position
+* `fg` `string` The foreground color to blit
+
+### Returns
+* `Render`
+
+## Render:bg(x, y, bg)
+
+Blits a background color to the screen
+
+### Parameters
+* `x` `number` The x position
+* `y` `number` The y position
+* `bg` `string` The background color to blit
+
+### Returns
+* `Render`
+
+## Render:text(x, y, text)
+
+Blits text to the screen
+
+### Parameters
+* `x` `number` The x position to blit to
+* `y` `number` The y position to blit to
+* `text` `string` The text to blit
+
+### Returns
+* `Render`
+
+## Render:fg(x, y, fg)
+
+Blits a foreground color to the screen
+
+### Parameters
+* `x` `number` The x position
+* `y` `number` The y position
+* `fg` `string` The foreground color to blit
+
+### Returns
+* `Render`
+
+## Render:bg(x, y, bg)
+
+Blits a background color to the screen
+
+### Parameters
+* `x` `number` The x position
+* `y` `number` The y position
+* `bg` `string` The background color to blit
+
+### Returns
+* `Render`
+
+## Render:clear(bg)
+
+Clears the screen
+
+### Parameters
+* `bg` `colors` The background color to clear the screen with
+
+### Returns
+* `Render`
+
+## Render:render()
+
+Renders the buffer to the screen
+
+### Returns
+* `Render`
+
+## Render:rectOverlaps(r1, r2)
+
+Checks if two rectangles overlap
+
+### Parameters
+* `r1` `table` The first rectangle
+* `r2` `table` The second rectangle
+
+### Returns
+* `boolean`
+
+## Render:mergeRects(target, source)
+
+Merges two rectangles
+
+### Parameters
+* `target` `table` The target rectangle
+* `source` `table` The source rectangle
+
+### Returns
+* `Render`
+
+## Render:setCursor(x, y, blink)
+
+Sets the cursor position
+
+### Parameters
+* `x` `number` The x position of the cursor
+* `y` `number` The y position of the cursor
+* `blink` `boolean` Whether the cursor should blink
+
+### Returns
+* `Render`
+
+## Render:clearArea(x, y, width, height, bg)
+
+Clears an area of the screen
+
+### Parameters
+* `x` `number` The x position of the area
+* `y` `number` The y position of the area
+* `width` `number` The width of the area
+* `height` `number` The height of the area
+* `bg` `colors` The background color to clear the area with
+
+### Returns
+* `Render`
+
+## Render:getSize()
+
+Gets the size of the render
+
+### Returns
+* `number`
+
+## Render:setSize(width, height)
+
+Sets the size of the render
+
+### Parameters
+* `width` `number` The width of the render
+* `height` `number` The height of the render
+
+### Returns
+* `Render`