-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbasaltLS.lua
More file actions
3665 lines (2983 loc) · 143 KB
/
Copy pathbasaltLS.lua
File metadata and controls
3665 lines (2983 loc) · 143 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
---@meta
---@class Display : VisualElement
local Display = {}
---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing.
---@protected
function Display:render() end
---Writes text to the display at the given position with the given foreground and background colors
---@param x number The x position to write to
---@param y number The y position to write to
---@param text string The text to write
---@return Display self The display instance
function Display:write(x, y, text) end
---Returns the current window object
---@return table window The current window object
function Display:getWindow() end
---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing.
---@param props table The properties to initialize the element with
---@param basalt table The basalt instance
---@protected
function Display:init(props, basalt) end
---@class ErrorHandler
local ErrorHandler = {}
---Handles an error
---@param errMsg string The error message
function errorHandler.error(errMsg) end
---@class BigFontText
local BigFontText = {}
---@class TextBox : VisualElement
---@field syntaxPatterns table Syntax highlighting patterns
---@field scrollX number Horizontal scroll offset
---@field cursorColor number Color of the cursor
---@field editable boolean Whether text can be edited
---@field lines table Array of text lines
---@field scrollY number Vertical scroll offset
---@field cursorX number Cursor X position
---@field cursorY number Cursor Y position (line number)
local TextBox = {}
---Sets the value of the Lines property.
---@param self TextBox self
---@param Lines table Array of text lines
function TextBox:setLines(self, Lines) end
---Adds a new syntax highlighting pattern
---@param pattern string The regex pattern to match
---@param color colors The color to apply
---@return TextBox self The TextBox instance
function TextBox:addSyntaxPattern(pattern, color) end
---Gets the value of the Lines property.
---@param self TextBox self
---@return table {} Array of text lines
function TextBox:getLines(self) end
---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing.
---@protected
function TextBox:render() end
---Sets the value of the CursorColor property.
---@param self TextBox self
---@param CursorColor number Color of the cursor
function TextBox:setCursorColor(self, CursorColor) end
---Sets the value of the CursorY property.
---@param self TextBox self
---@param CursorY number Cursor Y position (line number)
function TextBox:setCursorY(self, CursorY) end
---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing.
---@param key number The key that was pressed
---@return boolean handled Whether the event was handled
---@protected
function TextBox:key(key) end
---Gets the value of the CursorColor property.
---@param self TextBox self
---@return number nil Color of the cursor
function TextBox:getCursorColor(self) end
---Gets the value of the Editable property.
---@param self TextBox self
---@return boolean true Whether text can be edited
function TextBox:getEditable(self) end
---Gets the value of the SyntaxPatterns property.
---@param self TextBox self
---@return table {} Syntax highlighting patterns
function TextBox:getSyntaxPatterns(self) end
---Gets the text of the TextBox
---@return string text The text of the TextBox
function TextBox:getText() end
---Sets the value of the ScrollX property.
---@param self TextBox self
---@param ScrollX number Horizontal scroll offset
function TextBox:setScrollX(self, ScrollX) end
---Sets the value of the SyntaxPatterns property.
---@param self TextBox self
---@param SyntaxPatterns table Syntax highlighting patterns
function TextBox:setSyntaxPatterns(self, SyntaxPatterns) end
---Sets the text of the TextBox
---@param text string The text to set
---@return TextBox self The TextBox instance
function TextBox:setText(text) end
---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing.
---@param char string The character that was typed
---@return boolean handled Whether the event was handled
---@protected
function TextBox:char(char) end
---Sets the value of the CursorX property.
---@param self TextBox self
---@param CursorX number Cursor X position
function TextBox:setCursorX(self, CursorX) end
---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing.
---@protected
function TextBox:paste() end
---Gets the value of the CursorX property.
---@param self TextBox self
---@return number 1 Cursor X position
function TextBox:getCursorX(self) end
---Gets the value of the ScrollX property.
---@param self TextBox self
---@return number 0 Horizontal scroll offset
function TextBox:getScrollX(self) end
---Updates the viewport to keep the cursor in view
---@return TextBox self The TextBox instance
function TextBox:updateViewport() end
---Sets the value of the Editable property.
---@param self TextBox self
---@param Editable boolean Whether text can be edited
function TextBox:setEditable(self, Editable) end
---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing.
---@param button number The button that was clicked
---@param x number The x position of the click
---@param y number The y position of the click
---@return boolean handled Whether the event was handled
---@protected
function TextBox:mouse_click(button, x, y) end
---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing.
---@param direction number The scroll direction
---@param x number The x position of the scroll
---@param y number The y position of the scroll
---@return boolean handled Whether the event was handled
---@protected
function TextBox:mouse_scroll(direction, x, y) end
---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing.
---@param props table The properties to initialize the element with
---@param basalt table The basalt instance
---@return TextBox self The initialized instance
---@protected
function TextBox:init(props, basalt) end
---Sets the value of the ScrollY property.
---@param self TextBox self
---@param ScrollY number Vertical scroll offset
function TextBox:setScrollY(self, ScrollY) end
---Gets the value of the CursorY property.
---@param self TextBox self
---@return number 1 Cursor Y position (line number)
function TextBox:getCursorY(self) end
---Gets the value of the ScrollY property.
---@param self TextBox self
---@return number 0 Vertical scroll offset
function TextBox:getScrollY(self) end
---@class BarChart : Graph
local BarChart = {}
---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing.
---@param props table The properties to initialize the element with
---@param basalt table The basalt instance
---@return BarChart self The initialized instance
---@protected
function BarChart:init(props, basalt) end
---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing.
---@protected
function BarChart:render() end
---@class Table : VisualElement
---@field selectedRow number nil Currently selected row index
---@field headerColor color Color of the column headers
---@field sortColumn number nil Currently sorted column index
---@field sortDirection string Sort direction ("asc" or "desc")
---@field data table The table data as array of row arrays
---@field scrollOffset number Current scroll position
---@field gridColor color Color of grid lines
---@field selectedColor color Background color of selected row
---@field columns table List of column definitions with {name, width} properties
local Table = {}
---Adds a new column to the table
---@param name string The name of the column
---@param width number The width of the column
---@return Table self The Table instance
function Table:addColumn(name, width) end
---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing.
---@protected
function Table:render() end
---Gets the value of the SortColumn property.
---@param self Table self
---@return number ? nil Currently sorted column index
function Table:getSortColumn(self) end
---Sets the value of the SelectedColor property.
---@param self Table self
---@param SelectedColor color Background color of selected row
function Table:setSelectedColor(self, SelectedColor) end
---Adds a new row of data to the table
---@return Table self The Table instance
function Table:addData() end
---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing.
---@param props table The properties to initialize the element with
---@param basalt table The basalt instance
---@return Table self The initialized instance
---@protected
function Table:init(props, basalt) end
---Gets the value of the Columns property.
---@param self Table self
---@return table {} List of column definitions with {name, width} properties
function Table:getColumns(self) end
---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing.
---@param direction number The scroll direction (-1 up, 1 down)
---@param x number The x position of the scroll
---@param y number The y position of the scroll
---@return boolean handled Whether the event was handled
---@protected
function Table:mouse_scroll(direction, x, y) end
---Sets the value of the SortDirection property.
---@param self Table self
---@param SortDirection string Sort direction ("asc" or "desc")
function Table:setSortDirection(self, SortDirection) end
---Gets the value of the SelectedColor property.
---@param self Table self
---@return color lightBlue Background color of selected row
function Table:getSelectedColor(self) end
---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing.
---@param button number The button that was clicked
---@param x number The x position of the click
---@param y number The y position of the click
---@return boolean handled Whether the event was handled
---@protected
function Table:mouse_click(button, x, y) end
---Sets the value of the Data property.
---@param self Table self
---@param Data table The table data as array of row arrays
function Table:setData(self, Data) end
---Gets the value of the SelectedRow property.
---@param self Table self
---@return number ? nil Currently selected row index
function Table:getSelectedRow(self) end
---Sorts the table data by column
---@param columnIndex number The index of the column to sort by
---@param fn function ? Optional custom sorting function
---@return Table self The Table instance
function Table:sortData(columnIndex, fn) end
---Sets the value of the ScrollOffset property.
---@param self Table self
---@param ScrollOffset number Current scroll position
function Table:setScrollOffset(self, ScrollOffset) end
---Gets the value of the ScrollOffset property.
---@param self Table self
---@return number 0 Current scroll position
function Table:getScrollOffset(self) end
---Sets the value of the SortColumn property.
---@param self Table self
---@param SortColumn number nil Currently sorted column index
function Table:setSortColumn(self, SortColumn) end
---Sets the value of the HeaderColor property.
---@param self Table self
---@param HeaderColor color Color of the column headers
function Table:setHeaderColor(self, HeaderColor) end
---Gets the value of the SortDirection property.
---@param self Table self
---@return string "asc" Sort direction ("asc" or "desc")
function Table:getSortDirection(self) end
---Sets the value of the Columns property.
---@param self Table self
---@param Columns table List of column definitions with {name, width} properties
function Table:setColumns(self, Columns) end
---Gets the value of the Data property.
---@param self Table self
---@return table {} The table data as array of row arrays
function Table:getData(self) end
---Sets the value of the SelectedRow property.
---@param self Table self
---@param SelectedRow number nil Currently selected row index
function Table:setSelectedRow(self, SelectedRow) end
---Sets the value of the GridColor property.
---@param self Table self
---@param GridColor color Color of grid lines
function Table:setGridColor(self, GridColor) end
---Gets the value of the HeaderColor property.
---@param self Table self
---@return color blue Color of the column headers
function Table:getHeaderColor(self) end
---Gets the value of the GridColor property.
---@param self Table self
---@return color gray Color of grid lines
function Table:getGridColor(self) end
---@class Dropdown : List
---@field isOpen boolean Whether the dropdown menu is currently open
---@field selectedText string The text to show when no item is selected
---@field dropdownHeight number Maximum height of the dropdown menu when open
---@field dropSymbol string The symbol to show for dropdown indication
local Dropdown = {}
---Gets the value of the DropdownHeight property.
---@param self Dropdown self
---@return number 5 Maximum height of the dropdown menu when open
function Dropdown:getDropdownHeight(self) end
---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing.
---@param button number The button that was clicked
---@param x number The x position of the click
---@param y number The y position of the click
---@return boolean handled Whether the event was handled
---@protected
function Dropdown:mouse_click(button, x, y) end
---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing.
---@protected
function Dropdown:render() end
---Gets the value of the DropSymbol property.
---@param self Dropdown self
---@return string "\31" The symbol to show for dropdown indication
function Dropdown:getDropSymbol(self) end
---Sets the value of the DropdownHeight property.
---@param self Dropdown self
---@param DropdownHeight number Maximum height of the dropdown menu when open
function Dropdown:setDropdownHeight(self, DropdownHeight) end
---Sets the value of the SelectedText property.
---@param self Dropdown self
---@param SelectedText string The text to show when no item is selected
function Dropdown:setSelectedText(self, SelectedText) end
---Gets the value of the SelectedText property.
---@param self Dropdown self
---@return string "" The text to show when no item is selected
function Dropdown:getSelectedText(self) end
---Sets the value of the IsOpen property.
---@param self Dropdown self
---@param IsOpen boolean Whether the dropdown menu is currently open
function Dropdown:setIsOpen(self, IsOpen) end
---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing.
---@param props table The properties to initialize the element with
---@param basalt table The basalt instance
---@return Dropdown self The initialized instance
---@protected
function Dropdown:init(props, basalt) end
---Sets the value of the DropSymbol property.
---@param self Dropdown self
---@param DropSymbol string The symbol to show for dropdown indication
function Dropdown:setDropSymbol(self, DropSymbol) end
---Gets the value of the IsOpen property.
---@param self Dropdown self
---@return boolean false Whether the dropdown menu is currently open
function Dropdown:getIsOpen(self) end
---@class BaseElement : PropertySystem
---@field type string The type identifier of the element
---@field name string The name of the element
---@field eventCallbacks table The event callbacks for the element
---@field id string The unique identifier for the element
local BaseElement = {}
function BaseElement:computed() end
---Sets the value of the Id property.
---@param self BaseElement self
---@param Id string The unique identifier for the element
function BaseElement:setId(self, Id) end
---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing.
---@param event string The event to handle
---@return boolean ? handled Whether the event was handled
---@protected
function BaseElement:dispatchEvent(event) end
---Returns the base frame of the element
---@return BaseFrame BaseFrame The base frame of the element
function BaseElement:getBaseFrame() end
---Stops benchmarking for a method
---@param methodName string The name of the method to stop benchmarking
---@return BaseElement self The element instance
function BaseElement:stopBenchmark(methodName) end
---Sets the value of the EventCallbacks property.
---@param self BaseElement self
---@param EventCallbacks table The event callbacks for the element
function BaseElement:setEventCallbacks(self, EventCallbacks) end
---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing.
---@param event string The event to handle
---@return boolean ? handled Whether the event was handled
---@protected
function BaseElement:handleEvent(event) end
---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing.
---@return table self The BaseElement instance
---@protected
function BaseElement:postInit() end
---Checks if the element is a specific type
---@param type string The type to check for
---@return boolean isType Whether the element is of the specified type
function BaseElement:isType(type) end
---Gets the value of the EventCallbacks property.
---@param self BaseElement self
---@return table BaseElement The event callbacks for the element
function BaseElement:getEventCallbacks(self) end
---Enables or disables event listening for a specific event
---@param eventName string The name of the event to listen for
---@return table self The BaseElement instance
function BaseElement:listenEvent(eventName) end
---Logs benchmark statistics for a method
---@param methodName string The name of the method to log
---@return BaseElement self The element instance
function BaseElement:logBenchmark(methodName) end
---Observes a property and calls a callback when it changes
---@param property string The property to observe
---@param callback function The callback to call when the property changes
---@return table self The BaseElement instance
function BaseElement:onChange(property, callback) end
---Enables benchmarking for a method
---@param methodName string The name of the method to benchmark
---@return BaseElement self The element instance
function BaseElement:benchmark(methodName) end
---Gets the value of the Name property.
---@param self BaseElement self
---@return string BaseElement The name of the element
function BaseElement:getName(self) end
---Destroys the element and cleans up all references
function BaseElement:destroy() end
---Requests a render update for this element
---@return table self The BaseElement instance
function BaseElement:updateRender() end
---Registers a new event listener for the element (on class level)
---@param class table The class to register
---@param eventName string The name of the event to register
function BaseElement.defineEvent(class, eventName) end
---Applies the current theme to this element
---@param self BaseElement The element to apply theme to
---@param applyToChildren boolean ? Whether to apply theme to child elements (default: true)
---@return BaseElement self The element instance
function BaseElement:applyTheme(self, applyToChildren) end
---Gets the theme properties for this element
---@param self BaseElement The element to get theme for
---@return table styles The theme properties
function BaseElement:getTheme(self) end
---Binds a property to a state
---@param self BaseElement The element to bind
---@param propertyName string The property to bind
---@param stateName string The state to bind to (optional, uses propertyName if not provided)
---@return BaseElement self The element instance
function BaseElement:bind(self, propertyName, stateName) end
---Gets the value of the Id property.
---@param self BaseElement self
---@return string BaseElement The unique identifier for the element
function BaseElement:getId(self) end
---Dumps debug information for this element
---@param self BaseElement The element to dump debug info for
function BaseElement.dumpDebug(self) end
---Triggers an event and calls all registered callbacks
---@param event string The event to fire
---@return table self The BaseElement instance
function BaseElement:fireEvent(event) end
---Sets the value of the Type property.
---@param self BaseElement self
---@param Type string The type identifier of the element
function BaseElement:setType(self, Type) end
---Gets the value of the Type property.
---@param self BaseElement self
---@return string BaseElement The type identifier of the element
function BaseElement:getType(self) end
---Sets the value of the Name property.
---@param self BaseElement self
---@param Name string The name of the element
function BaseElement:setName(self, Name) end
---Registers a callback function for an event
---@param event string The event to register the callback for
---@param callback function The callback function to register
---@return table self The BaseElement instance
function BaseElement:registerCallback(event, callback) end
---Removes a state change observer
---@param self BaseElement The element to remove observer from
---@param stateName string The state to remove observer from
---@param callback function The callback function to remove
---@return BaseElement self The element instance
function BaseElement:removeStateChange(self, stateName, callback) end
---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing.
---@param props table The properties to initialize the element with
---@param basalt table The basalt instance
---@return table self The initialized instance
---@protected
function BaseElement:init(props, basalt) end
---Ends profiling a method
---@param methodName string The name of the method to stop profiling
---@return BaseElement self The element instance
function BaseElement:endProfile(methodName) end
---Gets benchmark statistics for a method
---@param methodName string The name of the method to get statistics for
---@return table ? stats The benchmark statistics or nil
function BaseElement:getBenchmarkStats(methodName) end
---Sets the value of a state
---@param self BaseElement The element to set state for
---@param name string The name of the state
---@param value any The new value for the state
---@return BaseElement self The element instance
function BaseElement:setState(self, name, value) end
---Starts profiling a method
---@param methodName string The name of the method to profile
---@return BaseElement self The element instance
function BaseElement:startProfile(methodName) end
---Enables debugging for this element
---@param self BaseElement The element to debug
---@param level number The debug level
function BaseElement.debug(self, level) end
---Gets the value of a state
---@param self BaseElement The element to get state from
---@param name string The name of the state
---@return any value The current state value
function BaseElement:getState(self, name) end
---Registers a callback for state changes
---@param self BaseElement The element to watch
---@param stateName string The state to watch
---@param callback function Called with (element, newValue, oldValue)
---@return BaseElement self The element instance
function BaseElement:onStateChange(self, stateName, callback) end
---Registers a new event callback for the element (on class level)
---@param class table The class to register
---@param callbackName string The name of the callback to register
function BaseElement.registerEventCallback(class, callbackName) end
---@class Switch : VisualElement
---@field checked boolean switch is checked
local Switch = {}
---Gets the value of the Checked property.
---@param self Switch self
---@return boolean Whether switch is checked
function Switch:getChecked(self) end
---Sets the value of the Checked property.
---@param self Switch self
---@param Checked boolean switch is checked
function Switch:setChecked(self, Checked) end
---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing.
---@param props table The properties to initialize the element with
---@param basalt table The basalt instance
---@protected
function Switch:init(props, basalt) end
---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing.
---@protected
function Switch:render() end
---@class Animation
local Animation = {}
---Registers a callback for the update event
---@param callback function The callback function to register
---@return Animation self The animation instance
function Animation:onUpdate(callback) end
---Registers a callback for the start event
---@param callback function The callback function to register
function Animation:onStart(callback) end
---Registers a new animation type
---@param name string The name of the animation
---@param handlers table Table containing start, update and complete handlers
function Animation.registerAnimation(name, handlers) end
---Starts the animation
---@return Animation self The animation instance
function Animation:start() end
---The event handler for the animation (listens to timer events)
---@param event string The event type
---@param timerId number The timer ID
function Animation:event(event, timerId) end
---Registers a new easing function
---@param name string The name of the easing function
---@param func function The easing function (takes progress 0-1, returns modified progress)
function Animation.registerEasing(name, func) end
---Registers a callback for the complete event
---@param callback function The callback function to register
---@return Animation self The animation instance
function Animation:onComplete(callback) end
---Creates a new sequence
---@return Animation self The animation instance
function Animation:sequence() end
---Adds a new animation to the sequence
---@param type string The type of animation
---@param args table The animation arguments
---@param duration number The duration in seconds
---@param easing string The easing function name
function Animation:addAnimation(type, args, duration, easing) end
---Creates a new Animation
---@param element VisualElement The element to animate
---@return Animation The new animation
function Animation.new(element) end
---@class Graph : VisualElement
---@field minValue number The minimum value of the graph
---@field maxValue number The maximum value of the graph
---@field series table The series of the graph
local Graph = {}
---@param name string The name of the series
---@param visible boolean Whether the series should be visible
---@return Graph self The graph instance
function Graph:changeSeriesVisibility(name, visible) end
---Clears all points from a series
---@return Graph self The graph instance
function Graph:clear() end
---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing.
---@protected
function Graph:render() end
---@param name string The name of the series
---@return table ? series The series
function Graph:getSeries(name) end
---@param name string The name of the series
---@param symbol string The symbol of the series
---@param bgCol number The background color of the series
---@param fgCol number The foreground color of the series
---@param pointCount number The number of points in the series
---@return Graph self The graph instance
function Graph:addSeries(name, symbol, bgCol, fgCol, pointCount) end
---Sets the value of the Series property.
---@param self Graph self
---@param Series table The series of the graph
function Graph:setSeries(self, Series) end
---@param name string The name of the series
---@param count number The number of points in the series
---@return Graph self The graph instance
function Graph:setSeriesPointCount(name, count) end
---@param name string The name of the series
---@return Graph self The graph instance
function Graph:focusSeries(name) end
---Gets the value of the MaxValue property.
---@param self Graph self
---@return number 100 The maximum value of the graph
function Graph:getMaxValue(self) end
---@param name string The name of the series
---@return Graph self The graph instance
function Graph:removeSeries(name) end
---Gets the value of the MinValue property.
---@param self Graph self
---@return number 0 The minimum value of the graph
function Graph:getMinValue(self) end
---Sets the value of the MaxValue property.
---@param self Graph self
---@param MaxValue number The maximum value of the graph
function Graph:setMaxValue(self, MaxValue) end
---@param name string The name of the series
---@param value number The value of the point
---@return Graph self The graph instance
function Graph:addPoint(name, value) end
---Sets the value of the MinValue property.
---@param self Graph self
---@param MinValue number The minimum value of the graph
function Graph:setMinValue(self, MinValue) end
---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing.
---@param props table The properties to initialize the element with
---@param basalt table The basalt instance
---@return Graph self The initialized instance
---@protected
function Graph:init(props, basalt) end
---@class basalt
local basalt = {}
---Returns a Plugin API
---@param name string The name of the plugin
---@return table Plugin The plugin API
function basalt.getAPI(name) end
---Returns the focused frame
---@return BaseFrame ? BaseFrame The focused frame
function basalt.getFocus() end
---Sets a frame as focused
---@param frame BaseFrame The frame to set as focused
function basalt.setFocus(frame) end
---Sets the active frame
---@param frame BaseFrame The frame to set as active
function basalt.setActiveFrame(frame) end
---Starts the Basalt runtime
function basalt.run() end
---Returns the error manager instance
---@return table ErrorManager The error manager
function basalt.getErrorManager() end
---Creates and returns a new UI element of the specified type.
---@param type string The type of element to create (e.g. "Button", "Label", "BaseFrame")
---@return table element The created element instance
function basalt.create(type) end
---Stops the Basalt runtime
function basalt.stop() end
---Runs basalt once, can be used to update the UI manually, but you have to feed it the events
function basalt.update() end
---Returns the active frame
---@return BaseFrame ? BaseFrame The frame to set as active
function basalt.getActiveFrame() end
---Returns the element manager instance
---@return table ElementManager The element manager
function basalt.getElementManager() end
---Creates and returns a new BaseFrame
---@return BaseFrame BaseFrame The created frame instance
function basalt.createFrame() end
---Gets or creates the main frame
---@return BaseFrame BaseFrame The main frame instance
function basalt.getMainFrame() end
---Schedules a function to run in a coroutine
---@param func function The function to schedule
---@return thread func The scheduled function
function basalt.schedule(func) end
---Returns an element's class without creating a instance
---@param name string The name of the element
---@return table Element The element class
function basalt.getElementClass(name) end
---Removes a scheduled update
---@param func thread The scheduled function to remove
---@return boolean success Whether the scheduled function was removed
function basalt.removeSchedule(func) end
---@class LineChart : Graph
local LineChart = {}
---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing.
---@protected
function LineChart:render() end
---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing.
---@param props table The properties to initialize the element with
---@param basalt table The basalt instance
---@return LineChart self The initialized instance
---@protected
function LineChart:init(props, basalt) end
---@class Log
local Log = {}
---Sends an info message to the logger.
function Log.info() end
---Sends an error message to the logger.
function Log.error() end
---Sends a debug message to the logger.
function Log.debug() end
---Sets if the logger should log
function Log.setEnabled() end
---Sets if the logger should log to a file.
function Log.setLogToFile() end
---Sends a warning message to the logger.
function Log.warn() end
---@class Checkbox : VisualElement
---@field checked boolean checkbox is checked
---@field checkedText string when checked
---@field autoSize boolean Whether to automatically size the checkbox
---@field text string Text to display
local Checkbox = {}
---Sets the value of the Checked property.
---@param self Checkbox self
---@param Checked boolean checkbox is checked
function Checkbox:setChecked(self, Checked) end
---Gets the value of the CheckedText property.
---@param self Checkbox self
---@return string Text when checked
function Checkbox:getCheckedText(self) end
---Sets the value of the AutoSize property.
---@param self Checkbox self
---@param AutoSize boolean Whether to automatically size the checkbox
function Checkbox:setAutoSize(self, AutoSize) end
---Gets the value of the Checked property.
---@param self Checkbox self
---@return boolean Whether checkbox is checked
function Checkbox:getChecked(self) end
---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing.
---@param button number The button that was clicked
---@param x number The x position of the click
---@param y number The y position of the click
---@return boolean Clicked Whether the event was handled
---@protected
function Checkbox:mouse_click(button, x, y) end
---Gets the value of the AutoSize property.
---@param self Checkbox self
---@return boolean true Whether to automatically size the checkbox
function Checkbox:getAutoSize(self) end
---Gets the value of the Text property.
---@param self Checkbox self
---@return string empty Text to display
function Checkbox:getText(self) end
---Sets the value of the Text property.
---@param self Checkbox self
---@param Text string Text to display
function Checkbox:setText(self, Text) end
---Sets the value of the CheckedText property.
---@param self Checkbox self
---@param CheckedText string when checked
function Checkbox:setCheckedText(self, CheckedText) end
---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing.
---@param props table The properties to initialize the element with
---@param basalt table The basalt instance
---@protected
function Checkbox:init(props, basalt) end
---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing.
---@return Checkbox self The created instance
---@protected
function Checkbox.new() end
---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing.
---@protected
function Checkbox:render() end
---@class Flexbox : Container
---@field flexWrap boolean Whether to wrap flex items onto multiple lines
---@field flexAlignItems string The alignment of flex items along the cross axis
---@field flexUpdateLayout boolean Whether to update the layout of the flexbox
---@field flexCrossPadding number The padding on both sides of the cross axis
---@field flexSpacing number The spacing between flex items
---@field flexJustifyContent string The alignment of flex items along the main axis
---@field flexDirection string The direction of the flexbox layout "row" or "column"
local Flexbox = {}
---Sets the value of the FlexUpdateLayout property.
---@param self Flexbox self
---@param FlexUpdateLayout boolean Whether to update the layout of the flexbox
function Flexbox:setFlexUpdateLayout(self, FlexUpdateLayout) end
---Gets the value of the FlexSpacing property.
---@param self Flexbox self
---@return number 1 The spacing between flex items
function Flexbox:getFlexSpacing(self) end
---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing.
---@param props table The properties to initialize the element with
---@param basalt table The basalt instance
---@return Flexbox self The initialized instance
---@protected
function Flexbox:init(props, basalt) end
---Gets the value of the FlexJustifyContent property.
---@param self Flexbox self
---@return string "flex-start" The alignment of flex items along the main axis
function Flexbox:getFlexJustifyContent(self) end
---Sets the value of the FlexWrap property.
---@param self Flexbox self
---@param FlexWrap boolean Whether to wrap flex items onto multiple lines
function Flexbox:setFlexWrap(self, FlexWrap) end
---Gets the value of the FlexWrap property.
---@param self Flexbox self
---@return boolean false Whether to wrap flex items onto multiple lines
function Flexbox:getFlexWrap(self) end
---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing.
---@protected
function Flexbox:render() end
---Sets the value of the FlexJustifyContent property.
---@param self Flexbox self
---@param FlexJustifyContent string The alignment of flex items along the main axis
function Flexbox:setFlexJustifyContent(self, FlexJustifyContent) end