This commit is contained in:
2025-03-13 16:28:23 +01:00
parent 468a68c3e7
commit 62e991cc66
23 changed files with 172 additions and 81 deletions

View File

@@ -1,15 +1,21 @@
---@diagnostic disable: missing-return, lowercase-global
---@alias auraFilter
---| 'RAID'
---| 'CANCELABLE'
---| 'HARMFUL'
---| 'HELPFUL'
---| 'NOT_CANCELABLE'
---| 'PLAYER'
---| 'RAID'
---@param unit string
---@param index number
---@param name string
---@param rank string
---@param filter RAID
---@param CANCELABLE
---@param HARMFUL
---@param HELPFUL
---@param NOT_CANCELABLE
---@param PLAYER
---@param RAID
---Cancels a buff on the player. CancelUnitBuff becomes a protected function while under combat lockdown.
function CancelUnitBuff(unit, index, name, rank, filter, CANCELABLE, HARMFUL, HELPFUL, NOT_CANCELABLE, PLAYER, RAID) end
---@overload fun(unit: string, index: number)
---@overload fun(unit: string, index: number, rank: string)
---@overload fun(unit: string, index: number, rank: string, filter: auraFilter)
---@overload fun(unit: string, name: string)
---@overload fun(unit: string, name: string, rank: string)
---@overload fun(unit: string, name: string, rank: string, filter: auraFilter)
function CancelUnitBuff(unit, index, name, rank, filter) end

View File

@@ -1,9 +1,7 @@
---@diagnostic disable: missing-return, lowercase-global
---@param frameType string
---@param name string
---@param parent table
---@param template string
---@return table frame
---Creates a new Frame object
function CreateFrame(frameType, name, parent, template) end
---@overload fun(frameType: string): table
---@overload fun(frameType: string, name: string): table
---@overload fun(frameType: string, name: string, parent: table): table
---@overload fun(frameType: string, name: string, parent: table, template: string): table
function CreateFrame(frameType, name, parent, template) end

View File

@@ -1,7 +1,7 @@
---@diagnostic disable: missing-return, lowercase-global
---@param emote string
---@param target string
---@param hold boolean
---Performs a preset emote (with optional target). The list of built-in emote tokens can be found in global variables whose names follow the format "EMOTE"..num.."_TOKEN", where num is a number between 1 and MAXEMOTEINDEX (a variable local to ChatFrame.lua.) For custom emotes (as performed using the /emote or /me commands in the default UI), see SendChatMessage().
---@overload fun(emote: string, target: string)
---@overload fun(emote: string, target: string, hold: boolean)
function DoEmote(emote, target, hold) end

View File

@@ -1,8 +1,6 @@
---@diagnostic disable: missing-return, lowercase-global
---@param itemID number
---@param itemName string
---@param itemLink string
---@param itemName string
---@return string name
---@return string link
---@return number quality
@@ -15,4 +13,6 @@
---@return string texture
---@return number vendorPrice
---Returns information about an item, by name, link or id. Will only return item information if it is directly available in memory. An item is present in memory if: It has been seen this session, OR It's present in Cache/enUS/Item-sparse.dba, where enUS is the user's locale If item information is not readily available, the client will first look on disk in DBFilesClient/Item-sparse.db2. If an item is found there, the client fires the GET_ITEM_INFO_RECEIVED event and keeps the result in memory for further GetItemInfo requests. If an item is not found on disk either, the client will send a server request for it. If the request fails, nothing happens. If the request succeeds, the client stores the item in memory and writes it to Cache/Locale/Item-sparse.dba. The client will never send more than one server request per id per session.
function GetItemInfo(itemID, itemName, itemLink) end
---@overload fun(itemID: number): table
---@overload fun(itemLink: string): table
function GetItemInfo(itemName) end

View File

@@ -1,4 +1,13 @@
---@diagnostic disable: missing-return, lowercase-global
---@class LootInfo
---@field isQuestItem boolean?
---@field item string Item name
---@field locked boolean Can loot?
---@field quality number Item quality
---@field quantity number Item quantity
---@field roll boolean
---@field texture number Texture file ID
---@return LootInfo[]
function GetLootInfo() end

View File

@@ -5,6 +5,6 @@
---@return string item
---@return number quantity
---@return number quality
---@return 1nil locked
---@return number? locked (1 if locked, nil if not)
---Returns information about an item available as loot
function GetLootSlotInfo(slot) end

View File

