-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathBasaltLS.lua
More file actions
5861 lines (4739 loc) · 235 KB
/
BasaltLS.lua
File metadata and controls
5861 lines (4739 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 Label : VisualElement
---@field autoSize boolean Whether the label should automatically resize its width based on the text content
---@field text string The text content to display. Can be a string or a function that returns a string
local Label = {}
---Sets the value of the Text property.
---@param self Label self
---@param Text string The text content to display. Can be a string or a function that returns a string
function Label:setText(self, Text) end
---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing.
---@protected
function Label:render() end
---Gets the value of the AutoSize property.
---@param self Label self
---@return boolean true Whether the label should automatically resize its width based on the text content
function Label:getAutoSize(self) end
---Gets the wrapped lines of the Label
---@return table wrappedText The wrapped lines of the Label
function Label:getWrappedText() end
---Gets the value of the Text property.
---@param self Label self
---@return string Label The text content to display. Can be a string or a function that returns a string
function Label:getText(self) end
---Sets the value of the AutoSize property.
---@param self Label self
---@param AutoSize boolean Whether the label should automatically resize its width based on the text content
function Label:setAutoSize(self, AutoSize) end
---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing.
---@param props table The properties to initialize the element with
---@param basalt table The basalt instance
---@return Label self The initialized instance
---@protected
function Label:init(props, basalt) end
---@class Benchmark
local Benchmark = {}
---Gets statistics for a benchmark
---@param name string The name of the benchmark
---@return table ? stats The benchmark statistics or nil
function API.getStats(name) end
---Starts a custom benchmark
---@param name string The name of the benchmark
function API.start(name) end
---Stops a custom benchmark
---@param name string The name of the benchmark to stop
function API.stop(name) end
---Clears all custom benchmarks
function API.clearAll() end
---Clears a specific benchmark
---@param name string The name of the benchmark to clear
function API.clear(name) end
---@class CheckBox : VisualElement
---@field autoSize boolean Automatically adjusts width based on text length
---@field checked boolean The current state of the checkbox (true=checked, false=unchecked)
---@field checkedText string Text shown when the checkbox is checked
---@field text string Text shown when the checkbox is unchecked
local CheckBox = {}
---Sets the value of the Text property.
---@param self CheckBox self
---@param Text string Text shown when the checkbox is unchecked
function CheckBox:setText(self, Text) end
---Handles mouse interactions to toggle the checkbox state
---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing.
---@param button number The button that was clicked
---@param x number The x position of the click
---@param y number The y position of the click
---@return boolean Clicked Whether the event was handled
---@protected
function CheckBox:mouse_click(button, x, y) end
---Sets the value of the AutoSize property.
---@param self CheckBox self
---@param AutoSize boolean Automatically adjusts width based on text length
function CheckBox:setAutoSize(self, AutoSize) end
---Sets the value of the Checked property.
---@param self CheckBox self
---@param Checked boolean The current state of the checkbox (true=checked, false=unchecked)
function CheckBox:setChecked(self, Checked) end
---Gets the value of the CheckedText property.
---@param self CheckBox self
---@return string x Text shown when the checkbox is checked
function CheckBox:getCheckedText(self) end
---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing.
---@protected
function CheckBox:render() end
---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing.
---@param 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
---Gets the value of the Text property.
---@param self CheckBox self
---@return string empty Text shown when the checkbox is unchecked
function CheckBox:getText(self) end
---Sets the value of the CheckedText property.
---@param self CheckBox self
---@param CheckedText string Text shown when the checkbox is checked
function CheckBox:setCheckedText(self, CheckedText) end
---Gets the value of the Checked property.
---@param self CheckBox self
---@return boolean false The current state of the checkbox (true=checked, false=unchecked)
function CheckBox:getChecked(self) end
---Gets the value of the AutoSize property.
---@param self CheckBox self
---@return boolean true Automatically adjusts width based on text length
function CheckBox:getAutoSize(self) end
---@class Accordion : Container
---@field allowMultiple boolean Allow multiple panels to be open at once
---@field headerTextColor color Text color for panel headers
---@field expandedHeaderTextColor color Text color for expanded panel headers
---@field headerBackground color Background color for panel headers
---@field panelHeaderHeight number Height of each panel header
---@field expandedHeaderBackground color Background color for expanded panel headers
---@field panels table List of panel definitions
local Accordion = {}
---@param panelId number The ID of the panel to expand
---@return Accordion self For method chaining
function Accordion:expandPanel(panelId) end
---Sets the value of the HeaderTextColor property.
---@param self Accordion self
---@param HeaderTextColor color Text color for panel headers
function Accordion:setHeaderTextColor(self, HeaderTextColor) end
---Gets the value of the Panels property.
---@param self Accordion self
---@return table {} List of panel definitions
function Accordion:getPanels(self) end
---Gets the value of the ExpandedHeaderBackground property.
---@param self Accordion self
---@return color lightGray Background color for expanded panel headers
function Accordion:getExpandedHeaderBackground(self) end
---Sets the value of the ExpandedHeaderTextColor property.
---@param self Accordion self
---@param ExpandedHeaderTextColor color Text color for expanded panel headers
function Accordion:setExpandedHeaderTextColor(self, ExpandedHeaderTextColor) end
---Gets the value of the AllowMultiple property.
---@param self Accordion self
---@return boolean false Allow multiple panels to be open at once
function Accordion:getAllowMultiple(self) end
---@param panelId number The ID of the panel to toggle
---@return Accordion self For method chaining
function Accordion:togglePanel(panelId) end
---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 Accordion:init(props, basalt) end
---Sets the value of the HeaderBackground property.
---@param self Accordion self
---@param HeaderBackground color Background color for panel headers
function Accordion:setHeaderBackground(self, HeaderBackground) end
---Sets the value of the Panels property.
---@param self Accordion self
---@param Panels table List of panel definitions
function Accordion:setPanels(self, Panels) end
---Sets the value of the PanelHeaderHeight property.
---@param self Accordion self
---@param PanelHeaderHeight number Height of each panel header
function Accordion:setPanelHeaderHeight(self, PanelHeaderHeight) end
---Sets the value of the ExpandedHeaderBackground property.
---@param self Accordion self
---@param ExpandedHeaderBackground color Background color for expanded panel headers
function Accordion:setExpandedHeaderBackground(self, ExpandedHeaderBackground) end
---Gets the value of the ExpandedHeaderTextColor property.
---@param self Accordion self
---@return color black Text color for expanded panel headers
function Accordion:getExpandedHeaderTextColor(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 Accordion:render() end
---Gets the value of the PanelHeaderHeight property.
---@param self Accordion self
---@return number 1 Height of each panel header
function Accordion:getPanelHeaderHeight(self) end
function Accordion:mouse_scroll() end
---@param panelId number The ID of the panel to collapse
---@return Accordion self For method chaining
function Accordion:collapsePanel(panelId) end
---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing.
---@param button number The button that was clicked
---@param x number The x position of the click (global)
---@param y number The y position of the click (global)
---@return boolean Whether the event was handled
---@protected
function Accordion:mouse_click(button, x, y) end
---Creates a new panel and returns the panel's container
---@param title string The title of the panel
---@param expanded boolean Whether the panel starts expanded (default: false)
---@return table panelContainer The container for this panel
function Accordion:newPanel(title, expanded) end
---Gets the value of the HeaderBackground property.
---@param self Accordion self
---@return color gray Background color for panel headers
function Accordion:getHeaderBackground(self) end
---@param panelId number The ID of the panel
---@return table ? container The panel's container or nil
function Accordion:getPanel(panelId) end
---Sets the value of the AllowMultiple property.
---@param self Accordion self
---@param AllowMultiple boolean Allow multiple panels to be open at once
function Accordion:setAllowMultiple(self, AllowMultiple) end
---Gets the value of the HeaderTextColor property.
---@param self Accordion self
---@return color white Text color for panel headers
function Accordion:getHeaderTextColor(self) end
---@class Image : VisualElement
---@field offsetY number Vertical offset for viewing larger images
---@field currentFrame number Current animation frame
---@field bimg table The bimg image data
---@field offsetX number Horizontal offset for viewing larger images
---@field autoResize boolean Whether to automatically resize the image when content exceeds bounds
local Image = {}
---Sets the text at the specified position
---@param x number The x position
---@param y number The y position
---@param text string The text to set
---@return Image self The Image instance
function Image:setText(x, y, text) end
---Gets the foreground color at the specified position
---@param x number The x position
---@param y number The y position
---@param length number The length of the foreground color pattern to get
---@return string fg The foreground color pattern
function Image:getFg(x, y, length) end
---Advances to the next frame in the animation
---@return Image self The Image instance
function Image:nextFrame() end
---Gets the value of the OffsetX property.
---@param self Image self
---@return number 0 Horizontal offset for viewing larger images
function Image:getOffsetX(self) end
---Gets the metadata of the image
---@return table metadata The metadata of the image
function Image:getMetadata() end
---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing.
---@protected
function Image:render() end
---Sets the metadata of the image
---@param key string The key of the metadata to set
---@param value string The value of the metadata to set
---@return Image self The Image instance
function Image:setMetadata(key, value) end
---Updates the specified frame with the provided data
---@param frameIndex number The index of the frame to update
---@param frame table The new frame data
---@return Image self The Image instance
function Image:updateFrame(frameIndex, frame) end
---Gets the specified frame
---@param frameIndex number The index of the frame to get
---@return table frame The frame data
function Image:getFrame(frameIndex) end
---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing.
---@param props table The properties to initialize the element with
---@param basalt table The basalt instance
---@return Image self The initialized instance
---@protected
function Image:init(props, basalt) end
---Sets the value of the Bimg property.
---@param self Image self
---@param Bimg table The bimg image data
function Image:setBimg(self, Bimg) end
---Adds a new frame to the image
---@return Image self The Image instance
function Image:addFrame() end
---Sets the pixel at the specified position
---@param x number The x position
---@param y number The y position
---@param char string The character to set
---@param fg string The foreground color pattern
---@param bg string The background color pattern
---@return Image self The Image instance
function Image:setPixel(x, y, char, fg, bg) end
---Gets the size of the image
---@return number width The width of the image
---@return number height The height of the image
function Image:getImageSize() end
---Gets the text at the specified position
---@param x number The x position
---@param y number The y position
---@param length number The length of the text to get
---@return string text The text at the specified position
function Image:getText(x, y, length) end
---Restores the previous palette before applyPalette was called
---@return Image self The Image instance
function Image:undoPalette() end
---Applies the palette defined in the image to the terminal
---@return Image self The Image instance
function Image:applyPalette() end
---Gets the background color at the specified position
---@param x number The x position
---@param y number The y position
---@param length number The length of the background color pattern to get
---@return string bg The background color pattern
function Image:getBg(x, y, length) end
---Sets the background color at the specified position
---@param x number The x position
---@param y number The y position
---@param pattern string The background color pattern
---@return Image self The Image instance
function Image:setBg(x, y, pattern) end
---Sets the value of the AutoResize property.
---@param self Image self
---@param AutoResize boolean Whether to automatically resize the image when content exceeds bounds
function Image:setAutoResize(self, AutoResize) end
---Sets the value of the CurrentFrame property.
---@param self Image self
---@param CurrentFrame number Current animation frame
function Image:setCurrentFrame(self, CurrentFrame) end
---Gets the value of the AutoResize property.
---@param self Image self
---@return boolean false Whether to automatically resize the image when content exceeds bounds
function Image:getAutoResize(self) end
---Sets the foreground color at the specified position
---@param x number The x position
---@param y number The y position
---@param pattern string The foreground color pattern
---@return Image self The Image instance
function Image:setFg(x, y, pattern) end
---Gets pixel information at position
---@param x number X position
---@param y number Y position
---@return number ? fg Foreground color
---@return number ? bg Background color
---@return string ? char Character at position
function Image:getPixelData(x, y) end
---Sets the value of the OffsetY property.
---@param self Image self
---@param OffsetY number Vertical offset for viewing larger images
function Image:setOffsetY(self, OffsetY) end
---Resizes the image to the specified width and height
---@param width number The new width of the image
---@param height number The new height of the image
---@return Image self The Image instance
function Image:resizeImage(width, height) end
---Sets the value of the OffsetX property.
---@param self Image self
---@param OffsetX number Horizontal offset for viewing larger images
function Image:setOffsetX(self, OffsetX) end
---Gets the value of the Bimg property.
---@param self Image self
---@return table {} The bimg image data
function Image:getBimg(self) end
---Gets the value of the OffsetY property.
---@param self Image self
---@return number 0 Vertical offset for viewing larger images
function Image:getOffsetY(self) end
---Gets the value of the CurrentFrame property.
---@param self Image self
---@return number 1 Current animation frame
function Image:getCurrentFrame(self) end
---@class Switch : VisualElement
---@field onBackground number color when ON
---@field text string to display next to switch
---@field autoSize boolean to automatically size the element to fit switch and text
---@field offBackground number color when OFF
---@field checked boolean switch is checked
local Switch = {}
---Gets the value of the OffBackground property.
---@param self Switch self
---@return number Background color when OFF
function Switch:getOffBackground(self) end
---Sets the value of the Checked property.
---@param self Switch self
---@param Checked boolean switch is checked
function Switch:setChecked(self, Checked) end
---Gets the value of the Checked property.
---@param self Switch self
---@return boolean Whether switch is checked
function Switch:getChecked(self) end
---Gets the value of the AutoSize property.
---@param self Switch self
---@return boolean Whether to automatically size the element to fit switch and text
function Switch:getAutoSize(self) end
---Sets the value of the OffBackground property.
---@param self Switch self
---@param OffBackground number color when OFF
function Switch:setOffBackground(self, OffBackground) end
---Sets the value of the Text property.
---@param self Switch self
---@param Text string to display next to switch
function Switch:setText(self, Text) end
---Gets the value of the Text property.
---@param self Switch self
---@return string Text to display next to switch
function Switch:getText(self) end
---Sets the value of the OnBackground property.
---@param self Switch self
---@param OnBackground number color when ON
function Switch:setOnBackground(self, OnBackground) end
---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing.
---@protected
function Switch:render() end
---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing.
---@param 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.
---@param button number The button that was clicked
---@param x number The x position of the click
---@param y number The y position of the click
---@return boolean Whether the event was handled
---@protected
function Switch:mouse_click(button, x, y) end
---Gets the value of the OnBackground property.
---@param self Switch self
---@return number Background color when ON
function Switch:getOnBackground(self) end
---Sets the value of the AutoSize property.
---@param self Switch self
---@param AutoSize boolean to automatically size the element to fit switch and text
function Switch:setAutoSize(self, AutoSize) end
---@class BaseElement : PropertySystem
---@field eventCallbacks table Collection of registered event handler functions
---@field name string User-defined name for the element
---@field enabled boolean Controls event processing for this element
---@field states table Table of currently active states with their priorities
---@field type string A hierarchical identifier of the element's type chain
---@field id string Auto-generated unique identifier for element lookup
local BaseElement = {}
---Defines a class-level event callback method with automatic event registration
---@param class table The class to register
---@param callbackName string The name of the callback to register
function BaseElement.registerEventCallback(class, callbackName) 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
---Updates all states that have auto-conditions
---@return BaseElement self
function BaseElement:updateConditionalStates() end
---Configures event listening behavior with automatic parent notification
---@param eventName string The name of the event to listen for
---@return table self The BaseElement instance
function BaseElement:listenEvent(eventName) end
---Starts profiling a method
---@param methodName string The name of the method to profile
---@return BaseElement self The element instance
function BaseElement:startProfile(methodName) end
---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 up a property change observer with immediate callback registration
---@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
---Creates a responsive builder for defining responsive states
---@param self BaseElement The element to create the builder for
---@return ResponsiveBuilder builder The responsive builder instance
function BaseElement:responsive(self) end
---Registers a class-level event listener with optional dependency
---@param class table The class to register
---@param eventName string The name of the event to register
function BaseElement.defineEvent(class, eventName) end
---Gets the value of the Type property.
---@param self BaseElement self
---@return string BaseElement A hierarchical identifier of the element's type chain
function BaseElement:getType(self) end
---Manually activates a state
---@param stateName string The state to activate
---@return BaseElement self
function BaseElement:setState(stateName) end
---Registers a responsive state that reacts to parent size changes
---@param stateName string The name of the state
---@param condition string |function Condition as string expression or function: function(element) return boolean end
---@return BaseElement self
function BaseElement:registerResponsiveState(stateName, condition) end
---Registers a callback for store changes
---@param self BaseElement The element to watch
---@param storeName string The store to watch
---@param callback function Called with (element, newValue, oldValue)
---@return BaseElement self The element instance
function BaseElement:onStoreChange(self, storeName, callback) end
---Sets the value of the Type property.
---@param self BaseElement self
---@param Type string A hierarchical identifier of the element's type chain
function BaseElement:setType(self, Type) 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
---Removes a state from the registry
---@param stateName string The state to remove
---@return BaseElement self
function BaseElement:unregisterState(stateName) end
---Dumps debug information for this element
---@param self BaseElement The element to dump debug info for
function BaseElement.dumpDebug(self) end
---Enables benchmarking for a method
---@param methodName string The name of the method to benchmark
---@return BaseElement self The element instance
function BaseElement:benchmark(methodName) end
---Manually deactivates a state
---@param stateName string The state to deactivate
---@return BaseElement self
function BaseElement:unsetState(stateName) end
---Removes the element from UI tree and cleans up resources
function BaseElement:destroy() end
---Gets the value of the EventCallbacks property.
---@param self BaseElement self
---@return table BaseElement Collection of registered event handler functions
function BaseElement:getEventCallbacks(self) 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
---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
---Removes a store change observer
---@param self BaseElement The element to remove observer from
---@param storeName string The store to remove observer from
---@param callback function The callback function to remove
---@return BaseElement self The element instance
function BaseElement:removeStoreChange(self, storeName, callback) end
---Gets the value of a store
---@param self BaseElement The element to get store from
---@param name string The name of the store
---@return any value The current store value
function BaseElement:getStore(self, name) end
---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
---Gets the highest priority active state
---@return string |nil currentState The state with highest priority
function BaseElement:getCurrentState() end
---Binds a property to a store
---@param self BaseElement The element to bind
---@param propertyName string The property to bind
---@param storeName string The store to bind to (optional, uses propertyName if not provided)
---@return BaseElement self The element instance
function BaseElement:bind(self, propertyName, storeName) 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
---Sets the value of the States property.
---@param self BaseElement self
---@param States table Table of currently active states with their priorities
function BaseElement:setStates(self, States) end
---Registers a new state with optional auto-condition
---@param stateName string The name of the state
---@return BaseElement self The BaseElement instance
function BaseElement:registerState(stateName) end
---Adds an event handler function with automatic event registration
---@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
---Checks if the element matches or inherits from the specified 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 Enabled property.
---@param self BaseElement self
---@return boolean BaseElement Controls event processing for this element
function BaseElement:getEnabled(self) end
---Executes all registered callbacks for the specified event
---@param event string The event to fire
---@return table self The BaseElement instance
function BaseElement:fireEvent(event) end
---Checks if a state is currently active
---@param stateName string The state to check
---@return boolean isActive
function BaseElement:hasState(stateName) end
function BaseElement:computed() end
---Gets all currently active states sorted by priority
---@return table states Array of {name, priority} sorted by priority
function BaseElement:getActiveStates() end
---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
---Sets the value of the EventCallbacks property.
---@param self BaseElement self
---@param EventCallbacks table Collection of registered event handler functions
function BaseElement:setEventCallbacks(self, EventCallbacks) end
---Sets the value of a store
---@param self BaseElement The element to set store for
---@param name string The name of the store
---@param value any The new value for the store
---@return BaseElement self The element instance
function BaseElement:setStore(self, name, value) 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
---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
---Sets the value of the Name property.
---@param self BaseElement self
---@param Name string User-defined name for the element
function BaseElement:setName(self, Name) end
---Propagates render request up the element tree
---@return table self The BaseElement instance
function BaseElement:updateRender() end
---Sets the value of the Id property.
---@param self BaseElement self
---@param Id string Auto-generated unique identifier for element lookup
function BaseElement:setId(self, Id) end
---Gets the value of the Id property.
---@param self BaseElement self
---@return string BaseElement Auto-generated unique identifier for element lookup
function BaseElement:getId(self) end
---Traverses parent chain to locate the root frame element
---@return BaseFrame BaseFrame The base frame of the element
function BaseElement:getBaseFrame() end
---Gets the value of the Name property.
---@param self BaseElement self
---@return string BaseElement User-defined name for the element
function BaseElement:getName(self) end
---Sets the value of the Enabled property.
---@param self BaseElement self
---@param Enabled boolean Controls event processing for this element
function BaseElement:setEnabled(self, Enabled) end
---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing.
---@param event string The event to handle
---@return boolean ? handled Whether the event was handled
---@protected
function BaseElement:handleEvent(event) end
---Gets the value of the States property.
---@param self BaseElement self
---@return table {} Table of currently active states with their priorities
function BaseElement:getStates(self) end
---@class BigFontText
local BigFontText = {}
---@class Slider : VisualElement
---@field barColor color Color of the slider track
---@field step number Current position of the slider handle (1 to width/height)
---@field horizontal boolean Whether the slider is horizontal (false for vertical)
---@field max number Maximum value for value conversion (maps slider position to this range)
---@field sliderColor color Color of the slider handle
local Slider = {}
---Gets the value of the SliderColor property.
---@param self Slider self
---@return color blue Color of the slider handle
function Slider:getSliderColor(self) end
---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing.
---@param button number The mouse button that was released
---@param x number The x position of the release
---@param y number The y position of the release
---@return boolean handled Whether the event was handled
---@protected
function Slider:mouse_scroll(button, x, y) end
---Gets the value of the Max property.
---@param self Slider self
---@return number 100 Maximum value for value conversion (maps slider position to this range)
function Slider:getMax(self) end
---Gets the value of the Horizontal property.
---@param self Slider self
---@return boolean true Whether the slider is horizontal (false for vertical)
function Slider:getHorizontal(self) end
---Sets the value of the Step property.
---@param self Slider self
---@param Step number Current position of the slider handle (1 to width/height)
function Slider:setStep(self, Step) end
---Sets the value of the Horizontal property.
---@param self Slider self
---@param Horizontal boolean Whether the slider is horizontal (false for vertical)
function Slider:setHorizontal(self, Horizontal) end
---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing.
---@param button number The mouse button that was clicked
---@param x number The x position of the click
---@param y number The y position of the click
---@return boolean handled Whether the event was handled
---@protected
function Slider:mouse_click(button, x, y) end
---Registers a function to handle the onChange event.
---@param value number
---@param self Slider self
---@param func function The function to be called when the event fires
function Slider:onOnChange(self, func) end
---Gets the current value of the slider
---@return number value The current value (0 to max)
function Slider:getValue() end
---Gets the value of the Step property.
---@param self Slider self
---@return number 1 Current position of the slider handle (1 to width/height)
function Slider:getStep(self) end
---Sets the value of the Max property.
---@param self Slider self
---@param Max number Maximum value for value conversion (maps slider position to this range)
function Slider:setMax(self, Max) end
---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing.
---@protected
function Slider:render() end
---Sets the value of the BarColor property.
---@param self Slider self
---@param BarColor color Color of the slider track
function Slider:setBarColor(self, BarColor) end
---Gets the value of the BarColor property.
---@param self Slider self
---@return color gray Color of the slider track
function Slider:getBarColor(self) end
---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing.
---@param props table The properties to initialize the element with
---@param basalt table The basalt instance
---@return Slider self The initialized instance
---@protected
function Slider:init(props, basalt) end
---Sets the value of the SliderColor property.
---@param self Slider self
---@param SliderColor color Color of the slider handle
function Slider:setSliderColor(self, SliderColor) end
---@class TextBox : VisualElement
---@field autoCompleteEnabled boolean Whether autocomplete suggestions are enabled
---@field autoCompleteSelectedForeground color Foreground color for the selected suggestion
---@field autoPairEnabled boolean Whether automatic bracket/quote pairing is enabled
---@field autoCompleteBorderColor color Color of the popup border when enabled
---@field autoCompleteOffsetY number Vertical offset applied to the popup frame relative to the TextBox bottom edge
---@field autoCompleteAcceptOnEnter boolean Whether pressing Enter accepts the current suggestion
---@field autoCompleteProvider function Optional suggestion provider returning a list for the current prefix
---@field cursorColor number Color of the cursor
---@field autoCompleteForeground color Foreground color of the suggestion popup
---@field autoCompleteAcceptOnClick boolean Whether clicking a suggestion accepts it immediately
---@field autoPairNewlineIndent boolean On Enter between matching braces, create blank line and keep closing aligned
---@field autoCompleteSelectedBackground color Background color for the selected suggestion
---@field autoCompleteOffsetX number Horizontal offset applied to the popup frame relative to the TextBox
---@field autoCompleteItems table List of suggestions used when no provider is supplied
---@field scrollX number Horizontal scroll offset
---@field autoCompleteMaxItems number Maximum number of visible suggestions
---@field autoCompleteMaxWidth number Maximum width of the autocomplete popup (0 uses the textbox width)
---@field lines table Array of text lines
---@field editable boolean Whether text can be edited
---@field autoPairSkipClosing boolean Skip inserting a closing char if the same one is already at cursor
---@field autoCompleteCloseOnEscape boolean Whether pressing Escape closes the popup
---@field autoCompleteMinChars number Minimum characters required before showing suggestions
---@field autoCompleteCaseInsensitive boolean Whether suggestions should match case-insensitively
---@field autoPairCharacters table ["("]=")", ["["]="]", ["{"]="}", ['"']='"', ['\'']='\'', ['`']='`'} Mapping of opening to closing characters for auto pairing
---@field cursorX number Cursor X position
---@field autoPairOverType boolean When pressing a closing char that matches the next char, move over it instead of inserting
---@field autoCompleteZOffset number Z-index offset applied to the popup frame
---@field cursorY number Cursor Y position (line number)
---@field syntaxPatterns table Syntax highlighting patterns
---@field scrollY number Vertical scroll offset
---@field autoCompleteBackground color Background color of the suggestion popup
---@field autoCompleteShowBorder boolean Whether to render a character border around the popup
---@field autoCompleteTokenPattern string Pattern used to extract the current token for suggestions
local TextBox = {}
---Sets the value of the AutoPairNewlineIndent property.
---@param self TextBox self
---@param AutoPairNewlineIndent boolean On Enter between matching braces, create blank line and keep closing aligned
function TextBox:setAutoPairNewlineIndent(self, AutoPairNewlineIndent) end
---Removes a syntax pattern by index (1-based)
---@param index number The index of the pattern to remove
---@return TextBox self
function TextBox:removeSyntaxPattern(index) end
---Gets the value of the ScrollX property.
---@param self TextBox self
---@return number 0 Horizontal scroll offset
function TextBox:getScrollX(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:focus() end
---Sets the value of the AutoCompleteOffsetY property.
---@param self TextBox self
---@param AutoCompleteOffsetY number Vertical offset applied to the popup frame relative to the TextBox bottom edge
function TextBox:setAutoCompleteOffsetY(self, AutoCompleteOffsetY) end
---Gets the value of the AutoCompleteOffsetY property.
---@param self TextBox self
---@return number 1 Vertical offset applied to the popup frame relative to the TextBox bottom edge
function TextBox:getAutoCompleteOffsetY(self) end
---Gets the value of the AutoPairOverType property.
---@param self TextBox self
---@return boolean true When pressing a closing char that matches the next char, move over it instead of inserting
function TextBox:getAutoPairOverType(self) end
---Sets the value of the AutoCompleteZOffset property.
---@param self TextBox self
---@param AutoCompleteZOffset number Z-index offset applied to the popup frame
function TextBox:setAutoCompleteZOffset(self, AutoCompleteZOffset) end
---Adds a new syntax highlighting pattern
---@param pattern string The regex pattern to match
---@param color number The color to apply
---@return TextBox self The TextBox instance
function TextBox:addSyntaxPattern(pattern, color) end
---Gets the value of the AutoCompleteSelectedForeground property.
---@param self TextBox self
---@return color white Foreground color for the selected suggestion
function TextBox:getAutoCompleteSelectedForeground(self) end
---Sets the value of the AutoCompleteCaseInsensitive property.
---@param self TextBox self
---@param AutoCompleteCaseInsensitive boolean Whether suggestions should match case-insensitively
function TextBox:setAutoCompleteCaseInsensitive(self, AutoCompleteCaseInsensitive) end
---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 AutoCompleteBorderColor property.
---@param self TextBox self
---@param AutoCompleteBorderColor color Color of the popup border when enabled
function TextBox:setAutoCompleteBorderColor(self, AutoCompleteBorderColor) end
---Sets the value of the CursorY property.
---@param self TextBox self
---@param CursorY number Cursor Y position (line number)
function TextBox:setCursorY(self, CursorY) end
---Sets the value of the AutoCompleteSelectedBackground property.
---@param self TextBox self
---@param AutoCompleteSelectedBackground color Background color for the selected suggestion
function TextBox:setAutoCompleteSelectedBackground(self, AutoCompleteSelectedBackground) end
---Sets the value of the Editable property.
---@param self TextBox self
---@param Editable boolean Whether text can be edited
function TextBox:setEditable(self, Editable) end
---Gets the value of the AutoCompleteItems property.
---@param self TextBox self