diff --git a/api/CreateFrame.lua b/api/CreateFrame.lua index 7ff908f..97b178e 100644 --- a/api/CreateFrame.lua +++ b/api/CreateFrame.lua @@ -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 \ No newline at end of file +---@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 diff --git a/api/GetItemInfo.lua b/api/GetItemInfo.lua index 7b78b6f..28ac686 100644 --- a/api/GetItemInfo.lua +++ b/api/GetItemInfo.lua @@ -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 \ No newline at end of file +---@overload fun(itemID: number): table +---@overload fun(itemLink: string): table +function GetItemInfo(itemName) end \ No newline at end of file diff --git a/api/GetLootInfo.lua b/api/GetLootInfo.lua index f9bf406..da4a6cc 100644 --- a/api/GetLootInfo.lua +++ b/api/GetLootInfo.lua @@ -9,4 +9,5 @@ ---@field roll boolean ---@field texture number Texture file ID +---@return LootInfo[] function GetLootInfo() end \ No newline at end of file diff --git a/api/GetLootSlotInfo.lua b/api/GetLootSlotInfo.lua index fe9270b..71640cb 100644 --- a/api/GetLootSlotInfo.lua +++ b/api/GetLootSlotInfo.lua @@ -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 \ No newline at end of file diff --git a/api/UnitClass.lua b/api/UnitClass.lua index 371c6eb..ab605db 100644 --- a/api/UnitClass.lua +++ b/api/UnitClass.lua @@ -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 \ No newline at end of file +---@overload fun(name: string) +function UnitClass(unit) end \ No newline at end of file diff --git a/api/strsplit.lua b/api/strsplit.lua index 82b8f79..94047a7 100644 --- a/api/strsplit.lua +++ b/api/strsplit.lua @@ -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 \ No newline at end of file