Update

Update

Update

Update

Update

Update

Update

Update

Update
This commit is contained in:
2025-05-04 20:46:46 +02:00
parent 169a514973
commit 8e28d1a570
38 changed files with 2668 additions and 89 deletions

4
Globals.lua Normal file
View File

@@ -0,0 +1,4 @@
---@meta
---@type Frame
UIParent = {}

View File

@@ -1,12 +1,14 @@
---@diagnostic disable: missing-return, lowercase-global ---@diagnostic disable: missing-return, lowercase-global
---@meta ---@meta
---@param unit string ---@alias distIndex
---@param distIndex 4 ---| 1
---@param 1 ---| 2
---@param 2 ---| 3
---@param 3 ---| 4
---@param 4
---@return 1nil canInteract ---@param unit string
---@param distIndex distIndex
---@return boolean canInteract
---Returns whether the player is close enough to a unit for certain types of interaction ---Returns whether the player is close enough to a unit for certain types of interaction
function CheckInteractDistance(unit, distIndex, 1, 2, 3, 4) end function CheckInteractDistance(unit, distIndex) end

View File

@@ -1,7 +1,7 @@
---@diagnostic disable: missing-return, lowercase-global ---@diagnostic disable: missing-return, lowercase-global
---@meta ---@meta
---@param unit unitID ---@param unit string
---@return 1nil success ---@return boolean success
---Enables comparing achievements/statistics with another player. After a call to this function, the INSPECTACHIEVEMENTREADY event fires to indicate that achievement/statistic comparison functions will return valid data on the given unit. ---Enables comparing achievements/statistics with another player. After a call to this function, the INSPECTACHIEVEMENTREADY event fires to indicate that achievement/statistic comparison functions will return valid data on the given unit.
function SetAchievementComparisonUnit(unit) end function SetAchievementComparisonUnit(unit) end

28
ui/Alpha.lua Normal file
View File

@@ -0,0 +1,28 @@
---@meta
---@class Alpha : Animation
Alpha = {
--- Gets the ending alpha value.
--- @return number alpha The ending alpha value.
--- @example
--- local alpha = myAlpha:GetEndAlpha()
GetEndAlpha = function(self) end,
--- Gets the starting alpha value.
--- @return number alpha The starting alpha value.
--- @example
--- local alpha = myAlpha:GetStartAlpha()
GetStartAlpha = function(self) end,
--- Sets the ending alpha value.
--- @param alpha number The ending alpha value (0.0 to 1.0).
--- @example
--- myAlpha:SetEndAlpha(1.0)
SetEndAlpha = function(self, alpha) end,
--- Sets the starting alpha value.
--- @param alpha number The starting alpha value (0.0 to 1.0).
--- @example
--- myAlpha:SetStartAlpha(0.0)
SetStartAlpha = function(self, alpha) end,
}

103
ui/Animation.lua Normal file
View File

@@ -0,0 +1,103 @@
---@meta
---@class Animation : UIObject
Animation = {
--- Gets the animation group this animation belongs to.
--- @return AnimationGroup group The parent animation group.
--- @example
--- local group = myAnimation:GetAnimationGroup()
GetAnimationGroup = function(self) end,
--- Gets the delay before the animation starts.
--- @return number delay The delay in seconds.
--- @example
--- local delay = myAnimation:GetDelay()
GetDelay = function(self) end,
--- Gets the duration of the animation.
--- @return number duration The duration in seconds.
--- @example
--- local duration = myAnimation:GetDuration()
GetDuration = function(self) end,
--- Gets the animation's current elapsed time.
--- @return number elapsed The elapsed time in seconds.
--- @example
--- local elapsed = myAnimation:GetElapsed()
GetElapsed = function(self) end,
--- Gets the animation's current progress.
--- @return number progress The progress (0.0 to 1.0).
--- @example
--- local progress = myAnimation:GetProgress()
GetProgress = function(self) end,
--- Gets the smoothing type ("IN", "OUT", "IN_OUT", "OUT_IN", "NONE").
--- @return string smoothing The smoothing type.
--- @example
--- local smoothing = myAnimation:GetSmoothing()
GetSmoothing = function(self) end,
--- Gets whether the animation plays in reverse.
--- @return boolean isReverse True if playing in reverse.
--- @example
--- local isReverse = myAnimation:IsReverse()
IsReverse = function(self) end,
--- Gets whether the animation is currently playing.
--- @return boolean isPlaying True if playing.
--- @example
--- local isPlaying = myAnimation:IsPlaying()
IsPlaying = function(self) end,
--- Gets whether the animation is currently paused.
--- @return boolean isPaused True if paused.
--- @example
--- local isPaused = myAnimation:IsPaused()
IsPaused = function(self) end,
--- Gets whether the animation is currently stopped.
--- @return boolean isStopped True if stopped.
--- @example
--- local isStopped = myAnimation:IsStopped()
IsStopped = function(self) end,
--- Pauses the animation.
--- @example
--- myAnimation:Pause()
Pause = function(self) end,
--- Plays the animation.
--- @example
--- myAnimation:Play()
Play = function(self) end,
--- Sets the delay before the animation starts.
--- @param delay number The delay in seconds.
--- @example
--- myAnimation:SetDelay(0.5)
SetDelay = function(self, delay) end,
--- Sets the duration of the animation.
--- @param duration number The duration in seconds.
--- @example
--- myAnimation:SetDuration(1.0)
SetDuration = function(self, duration) end,
--- Sets whether the animation plays in reverse.
--- @param reverse boolean True to play in reverse.
--- @example
--- myAnimation:SetReverse(true)
SetReverse = function(self, reverse) end,
--- Sets the smoothing type.
--- @param smoothing string The smoothing type ("IN", "OUT", "IN_OUT", "OUT_IN", "NONE").
--- @example
--- myAnimation:SetSmoothing("IN_OUT")
SetSmoothing = function(self, smoothing) end,
--- Stops the animation.
--- @example
--- myAnimation:Stop()
Stop = function(self) end,
}

101
ui/AnimationGroup.lua Normal file
View File

@@ -0,0 +1,101 @@
---@meta
---@class AnimationGroup : UIObject
AnimationGroup = {
--- Creates a new animation of the specified type.
--- @param animationType string The type of animation to create.
--- @param name? string Optional. The name for the new animation.
--- @param inheritsFrom? string Optional. Template to inherit from.
--- @return Animation animation The created animation.
--- @example
--- local alpha = myAnimGroup:CreateAnimation("Alpha", "FadeOut")
CreateAnimation = function(self, animationType, name, inheritsFrom) end,
--- Gets the animation at the specified index.
--- @param index number The index of the animation.
--- @return Animation animation The animation at the index.
--- @example
--- local anim = myAnimGroup:GetAnimation(1)
GetAnimation = function(self, index) end,
--- Gets the number of animations in the group.
--- @return number count The number of animations.
--- @example
--- local count = myAnimGroup:GetAnimations()
GetAnimations = function(self) end,
--- Gets the duration of the animation group.
--- @return number duration The duration in seconds.
--- @example
--- local duration = myAnimGroup:GetDuration()
GetDuration = function(self) end,
--- Gets the animation group's current progress.
--- @return number progress The progress (0.0 to 1.0).
--- @example
--- local progress = myAnimGroup:GetProgress()
GetProgress = function(self) end,
--- Gets the number of times to loop.
--- @return number loopCount The loop count (-1 for infinite).
--- @example
--- local loops = myAnimGroup:GetLooping()
GetLooping = function(self) end,
--- Gets whether the animation group plays in reverse.
--- @return boolean isReverse True if playing in reverse.
--- @example
--- local isReverse = myAnimGroup:IsReverse()
IsReverse = function(self) end,
--- Gets whether the animation group is currently playing.
--- @return boolean isPlaying True if playing.
--- @example
--- local isPlaying = myAnimGroup:IsPlaying()
IsPlaying = function(self) end,
--- Gets whether the animation group is currently paused.
--- @return boolean isPaused True if paused.
--- @example
--- local isPaused = myAnimGroup:IsPaused()
IsPaused = function(self) end,
--- Gets whether the animation group is currently stopped.
--- @return boolean isStopped True if stopped.
--- @example
--- local isStopped = myAnimGroup:IsStopped()
IsStopped = function(self) end,
--- Pauses the animation group.
--- @example
--- myAnimGroup:Pause()
Pause = function(self) end,
--- Plays the animation group.
--- @example
--- myAnimGroup:Play()
Play = function(self) end,
--- Sets whether the animation group plays in reverse.
--- @param reverse boolean True to play in reverse.
--- @example
--- myAnimGroup:SetReverse(true)
SetReverse = function(self, reverse) end,
--- Sets the number of times to loop.
--- @param loopType string The loop type ("NONE", "REPEAT", "BOUNCE").
--- @param loopCount? number Optional. Number of times to loop (-1 for infinite).
--- @example
--- myAnimGroup:SetLooping("REPEAT", -1)
SetLooping = function(self, loopType, loopCount) end,
--- Stops the animation group.
--- @example
--- myAnimGroup:Stop()
Stop = function(self) end,
--- Finishes the current animation loop.
--- @example
--- myAnimGroup:Finish()
Finish = function(self) end,
}

95
ui/Button.lua Normal file
View File

@@ -0,0 +1,95 @@
---@meta
---@class Button : Frame
Button = {
--- Clicks the button programmatically.
--- @param button? string Optional. The mouse button to simulate ("LeftButton", "RightButton", "MiddleButton").
--- @param down? boolean Optional. Whether the button is being pressed down.
--- @example
--- myButton:Click()
Click = function(self, button, down) end,
--- Gets the button state.
--- @return string state The button state ("PUSHED", "NORMAL").
--- @example
--- local state = myButton:GetButtonState()
GetButtonState = function(self) end,
--- Gets the text displayed on the button.
--- @return string text The button text.
--- @example
--- local text = myButton:GetText()
GetText = function(self) end,
--- Gets the texture for the specified state.
--- @param stateIndex number The state index.
--- @return Texture texture The state texture.
--- @example
--- local texture = myButton:GetTextureStateTexture(1)
GetTextureStateTexture = function(self, stateIndex) end,
--- Enables or disables the button.
--- @param enabled boolean True to enable the button.
--- @example
--- myButton:Enable()
Enable = function(self, enabled) end,
--- Disables the button.
--- @example
--- myButton:Disable()
Disable = function(self) end,
--- Returns whether the button is enabled.
--- @return boolean enabled True if the button is enabled.
--- @example
--- local enabled = myButton:IsEnabled()
IsEnabled = function(self) end,
--- Sets whether the button is locked.
--- @param locked boolean True to lock the button.
--- @example
--- myButton:LockHighlight(true)
LockHighlight = function(self, locked) end,
--- Registers the button for drag events.
--- @param ... string The mouse buttons to register ("LeftButton", "RightButton", "MiddleButton").
--- @example
--- myButton:RegisterForDrag("LeftButton", "RightButton")
RegisterForDrag = function(self, ...) end,
--- Sets the button state.
--- @param state string The state to set ("PUSHED", "NORMAL").
--- @example
--- myButton:SetButtonState("PUSHED")
SetButtonState = function(self, state) end,
--- Sets whether the button is enabled.
--- @param enabled boolean True to enable the button.
--- @example
--- myButton:SetEnabled(true)
SetEnabled = function(self, enabled) end,
--- Sets the font string used for the button text.
--- @param fontString FontString The font string to use.
--- @example
--- myButton:SetFontString(myFontString)
SetFontString = function(self, fontString) end,
--- Sets the button text.
--- @param text string The text to display.
--- @example
--- myButton:SetText("Click Me")
SetText = function(self, text) end,
--- Sets the texture for a button state.
--- @param texture Texture|string The texture or texture path.
--- @param stateIndex number The state index.
--- @example
--- myButton:SetTextureStateTexture(myTexture, 1)
SetTextureStateTexture = function(self, texture, stateIndex) end,
--- Unlocks the button highlight.
--- @example
--- myButton:UnlockHighlight()
UnlockHighlight = function(self) end,
}

40
ui/CheckButton.lua Normal file
View File

