-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathBasaltLS.lua
More file actions
5872 lines (4748 loc) · 235 KB
/
Copy pathBasaltLS.lua
File metadata and controls
5872 lines (4748 loc) · 235 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 Collection : VisualElement
---@field selectedForeground color Text color for selected items
---@field selectable boolean Whether items can be selected
---@field selectedBackground color Background color for selected items
---@field multiSelection boolean Whether multiple items can be selected at once
---@field items table Collection of items in the collection.
local Collection = {}
---Gets the value of the MultiSelection property.
---@param self Collection self
---@return boolean false Whether multiple items can be selected at once
function Collection:getMultiSelection(self) end
---Registers a function to handle the onSelect event.
---@param index number
---@param item table
---@param self Collection self
---@param func function The function to be called when the event fires
function Collection:onOnSelect(self, func) end
---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing.
---@param props table The properties to initialize the element with
---@param basalt table The basalt instance
---@return Collection self The initialized instance
---@protected
function Collection:init(props, basalt) end
---Adds an item to the Collection
---@param text string |table The item to add (string or item table)
---@return Collection self The Collection instance
function Collection:addItem(text) end
---Sets the value of the MultiSelection property.
---@param self Collection self
---@param MultiSelection boolean Whether multiple items can be selected at once
function Collection:setMultiSelection(self, MultiSelection) end
---Sets the value of the Items property.
---@param self Collection self
---@param Items table Collection of items in the collection.
function Collection:setItems(self, Items) end
---Gets the currently selected items
---@return table selected Collection of selected items
function Collection:getSelectedItems() end
---Registers a callback for the select event
---@param callback function The callback function to register
---@return Collection self The Collection instance
function Collection:onSelect(callback) end
---Gets the value of the SelectedForeground property.
---@param self Collection self
---@return color white Text color for selected items
function Collection:getSelectedForeground(self) end
function Collection:unselectItem() end
---Selects the next item in the collection
---@return Collection self The Collection instance
function Collection:selectNext() end
---Gets the index of the first selected item
---@return number ? index The index of the first selected item, or nil if none selected
function Collection:getSelectedIndex() end
function Collection:selectItem() end
---Sets the value of the SelectedForeground property.
---@param self Collection self
---@param SelectedForeground color Text color for selected items
function Collection:setSelectedForeground(self, SelectedForeground) end
---Gets first selected item
---@return table ? selected The first item
function Collection:getSelectedItem() end
function Collection:clearItemSelection() end
---Selects the previous item in the collection
---@return Collection self The Collection instance
function Collection:selectPrevious() end
---Gets the value of the Items property.
---@param self Collection self
---@return table {} Collection of items in the collection.
function Collection:getItems(self) end
---Gets the value of the SelectedBackground property.
---@param self Collection self
---@return color blue Background color for selected items
function Collection:getSelectedBackground(self) end
---Clears all items from the Collection
---@return Collection self The Collection instance
function Collection:clear() end
---Sets the value of the Selectable property.
---@param self Collection self
---@param Selectable boolean Whether items can be selected
function Collection:setSelectable(self, Selectable) end
---Sets the value of the SelectedBackground property.
---@param self Collection self
---@param SelectedBackground color Background color for selected items
function Collection:setSelectedBackground(self, SelectedBackground) end
---Gets the value of the Selectable property.
---@param self Collection self
---@return boolean true Whether items can be selected
function Collection:getSelectable(self) end
---Removes an item from the Collection
---@param index number The index of the item to remove
---@return Collection self The Collection instance
function Collection:removeItem(index) end
---@class Input : VisualElement
---@field cursorPos number The current cursor position in the text
---@field text string The current text content of the input
---@field viewOffset number The horizontal scroll offset for viewing long text
---@field pattern string nil Regular expression pattern for input validation
---@field replaceChar string Character to replace the input with (for password fields)
---@field placeholder string Text to display when input is empty
---@field cursorColor number Color of the cursor
---@field maxLength number nil Maximum length of input text (optional)
---@field placeholderColor color Color of the placeholder text
local Input = {}
---Gets the value of the CursorColor property.
---@param self Input self
---@return number nil Color of the cursor
function Input:getCursorColor(self) end
---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing.
---@protected
function Input:focus() end
---Sets the value of the CursorColor property.
---@param self Input self
---@param CursorColor number Color of the cursor
function Input:setCursorColor(self, CursorColor) end
---Registers a callback for the submit event
---@param callback function The callback function to register
---@return Input self The Input instance
function Input:onSubmit(callback) end
---Sets the value of the ViewOffset property.
---@param self Input self
---@param ViewOffset number The horizontal scroll offset for viewing long text
function Input:setViewOffset(self, ViewOffset) end
---Gets the value of the PlaceholderColor property.
---@param self Input self
---@return color gray Color of the placeholder text
function Input:getPlaceholderColor(self) end
---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing.
---@param key number The key that was pressed
---@return boolean handled Whether the event was handled
---@protected
function Input:key(key) end
---Updates the input's viewport
---@return Input self The updated instance
function Input:updateViewport() end
---Gets the value of the Text property.
---@param self Input self
---@return string - The current text content of the input
function Input:getText(self) end
---Gets the value of the CursorPos property.
---@param self Input self
---@return number 1 The current cursor position in the text
function Input:getCursorPos(self) end
---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing.
---@protected
function Input:render() end
---Sets the value of the CursorPos property.
---@param self Input self
---@param CursorPos number The current cursor position in the text
function Input:setCursorPos(self, CursorPos) end
---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing.
---@protected
function Input:paste() end
---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing.
---@protected
function Input:blur() end
---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing.
---@param button number The button that was clicked
---@param x number The x position of the click
---@param y number The y position of the click
---@return boolean handled Whether the event was handled
---@protected
function Input:mouse_click(button, x, y) end
---Gets the value of the Pattern property.
---@param self Input self
---@return string ? nil Regular expression pattern for input validation
function Input:getPattern(self) end
---Gets the value of the MaxLength property.
---@param self Input self
---@return number ? nil Maximum length of input text (optional)
function Input:getMaxLength(self) end
---Sets the value of the Text property.
---@param self Input self
---@param Text string The current text content of the input
function Input:setText(self, Text) end
---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing.
---@param char string The character that was typed
---@return boolean handled Whether the event was handled
---@protected
function Input:char(char) end
---Sets the cursor position and color
---@param x number The x position of the cursor
---@param y number The y position of the cursor
---@param blink boolean Whether the cursor should blink
---@param color number The color of the cursor
function Input:setCursor(x, y, blink, color) end
---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing.
---@param props table The properties to initialize the element with
---@param basalt table The basalt instance
---@return Input self The initialized instance
---@protected
function Input:init(props, basalt) end
---Sets the value of the Pattern property.
---@param self Input self
---@param Pattern string nil Regular expression pattern for input validation
function Input:setPattern(self, Pattern) end
---Sets the value of the ReplaceChar property.
---@param self Input self
---@param ReplaceChar string Character to replace the input with (for password fields)
function Input:setReplaceChar(self, ReplaceChar) end
---Sets the value of the PlaceholderColor property.
---@param self Input self
---@param PlaceholderColor color Color of the placeholder text
function Input:setPlaceholderColor(self, PlaceholderColor) end
---Gets the value of the ReplaceChar property.
---@param self Input self
---@return string nil Character to replace the input with (for password fields)
function Input:getReplaceChar(self) end
---Sets the value of the Placeholder property.
---@param self Input self
---@param Placeholder string Text to display when input is empty
function Input:setPlaceholder(self, Placeholder) end
---Gets the value of the Placeholder property.
---@param self Input self
---@return string ... Text to display when input is empty
function Input:getPlaceholder(self) end
---Sets the value of the MaxLength property.
---@param self Input self
---@param MaxLength number nil Maximum length of input text (optional)
function Input:setMaxLength(self, MaxLength) end
---Gets the value of the ViewOffset property.
---@param self Input self
---@return number 0 The horizontal scroll offset for viewing long text
function Input:getViewOffset(self) end
---@class ErrorHandler
local ErrorHandler = {}
---Handles an error
---@param errMsg string The error message
function errorHandler.error(errMsg) end
---@class Button : VisualElement
---@field text string Label text displayed centered within the button
local Button = {}
---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing.
---@param props table The properties to initialize the element with
---@param basalt table The basalt instance
---@protected
function Button:init(props, basalt) end
---Sets the value of the Text property.
---@param self Button self
---@param Text string Label text displayed centered within the button
function Button:setText(self, Text) end
---Gets the value of the Text property.
---@param self Button self
---@return string Button Label text displayed centered within the button
function Button:getText(self) end
---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing.
---@protected
function Button:render() end
---@class ContextMenu : Container
---@field isOpen boolean Whether the menu is currently open
---@field items table List of menu items
---@field itemHeight number Height of each menu item
---@field openSubmenu table Currently open submenu data
local ContextMenu = {}
---Gets the value of the IsOpen property.
---@param self ContextMenu self
---@return boolean false Whether the menu is currently open
function ContextMenu:getIsOpen(self) end
---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing.
---@param props table The properties to initialize the element with
---@param basalt table The basalt instance
---@protected
function ContextMenu:init(props, basalt) end
---Sets the value of the OpenSubmenu property.
---@param self ContextMenu self
---@param OpenSubmenu table Currently open submenu data
function ContextMenu:setOpenSubmenu(self, OpenSubmenu) end
---Closes the menu and any submenus
---@return ContextMenu self For method chaining
function ContextMenu:close() end
---Closes the entire menu chain (parent and all submenus)
---@return ContextMenu self For method chaining
function ContextMenu:closeAll() end
---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 ContextMenu:mouse_click() end
---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 ContextMenu:render() end
---Sets the value of the IsOpen property.
---@param self ContextMenu self
---@param IsOpen boolean Whether the menu is currently open
function ContextMenu:setIsOpen(self, IsOpen) end
---Opens the menu
---@return ContextMenu self For method chaining
function ContextMenu:open() end
---Sets the menu items
---@param items table Array of item definitions
---@return ContextMenu self For method chaining
function ContextMenu:setItems(items) end
---Gets the value of the ItemHeight property.
---@param self ContextMenu self
---@return number 1 Height of each menu item
function ContextMenu:getItemHeight(self) end
---Gets the value of the Items property.
---@param self ContextMenu self
---@return table {} List of menu items
function ContextMenu:getItems(self) end
---Gets the value of the OpenSubmenu property.
---@param self ContextMenu self
---@return table nil Currently open submenu data
function ContextMenu:getOpenSubmenu(self) end
---Sets the value of the ItemHeight property.
---@param self ContextMenu self
---@param ItemHeight number Height of each menu item
function ContextMenu:setItemHeight(self, ItemHeight) end
---@class Breadcrumb : VisualElement
---@field clickable true Whether the segments are clickable
---@field autoSize false Whether to resize the element width automatically based on text
---@field path table Array of strings representing the breadcrumb segments
local Breadcrumb = {}
---Gets the value of the AutoSize property.
---@param self Breadcrumb self
---@return false boolean Whether to resize the element width automatically based on text
function Breadcrumb:getAutoSize(self) end
---Sets the value of the Path property.
---@param self Breadcrumb self
---@param Path table Array of strings representing the breadcrumb segments
function Breadcrumb:setPath(self, Path) end
---Gets the value of the Path property.
---@param self Breadcrumb self
---@return table {} Array of strings representing the breadcrumb segments
function Breadcrumb:getPath(self) end
---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing.
---@protected
function Breadcrumb:render() end
---Registers a callback for the select event
---@param callback function The callback function to register
---@return Breadcrumb self The Breadcrumb instance
function Breadcrumb:onSelect(callback) end
---Gets the value of the Clickable property.
---@param self Breadcrumb self
---@return true boolean Whether the segments are clickable
function Breadcrumb:getClickable(self) end
---Sets the value of the Clickable property.
---@param self Breadcrumb self
---@param Clickable true Whether the segments are clickable
function Breadcrumb:setClickable(self, Clickable) end
---Sets the value of the AutoSize property.
---@param self Breadcrumb self
---@param AutoSize false Whether to resize the element width automatically based on text
function Breadcrumb:setAutoSize(self, AutoSize) end
---@param props table
---@param basalt table
function Breadcrumb:init(props, basalt) end
---@param button number
---@param x number
---@param y number
---@return boolean handled
function Breadcrumb:mouse_click(button, x, y) end
---@return table self
function Breadcrumb.new() end
---@class BaseFrame : Container
---@field term term term.current() The terminal or (monitor) peripheral object to render to
local BaseFrame = {}
---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing.
---@param x number The x position to render to
---@param y number The y position to render to
---@param text string The text to render
---@param bg colors The background color
---@protected
function BaseFrame:textBg(x, y, text, bg) end
---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing.
---@param key number The key that was released
---@protected
function BaseFrame:key_up(key) end
---Hides the debug log frame
---@param self BaseFrame The frame to hide debug log for
function BaseFrame.closeConsole(self) end
---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing.
---@param x number The x position to render to
---@param y number The y position to render to
---@param text string The text to render
---@protected
function BaseFrame:drawText(x, y, text) end
---Initializes a new store for this element
---@param self BaseFrame The element to initialize store for
---@param name string The name of the store
---@param default any The default value of the store
---@return BaseFrame self The element instance
function BaseFrame:initializeStore(self, name, default) end
---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing.
---@param x number The x position to render to
---@param y number The y position to render to
---@param text string The text to render
---@param fg string The foreground color
---@param bg string The background color
---@protected
function BaseFrame:blit(x, y, text, fg, bg) end
---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing.
---@param props table The properties to initialize the element with
---@param basalt table The basalt instance
---@return table self The initialized instance
---@protected
function BaseFrame:init(props, basalt) end
---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing.
---@param key number The key that was pressed
---@protected
function BaseFrame:key(key) end
---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing.
---@protected
function BaseFrame:render() end
function BaseFrame:dispatchEvent() end
---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing.
---@param x number The x position to render to
---@param y number The y position to render to
---@param text string The text to render
---@param fg colors The foreground color
---@protected
function BaseFrame:textFg(x, y, text, fg) end
---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing.
---@param char string The character that was pressed
---@protected
function BaseFrame:char(char) end
---Gets the value of the Term property.
---@param self BaseFrame self
---@return term |peripheral term.current() The terminal or (monitor) peripheral object to render to
function BaseFrame:getTerm(self) end
---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing.
---@param x number The x position to render to
---@param y number The y position to render to
---@param bg colors The background color
---@protected
function BaseFrame:drawBg(x, y, bg) end
---Shows the debug log frame
---@param self BaseFrame The frame to show debug log in
function BaseFrame.openConsole(self) end
---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing.
---@param name string The name of the monitor that was touched
---@param x number The x position of the mouse
---@param y number The y position of the mouse
---@protected
function BaseFrame:monitor_touch(name, x, y) end
---Sets the value of the Term property.
---@param self BaseFrame self
---@param Term term term.current() The terminal or (monitor) peripheral object to render to
function BaseFrame:setTerm(self, Term) end
---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing.
---@param x number The x position to render to
---@param y number The y position to render to
---@param width number The width of the text
---@param height number The height of the text
---@param text string The text to render
---@param fg string The foreground color
---@param bg string The background color
---@protected
function BaseFrame:multiBlit(x, y, width, height, text, fg, bg) end
---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing.
---@param button number The button that was clicked
---@param x number The x position of the mouse
---@param y number The y position of the mouse
---@protected
function BaseFrame:mouse_click(button, x, y) end
---Sets the cursor position
---@param x number The x position to set the cursor to
---@param y number The y position to set the cursor to
---@param blink boolean Whether the cursor should blink
function BaseFrame:setCursor(x, y, blink) end
---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing.
---@param button number The button that was released
---@param x number The x position of the mouse
---@param y number The y position of the mouse
---@protected
function BaseFrame:mouse_up(button, x, y) end
---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing.
---@param x number The x position to render to
---@param y number The y position to render to
---@param fg colors The foreground color
---@protected
function BaseFrame:drawFg(x, y, fg) end
---Toggles the debug log frame
---@param self BaseFrame The frame to toggle debug log for
function BaseFrame.toggleConsole(self) end
function BaseFrame.setup() end
---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing.
---@protected
function BaseFrame:term_resize() end
---@class List : Collection
---@field showScrollBar boolean Whether to show the scrollbar when items exceed height
---@field scrollBarSymbol string " Symbol used for the scrollbar handle
---@field emptyText string items" Text to display when the list is empty
---@field scrollBarBackgroundColor color Background color of the scrollbar
---@field scrollBarBackground string Symbol used for the scrollbar background
---@field scrollBarColor color Color of the scrollbar handle
---@field offset number Current scroll offset for viewing long lists
local List = {}
---Sets the value of the ScrollBarBackground property.
---@param self List self
---@param ScrollBarBackground string Symbol used for the scrollbar background
function List:setScrollBarBackground(self, ScrollBarBackground) end
---Gets the value of the ScrollBarBackgroundColor property.
---@param self List self
---@return color gray Background color of the scrollbar
function List:getScrollBarBackgroundColor(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 direction of the scroll (1 for down, -1 for up)
---@param x number The x-coordinate of the scroll
---@param y number The y-coordinate of the scroll
---@return boolean Whether the event was handled
---@protected
function List:mouse_scroll(direction, x, y) end
---Gets the value of the ScrollBarSymbol property.
---@param self List self
---@return string " " Symbol used for the scrollbar handle
function List:getScrollBarSymbol(self) end
---Sets the value of the ScrollBarSymbol property.
---@param self List self
---@param ScrollBarSymbol string " Symbol used for the scrollbar handle
function List:setScrollBarSymbol(self, ScrollBarSymbol) end
---Sets the value of the EmptyText property.
---@param self List self
---@param EmptyText string items" Text to display when the list is empty
function List:setEmptyText(self, EmptyText) end
---Gets the value of the EmptyText property.
---@param self List self
---@return string "No items" Text to display when the list is empty
function List:getEmptyText(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 List:render() end
---Sets the value of the Offset property.
---@param self List self
---@param Offset number Current scroll offset for viewing long lists
function List:setOffset(self, Offset) end
---Sets the value of the ScrollBarColor property.
---@param self List self
---@param ScrollBarColor color Color of the scrollbar handle
function List:setScrollBarColor(self, ScrollBarColor) end
---Scrolls to make a specific item visible
---@param index number The index of the item to scroll to
---@return List self The List instance
function List:scrollToItem(index) end
---Sets the value of the ScrollBarBackgroundColor property.
---@param self List self
---@param ScrollBarBackgroundColor color Background color of the scrollbar
function List:setScrollBarBackgroundColor(self, ScrollBarBackgroundColor) end
---Gets the value of the ScrollBarColor property.
---@param self List self
---@return color lightGray Color of the scrollbar handle
function List:getScrollBarColor(self) end
---Scrolls the list to the top
---@return List self The List instance
function List:scrollToTop() end
---Gets the value of the ScrollBarBackground property.
---@param self List self
---@return string "\127" Symbol used for the scrollbar background
function List:getScrollBarBackground(self) end
---Registers a function to handle the onSelect event.
---@param List self
---@param index number
---@param item table
---@param self List self
---@param func function The function to be called when the event fires
function List:onOnSelect(self, func) end
---Scrolls the list to the bottom
---@return List self The List instance
function List:scrollToBottom() end
---Gets the value of the ShowScrollBar property.
---@param self List self
---@return boolean true Whether to show the scrollbar when items exceed height
function List:getShowScrollBar(self) end
---Registers a callback for the select event
---@param callback function The callback function to register
---@return List self The List instance
function List:onSelect(callback) end
---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing.
---@param button number The mouse button that was released
---@param x number The x-coordinate of the release
---@param y number The y-coordinate of the release
---@return boolean Whether the event was handled
---@protected
function List:mouse_up(button, x, y) end
---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing.
---@param props table The properties to initialize the element with
---@param basalt table The basalt instance
---@return List self The initialized instance
---@protected
function List:init(props, basalt) end
---Gets the value of the Offset property.
---@param self List self
---@return number 0 Current scroll offset for viewing long lists
function List:getOffset(self) end
---Handles key events for keyboard navigation
---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 keyCode number The key code
---@return boolean Whether the event was handled
---@protected
function List:key(keyCode) end
---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing.
---@param button number The mouse button that was clicked
---@param x number The x-coordinate of the click
---@param y number The y-coordinate of the click
---@return boolean Whether the event was handled
---@protected
function List:mouse_click(button, x, y) end
---Sets the value of the ShowScrollBar property.
---@param self List self
---@param ShowScrollBar boolean Whether to show the scrollbar when items exceed height
function List:setShowScrollBar(self, ShowScrollBar) end
---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing.
---@param button number The mouse button being dragged
---@param x number The x-coordinate of the drag
---@param y number The y-coordinate of the drag
---@return boolean Whether the event was handled
---@protected
function List:mouse_drag(button, x, y) end
---@class Table : Collection
---@field columns table List of column definitions with {name, width} properties
---@field offset number Scroll offset for vertical scrolling
---@field scrollBarBackground string Symbol used for the scrollbar background
---@field scrollBarColor color Color of the scrollbar handle
---@field sortDirection string Sort direction ("asc" or "desc")
---@field showScrollBar boolean Whether to show the scrollbar when items exceed height
---@field scrollBarSymbol string " Symbol used for the scrollbar handle
---@field scrollBarBackgroundColor color Background color of the scrollbar
---@field gridColor color Color of grid lines
---@field headerColor color Color of the column headers
---@field sortColumn number nil Currently sorted column index
---@field customSortFunction table Custom sort functions for columns
local Table = {}
---Gets the value of the ScrollBarBackgroundColor property.
---@param self Table self
---@return color gray Background color of the scrollbar
function Table:getScrollBarBackgroundColor(self) end
---Gets the value of the ScrollBarSymbol property.
---@param self Table self
---@return string " " Symbol used for the scrollbar handle
function Table:getScrollBarSymbol(self) end
---Set data with automatic formatting
---@param rawData table The raw data array (array of row arrays)
---@param formatters table ? Optional formatter functions for columns {[2] = function(value) return value end}
---@return Table self The Table instance
function Table:setData(rawData, formatters) end
---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing.
---@protected
function Table:mouse_scroll() end
---Clears all table data
---@return Table self The Table instance
function Table:clearData() end
---Sets the value of the ShowScrollBar property.
---@param self Table self
---@param ShowScrollBar boolean Whether to show the scrollbar when items exceed height
function Table:setShowScrollBar(self, ShowScrollBar) end
---Gets the value of the GridColor property.
---@param self Table self
---@return color gray Color of grid lines
function Table:getGridColor(self) end
---Gets a row by index
---@param rowIndex number The index of the row
---@return table ? row The row data or nil
function Table:getRow(rowIndex) end
---Gets the value of the ScrollBarBackground property.
---@param self Table self
---@return string "\127" Symbol used for the scrollbar background
function Table:getScrollBarBackground(self) end
---Gets the value of the SortDirection property.
---@param self Table self
---@return string "asc" Sort direction ("asc" or "desc")
function Table:getSortDirection(self) end
---Gets the value of the Columns property.
---@param self Table self
---@return table {} List of column definitions with {name, width} properties
function Table:getColumns(self) end
---Sets the value of the Columns property.
---@param self Table self
---@param Columns table List of column definitions with {name, width} properties
function Table:setColumns(self, Columns) end
---Registers callback for row selection
---@param callback function The callback function(rowIndex, row)
---@return Table self The Table instance
function Table:onRowSelect(callback) end
---Removes a row by index
---@param rowIndex number The index of the row to remove
---@return Table self The Table instance
function Table:removeRow(rowIndex) end
---Sets the value of the ScrollBarBackground property.
---@param self Table self
---@param ScrollBarBackground string Symbol used for the scrollbar background
function Table:setScrollBarBackground(self, ScrollBarBackground) end
---Updates a specific cell value
---@param rowIndex number The row index
---@param colIndex number The column index
---@param value any The new value
---@return Table self The Table instance
function Table:updateCell(rowIndex, colIndex, value) end
---Sets the value of the Offset property.
---@param self Table self
---@param Offset number Scroll offset for vertical scrolling
function Table:setOffset(self, Offset) 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:sortByColumn(columnIndex, fn) end
---Gets the value of the CustomSortFunction property.
---@param self Table self
---@return table {} Custom sort functions for columns
function Table:getCustomSortFunction(self) end
---Gets all table data
---@return table data Array of row cell arrays
function Table:getData() end
---Gets the value of the Offset property.
---@param self Table self
---@return number 0 Scroll offset for vertical scrolling
function Table:getOffset(self) end
---Registers a function to handle the onRowSelect event.
---@param rowIndex number
---@param row table
---@param self Table self
---@param func function The function to be called when the event fires
function Table:onOnRowSelect(self, func) end
---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing.
---@protected
function Table:mouse_up() end
---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing.
---@protected
function Table:mouse_drag() end
---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing.
---@protected
function Table:mouse_click() end
---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
---Adds a new row to the table
---@return Table self The Table instance
function Table:addRow() end
---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 ShowScrollBar property.
---@param self Table self
---@return boolean true Whether to show the scrollbar when items exceed height
function Table:getShowScrollBar(self) end
---Gets the currently selected row
---@return table ? row The selected row or nil
function Table:getSelectedRow() end
---Adds a new column to the table
---@param name string The name of the column
---@param width number |string The width of the column (number, "auto", or "30%")
---@return Table self The Table instance
function Table:addColumn(name, width) 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 GridColor property.
---@param self Table self
---@param GridColor color Color of grid lines
function Table:setGridColor(self, GridColor) end
---Gets the value of the ScrollBarColor property.
---@param self Table self
---@return color lightGray Color of the scrollbar handle
function Table:getScrollBarColor(self) end
---Sets a custom sort function for a specific column
---@param columnIndex number The index of the column
---@param sortFn function Function that takes (rowA, rowB) and returns comparison result
---@return Table self The Table instance
function Table:setColumnSortFunction(columnIndex, sortFn) end
---Sets the value of the CustomSortFunction property.
---@param self Table self
---@param CustomSortFunction table Custom sort functions for columns
function Table:setCustomSortFunction(self, CustomSortFunction) end
---Gets the value of the HeaderColor property.
---@param self Table self
---@return color blue Color of the column headers
function Table:getHeaderColor(self) end
---Sets the value of the ScrollBarSymbol property.
---@param self Table self
---@param ScrollBarSymbol string " Symbol used for the scrollbar handle
function Table:setScrollBarSymbol(self, ScrollBarSymbol) end
---Sets the value of the HeaderColor property.
---@param self Table self
---@param HeaderColor color Color of the column headers
function Table:setHeaderColor(self, HeaderColor) end
---Sets the value of the ScrollBarBackgroundColor property.
---@param self Table self
---@param ScrollBarBackgroundColor color Background color of the scrollbar
function Table:setScrollBarBackgroundColor(self, ScrollBarBackgroundColor) 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
---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 ScrollBarColor property.
---@param self Table self
---@param ScrollBarColor color Color of the scrollbar handle
function Table:setScrollBarColor(self, ScrollBarColor) end
---@class Slider : VisualElement
---@field max number Maximum value for value conversion (maps slider position to this range)
---@field horizontal boolean Whether the slider is horizontal (false for vertical)
---@field step number Current position of the slider handle (1 to width/height)
---@field sliderColor color Color of the slider handle
---@field barColor color Color of the slider track
local Slider = {}
---Gets the current value of the slider
---@return number value The current value (0 to max)
function Slider:getValue() end
---Registers a function to handle the onChange event.
---@param value number
---@param self Slider self
---@param func function The function to be called when the event fires
function Slider:onOnChange(self, func) end
---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