@@ -1,13 +1,15 @@
---@diagnostic disable: missing-return, lowercase-global
---@alias bookType
---| 'SPELL'
---| 'PET'
---@param index number
---@param bookType spell
---@param pet
---@param spell
---@param name string
---@param id number
---@param bookType bookType
---@return number start
---@return number duration
---@return number enable
---Returns cooldown information about a spell in the spellbook
function GetSpellCooldown(index, bookType, pet, spell, name, id) end
---@overload fun(name: string)
---@overload fun(id: number)
function GetSpellCooldown(index, bookType) end

View File

@@ -1,7 +1,7 @@
---@diagnostic disable: missing-return, lowercase-global
---@param unit string
---@param name string
---@param exactMatch boolean
---Promotes a raid member to raid assistant
---@overload fun(name: string, exactMatch: boolean)
---@overload fun(unit: string)
function PromoteToAssistant(unit, name, exactMatch) end

View File

@@ -1,20 +1,22 @@
---@diagnostic disable: missing-return, lowercase-global
---@alias channel
---| 'CHANNEL' channel
---| 'DND' text
---| 'EMOTE' /e
---| 'GUILD' /g
---| 'INSTANCE_CHAT' /i
---| 'OFFICER' /o
---| 'PARTY' /p
---| 'RAID' /ra
---| 'RAID_WARNING' /rw
---| 'SAY' /s
---| 'WHISPER' channel
---| 'YELL' /y
---@param text string
---@param chatType /y
---@param CHANNEL channel
---@param DND text
---@param EMOTE /e
---@param GUILD /g
---@param INSTANCE_CHAT /i
---@param OFFICER /o
---@param PARTY /p
---@param RAID /ra
---@param RAID_WARNING /rw
---@param SAY /s
---@param WHISPER channel
---@param YELL /y
---@param languageIndex number
---@param channel string
---@param chatType channel
---Sends a chat message
function SendChatMessage(text, chatType, CHANNEL, DND, EMOTE, GUILD, INSTANCE_CHAT, OFFICER, PARTY, RAID, RAID_WARNING, SAY, WHISPER, YELL, languageIndex, channel) end
---@overload fun(text: string, chatType: channel, languageIndex: number)
---@overload fun(text: string, chatType: channel, languageIndex: number, channel: string)
function SendChatMessage(text, chatType, languageIndex, channel) end

View File

@@ -1,9 +1,9 @@
---@diagnostic disable: missing-return, lowercase-global
---@param unit string
---@param name string
---@return string class
---@return string classFileName
---@return number classIndex
---Returns a unit's class. The second return (classFileName) can be used for locale-independent verification of a unit's class, or to look up class-related data in various global tables: RAID_CLASS_COLORS provides a standard color for each class (as seen in the default who, guild, calendar, and raid UIs) CLASS_ICON_TCOORDS provides coordinates to locate each class' icon within the "Interface\Glues\CharacterCreate\UI-CharacterCreate-Classes" texture For non-player units, the first return (class) will be the unit's name; to always get a localized class name regardless of unit type, use UnitClassBase instead.
function UnitClass(unit, name) end
---@overload fun(name: string)
function UnitClass(unit) end

View File

@@ -1,7 +1,7 @@
---@diagnostic disable: missing-return, lowercase-global
---@param unit string
---@param name string
---@return 1nil exists
---@return boolean exists
---Returns whether a unit exists. A unit "exists" if it can be referenced by the player; e.g. party1 exists if the player is in a party with at least one other member (regardless of whether that member is nearby), target exists if the player has a target, npc exists if the player is currently interacting with an NPC, etc.
---@overload fun(name: string)
function UnitExists(unit, name) end

View File

@@ -1,7 +1,7 @@
---@diagnostic disable: missing-return, lowercase-global
---@param unit string
---@param name string
---@return bool leader
---@return boolean leader
---Returns whether a unit is the raid leader.
---@overload fun(name: string)
function UnitIsGroupLeader(unit, name) end

View File

@@ -2,7 +2,7 @@
---@param sep string
---@param text string
---@param limit number
---@param limit number?
---@return string ...
---Splits a string based on another seperator string. Also available as string.split (though not provided by the Lua standard library).
function strsplit(sep, text, limit) end

View File

@@ -1,7 +1,7 @@
---@diagnostic disable: missing-return, lowercase-global
---@param str string
---@param trimChars string
---@return string text
---Trims leading and trailing characters (whitespace by default) from a string. Also available as string.trim (though not provided by the Lua standard library).
---@overload fun(str: string, trimChars: string)
function strtrim(str, trimChars) end