@@ -0,0 +1,40 @@
---@meta
---@class CheckButton : Button
CheckButton = {
--- Gets the checked state of the checkbox.
--- @return boolean checked True if the checkbox is checked.
--- @example
--- local checked = myCheckButton:GetChecked()
GetChecked = function(self) end,
--- Gets the texture used for a checked box.
--- @return Texture texture The checked texture.
--- @example
--- local texture = myCheckButton:GetCheckedTexture()
GetCheckedTexture = function(self) end,
--- Gets the texture used for a disabled checked box.
--- @return Texture texture The disabled checked texture.
--- @example
--- local texture = myCheckButton:GetDisabledCheckedTexture()
GetDisabledCheckedTexture = function(self) end,
--- Sets the checked state of the checkbox.
--- @param checked boolean True to check the checkbox.
--- @example
--- myCheckButton:SetChecked(true)
SetChecked = function(self, checked) end,
--- Sets the texture to use for a checked box.
--- @param texture Texture|string The texture or texture path.
--- @example
--- myCheckButton:SetCheckedTexture("Interface\\Buttons\\UI-CheckBox-Check")
SetCheckedTexture = function(self, texture) end,
--- Sets the texture to use for a disabled checked box.
--- @param texture Texture|string The texture or texture path.
--- @example
--- myCheckButton:SetDisabledCheckedTexture("Interface\\Buttons\\UI-CheckBox-Check-Disabled")
SetDisabledCheckedTexture = function(self, texture) end,
}

36
ui/ColorSelect.lua Normal file
View File

@@ -0,0 +1,36 @@
---@meta
---@class ColorSelect : Frame
ColorSelect = {
--- Gets the currently selected color.
--- @return number h The hue value (0-1).
--- @return number s The saturation value (0-1).
--- @return number v The brightness value (0-1).
--- @example
--- local h, s, v = myColorSelect:GetColorHSV()
GetColorHSV = function(self) end,
--- Gets the RGB values of the currently selected color.
--- @return number r The red value (0-1).
--- @return number g The green value (0-1).
--- @return number b The blue value (0-1).
--- @example
--- local r, g, b = myColorSelect:GetColorRGB()
GetColorRGB = function(self) end,
--- Sets the color using HSV values.
--- @param h number The hue value (0-1).
--- @param s number The saturation value (0-1).
--- @param v number The brightness value (0-1).
--- @example
--- myColorSelect:SetColorHSV(0.5, 1.0, 1.0)
SetColorHSV = function(self, h, s, v) end,
--- Sets the color using RGB values.
--- @param r number The red value (0-1).
--- @param g number The green value (0-1).
--- @param b number The blue value (0-1).
--- @example
--- myColorSelect:SetColorRGB(1.0, 0.0, 0.0)
SetColorRGB = function(self, r, g, b) end,
}

48
ui/Cooldown.lua Normal file
View File

@@ -0,0 +1,48 @@
---@meta
---@class Cooldown : Frame
Cooldown = {
--- Gets whether the cooldown is showing the countdown numbers.
--- @return boolean isShowing Whether the countdown numbers are showing.
--- @example
--- local isShowing = myCooldown:GetDrawEdge()
GetDrawEdge = function(self) end,
--- Gets whether the cooldown is showing the edge sparkle.
--- @return boolean isShowing Whether the edge sparkle is showing.
--- @example
--- local isShowing = myCooldown:GetDrawSwipe()
GetDrawSwipe = function(self) end,
--- Gets whether the cooldown is reversed (filling up instead of emptying).
--- @return boolean isReversed Whether the cooldown is reversed.
--- @example
--- local isReversed = myCooldown:GetReverse()
GetReverse = function(self) end,
--- Sets whether the cooldown shows countdown numbers.
--- @param show boolean Whether to show countdown numbers.
--- @example
--- myCooldown:SetDrawEdge(true)
SetDrawEdge = function(self, show) end,
--- Sets whether the cooldown shows the edge sparkle.
--- @param show boolean Whether to show the edge sparkle.
--- @example
--- myCooldown:SetDrawSwipe(true)
SetDrawSwipe = function(self, show) end,
--- Sets whether the cooldown fills up (true) or empties (false).
--- @param reverse boolean Whether to reverse the cooldown.
--- @example
--- myCooldown:SetReverse(true)
SetReverse = function(self, reverse) end,
--- Sets the cooldown timer.
--- @param start number Start time in seconds.
--- @param duration number Duration in seconds.
--- @param enable boolean? Optional. Whether to enable the cooldown.
--- @example
--- myCooldown:SetCooldown(GetTime(), 30)
SetCooldown = function(self, start, duration, enable) end,
}

20
ui/DressUpModel.lua Normal file
View File

@@ -0,0 +1,20 @@
---@meta
---@class DressUpModel : PlayerModel
DressUpModel = {
--- Sets the model to reflect the character's current inventory.
--- @example
--- myDressUpModel:Dress()
Dress = function(self) end,
--- Adds the specified item to the model.
--- @param itemID string|number The item ID or link to try on.
--- @example
--- myDressUpModel:TryOn("item:12345:0:0:0:0:0:0:0")
TryOn = function(self, itemID) end,
--- Sets the model to reflect the character without inventory.
--- @example
--- myDressUpModel:Undress()
Undress = function(self) end,
}

269
ui/EditBox.lua Normal file
View File

@@ -0,0 +1,269 @@
---@meta
---@class EditBox : Frame, FontInstance
EditBox = {
--- Adds text to the edit history.
--- @param self EditBox
--- @param text string The text to add to the history.
--- @example
--- myEditBox:AddHistoryLine("Previous input")
AddHistoryLine = function(self, text) end,
--- Removes text input focus from this edit box.
--- @param self EditBox
--- @example
--- myEditBox:ClearFocus()
ClearFocus = function(self) end,
--- Returns whether only alt+arrow keys work for navigating the edit box, not arrow keys alone.
--- @param self EditBox
--- @return boolean ignoreArrows True if only alt+arrow keys are used.
--- @example
--- local ignoreArrows = myEditBox:GetAltArrowKeyMode()
GetAltArrowKeyMode = function(self) end,
--- Gets the blink speed of the EditBox in seconds.
--- @param self EditBox
--- @return number blinkSpeed The blink speed of the cursor.
--- @example
--- local blinkSpeed = myEditBox:GetBlinkSpeed()
GetBlinkSpeed = function(self) end,
--- Gets the position of the cursor inside the EditBox.
--- @param self EditBox
--- @return number position The current cursor position.
--- @example
--- local cursorPos = myEditBox:GetCursorPosition()
GetCursorPosition = function(self) end,
--- Gets the number of history lines for this edit box.
--- @param self EditBox
--- @return number historyLines The number of history lines.
--- @example
--- local historyLines = myEditBox:GetHistoryLines()
GetHistoryLines = function(self) end,
--- Returns whether hyperlinks are enabled in the EditBox.
--- @param self EditBox
--- @return boolean enabled True if hyperlinks are enabled.
--- @example
--- local enabled = myEditBox:GetHyperlinksEnabled()
GetHyperlinksEnabled = function(self) end,
--- Gets the input language (locale based, not in-game).
--- @param self EditBox
--- @return string inputLanguage The current input language.
--- @example
--- local inputLanguage = myEditBox:GetInputLanguage()
GetInputLanguage = function(self) end,
--- Gets the maximum number of bytes allowed in the EditBox.
--- @param self EditBox
--- @return number maxBytes The maximum byte size.
--- @example
--- local maxBytes = myEditBox:GetMaxBytes()
GetMaxBytes = function(self) end,
--- Gets the maximum number of letters allowed in the EditBox.
--- @param self EditBox
--- @return number maxLetters The maximum number of letters.
--- @example
--- local maxLetters = myEditBox:GetMaxLetters()
GetMaxLetters = function(self) end,
--- Gets the number of letters in the box.
--- @param self EditBox
--- @return number numLetters The number of letters.
--- @example
--- local numLetters = myEditBox:GetNumLetters()
GetNumLetters = function(self) end,
--- Returns the number entered in the edit box, or 0 if the text is not a number.
--- @param self EditBox
--- @return number number The number entered.
--- @example
--- local number = myEditBox:GetNumber()
GetNumber = function(self) end,
--- Gets the current text contained in the edit box.
--- @param self EditBox
--- @return string text The current text.
--- @example
--- local text = myEditBox:GetText()
GetText = function(self) end,
--- Gets the text display insets for the EditBox.
--- @param self EditBox
--- @return number left The left inset.
--- @return number right The right inset.
--- @return number top The top inset.
--- @return number bottom The bottom inset.
--- @example
--- local left, right, top, bottom = myEditBox:GetTextInsets()
GetTextInsets = function(self) end,
--- Sets the highlight to all or some of the edit box text.
--- @param self EditBox
--- @param startPos number? Optional. The start position of the highlight.
--- @param endPos number? Optional. The end position of the highlight.
--- @example
--- myEditBox:HighlightText(1, 5) -- Highlight first 5 characters
HighlightText = function(self, startPos, endPos) end,
--- Inserts text into the edit box.
--- @param self EditBox
--- @param text string The text to insert.
--- @example
--- myEditBox:Insert("Hello")
Insert = function(self, text) end,
--- Determines if the EditBox has autofocus enabled.
--- @param self EditBox
--- @return boolean autoFocus True if auto focus is enabled.
--- @example
--- local autoFocus = myEditBox:IsAutoFocus()
IsAutoFocus = function(self) end,
--- Determines if the EditBox accepts multiple lines.
--- @param self EditBox
--- @return boolean multiLine True if multi-line is enabled.
--- @example
--- local multiLine = myEditBox:IsMultiLine()
IsMultiLine = function(self) end,
--- Determines if the EditBox only accepts numeric input.
--- @param self EditBox
--- @return boolean numeric True if numeric input is enabled.
--- @example
--- local numeric = myEditBox:IsNumeric()
IsNumeric = function(self) end,
--- Determines if the EditBox performs password masking.
--- @param self EditBox
--- @return boolean password True if password masking is enabled.
--- @example
--- local password = myEditBox:IsPassword()
IsPassword = function(self) end,
--- Sets whether only alt+arrow keys work for navigating the edit box.
--- @param self EditBox
--- @param enable boolean True to enable alt+arrow key navigation.
--- @example
--- myEditBox:SetAltArrowKeyMode(true)
SetAltArrowKeyMode = function(self, enable) end,
--- Sets whether or not the edit box will attempt to get input focus when it gets shown.
--- @param self EditBox
--- @param state boolean True to enable auto focus.
--- @example
--- myEditBox:SetAutoFocus(true)
SetAutoFocus = function(self, state) end,
--- Sets the blink speed of the cursor.
--- @param self EditBox
--- @param blinkSpeed number The blink speed to set.
--- @example
--- myEditBox:SetBlinkSpeed(0.5)
SetBlinkSpeed = function(self, blinkSpeed) end,
--- Sets the position of the cursor within the EditBox.
--- @param self EditBox
--- @param position number The position to set the cursor to.
--- @example
--- myEditBox:SetCursorPosition(5) -- Move cursor to the 5th character
SetCursorPosition = function(self, position) end,
--- Moves input focus (the cursor) to this edit box.
--- @param self EditBox
--- @example
--- myEditBox:SetFocus()
SetFocus = function(self) end,
--- Sets the font to use for display.
--- @param self EditBox
--- @param font string The font to set.
--- @param size number The size of the font.
--- @param flags string? Optional. The font flags.
--- @example
--- myEditBox:SetFont("Fonts\\FRIZQT__.TTF", 12, "OUTLINE")
SetFont = function(self, font, size, flags) end,
--- Sets the number of history lines to remember.
--- @param self EditBox
--- @param historyLines number The number of history lines.
--- @example
--- myEditBox:SetHistoryLines(10)
SetHistoryLines = function(self, historyLines) end,
--- Sets whether hyperlinks are enabled in the EditBox.
--- @param self EditBox
--- @param enableFlag boolean True to enable hyperlinks.
--- @example
--- myEditBox:SetHyperlinksEnabled(true)
SetHyperlinksEnabled = function(self, enableFlag) end,
--- Sets the maximum byte size for entered text.
--- @param self EditBox
--- @param maxBytes number The maximum byte size to set.
--- @example
--- myEditBox:SetMaxBytes(255)
SetMaxBytes = function(self, maxBytes) end,
--- Sets the maximum number of letters for entered text.
--- @param self EditBox
--- @param maxLetters number The maximum number of letters to set.
--- @example
--- myEditBox:SetMaxLetters(100)
SetMaxLetters = function(self, maxLetters) end,
--- Sets the EditBox's multi-line state.
--- @param self EditBox
--- @param state boolean True to enable multi-line input.
--- @example
--- myEditBox:SetMultiLine(true)
SetMultiLine = function(self, state) end,
--- Sets the number in the edit box.
--- @param self EditBox
--- @param number number The number to set.
--- @example
--- myEditBox:SetNumber(42)
SetNumber = function(self, number) end,
--- Sets if the EditBox only accepts numeric input.
--- @param self EditBox
--- @param state boolean True to enable numeric input only.
--- @example
--- myEditBox:SetNumeric(true)
SetNumeric = function(self, state) end,
--- Sets the EditBox's password masking state.
--- @param self EditBox
--- @param state boolean True to enable password masking.
--- @example
--- myEditBox:SetPassword(true)
SetPassword = function(self, state) end,
--- Sets the text contained in the edit box.
--- @param self EditBox
--- @param text string The text to set.
--- @example
--- myEditBox:SetText("Hello World")
SetText = function(self, text) end,
--- Sets the text display insets for the EditBox.
--- @param self EditBox
--- @param left number The left inset.
--- @param right number The right inset.
--- @param top number The top inset.
--- @param bottom number The bottom inset.
--- @example
--- myEditBox:SetTextInsets(5, 5, 5, 5)
SetTextInsets = function(self, left, right, top, bottom) end,
--- Toggles the input language for the edit box.
--- @param self EditBox
--- @example
--- myEditBox:ToggleInputLanguage()
ToggleInputLanguage = function(self) end,
}

20
ui/Font.lua Normal file
View File

@@ -0,0 +1,20 @@
---@meta
---@class Font : FontInstance
Font = {
--- Gets the font object's font path, height, and flags.
--- @return string path The font path.
--- @return number height The font height.
--- @return string flags The font flags.
--- @example
--- local path, height, flags = myFont:GetFont()
GetFont = function(self) end,
--- Sets the font object's font path, height, and flags.
--- @param path string The font path.
--- @param height number The font height.
--- @param flags string? Optional. The font flags.
--- @example
--- myFont:SetFont("Fonts\\FRIZQT__.TTF", 12, "OUTLINE")
SetFont = function(self, path, height, flags) end,
}

109
ui/FontInstance.lua Normal file
View File

@@ -0,0 +1,109 @@
---@meta
---@class FontInstance
FontInstance = {
--- Gets the font properties.
--- @return string fontFile, number height, string flags
--- @example
--- local fontFile, height, flags = myFontInstance:GetFont()
GetFont = function(self) end,
--- Gets the font object.
--- @return FontObject fontObject The font object.
--- @example
--- local fontObject = myFontInstance:GetFontObject()
GetFontObject = function(self) end,
--- Gets the horizontal text alignment.
--- @return string justifyH The horizontal alignment ("LEFT", "CENTER", "RIGHT").
--- @example
--- local justifyH = myFontInstance:GetJustifyH()
GetJustifyH = function(self) end,
--- Gets the vertical text alignment.
--- @return string justifyV The vertical alignment ("TOP", "MIDDLE", "BOTTOM").
--- @example
--- local justifyV = myFontInstance:GetJustifyV()
GetJustifyV = function(self) end,
--- Gets the shadow color.
--- @return number r, number g, number b, number a The color components.
--- @example
--- local r, g, b, a = myFontInstance:GetShadowColor()
GetShadowColor = function(self) end,
--- Gets the shadow offset.
--- @return number x, number y The shadow offset.
--- @example
--- local x, y = myFontInstance:GetShadowOffset()
GetShadowOffset = function(self) end,
--- Gets the spacing between lines.
--- @return number spacing The line spacing.
--- @example
--- local spacing = myFontInstance:GetSpacing()
GetSpacing = function(self) end,
--- Gets the text color.
--- @return number r, number g, number b, number a The color components.
--- @example
--- local r, g, b, a = myFontInstance:GetTextColor()
GetTextColor = function(self) end,
--- Sets the font properties.
--- @param fontFile string The path to the font file.
--- @param height number The font height.
--- @param flags string? Optional. The font flags.
--- @example
--- myFontInstance:SetFont("Fonts\\FRIZQT__.TTF", 12, "OUTLINE")
SetFont = function(self, fontFile, height, flags) end,
--- Sets the font object.
--- @param fontObject FontObject The font object to use.
--- @example
--- myFontInstance:SetFontObject(GameFontNormal)
SetFontObject = function(self, fontObject) end,
--- Sets the horizontal text alignment.
--- @param justifyH string The horizontal alignment ("LEFT", "CENTER", "RIGHT").
--- @example
--- myFontInstance:SetJustifyH("CENTER")
SetJustifyH = function(self, justifyH) end,
--- Sets the vertical text alignment.
--- @param justifyV string The vertical alignment ("TOP", "MIDDLE", "BOTTOM").
--- @example
--- myFontInstance:SetJustifyV("MIDDLE")
SetJustifyV = function(self, justifyV) end,
--- Sets the shadow color.
--- @param r number The red component.
--- @param g number The green component.
--- @param b number The blue component.
--- @param a number? Optional. The alpha component.
--- @example
--- myFontInstance:SetShadowColor(0, 0, 0, 1)
SetShadowColor = function(self, r, g, b, a) end,
--- Sets the shadow offset.
--- @param x number The horizontal offset.
--- @param y number The vertical offset.
--- @example
--- myFontInstance:SetShadowOffset(1, -1)
SetShadowOffset = function(self, x, y) end,
--- Sets the spacing between lines.
--- @param spacing number The line spacing.
--- @example
--- myFontInstance:SetSpacing(2)
SetSpacing = function(self, spacing) end,
--- Sets the text color.
--- @param r number The red component.
--- @param g number The green component.
--- @param b number The blue component.
--- @param a number? Optional. The alpha component.
--- @example
--- myFontInstance:SetTextColor(1, 1, 1, 1)
SetTextColor = function(self, r, g, b, a) end,
}

334
ui/FontString.lua Normal file
View File

@@ -0,0 +1,334 @@
---@meta
---@class rect
---@field left number
---@field right number
---@field top number
---@field bottom number
---@class FontString : Region, FontInstance
FontString = {
--- Returns localized text depending on the specified gender.
--- @param self FontString
--- @param token string? Reputation index.
--- @param gender number? Optional. Gender ID (1 for male, 2 for female, etc.).
--- @param ordinal unknown? Optional. Used for ordinal numbers.
--- @return string # The localized text.
--- @example
--- local text = GetText("FACTION_STANDING_LABEL1") -- Returns "Hated"
--- local femaleText = GetText("FACTION_STANDING_LABEL1", 3) -- Returns "Hated" for female
GetText = function(self, token, gender, ordinal) end,
--- Sets the text to be displayed in the fontstring.
--- @param self FontString
--- @param text string The text to display. Can include escape sequences for color and formatting.
--- Note: FontString has a limit of approximately 4000 characters.
--- @example
--- myFontString:SetText('|cff000000This text is black,|r |cffff0000while this text will be red.|r')
SetText = function(self, text) end,
--- Calculates the screen area covered by the characters between the specified indices.
--- @param leftIndex number The starting index of the character span.
--- @param rightIndex number The ending index of the character span.
--- @return rect areas The calculated screen area.
--- @example
--- local area = myFontString:CalculateScreenAreaFromCharacterSpan(1, 5)
CalculateScreenAreaFromCharacterSpan = function(self, leftIndex, rightIndex) end,
--- Checks if the fontstring can wrap non-space characters.
--- @return boolean wrap True if it can wrap non-space characters.
--- @example
--- local canWrap = myFontString:CanNonSpaceWrap()
CanNonSpaceWrap = function(self) end,
--- Checks if the fontstring can wrap words.
--- @return boolean wrap True if it can wrap words.
--- @example
--- local canWrap = myFontString:CanWordWrap()
CanWordWrap = function(self) end,
--- Finds the character index at the specified screen coordinates.
--- @param x number The x-coordinate.
--- @param y number The y-coordinate.
--- @return number characterIndex The index of the character at the specified coordinates.
--- @return boolean inside True if the coordinates are inside the fontstring.
--- @example
--- local index, isInside = myFontString:FindCharacterIndexAtCoordinate(100, 200)
FindCharacterIndexAtCoordinate = function(self, x, y) end,
--- Gets the field size of the fontstring.
--- @return number fieldSize The size of the field.
--- @example
--- local size = myFontString:GetFieldSize()
GetFieldSize = function(self) end,
--- Gets the font settings of the fontstring.
--- @return string fontFile The font file used.
--- @return number fontHeight The height of the font.
--- @return string flags The font flags.
--- @example
--- local fontFile, fontHeight, flags = myFontString:GetFont()
GetFont = function(self) end,
--- Gets the font object of the fontstring.
--- @return FontObject font The font object.
--- @example
--- local font = myFontString:GetFontObject()
GetFontObject = function(self) end,
--- Gets the indented word wrap setting.
--- @return boolean wrap True if indented word wrap is enabled.
--- @example
--- local indentedWrap = myFontString:GetIndentedWordWrap()
GetIndentedWordWrap = function(self) end,
--- Gets the horizontal justification of the fontstring.
--- @return string justifyH The horizontal justification.
--- @example
--- local justifyH = myFontString:GetJustifyH()
GetJustifyH = function(self) end,
--- Gets the vertical justification of the fontstring.
--- @return string justifyV The vertical justification.
--- @example
--- local justifyV = myFontString:GetJustifyV()
GetJustifyV = function(self) end,
--- Gets the line height of the fontstring.
--- @return number lineHeight The height of a line.
--- @example
--- local lineHeight = myFontString:GetLineHeight()
GetLineHeight = function(self) end,
--- Gets the maximum number of lines for the fontstring.
--- @return number maxLines The maximum number of lines.
--- @example
--- local maxLines = myFontString:GetMaxLines()
GetMaxLines = function(self) end,
--- Gets the number of lines currently displayed in the fontstring.
--- @return number numLines The number of lines.
--- @example
--- local numLines = myFontString:GetNumLines()
GetNumLines = function(self) end,
--- Gets the rotation of the fontstring.
--- @return number radians The rotation in radians.
--- @example
--- local rotation = myFontString:GetRotation()
GetRotation = function(self) end,
--- Gets the shadow color of the fontstring.
--- @return number colorR The red component of the shadow color.
--- @return number colorG The green component of the shadow color.
--- @return number colorB The blue component of the shadow color.
--- @return number? colorA Optional. The alpha component of the shadow color.
--- @example
--- local r, g, b, a = myFontString:GetShadowColor()
GetShadowColor = function(self) end,
--- Gets the shadow offset of the fontstring.
--- @return number offsetX The x offset of the shadow.
--- @return number offsetY The y offset of the shadow.
--- @example
--- local offsetX, offsetY = myFontString:GetShadowOffset()
GetShadowOffset = function(self) end,
--- Gets the spacing between lines in the fontstring.
--- @return number spacing The spacing value.
--- @example
--- local spacing = myFontString:GetSpacing()
GetSpacing = function(self) end,
--- Gets the height of the string displayed in the fontstring.
--- @return number height The height of the string.
--- @example
--- local height = myFontString:GetStringHeight()
GetStringHeight = function(self) end,
--- Gets the width of the string displayed in the fontstring.
--- @return number width The width of the string.
--- @example
--- local width = myFontString:GetStringWidth()
GetStringWidth = function(self) end,
--- Gets the text color of the fontstring.
--- @return number colorR The red component of the text color.
--- @return number colorG The green component of the text color.
--- @return number colorB The blue component of the text color.
--- @return number? colorA Optional. The alpha component of the text color.
--- @example
--- local r, g, b, a = myFontString:GetTextColor()
GetTextColor = function(self) end,
--- Gets the text scale of the fontstring.
--- @return number textScale The scale of the text.
--- @example
--- local textScale = myFontString:GetTextScale()
GetTextScale = function(self) end,
--- Gets the unbounded width of the string displayed in the fontstring.
--- @return number width The unbounded width.
--- @example
--- local width = myFontString:GetUnboundedStringWidth()
GetUnboundedStringWidth = function(self) end,
--- Gets the wrapped width of the string displayed in the fontstring.
--- @return number width The wrapped width.
--- @example
--- local width = myFontString:GetWrappedWidth()
GetWrappedWidth = function(self) end,
--- Checks if the text in the fontstring is truncated.
--- @return boolean isTruncated True if the text is truncated.
--- @example
--- local isTruncated = myFontString:IsTruncated()
IsTruncated = function(self) end,
--- Sets a gradient alpha for the fontstring.
--- @param start number The starting alpha value.
--- @param length number The length of the gradient.
--- @return boolean isWithinText True if the gradient is within the text.
--- @example
--- local isWithin = myFontString:SetAlphaGradient(0, 1)
SetAlphaGradient = function(self, start, length) end,
--- Sets a fixed color for the fontstring.
--- @param fixedColor boolean True to set a fixed color.
--- @example
--- myFontString:SetFixedColor(true)
SetFixedColor = function(self, fixedColor) end,
--- Sets the font of the fontstring.
--- @param fontFile string The font file to use.
--- @param fontHeight number The height of the font.
--- @param flags string The font flags.
--- @example
--- myFontString:SetFont("Fonts\\FRIZQT__.TTF", 12, "OUTLINE")
SetFont = function(self, fontFile, fontHeight, flags) end,
--- Sets the font object of the fontstring.
--- @param font FontObject The font object to set.
--- @example
--- myFontString:SetFontObject(myFontObject)
SetFontObject = function(self, font) end,
--- Sets formatted text for the fontstring.
--- @param text string The formatted text to set.
--- @example
--- myFontString:SetFormattedText("Hello %s", "World")
SetFormattedText = function(self, text) end,
--- Sets the indented word wrap setting.
--- @param wrap boolean True to enable indented word wrap.
--- @example
--- myFontString:SetIndentedWordWrap(true)
SetIndentedWordWrap = function(self, wrap) end,
--- Sets the horizontal justification of the fontstring.
--- @param justifyH string The horizontal justification to set.
--- @example
--- myFontString:SetJustifyH("CENTER")
SetJustifyH = function(self, justifyH) end,
--- Sets the vertical justification of the fontstring.
--- @param justifyV string The vertical justification to set.
--- @example
--- myFontString:SetJustifyV("MIDDLE")
SetJustifyV = function(self, justifyV) end,
--- Sets the maximum number of lines for the fontstring.
--- @param maxLines number The maximum number of lines to set.
--- @example
--- myFontString:SetMaxLines(3)
SetMaxLines = function(self, maxLines) end,
--- Sets the non-space wrap setting.
--- @param wrap boolean True to enable non-space wrap.
--- @example
--- myFontString:SetNonSpaceWrap(true)
SetNonSpaceWrap = function(self, wrap) end,
--- Sets the rotation of the fontstring.
--- @param radians number The rotation in radians.
--- @example
--- myFontString:SetRotation(math.rad(45))
SetRotation = function(self, radians) end,
--- Sets the shadow color of the fontstring.
--- @param colorR number The red component of the shadow color.
--- @param colorG number The green component of the shadow color.
--- @param colorB number The blue component of the shadow color.
--- @param a number? Optional. The alpha component of the shadow color.
--- @example
--- myFontString:SetShadowColor(0, 0, 0, 1) -- Black shadow
SetShadowColor = function(self, colorR, colorG, colorB, a) end,
--- Sets the shadow offset of the fontstring.
--- @param offsetX number The x offset of the shadow.
--- @param offsetY number The y offset of the shadow.
--- @example
--- myFontString:SetShadowOffset(1, -1)
SetShadowOffset = function(self, offsetX, offsetY) end,
--- Sets the spacing between lines in the fontstring.
--- @param spacing number The spacing value to set.
--- @example
--- myFontString:SetSpacing(2)
SetSpacing = function(self, spacing) end,
--- Sets the text color of the fontstring.
--- @param colorR number The red component of the text color.
--- @param colorG number The green component of the text color.
--- @param colorB number The blue component of the text color.
--- @param a number? Optional. The alpha component of the text color.
--- @example
--- myFontString:SetTextColor(1, 1, 1) -- White text
SetTextColor = function(self, colorR, colorG, colorB, a) end,
--- Sets the height of the text in the fontstring.
--- @param height number The height to set.
--- @example
--- myFontString:SetTextHeight(14)
SetTextHeight = function(self, height) end,
--- Sets the scale of the text in the fontstring.
--- @param textScale number The scale to set.
--- @example
--- myFontString:SetTextScale(1.5)
SetTextScale = function(self, textScale) end,
--- Sets the word wrap setting for the fontstring.
--- @param wrap boolean True to enable word wrap.
--- @example
--- myFontString:SetWordWrap(true)
SetWordWrap = function(self, wrap) end,
}
---@alias FontObject
---| 'GameFontNormal'
---| 'GameFontNormalSmall'
---| 'GameFontNormalLarge'
---| 'GameFontHighlight'
---| 'GameFontHighlightSmall'
---| 'GameFontHighlightSmallOutline'
---| 'GameFontHighlightLarge'
---| 'GameFontDisable'
---| 'GameFontDisableSmall'
---| 'GameFontDisableLarge'
---| 'GameFontGreen'
---| 'GameFontGreenSmall'
---| 'GameFontGreenLarge'
---| 'GameFontRed'
---| 'GameFontRedSmall'
---| 'GameFontRedLarge'
---| 'GameFontWhite'
---| 'GameFontDarkGraySmall'
---| 'NumberFontNormalYellow'
---| 'NumberFontNormalSmallGray'
---| 'QuestFontNormalSmall'
---| 'DialogButtonHighlightText'
---| 'ErrorFont'
---| 'TextStatusBarText'
---| 'CombatLogFont'
---| string

View File

@@ -1,76 +1,184 @@
---@meta ---@meta
---Frame is in many ways the most fundamental widget object. Other types of widget derivatives such as FontStrings, Textures and Animations can only be created attached to a Frame or other derivative of a Frame. Frames provide the basis for interaction with the user, and registering and responding to game events. ---@class Frame : Region
---
---When an addon needs to respond to game events or state changes and needs no visible components, this is typically accomplished using a Frame. Visibly, widgets that display game information such as threat or cooldowns and aren't directly interactive beyond being draggable are typically Frames. They are also commonly used as ways to group other related frames, either visibly (such as the way the Talents pane groups the buttons representing your character's talents) or invisibly (such as the way MultiBarRight groups twelve action buttons).
---
---You create a plain frame by specifying "Frame" as the first argument to CreateFrame, or with a <Frame> element in an XML file:
---
---- Create a new frame in Lua
---
--- local self = CreateFrame("Frame", "FunWidget", UIParent)
---
--- <Frame name="FunWidget" parent="UIParent">
--- <!-- insert anchors, scripts, children and other components here in XML -->
--- </Frame>
---
---Frames in the FrameXML include the action bars (the frames that group the action buttons together), the panels that display information like your character status and quest log, and the grand-daddy of the rest of the UI, UIParent.
---@class Frame : UIObject
Frame = { Frame = {
---Sets whether the frame should automatically come to the front when clicked. When a frame with Toplevel behavior enabled is clicked, it automatically changes its frame level such that it is greater than (and therefore drawn "in front of") all other frames in its strata. --- Aborts the current drag operation.
---@param self Frame --- @example
---@param enable boolean True to cause the frame to automatically come to the front when clicked; false otherwise --- myFrame:AbortDrag()
SetTopLevel = function(self, enable) end, AbortDrag = function(self) end,
---Flags the frame for automatic saving and restoration of position and dimensions. The position and size of frames so flagged is automatically saved when the UI is shut down (as when quitting, logging out, or reloading) and restored when the UI next starts up (as when logging in or reloading). If the frame does not have a name (set at creation time) specified, its position will not be saved. As implied by its name, enabling this property is useful for frames which can be moved or resized by the user. --- Returns true if secure frame attributes can be changed.
--- --- @return boolean canChange True if attributes can be changed.
---This function is automatically called with the value true when frame:StartMoving() is called. --- @example
--- --- local canChange = myFrame:CanChangeAttribute()
---In order for the saved position to be applied to the frame in later sessions, the frame must have been made movable with frame:SetMovable(true). CanChangeAttribute = function(self) end,
---@param self Frame
---@param enable boolean True to enable automatic saving and restoration of the frame's position and dimensions; false to disable
SetUserPlaced = function(self, enable) end,
---Begins repositioning the frame via mouse movement. --- Creates and returns a FontString as a child of this Frame.
---@param self Frame --- @param name string? Optional. The name of the FontString.
--- @param layer string? Optional. The layer of the FontString.
--- @param inheritsFrom string? Optional. The name of the FontString to inherit from.
--- @return FontString fontString The created FontString.
--- @example
--- local myFontString = myFrame:CreateFontString("MyFontString", "OVERLAY")
CreateFontString = function(self, name, layer, inheritsFrom) end,
--- Creates a mask texture.
--- @param name string? Optional. The name of the mask texture.
--- @param drawLayer string? Optional. The layer to draw the mask texture.
--- @param templateName string? Optional. The name of a template to use.
--- @param subLevel number? Optional. The sublevel of the mask texture.
--- @return Texture The created mask texture.
--- @example
--- local maskTexture = myFrame:CreateMaskTexture(nil, "OVERLAY", "MaskTemplate")
CreateMaskTexture = function(self, name, drawLayer, templateName, subLevel) end,
--- Creates and returns a Texture as a child of this Frame.
--- @param name string? Optional. The name of the Texture.
--- @param layer string? Optional. The layer of the Texture.
--- @param inheritsFrom string? Optional. The name of the Texture to inherit from.
--- @return Texture texture The created Texture.
--- @example
--- local myTexture = myFrame:CreateTexture("MyTexture", "BACKGROUND")
CreateTexture = function(self, name, layer, inheritsFrom) end,
--- Disables drawing on the specified layer.
--- @param layer string The layer to disable.
--- @example
--- myFrame:DisableDrawLayer("BACKGROUND")
DisableDrawLayer = function(self, layer) end,
--- Enables drawing on the specified layer.
--- @param layer string The layer to enable.
--- @example
--- myFrame:EnableDrawLayer("BACKGROUND")
EnableDrawLayer = function(self, layer) end,
--- Sets the opacity of the frame.
--- @param alpha number The opacity value (0 to 1).
--- @example
--- myFrame:SetAlpha(0.5) -- Set to 50% opacity
SetAlpha = function(self, alpha) end,
--- Returns the frame's numeric identifier.
--- @return number id The frame's ID.
--- @example
--- local id = myFrame:GetID()
GetID = function(self) end,
--- Shows this object (it will appear if its parent is visible).
--- @example
--- myFrame:Show()
Show = function(self) end,
--- Hides this object (it and all of its children will disappear).
--- @example
--- myFrame:Hide()
Hide = function(self) end,
--- Starts moving the frame via mouse movement.
--- @example
--- myFrame:StartMoving()
StartMoving = function(self) end, StartMoving = function(self) end,
---Begins resizing the frame via mouse movement. --- Stops moving the frame.
---@param self Frame --- @example
StartSizing = function(self) end, --- myFrame:StopMovingOrSizing()
---Ends movement or resizing of the frame initiated with :StartMoving() or :StartSizing().
---@param self Frame
StopMovingOrSizing = function(self) end, StopMovingOrSizing = function(self) end,
---Unregisters the frame from any events for which it is registered. --- Sets whether the frame can be moved.
---@param self Frame --- @param movable boolean True to allow moving.
UnregisterAllEvents = function(self) end, --- @example
--- myFrame:SetMovable(true)
SetMovable = function(self, movable) end,
---Unregisters the frame for an event. Once unregistered, the frame's OnEvent script handler will not be called for that event. --- Sets the frame's level.
--- --- @param level number The level to set.
---Unregistering from notifications for an event can be useful for improving addon performance at times when it's not necessary to process the event. For example, a frame which monitors target health does not need to receive the UNIT_HEALTH event while the player has no target. An addon that sorts the contents of the player's bags can register for the BAG_UPDATE event to keep track of when items are picked up, but unregister from the event while it performs its sorting. --- @example
---@param self Frame --- myFrame:SetFrameLevel(5)
---@param event string Name of an event SetFrameLevel = function(self, level) end,
UnregisterEvent = function(self, event) end,
---Returns whether the mouse cursor is over the given region. This function replaces the previous MouseIsOver FrameXML function. --- Sets the frame's strata.
--- --- @param strata string The strata to set (e.g., "BACKGROUND", "MEDIUM", "HIGH").
---If provided, the arguments are treated as offsets by which to adjust the hit rectangle when comparing it to the mouse. They are in screen coordinates; positive offsets move an edge right or up, negative values move it left or down. No frame edges are actually moved. For example: --- @example
--- --- myFrame:SetFrameStrata("HIGH")
--- if button:IsMouseOver(2, -2, -2, 2) then SetFrameStrata = function(self, strata) end,
---
---will return true if the mouse is within 2 pixels of the given frame. --- Registers the frame for a specific event.
---@overload fun(self: Frame): boolean --- @param eventName string The name of the event to register.
---@overload fun(self: Frame, topOffset: number): boolean --- @example
---@overload fun(self: Frame, topOffset: number, leftOffset: number): boolean --- myFrame:RegisterEvent("PLAYER_LOGIN")
---@overload fun(self: Frame, topOffset: number, leftOffset: number, bottomOffset: number): boolean RegisterEvent = function(self, eventName) end,
---@overload fun(self: Frame, topOffset: number, leftOffset: number, bottomOffset: number, rightOffset: number): boolean
---@param self Frame --- Unregisters an event from the frame.
---@param topOffset number The amount by which to displace the top edge of the test rectangle --- @param eventName string The name of the event to unregister.
---@param leftOffset number The amount by which to displace the left edge of the test rectangle --- @example
---@param bottomOffset number The amount by which to displace the bottom edge of the test rectangle --- myFrame:UnregisterEvent("PLAYER_LOGIN")
---@param rightOffset number The amount by which to displace the right edge of the test rectangle UnregisterEvent = function(self, eventName) end,
---@return boolean isOver true if the mouse is over the region; otherwise false
IsMouseOver = function(self, topOffset, leftOffset, bottomOffset, rightOffset) end, --- Sets the backdrop of the frame according to the specification provided.
--- @param backdropTable table? Optional. A table defining the backdrop.
--- @example
--- myFrame:SetBackdrop({bgFile = "Interface\\DialogFrame\\UI-DialogBox-Background"})
SetBackdrop = function(self, backdropTable) end,
--- Sets the frame's backdrop color.
--- @param r number The red component of the color.
--- @param g number The green component of the color.
--- @param b number The blue component of the color.
--- @param a number? Optional. The alpha component of the color.
--- @example
--- myFrame:SetBackdropColor(0, 0, 0, 0.5) -- Set to semi-transparent black
SetBackdropColor = function(self, r, g, b, a) end,
--- Sets the frame's backdrop border color.
--- @param r number The red component of the border color.
--- @param g number The green component of the border color.
--- @param b number The blue component of the border color.
--- @param a number? Optional. The alpha component of the border color.
--- @example
--- myFrame:SetBackdropBorderColor(1, 1, 1) -- Set to white
SetBackdropBorderColor = function(self, r, g, b, a) end,
--- Sets whether this frame will get keyboard input.
--- @param enableFlag boolean True to enable keyboard input.
--- @example
--- myFrame:EnableKeyboard(true)
EnableKeyboard = function(self, enableFlag) end,
--- Sets whether this frame will get mouse input.
--- @param enableFlag boolean True to enable mouse input.
--- @example
--- myFrame:EnableMouse(true)
EnableMouse = function(self, enableFlag) end,
--- Sets whether this frame will get mouse wheel notifications.
--- @param enableFlag boolean True to enable mouse wheel notifications.
--- @example
--- myFrame:EnableMouseWheel(true)
EnableMouseWheel = function(self, enableFlag) end,
--- Sets the height of the object.
--- @param height number The height to set.
--- @example
--- myFrame:SetHeight(200)
SetHeight = function(self, height) end,
--- Sets the width of the object.
--- @param width number The width to set.
--- @example
--- myFrame:SetWidth(300)
SetWidth = function(self, width) end,
--- Sets the size of the frame.
--- @param width number The width to set.
--- @param height number The height to set.
--- @example
--- myFrame:SetSize(300, 200)
SetSize = function(self, width, height) end,
--- Sets the parent for this frame.
--- @param parent Frame|string The parent frame or name of the parent frame.
--- @example
--- myFrame:SetParent(otherFrame)
SetParent = function(self, parent) end,
} }

60
ui/GameTooltip.lua Normal file
View File

@@ -0,0 +1,60 @@
---@meta
---@class GameTooltip : Frame
GameTooltip = {
--- Adds a line of text to the tooltip.
--- @param text string The text to add.
--- @param r number? Optional. The red component (0-1).
--- @param g number? Optional. The green component (0-1).
--- @param b number? Optional. The blue component (0-1).
--- @param wrap boolean? Optional. Whether to wrap the text.
--- @example
--- myGameTooltip:AddLine("New Line", 1.0, 0.0, 0.0)
AddLine = function(self, text, r, g, b, wrap) end,
--- Adds a line with left and right text to the tooltip.
--- @param textLeft string The left text.
--- @param textRight string The right text.
--- @param leftR number? Optional. Left text red component (0-1).
--- @param leftG number? Optional. Left text green component (0-1).
--- @param leftB number? Optional. Left text blue component (0-1).
--- @param rightR number? Optional. Right text red component (0-1).
--- @param rightG number? Optional. Right text green component (0-1).
--- @param rightB number? Optional. Right text blue component (0-1).
--- @example
--- myGameTooltip:AddDoubleLine("Left", "Right", 1.0, 0.0, 0.0, 0.0, 1.0, 0.0)
AddDoubleLine = function(self, textLeft, textRight, leftR, leftG, leftB, rightR, rightG, rightB) end,
--- Clears all lines from the tooltip.
--- @example
--- myGameTooltip:ClearLines()
ClearLines = function(self) end,
--- Gets the number of lines in the tooltip.
--- @return number numLines The number of lines.
--- @example
--- local numLines = myGameTooltip:NumLines()
NumLines = function(self) end,
--- Sets the text of the tooltip.
--- @param text string The text to set.
--- @param r number? Optional. The red component (0-1).
--- @param g number? Optional. The green component (0-1).
--- @param b number? Optional. The blue component (0-1).
--- @param wrap boolean? Optional. Whether to wrap the text.
--- @example
--- myGameTooltip:SetText("Tooltip Text", 1.0, 1.0, 1.0)
SetText = function(self, text, r, g, b, wrap) end,
--- Sets the tooltip to show item information.
--- @param itemLink string|number The item ID or link.
--- @example
--- myGameTooltip:SetHyperlink("item:12345:0:0:0:0:0:0:0")
SetHyperlink = function(self, itemLink) end,
--- Sets the tooltip to show unit information.
--- @param unit string The unit ID.
--- @example
--- myGameTooltip:SetUnit("player")
SetUnit = function(self, unit) end,
}

17
ui/LayeredRegion.lua Normal file
View File

@@ -0,0 +1,17 @@
---@meta
---@class LayeredRegion : Region
LayeredRegion = {
--- Gets the draw layer of the region.
--- @return string layer The draw layer.
--- @example
--- local layer = myLayeredRegion:GetDrawLayer()
GetDrawLayer = function(self) end,
--- Sets the draw layer of the region.
--- @param layer string The draw layer.
--- @param subLevel number? Optional. The sublevel within the layer.
--- @example
--- myLayeredRegion:SetDrawLayer("ARTWORK", 1)
SetDrawLayer = function(self, layer, subLevel) end,
}

10
ui/LootButton.lua Normal file
View File

@@ -0,0 +1,10 @@
---@meta
---@class LootButton : Button
LootButton = {
--- Sets the slot index for this loot button.
--- @param index number The index of the loot slot.
--- @example
--- myLootButton:SetSlot(1)
SetSlot = function(self, index) end,
}

56
ui/MessageFrame.lua Normal file
View File

@@ -0,0 +1,56 @@
---@meta
---@class MessageFrame : Frame, FontInstance
MessageFrame = {
--- Adds a message to the frame.
--- @param text string The message text.
--- @param r? number Optional. The red color component.
--- @param g? number Optional. The green color component.
--- @param b? number Optional. The blue color component.
--- @param id? number Optional. A message identifier.
--- @param holdTime? number Optional. How long to display the message.
--- @example
--- myMessageFrame:AddMessage("Hello", 1, 0, 0)
AddMessage = function(self, text, r, g, b, id, holdTime) end,
--- Clears all messages from the frame.
--- @example
--- myMessageFrame:Clear()
Clear = function(self) end,
--- Gets the fade duration for messages.
--- @return number duration The fade duration in seconds.
--- @example
--- local duration = myMessageFrame:GetFadeDuration()
GetFadeDuration = function(self) end,
--- Gets whether fading is enabled.
--- @return boolean enabled True if fading is enabled.
--- @example
--- local enabled = myMessageFrame:GetFading()
GetFading = function(self) end,
--- Gets the time messages remain visible.
--- @return number time The time in seconds.
--- @example
--- local time = myMessageFrame:GetTimeVisible()
GetTimeVisible = function(self) end,
--- Sets the fade duration for messages.
--- @param duration number The fade duration in seconds.
--- @example
--- myMessageFrame:SetFadeDuration(0.3)
SetFadeDuration = function(self, duration) end,
--- Sets whether fading is enabled.
--- @param enabled boolean True to enable fading.
--- @example
--- myMessageFrame:SetFading(true)
SetFading = function(self, enabled) end,
--- Sets how long messages remain visible.
--- @param time number The time in seconds.
--- @example
--- myMessageFrame:SetTimeVisible(5)
SetTimeVisible = function(self, time) end,
}

35
ui/Minimap.lua Normal file
View File

@@ -0,0 +1,35 @@
---@meta
---@class Minimap : Frame
Minimap = {
--- Gets the zoom level of the minimap.
--- @return number zoom The zoom level.
--- @example
--- local zoom = myMinimap:GetZoom()
GetZoom = function(self) end,
--- Gets the zoom levels of the minimap.
--- @return number min The minimum zoom level.
--- @return number max The maximum zoom level.
--- @example
--- local min, max = myMinimap:GetZoomLevels()
GetZoomLevels = function(self) end,
--- Sets the zoom level of the minimap.
--- @param zoom number The zoom level.
--- @example
--- myMinimap:SetZoom(2)
SetZoom = function(self, zoom) end,
--- Sets the mask texture of the minimap.
--- @param texture string|number The texture path or file ID.
--- @example
--- myMinimap:SetMaskTexture("Interface\\CHARACTERFRAME\\TempPortraitAlphaMask")
SetMaskTexture = function(self, texture) end,
--- Sets the blend mode of the minimap.
--- @param mode string The blend mode ("DISABLE"|"BLEND"|"ALPHAKEY"|"ADD"|"MOD").
--- @example
--- myMinimap:SetBlipTexture("BLEND")
SetBlipTexture = function(self, mode) end,
}

49
ui/Model.lua Normal file
View File

@@ -0,0 +1,49 @@
---@meta
---@class Model : Frame
Model = {
--- Advances the model's animation by the specified time.
--- @param seconds number The time to advance in seconds.
--- @example
--- myModel:AdvanceTime(0.1)
AdvanceTime = function(self, seconds) end,
--- Clears the model.
--- @example
--- myModel:ClearModel()
ClearModel = function(self) end,
--- Gets the model's facing direction in radians.
--- @return number facing The facing direction in radians.
--- @example
--- local facing = myModel:GetFacing()
GetFacing = function(self) end,
--- Gets the model's position.
--- @return number x The x coordinate.
--- @return number y The y coordinate.
--- @return number z The z coordinate.
--- @example
--- local x, y, z = myModel:GetPosition()
GetPosition = function(self) end,
--- Sets the model's facing direction.
--- @param facing number The facing direction in radians.
--- @example
--- myModel:SetFacing(math.pi)
SetFacing = function(self, facing) end,
--- Sets the model's position.
--- @param x number The x coordinate.
--- @param y number The y coordinate.
--- @param z number The z coordinate.
--- @example
--- myModel:SetPosition(1.0, 0.0, 0.0)
SetPosition = function(self, x, y, z) end,
--- Sets the model to display.
--- @param modelPath string The path to the model file.
--- @example
--- myModel:SetModel("Interface\\Buttons\\TalkToMeQuestionMark.m2")
SetModel = function(self, modelPath) end,
}

16
ui/Object.lua Normal file
View File

@@ -0,0 +1,16 @@
---@meta
---@class Object
Object = {
--- Returns the name of the object.
--- @return string name The name of the object.
--- @example
--- local name = myObject:GetName()
GetName = function(self) end,
--- Returns the object's parent object.
--- @return Object parent The parent object.
--- @example
--- local parent = myObject:GetParent()
GetParent = function(self) end,
}

36
ui/Path.lua Normal file
View File

@@ -0,0 +1,36 @@
---@meta
---@class Path : Animation
Path = {
--- Gets the number of control points in the path.
--- @return number count The number of control points.
--- @example
--- local count = myPath:GetNumControlPoints()
GetNumControlPoints = function(self) end,
--- Gets the curve type of the path.
--- @return string curveType The curve type ("NONE", "BEZIER").
--- @example
--- local curveType = myPath:GetCurveType()
GetCurveType = function(self) end,
--- Creates a new control point at the specified index.
--- @param index number The index to create the control point at.
--- @return ControlPoint point The created control point.
--- @example
--- local point = myPath:CreateControlPoint(1)
CreateControlPoint = function(self, index) end,
--- Gets a control point at the specified index.
--- @param index number The index of the control point.
--- @return ControlPoint point The control point.
--- @example
--- local point = myPath:GetControlPoint(1)
GetControlPoint = function(self, index) end,
--- Sets the curve type of the path.
--- @param curveType string The curve type ("NONE", "BEZIER").
--- @example
--- myPath:SetCurveType("BEZIER")
SetCurveType = function(self, curveType) end,
}

27
ui/PlayerModel.lua Normal file
View File

@@ -0,0 +1,27 @@
---@meta
---@class PlayerModel : Model
PlayerModel = {
--- Refreshes the model's display.
--- @example
--- myPlayerModel:RefreshUnit()
RefreshUnit = function(self) end,
--- Sets the model to display a specific creature.
--- @param creatureID number The ID of the creature to display.
--- @example
--- myPlayerModel:SetCreature(12345)
SetCreature = function(self, creatureID) end,
--- Sets the model's rotation.
--- @param rotation number The rotation in radians.
--- @example
--- myPlayerModel:SetRotation(math.pi)
SetRotation = function(self, rotation) end,
--- Sets the model to display a specific unit.
--- @param unit string The unit ID to display.
--- @example
--- myPlayerModel:SetUnit("player")
SetUnit = function(self, unit) end,
}

167
ui/Region.lua Normal file
View File

@@ -0,0 +1,167 @@
---@meta
---@class Region : UIObject
Region = {
--- Gets the effective alpha (opacity) of the region.
--- @return number alpha The effective alpha value.
--- @example
--- local alpha = myRegion:GetEffectiveAlpha()
GetEffectiveAlpha = function(self) end,
--- Gets the height of the region.
--- @return number height The height in pixels.
--- @example
--- local height = myRegion:GetHeight()
GetHeight = function(self) end,
--- Gets the width of the region.
--- @return number width The width in pixels.
--- @example
--- local width = myRegion:GetWidth()
GetWidth = function(self) end,
--- Gets the region's numeric identifier.
--- @return number id The region's ID.
--- @example
--- local id = myRegion:GetID()
GetID = function(self) end,
--- Gets the number of points defined for the region.
--- @return number numPoints The number of points.
--- @example
--- local numPoints = myRegion:GetNumPoints()
GetNumPoints = function(self) end,
--- Gets the position and anchoring of the region at the specified point index.
--- @param pointIndex number The index of the point to query.
--- @return string point, Region relativeTo, string relativePoint, number xOffset, number yOffset
--- @example
--- local point, relativeTo, relativePoint, xOffset, yOffset = myRegion:GetPoint(1)
GetPoint = function(self, pointIndex) end,
--- Gets the scale factor of the region.
--- @return number scale The scale factor.
--- @example
--- local scale = myRegion:GetScale()
GetScale = function(self) end,
--- Sets the alpha (opacity) of the region.
--- @param alpha number The alpha value (0.0 to 1.0).
--- @example
--- myRegion:SetAlpha(0.5)
SetAlpha = function(self, alpha) end,
--- Sets the height of the region.
--- @param height number The height in pixels.
--- @example
--- myRegion:SetHeight(100)
SetHeight = function(self, height) end,
--- Sets the width of the region.
--- @param width number The width in pixels.
--- @example
--- myRegion:SetWidth(200)
SetWidth = function(self, width) end,
--- Sets both the width and height of the region.
--- @param width number The width in pixels.
--- @param height number The height in pixels.
--- @example
--- myRegion:SetSize(200, 100)
SetSize = function(self, width, height) end,
--- Sets the scale factor of the region.
--- @param scale number The scale factor.
--- @example
--- myRegion:SetScale(1.5)
SetScale = function(self, scale) end,
--- Clears all anchor points from the region.
--- @example
--- myRegion:ClearAllPoints()
ClearAllPoints = function(self) end,
--- Sets the position and anchoring of the region.
--- @param point string The point on this region to anchor from.
--- @param relativeTo Region|string The region or frameName to anchor to.
--- @param relativePoint string The point on the other region to anchor to.
--- @param xOffset number The x-axis offset.
--- @param yOffset number The y-axis offset.
--- @example
--- myRegion:SetPoint("TOPLEFT", otherRegion, "BOTTOMRIGHT", 10, -10)
SetPoint = function(self, point, relativeTo, relativePoint, xOffset, yOffset) end,
--- Returns the region's opacity.
--- @return number alpha The opacity of the region.
--- @example
--- local alpha = myRegion:GetAlpha()
GetAlpha = function(self) end,
--- Returns the layer in which the region is drawn.
--- @return string layer The layer of the region.
--- @return number sublayer The sublayer of the region.
--- @example
--- local layer, sublayer = myRegion:GetDrawLayer()
GetDrawLayer = function(self) end,
--- Returns the scale of the region after propagating from its parents.
--- @return number effectiveScale The effective scale of the region.
--- @example
--- local effectiveScale = myRegion:GetEffectiveScale()
GetEffectiveScale = function(self) end,
--- Returns the vertex color shading of the region.
--- @return number colorR The red component of the vertex color.
--- @return number colorG The green component of the vertex color.
--- @return number colorB The blue component of the vertex color.
--- @return number colorA The alpha component of the vertex color.
--- @example
--- local r, g, b, a = myRegion:GetVertexColor()
GetVertexColor = function(self) end,
--- Returns true if the region is ignoring parent alpha.
--- @return boolean isIgnoring True if the region is ignoring parent alpha.
--- @example
--- local isIgnoring = myRegion:IsIgnoringParentAlpha()
IsIgnoringParentAlpha = function(self) end,
--- Returns true if the region is ignoring parent scale.
--- @return boolean isIgnoring True if the region is ignoring parent scale.
--- @example
--- local isIgnoring = myRegion:IsIgnoringParentScale()
IsIgnoringParentScale = function(self) end,
--- Returns true if the region is fully loaded.
--- @return boolean isLoaded True if the region is loaded.
--- @example
--- local isLoaded = myRegion:IsObjectLoaded()
IsObjectLoaded = function(self) end,
--- Sets the layer in which the region is drawn.
--- @param layer string The layer to set.
--- @param sublevel number? Optional. The sublevel to set.
--- @example
--- myRegion:SetDrawLayer("ARTWORK", 1)
SetDrawLayer = function(self, layer, sublevel) end,
--- Sets whether the region should ignore its parent's alpha.
--- @param ignore boolean True to ignore parent alpha.
--- @example
--- myRegion:SetIgnoreParentAlpha(true)
SetIgnoreParentAlpha = function(self, ignore) end,
--- Sets whether the region should ignore its parent's scale.
--- @param ignore boolean True to ignore parent scale.
--- @example
--- myRegion:SetIgnoreParentScale(true)
SetIgnoreParentScale = function(self, ignore) end,
--- Sets the vertex shading color of the region.
--- @param colorR number The red component of the color.
--- @param colorG number The green component of the color.
--- @param colorB number The blue component of the color.
--- @param a number? Optional. The alpha component of the color.
--- @example
--- myRegion:SetVertexColor(1, 0, 0) -- Set to red
SetVertexColor = function(self, colorR, colorG, colorB, a) end,
}

41
ui/Rotation.lua Normal file
View File

@@ -0,0 +1,41 @@
---@meta
---@class Rotation : Animation
Rotation = {
--- Gets the origin point for the rotation.
--- @return number x, number y The origin point coordinates.
--- @example
--- local x, y = myRotation:GetOrigin()
GetOrigin = function(self) end,
--- Gets the degrees to rotate.
--- @return number degrees The rotation amount in degrees.
--- @example
--- local degrees = myRotation:GetDegrees()
GetDegrees = function(self) end,
--- Gets the radians to rotate.
--- @return number radians The rotation amount in radians.
--- @example
--- local radians = myRotation:GetRadians()
GetRadians = function(self) end,
--- Sets the origin point for the rotation.
--- @param x number The x-coordinate of the origin point.
--- @param y number The y-coordinate of the origin point.
--- @example
--- myRotation:SetOrigin(0.5, 0.5)
SetOrigin = function(self, x, y) end,
--- Sets the degrees to rotate.
--- @param degrees number The rotation amount in degrees.
--- @example
--- myRotation:SetDegrees(90)
SetDegrees = function(self, degrees) end,
--- Sets the radians to rotate.
--- @param radians number The rotation amount in radians.
--- @example
--- myRotation:SetRadians(math.pi / 2)
SetRadians = function(self, radians) end,
}

30
ui/Scale.lua Normal file
View File

@@ -0,0 +1,30 @@
---@meta
---@class Scale : Animation
Scale = {
--- Gets the origin point for the scaling.
--- @return number x, number y The origin point coordinates.
--- @example
--- local x, y = myScale:GetOrigin()
GetOrigin = function(self) end,
--- Gets the scale factors.
--- @return number scaleX, number scaleY The x and y scale factors.
--- @example
--- local scaleX, scaleY = myScale:GetScale()
GetScale = function(self) end,
--- Sets the origin point for the scaling.
--- @param x number The x-coordinate of the origin point.
--- @param y number The y-coordinate of the origin point.
--- @example
--- myScale:SetOrigin(0.5, 0.5)
SetOrigin = function(self, x, y) end,
--- Sets the scale factors.
--- @param scaleX number The x scale factor.
--- @param scaleY number The y scale factor.
--- @example
--- myScale:SetScale(2.0, 2.0)
SetScale = function(self, scaleX, scaleY) end,
}

57
ui/ScrollFrame.lua Normal file
View File

@@ -0,0 +1,57 @@
---@meta
---@class ScrollFrame : Frame
ScrollFrame = {
--- Gets the horizontal scroll range.
--- @return number range The horizontal scroll range.
--- @example
--- local range = myScrollFrame:GetHorizontalScrollRange()
GetHorizontalScrollRange = function(self) end,
--- Gets the current horizontal scroll position.
--- @return number position The horizontal scroll position.
--- @example
--- local position = myScrollFrame:GetHorizontalScroll()
GetHorizontalScroll = function(self) end,
--- Gets the vertical scroll range.
--- @return number range The vertical scroll range.
--- @example
--- local range = myScrollFrame:GetVerticalScrollRange()
GetVerticalScrollRange = function(self) end,
--- Gets the current vertical scroll position.
--- @return number position The vertical scroll position.
--- @example
--- local position = myScrollFrame:GetVerticalScroll()
GetVerticalScroll = function(self) end,
--- Gets the scrollable child frame.
--- @return Frame childFrame The scrollable child frame.
--- @example
--- local childFrame = myScrollFrame:GetScrollChild()
GetScrollChild = function(self) end,
--- Sets the horizontal scroll position.
--- @param position number The horizontal scroll position.
--- @example
--- myScrollFrame:SetHorizontalScroll(50)
SetHorizontalScroll = function(self, position) end,
--- Sets the vertical scroll position.
--- @param position number The vertical scroll position.
--- @example
--- myScrollFrame:SetVerticalScroll(50)
SetVerticalScroll = function(self, position) end,
--- Sets the scrollable child frame.
--- @param frame Frame The frame to set as the scrollable child.
--- @example
--- myScrollFrame:SetScrollChild(childFrame)
SetScrollChild = function(self, frame) end,
--- Updates the scroll range and position.
--- @example
--- myScrollFrame:UpdateScrollChildRect()
UpdateScrollChildRect = function(self) end,
}

View File

@@ -0,0 +1,125 @@
---@meta
---@class ScrollingMessageFrame : Frame, FontInstance
ScrollingMessageFrame = {
--- Adds a message to the frame.
--- @param text string The message text.
--- @param r? number Optional. The red color component.
--- @param g? number Optional. The green color component.
--- @param b? number Optional. The blue color component.
--- @param id? number Optional. A message identifier.
--- @param holdTime? number Optional. How long to display the message.
--- @example
--- myFrame:AddMessage("Hello", 1, 0, 0)
AddMessage = function(self, text, r, g, b, id, holdTime) end,
--- Clears all messages from the frame.
--- @example
--- myFrame:Clear()
Clear = function(self) end,
--- Gets the fade duration for messages.
--- @return number duration The fade duration in seconds.
--- @example
--- local duration = myFrame:GetFadeDuration()
GetFadeDuration = function(self) end,
--- Gets whether fading is enabled.
--- @return boolean enabled True if fading is enabled.
--- @example
--- local enabled = myFrame:GetFading()
GetFading = function(self) end,
--- Gets the time messages remain visible.
--- @return number time The time in seconds.
--- @example
--- local time = myFrame:GetTimeVisible()
GetTimeVisible = function(self) end,
--- Gets the current scroll offset.
--- @return number offset The scroll offset.
--- @example
--- local offset = myFrame:GetScrollOffset()
GetScrollOffset = function(self) end,
--- Gets the insert mode for new messages.
--- @return string mode The insert mode ("TOP" or "BOTTOM").
--- @example
--- local mode = myFrame:GetInsertMode()
GetInsertMode = function(self) end,
--- Scrolls down one line.
--- @example
--- myFrame:ScrollDown()
ScrollDown = function(self) end,
--- Scrolls up one line.
--- @example
--- myFrame:ScrollUp()
ScrollUp = function(self) end,
--- Scrolls to the bottom of the frame.
--- @example
--- myFrame:ScrollToBottom()
ScrollToBottom = function(self) end,
--- Scrolls to the top of the frame.
--- @example
--- myFrame:ScrollToTop()
ScrollToTop = function(self) end,
--- Sets the fade duration for messages.
--- @param duration number The fade duration in seconds.
--- @example
--- myFrame:SetFadeDuration(0.3)
SetFadeDuration = function(self, duration) end,
--- Sets whether fading is enabled.
--- @param enabled boolean True to enable fading.
--- @example
--- myFrame:SetFading(true)
SetFading = function(self, enabled) end,
--- Sets how long messages remain visible.
--- @param time number The time in seconds.
--- @example
--- myFrame:SetTimeVisible(5)
SetTimeVisible = function(self, time) end,
--- Sets the insert mode for new messages.
--- @param mode string The insert mode ("TOP" or "BOTTOM").
--- @example
--- myFrame:SetInsertMode("TOP")
SetInsertMode = function(self, mode) end,
--- Sets the maximum number of lines to display.
--- @param maxLines number The maximum number of lines.
--- @example
--- myFrame:SetMaxLines(50)
SetMaxLines = function(self, maxLines) end,
--- Sets the scroll offset.
--- @param offset number The scroll offset.
--- @example
--- myFrame:SetScrollOffset(5)
SetScrollOffset = function(self, offset) end,
--- Updates the color of a message by its ID.
--- @param id number The message ID.
--- @param r number The red color component.
--- @param g number The green color component.
--- @param b number The blue color component.
--- @example
--- myFrame:UpdateColorByID(1, 1, 0, 0)
UpdateColorByID = function(self, id, r, g, b) end,
--- Scrolls down one page.
--- @example
--- myFrame:PageDown()
PageDown = function(self) end,
--- Scrolls up one page.
--- @example
--- myFrame:PageUp()
PageUp = function(self) end,
}

155
ui/SimpleHTML.lua Normal file
View File

@@ -0,0 +1,155 @@
---@meta
---@class SimpleHTML : Frame
SimpleHTML = {
--- Gets the font properties for an HTML element.
--- @param element? string Optional. The HTML element to query.
--- @return string fontFile, number height, string flags
--- @example
--- local fontFile, height, flags = myHTML:GetFont("p")
GetFont = function(self, element) end,
--- Gets the font object for an HTML element.
--- @param element? string Optional. The HTML element to query.
--- @return FontObject fontObject The font object.
--- @example
--- local fontObject = myHTML:GetFontObject("h1")
GetFontObject = function(self, element) end,
--- Gets the hyperlink format string.
--- @return string format The hyperlink format.
--- @example
--- local format = myHTML:GetHyperlinkFormat()
GetHyperlinkFormat = function(self) end,
--- Gets whether hyperlinks are enabled.
--- @return boolean enabled True if hyperlinks are enabled.
--- @example
--- local enabled = myHTML:GetHyperlinksEnabled()
GetHyperlinksEnabled = function(self) end,
--- Gets the horizontal justification for an HTML element.
--- @param element? string Optional. The HTML element to query.
--- @return string justifyH The horizontal justification.
--- @example
--- local justifyH = myHTML:GetJustifyH("p")
GetJustifyH = function(self, element) end,
--- Gets the vertical justification for an HTML element.
--- @param element? string Optional. The HTML element to query.
--- @return string justifyV The vertical justification.
--- @example
--- local justifyV = myHTML:GetJustifyV("p")
GetJustifyV = function(self, element) end,
--- Gets the shadow color for an HTML element.
--- @param element? string Optional. The HTML element to query.
--- @return number r, number g, number b, number a The shadow color.
--- @example
--- local r, g, b, a = myHTML:GetShadowColor("p")
GetShadowColor = function(self, element) end,
--- Gets the shadow offset for an HTML element.
--- @param element? string Optional. The HTML element to query.
--- @return number x, number y The shadow offset.
--- @example
--- local x, y = myHTML:GetShadowOffset("p")
GetShadowOffset = function(self, element) end,
--- Gets the line spacing for an HTML element.
--- @param element? string Optional. The HTML element to query.
--- @return number spacing The line spacing.
--- @example
--- local spacing = myHTML:GetSpacing("p")
GetSpacing = function(self, element) end,
--- Gets the text color for an HTML element.
--- @param element? string Optional. The HTML element to query.
--- @return number r, number g, number b, number a The text color.
--- @example
--- local r, g, b, a = myHTML:GetTextColor("p")
GetTextColor = function(self, element) end,
--- Sets the font properties for an HTML element.
--- @param element? string Optional. The HTML element to set.
--- @param fontFile string The font file path.
--- @param height number The font height.
--- @param flags? string Optional. The font flags.
--- @example
--- myHTML:SetFont("p", "Fonts\\FRIZQT__.TTF", 12, "OUTLINE")
SetFont = function(self, element, fontFile, height, flags) end,
--- Sets the font object for an HTML element.
--- @param element? string Optional. The HTML element to set.
--- @param fontObject FontObject The font object.
--- @example
--- myHTML:SetFontObject("h1", GameFontNormalLarge)
SetFontObject = function(self, element, fontObject) end,
--- Sets the hyperlink format string.
--- @param format string The hyperlink format.
--- @example
--- myHTML:SetHyperlinkFormat("|cff0000ff|H%s|h%s|h|r")
SetHyperlinkFormat = function(self, format) end,
--- Sets whether hyperlinks are enabled.
--- @param enabled boolean True to enable hyperlinks.
--- @example
--- myHTML:SetHyperlinksEnabled(true)
SetHyperlinksEnabled = function(self, enabled) end,
--- Sets the horizontal justification for an HTML element.
--- @param element? string Optional. The HTML element to set.
--- @param justifyH string The horizontal justification.
--- @example
--- myHTML:SetJustifyH("p", "CENTER")
SetJustifyH = function(self, element, justifyH) end,
--- Sets the vertical justification for an HTML element.
--- @param element? string Optional. The HTML element to set.
--- @param justifyV string The vertical justification.
--- @example
--- myHTML:SetJustifyV("p", "MIDDLE")
SetJustifyV = function(self, element, justifyV) end,
--- Sets the shadow color for an HTML element.
--- @param element? string Optional. The HTML element to set.
--- @param r number The red component.
--- @param g number The green component.
--- @param b number The blue component.
--- @param a? number Optional. The alpha component.
--- @example
--- myHTML:SetShadowColor("p", 0, 0, 0, 1)
SetShadowColor = function(self, element, r, g, b, a) end,
--- Sets the shadow offset for an HTML element.
--- @param element? string Optional. The HTML element to set.
--- @param x number The horizontal offset.
--- @param y number The vertical offset.
--- @example
--- myHTML:SetShadowOffset("p", 1, -1)
SetShadowOffset = function(self, element, x, y) end,
--- Sets the line spacing for an HTML element.
--- @param element? string Optional. The HTML element to set.
--- @param spacing number The line spacing.
--- @example
--- myHTML:SetSpacing("p", 2)
SetSpacing = function(self, element, spacing) end,
--- Sets the text color for an HTML element.
--- @param element? string Optional. The HTML element to set.
--- @param r number The red component.
--- @param g number The green component.
--- @param b number The blue component.
--- @param a? number Optional. The alpha component.
--- @example
--- myHTML:SetTextColor("p", 1, 1, 1, 1)
SetTextColor = function(self, element, r, g, b, a) end,
--- Sets the HTML text to display.
--- @param text string The HTML text.
--- @example
--- myHTML:SetText("<p>Hello <b>World</b></p>")
SetText = function(self, text) end,
}

93
ui/Slider.lua Normal file
View File

@@ -0,0 +1,93 @@
---@meta
---@class Slider : Frame
Slider = {
--- Disables the slider.
--- @example
--- mySlider:Disable()
Disable = function(self) end,
--- Enables the slider.
--- @example
--- mySlider:Enable()
Enable = function(self) end,
--- Gets the minimum and maximum values.
--- @return number min, number max The minimum and maximum values.
--- @example
--- local min, max = mySlider:GetMinMaxValues()
GetMinMaxValues = function(self) end,
--- Gets the orientation of the slider.
--- @return string orientation The orientation ("HORIZONTAL" or "VERTICAL").
--- @example
--- local orientation = mySlider:GetOrientation()
GetOrientation = function(self) end,
--- Gets the page step size.
--- @return number stepSize The page step size.
--- @example
--- local stepSize = mySlider:GetStepsPerPage()
GetStepsPerPage = function(self) end,
--- Gets the thumb texture.
--- @return Texture texture The thumb texture.
--- @example
--- local texture = mySlider:GetThumbTexture()
GetThumbTexture = function(self) end,
--- Gets the current value.
--- @return number value The current value.
--- @example
--- local value = mySlider:GetValue()
GetValue = function(self) end,
--- Gets the value step size.
--- @return number stepSize The value step size.
--- @example
--- local stepSize = mySlider:GetValueStep()
GetValueStep = function(self) end,
--- Returns whether the slider is enabled.
--- @return boolean enabled True if the slider is enabled.
--- @example
--- local enabled = mySlider:IsEnabled()
IsEnabled = function(self) end,
--- Sets the minimum and maximum values.
--- @param min number The minimum value.
--- @param max number The maximum value.
--- @example
--- mySlider:SetMinMaxValues(0, 100)
SetMinMaxValues = function(self, min, max) end,
--- Sets the orientation of the slider.
--- @param orientation string The orientation ("HORIZONTAL" or "VERTICAL").
--- @example
--- mySlider:SetOrientation("HORIZONTAL")
SetOrientation = function(self, orientation) end,
--- Sets the page step size.
--- @param stepSize number The page step size.
--- @example
--- mySlider:SetStepsPerPage(10)
SetStepsPerPage = function(self, stepSize) end,
--- Sets the thumb texture.
--- @param texture Texture|string The texture or texture path.
--- @example
--- mySlider:SetThumbTexture("Interface\\Buttons\\UI-SliderBar-Button-Horizontal")
SetThumbTexture = function(self, texture) end,
--- Sets the current value.
--- @param value number The value to set.
--- @example
--- mySlider:SetValue(50)
SetValue = function(self, value) end,
--- Sets the value step size.
--- @param stepSize number The value step size.
--- @example
--- mySlider:SetValueStep(5)
SetValueStep = function(self, stepSize) end,
}

69
ui/StatusBar.lua Normal file
View File

@@ -0,0 +1,69 @@
---@meta
---@class StatusBar : Frame
StatusBar = {
--- Gets the minimum and maximum values of the bar.
--- @return number min, number max The minimum and maximum values.
--- @example
--- local min, max = myStatusBar:GetMinMaxValues()
GetMinMaxValues = function(self) end,
--- Gets the orientation of the status bar.
--- @return string orientation The orientation ("HORIZONTAL" or "VERTICAL").
--- @example
--- local orientation = myStatusBar:GetOrientation()
GetOrientation = function(self) end,
--- Gets the color of the status bar.
--- @return number r, number g, number b, number a The color components.
--- @example
--- local r, g, b, a = myStatusBar:GetStatusBarColor()
GetStatusBarColor = function(self) end,
--- Gets the texture object for the bar.
--- @return Texture texture The status bar texture.
--- @example
--- local texture = myStatusBar:GetStatusBarTexture()
GetStatusBarTexture = function(self) end,
--- Gets the current value of the bar.
--- @return number value The current value.
--- @example
--- local value = myStatusBar:GetValue()
GetValue = function(self) end,
--- Sets the minimum and maximum values of the bar.
--- @param min number The minimum value.
--- @param max number The maximum value.
--- @example
--- myStatusBar:SetMinMaxValues(0, 100)
SetMinMaxValues = function(self, min, max) end,
--- Sets the orientation of the status bar.
--- @param orientation string The orientation ("HORIZONTAL" or "VERTICAL").
--- @example
--- myStatusBar:SetOrientation("HORIZONTAL")
SetOrientation = function(self, orientation) end,
--- Sets the color of the status bar.
--- @param r number The red component.
--- @param g number The green component.
--- @param b number The blue component.
--- @param a number? Optional. The alpha component.
--- @example
--- myStatusBar:SetStatusBarColor(1, 0, 0, 1)
SetStatusBarColor = function(self, r, g, b, a) end,
--- Sets the texture of the bar.
--- @param texture string|Texture The texture path or texture object.
--- @param layer? string Optional. The layer to set the texture in.
--- @example
--- myStatusBar:SetStatusBarTexture("Interface\\TargetingFrame\\UI-StatusBar")
SetStatusBarTexture = function(self, texture, layer) end,
--- Sets the current value of the bar.
--- @param value number The value to set.
--- @example
--- myStatusBar:SetValue(50)
SetValue = function(self, value) end,
}

65
ui/TabardModel.lua Normal file
View File

@@ -0,0 +1,65 @@
---@meta
---@class TabardModel : PlayerModel
TabardModel = {
--- Checks if the tabard can be saved.
--- @return boolean canSave Whether the tabard can be saved.
--- @example
--- local canSave = myTabardModel:CanSaveTabardNow()
CanSaveTabardNow = function(self) end,
--- Cycles through the variations of a tabard component.
--- @param variationIndex number The index of the variation to cycle.
--- @param delta number The amount to cycle by.
--- @example
--- myTabardModel:CycleVariation(1, 1)
CycleVariation = function(self, variationIndex, delta) end,
--- Gets the filename for the lower background texture.
--- @return string filename The filename.
--- @example
--- local filename = myTabardModel:GetLowerBackgroundFileName()
GetLowerBackgroundFileName = function(self) end,
--- Gets the filename for the lower emblem texture.
--- @return string filename The filename.
--- @example
--- local filename = myTabardModel:GetLowerEmblemFileName()
GetLowerEmblemFileName = function(self) end,
--- Gets the lower emblem texture.
--- @param textureName string The name of the texture.
--- @return Texture texture The texture object.
--- @example
--- local texture = myTabardModel:GetLowerEmblemTexture("BACKGROUND")
GetLowerEmblemTexture = function(self, textureName) end,
--- Gets the filename for the upper background texture.
--- @return string filename The filename.
--- @example
--- local filename = myTabardModel:GetUpperBackgroundFileName()
GetUpperBackgroundFileName = function(self) end,
--- Gets the filename for the upper emblem texture.
--- @return string filename The filename.
--- @example
--- local filename = myTabardModel:GetUpperEmblemFileName()
GetUpperEmblemFileName = function(self) end,
--- Gets the upper emblem texture.
--- @param textureName string The name of the texture.
--- @return Texture texture The texture object.
--- @example
--- local texture = myTabardModel:GetUpperEmblemTexture("BACKGROUND")
GetUpperEmblemTexture = function(self, textureName) end,
--- Initializes the tabard colors.
--- @example
--- myTabardModel:InitializeTabardColors()
InitializeTabardColors = function(self) end,
--- Saves the current tabard design.
--- @example
--- myTabardModel:Save()
Save = function(self) end,
}

129
ui/Texture.lua Normal file
View File

@@ -0,0 +1,129 @@
---@meta
---@class Texture : Region
Texture = {
--- Adds a mask texture to the texture.
--- @param mask Texture The mask texture to add.
--- @example
--- myTexture:AddMaskTexture(myMaskTexture)
AddMaskTexture = function(self, mask) end,
--- Returns the mask texture at the specified index.
--- @param index number The index of the mask texture.
--- @return Texture mask The mask texture at the specified index.
--- @example
--- local mask = myTexture:GetMaskTexture(1)
GetMaskTexture = function(self, index) end,
--- Returns the number of mask textures applied to the texture.
--- @return number count The number of mask textures.
--- @example
--- local count = myTexture:GetNumMaskTextures()
GetNumMaskTextures = function(self) end,
--- Removes a mask texture from the texture.
--- @param mask Texture The mask texture to remove.
--- @example
--- myTexture:RemoveMaskTexture(myMaskTexture)
RemoveMaskTexture = function(self, mask) end,
--- Gets the blend mode of the texture.
--- @return string mode The blend mode.
--- @example
--- local mode = myTexture:GetBlendMode()
GetBlendMode = function(self) end,
--- Gets the texture coordinates.
--- @return number ULx, number ULy, number LLx, number LLy, number URx, number URy, number LRx, number LRy
--- @example
--- local ULx, ULy, LLx, LLy, URx, URy, LRx, LRy = myTexture:GetTexCoord()
GetTexCoord = function(self) end,
--- Gets the texture path.
--- @return string texturePath The texture path.
--- @example
--- local texturePath = myTexture:GetTexture()
GetTexture = function(self) end,
--- Gets the vertex color.
--- @return number r, number g, number b, number a The color components.
--- @example
--- local r, g, b, a = myTexture:GetVertexColor()
GetVertexColor = function(self) end,
--- Gets whether the texture is desaturated.
--- @return boolean isDesaturated True if the texture is desaturated.
--- @example
--- local isDesaturated = myTexture:IsDesaturated()
IsDesaturated = function(self) end,
--- Sets the blend mode of the texture.
--- @param mode string The blend mode ("DISABLE", "BLEND", "ALPHAKEY", "ADD", "MOD").
--- @example
--- myTexture:SetBlendMode("ADD")
SetBlendMode = function(self, mode) end,
--- Sets whether the texture should be displayed without saturation.
--- @param desaturated boolean True to desaturate the texture.
--- @example
--- myTexture:SetDesaturated(true)
SetDesaturated = function(self, desaturated) end,
--- Sets a color gradient across the texture.
--- @param orientation string The gradient orientation ("HORIZONTAL" or "VERTICAL").
--- @param startR number The start red value.
--- @param startG number The start green value.
--- @param startB number The start blue value.
--- @param endR number The end red value.
--- @param endG number The end green value.
--- @param endB number The end blue value.
--- @example
--- myTexture:SetGradient("HORIZONTAL", 1, 0, 0, 0, 0, 1)
SetGradient = function(self, orientation, startR, startG, startB, endR, endG, endB) end,
--- Sets a color gradient with alpha across the texture.
--- @param orientation string The gradient orientation ("HORIZONTAL" or "VERTICAL").
--- @param startR number The start red value.
--- @param startG number The start green value.
--- @param startB number The start blue value.
--- @param startA number The start alpha value.
--- @param endR number The end red value.
--- @param endG number The end green value.
--- @param endB number The end blue value.
--- @param endA number The end alpha value.
--- @example
--- myTexture:SetGradientAlpha("VERTICAL", 1, 0, 0, 1, 0, 0, 1, 0)
SetGradientAlpha = function(self, orientation, startR, startG, startB, startA, endR, endG, endB, endA) end,
--- Sets the texture's rotation.
--- @param angle number The rotation angle in radians.
--- @param cx number? Optional. The x coordinate of the rotation center.
--- @param cy number? Optional. The y coordinate of the rotation center.
--- @example
--- myTexture:SetRotation(math.pi / 2)
SetRotation = function(self, angle, cx, cy) end,
--- Sets the texture coordinates.
--- @param left number The left coordinate.
--- @param right number The right coordinate.
--- @param top number The top coordinate.
--- @param bottom number The bottom coordinate.
--- @example
--- myTexture:SetTexCoord(0, 1, 0, 1)
SetTexCoord = function(self, left, right, top, bottom) end,
--- Sets the texture to be displayed.
--- @param texture string|number The texture path or file ID.
--- @example
--- myTexture:SetTexture("Interface\\Icons\\Spell_Nature_Regeneration")
SetTexture = function(self, texture) end,
--- Sets the texture to a solid color.
--- @param r number The red component.
--- @param g number The green component.
--- @param b number The blue component.
--- @param a number? Optional. The alpha component.
--- @example
--- myTexture:SetColorTexture(1, 0, 0, 1)
SetColorTexture = function(self, r, g, b, a) end,
}

17
ui/Translation.lua Normal file
View File

@@ -0,0 +1,17 @@
---@meta
---@class Translation : Animation
Translation = {
--- Gets the offset values.
--- @return number offsetX, number offsetY The x and y offsets.
--- @example
--- local offsetX, offsetY = myTranslation:GetOffset()
GetOffset = function(self) end,
--- Sets the offset values.
--- @param offsetX number The x offset.
--- @param offsetY number The y offset.
--- @example
--- myTranslation:SetOffset(100, 50)
SetOffset = function(self, offsetX, offsetY) end,
}

View File

@@ -1,21 +1,22 @@
---@meta ---@meta
---UIObject is an abstract UI object type that is used to group together methods that are common to all user interface types. All of the various user interface elements in World of Warcraft are derived from UIObject. ---@class UIObject : Object
---@class UIObject
UIObject = { UIObject = {
---Returns the widget object's name --- Returns whether the object is loaded.
---@param self UIObject --- @return boolean isLoaded True if the object is loaded.
---@return string Name of the object --- @example
GetName = function(self) end, --- local isLoaded = myUIObject:IsLoaded()
IsLoaded = function(self) end,
---Returns the widget object's widget type --- Returns whether the object is visible.
---@param self UIObject --- @return boolean isVisible True if the object is visible.
---@return string Name of the object's type (e.g. Frame, Button, FontString, etc.) --- @example
GetObjectType = function(self) end, --- local isVisible = myUIObject:IsVisible()
IsVisible = function(self) end,
--- Returns whether the object belongs to a given widget type --- Returns whether the object is shown.
---@param self UIObject --- @return boolean isShown True if the object is shown.
---@param type string Name of the object's type (e.g. Frame, Button, FontString, etc.) --- @example
---@return number|nil 1 if the object belongs to the given type (or a subtype thereof); otherwise nil --- local isShown = myUIObject:IsShown()
IsObjectType = function(self, type) end, IsShown = function(self) end,
} }

7
ui/WorldFrame.lua Normal file
View File

@@ -0,0 +1,7 @@
---@meta
---@class WorldFrame : Frame
WorldFrame = {
--- The WorldFrame is a special frame that displays the 3D game world.
--- It inherits all methods from Frame but has no additional methods of its own.
}