-
Notifications
You must be signed in to change notification settings - Fork 111
/
Annotations.lua
421 lines (346 loc) · 17.7 KB
/
Annotations.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
--[[
AdiBags - Adirelle's bag addon.
Copyright 2010-2023 Adirelle ([email protected])
All rights reserved.
This file is part of AdiBags.
AdiBags is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
AdiBags is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with AdiBags. If not, see <http://www.gnu.org/licenses/>.
--]]
---@meta
-- This file holds type annotations for various objects used in AdiBags. It is
-- never loaded by the addon, but is used as a reference for the lua linter.
-----------------------------------------
--
-- Constant definitions
--
-----------------------------------------
BACKPACK_CONTAINER = Enum.BagIndex.Backpack
BANK_CONTAINER = Enum.BagIndex.Bank
REAGENTBANK_CONTAINER = Enum.BagIndex.Reagentbank
NUM_BAG_SLOTS = Constants.InventoryConstants.NumBagSlots
NUM_REAGENTBAG_SLOTS = Constants.InventoryConstants.NumReagentBagSlots
NUM_BANKBAGSLOTS = Constants.InventoryConstants.NumBankBagSlots
NUM_TOTAL_EQUIPPED_BAG_SLOTS = NUM_BAG_SLOTS + NUM_REAGENTBAG_SLOTS
REAGENTBANK_DEPOSIT = REAGENTBANK_DEPOSIT
REAGENT_BANK = REAGENT_BANK
BANKSLOTPURCHASE = BANKSLOTPURCHASE
REAGENTBANK_PURCHASE_TEXT = REAGENTBANK_PURCHASE_TEXT
COSTS_LABEL = COSTS_LABEL
ADDON_LOAD_FAILED = ADDON_LOAD_FAILED
WOW_PROJECT_WRATH_CLASSIC = 11
ITEM_SEARCHBAR_LIST = {
"BagItemSearchBox",
"GuildItemSearchBox",
"VoidItemSearchBox",
"BankItemSearchBox",
}
-----------------------------------------
--
-- Globals Definition
--
-----------------------------------------
_G.CloseWindows = function() end
_G.InterfaceOptions_AddCategory = function(frame, addOn, position) end
-----------------------------------------
--
-- Alias definitions
--
-----------------------------------------
---@alias slotId number A unique slotId for an item in a bag.
-----------------------------------------
--
-- Class definitions
--
-----------------------------------------
---@class ContainerInfo ContainerInfo is information about a bag, including all it's slots and all it's items.
---@field bag number This bag's index.
---@field slots table<number, SlotInfo> A table of all the slots in the bag, indexed by slotId.
---@class SlotInfo SlotInfo is information about a bag slot, as returned by GetContainerItemInfo(), with some additional fields for use in AdiBags.
---@field iconFileID number The texture for the item icon in FileID format.
---@field stackCount number The number of times this item is in the bag slot.
---@field isLocked boolean Whether the item is locked by the server.
---@field quality Enum.ItemQuality The item quality, i.e. 1 for common, 2 for uncommon, etc.
---@field isReadable boolean Whether the item is readable, i.e. a book.
---@field hasLoot boolean Whether the item has loot, i.e. a container.
---@field hyperlink string The itemLink of this item.
---@field isFiltered boolean True if the item is grayed-out during the current inventory search, false otherwise.
---@field hasNoValue boolean True if the item has no gold value, false otherwise.
---@field itemID number The itemID of the item in the bag slot.
---@field isBound boolean True if the item is bound to the player, false otherwise.
---@field slot number The slot index of the item in the bag.
---@field slotId slotId The unique slotId of the item in the bag.
---@field bagFamily number? The bag family as documented in [GetContainerNumFreeSlots](https://wowpedia.fandom.com/wiki/API_C_Container.GetContainerNumFreeSlots)
---@field isBank boolean Whether the item is in the player's bank.
---@field item ItemInfo The item information for the item in the bag slot.
---@class ItemInfo ItemInfo is constructed by C_Item.GetItemInfo(), with some additional fields for use in AdiBags.
---@field itemName string The localized name of the item.
---@field itemLink string The localized link of the item.
---@field itemQuality Enum.ItemQuality The item quality, i.e. 1 for common, 2 for uncommon, etc.
---@field itemLevel number The base item level, not including upgrades. See C_Item.GetDetailedItemLevelInfo() for getting the actual item level.
---@field itemMinLevel number The minimum level required to use the item, or 0 if there is no level requirement.
---@field itemType string The localized type name of the item: Armor, Weapon, Quest, etc.
---@field itemSubType string The localized sub-type name of the item: Bows, Guns, Staves, etc.
---@field itemStackCount number The max amount of an item per stack, e.g. 200 for Runecloth.
---@field itemEquipLoc string The inventory equipment location in which the item may be equipped e.g. "INVTYPE_HEAD", or an empty string if it cannot be equipped.
---@field itemTexture number The texture for the item icon in FileID format.
---@field sellPrice number The vendor price in copper, or 0 for items that cannot be sold.
---[Documentation](https://wowpedia.fandom.com/wiki/ItemType)
---@field classID Enum.ItemClass The numeric ID that matches the string field itemType.
---@field subclassID Enum.ItemConsumableSubclass|Enum.ItemWeaponSubclass|Enum.ItemGemSubclass|Enum.ItemArmorSubclass|Enum.ItemReagentSubclass|Enum.ItemRecipeSubclass|Enum.ItemMiscellaneousSubclass|Enum.BattlePetTypes|Enum.ItemProfessionSubclass|number The numeric ID that matches the string field itemSubType. See: https://wowpedia.fandom.com/wiki/ItemType
---@field bindType ItemBindType The binding type of the item: 0 for no binding, 1 for on pickup, 2 for on equip, 3 for on use.
---@field expacID ExpansionType The related Expansion, e.g. 8 for Shadowlands.
---@field setID number The ID of the item set to which this item belongs, or nil if it does not belong to a set.
---@field isCraftingReagent boolean Whether the item can be used as a crafting reagent.
---@field itemGUID string The GUID of the item as returned by GetItemGUID().
---@field itemLocation ItemLocationMixin The item location of the item as returned by ItemLocation:CreateFromBagAndSlot(bag, slot).
---@class BankFrame
---@field selectedTab number The tab that is currently selected, 1 for the main bank, 2 for the reagent bank.
---@type BankFrame
BankFrame = {}
-----------------------------------------
--
-- Function definitions
--
-----------------------------------------
-- Container Functions
---[Documentation](https://wowpedia.fandom.com/wiki/API_C_Container.ContainerIDToInventoryID)
---@param containerID number
---@return number inventoryID
function ContainerIDToInventoryID(containerID) end
---[Documentation](https://wowpedia.fandom.com/wiki/API_C_Container.ContainerRefundItemPurchase)
---@param containerIndex number
---@param slotIndex number
---@param isEquipped? boolean Default = false
function ContainerRefundItemPurchase(containerIndex, slotIndex, isEquipped) end
---[Documentation](https://wowpedia.fandom.com/wiki/API_C_Container.GetBackpackAutosortDisabled)
---@return boolean isDisabled
function GetBackpackAutosortDisabled() end
---[Documentation](https://wowpedia.fandom.com/wiki/API_C_Container.GetBagName)
---@param bagIndex number
---@return string name
function GetBagName(bagIndex) end
---[Documentation](https://wowpedia.fandom.com/wiki/API_C_Container.GetBagSlotFlag)
---@param bagIndex number
---@param flag number|Enum.BagSlotFlags
---@return boolean isSet
function GetBagSlotFlag(bagIndex, flag) end
---[Documentation](https://wowpedia.fandom.com/wiki/API_C_Container.GetBankAutosortDisabled)
---@return boolean isDisabled
function GetBankAutosortDisabled() end
---[Documentation](https://wowpedia.fandom.com/wiki/API_C_Container.GetContainerFreeSlots)
---@param containerIndex number
---@return number[] freeSlots
function GetContainerFreeSlots(containerIndex) end
---[Documentation](https://wowpedia.fandom.com/wiki/API_C_Container.GetContainerItemCooldown)
---@param containerIndex number
---@param slotIndex number
---@return number startTime
---@return number duration
---@return number enable
function GetContainerItemCooldown(containerIndex, slotIndex) end
---[Documentation](https://wowpedia.fandom.com/wiki/API_C_Container.GetContainerItemDurability)
---@param containerIndex number
---@param slotIndex number
---@return number durability
---@return number maxDurability
function GetContainerItemDurability(containerIndex, slotIndex) end
---[Documentation](https://wowpedia.fandom.com/wiki/API_C_Container.GetContainerItemEquipmentSetInfo)
---@param containerIndex number
---@param slotIndex number
---@return boolean inSet
---@return string setList
function GetContainerItemEquipmentSetInfo(containerIndex, slotIndex) end
---[Documentation](https://wowpedia.fandom.com/wiki/API_C_Container.GetContainerItemID)
---@param containerIndex number
---@param slotIndex number
---@return number containerID
function GetContainerItemID(containerIndex, slotIndex) end
---[Documentation](https://wowpedia.fandom.com/wiki/API_C_Container.GetContainerItemInfo)
---@param containerIndex number
---@param slotIndex number
---@return ContainerItemInfo containerInfo
function GetContainerItemInfo(containerIndex, slotIndex) end
---[Documentation](https://wowpedia.fandom.com/wiki/API_C_Container.GetContainerItemLink)
---@param containerIndex number
---@param slotIndex number
---@return string itemLink
function GetContainerItemLink(containerIndex, slotIndex) end
---[Documentation](https://wowpedia.fandom.com/wiki/API_C_Container.GetContainerItemPurchaseCurrency)
---@param containerIndex number
---@param slotIndex number
---@param itemIndex number
---@param isEquipped boolean
---@return ItemPurchaseCurrency currencyInfo
function GetContainerItemPurchaseCurrency(containerIndex, slotIndex, itemIndex, isEquipped) end
---[Documentation](https://wowpedia.fandom.com/wiki/API_C_Container.GetContainerItemPurchaseInfo)
---@param containerIndex number
---@param slotIndex number
---@param isEquipped boolean
---@return ItemPurchaseInfo info
function GetContainerItemPurchaseInfo(containerIndex, slotIndex, isEquipped) end
---[Documentation](https://wowpedia.fandom.com/wiki/API_C_Container.GetContainerItemPurchaseItem)
---@param containerIndex number
---@param slotIndex number
---@param itemIndex number
---@param isEquipped boolean
---@return ItemPurchaseItem itemInfo
function GetContainerItemPurchaseItem(containerIndex, slotIndex, itemIndex, isEquipped) end
---[Documentation](https://wowpedia.fandom.com/wiki/API_C_Container.GetContainerItemQuestInfo)
---@param containerIndex number
---@param slotIndex number
---@return ItemQuestInfo questInfo
function GetContainerItemQuestInfo(containerIndex, slotIndex) end
---[Documentation](https://wowpedia.fandom.com/wiki/API_C_Container.GetContainerNumFreeSlots)
---@param bagIndex number
---@return number numFreeSlots
---@return number? bagFamily
function GetContainerNumFreeSlots(bagIndex) end
---[Documentation](https://wowpedia.fandom.com/wiki/API_C_Container.GetContainerNumSlots)
---@param containerIndex number
---@return number numSlots
function GetContainerNumSlots(containerIndex) end
---[Documentation](https://wowpedia.fandom.com/wiki/API_C_Container.GetInsertItemsLeftToRight)
---@return boolean isEnabled
function GetInsertItemsLeftToRight() end
---[Documentation](https://wowpedia.fandom.com/wiki/API_C_Container.GetItemCooldown)
---@param itemID number
---@return number startTime
---@return number duration
---@return number enable
function GetItemCooldown(itemID) end
---[Documentation](https://wowpedia.fandom.com/wiki/API_C_Container.GetMaxArenaCurrency)
---@return number maxCurrency
function GetMaxArenaCurrency() end
---[Documentation](https://wowpedia.fandom.com/wiki/API_C_Container.GetSortBagsRightToLeft)
---@return boolean isEnabled
function GetSortBagsRightToLeft() end
---[Documentation](https://wowpedia.fandom.com/wiki/API_C_Container.IsBattlePayItem)
---@param containerIndex number
---@param slotIndex number
---@return boolean isBattlePayItem
function IsBattlePayItem(containerIndex, slotIndex) end
---[Documentation](https://wowpedia.fandom.com/wiki/API_C_Container.IsContainerFiltered)
---@param containerIndex number
---@return boolean isFiltered
function IsContainerFiltered(containerIndex) end
---[Documentation](https://wowpedia.fandom.com/wiki/API_C_Container.PickupContainerItem)
---@param containerIndex number
---@param slotIndex number
function PickupContainerItem(containerIndex, slotIndex) end
---[Documentation](https://wowpedia.fandom.com/wiki/API_C_Container.PlayerHasHearthstone)
---@return number? itemID
function PlayerHasHearthstone() end
---[Documentation](https://wowpedia.fandom.com/wiki/API_C_Container.SetBackpackAutosortDisabled)
---@param disable boolean
function SetBackpackAutosortDisabled(disable) end
---[Documentation](https://wowpedia.fandom.com/wiki/API_C_Container.SetBagPortraitTexture)
---@param texture table
---@param bagIndex number
function SetBagPortraitTexture(texture, bagIndex) end
---[Documentation](https://wowpedia.fandom.com/wiki/API_C_Container.SetBagSlotFlag)
---@param bagIndex number
---@param flag number|Enum.BagSlotFlags
---@param isSet boolean
function SetBagSlotFlag(bagIndex, flag, isSet) end
---[Documentation](https://wowpedia.fandom.com/wiki/API_C_Container.SetBankAutosortDisabled)
---@param disable boolean
function SetBankAutosortDisabled(disable) end
---[Documentation](https://wowpedia.fandom.com/wiki/API_C_Container.SetInsertItemsLeftToRight)
---@param enable boolean
function SetInsertItemsLeftToRight(enable) end
---[Documentation](https://wowpedia.fandom.com/wiki/API_C_Container.SetItemSearch)
---@param searchString string
function SetItemSearch(searchString) end
---[Documentation](https://wowpedia.fandom.com/wiki/API_C_Container.SetSortBagsRightToLeft)
---@param enable boolean
function SetSortBagsRightToLeft(enable) end
---[Documentation](https://wowpedia.fandom.com/wiki/API_C_Container.ShowContainerSellCursor)
---@param containerIndex number
---@param slotIndex number
function ShowContainerSellCursor(containerIndex, slotIndex) end
---[Documentation](https://wowpedia.fandom.com/wiki/API_C_Container.SocketContainerItem)
---@param containerIndex number
---@param slotIndex number
---@return boolean success
function SocketContainerItem(containerIndex, slotIndex) end
---[Documentation](https://wowpedia.fandom.com/wiki/API_C_Container.SortBags)
function SortBags() end
---[Documentation](https://wowpedia.fandom.com/wiki/API_C_Container.SortBankBags)
function SortBankBags() end
---[Documentation](https://wowpedia.fandom.com/wiki/API_C_Container.SortReagentBankBags)
function SortReagentBankBags() end
---[Documentation](https://wowpedia.fandom.com/wiki/API_C_Container.SplitContainerItem)
---@param containerIndex number
---@param slotIndex number
---@param amount number
function SplitContainerItem(containerIndex, slotIndex, amount) end
---[Documentation](https://wowpedia.fandom.com/wiki/API_C_Container.UseContainerItem)
---@param containerIndex number
---@param slotIndex number
---@param unitToken? string
---@param reagentBankOpen? boolean Default = false
function UseContainerItem(containerIndex, slotIndex, unitToken, reagentBankOpen) end
---[Documentation](https://wowpedia.fandom.com/wiki/API_C_Container.UseHearthstone)
---@return boolean used
function UseHearthstone() end
-- PetJournal definitions
---@param speciesID number
---@return string speciesName
---@return number speciesIcon
---@return number petType
---@diagnostic disable-next-line: duplicate-set-field
function C_PetJournal.GetPetInfoBySpeciesID(speciesID) end
-- Missing LibSharedMedia definitions
---@class LibSharedMedia-3.0
local LibSharedMedia = {}
---@param self table The object to register the callback on.
---@param eventname string The name of the event to register.
---@param method string|function The method on the object or the function to call when the event is fired.
---@param ... any Any additional arguments to pass to the method when it is called.
function LibSharedMedia.RegisterCallback(self, eventname, method, ...) end
-- ABEvent definitions
---@class ABEvent-1.0
local ABEvent = {}
---@param eventname string The name of the event to register.
---@param method function The method to call when the event is fired.
---@param ... any Additional arguments to pass to the method when it is called.
function ABEvent.RegisterMessage(eventname, method, ...) end
---@param eventname string The name of the event to register.
---@param method function|string The method to call when the event is fired.
---@param ... any Additional arguments to pass to the method when it is called.
function ABEvent.RegisterEvent(eventname, method, ...) end
-- AdiDebug definitions
---@class AdiDebug
local AdiDebug = {}
---@param target table
---@param name string
function AdiDebug:Embed(target, name) end
-- Global functions
---@param which string The name of the popup to show.
---@param text_arg1? string The first text argument to pass to the popup.
---@param text_arg2? string The second text argument to pass to the popup.
---@param data? table The data to pass for certain popups.
---@param insertedFrame? Frame The frame to insert into the popup.
function StaticPopup_Show(which, text_arg1, text_arg2, data, insertedFrame) end
---@param frame Frame The frame to set the tooltip on.
---@param money number|nil The amount of money to display, in copper.
---@param type? string Unknown/undocumented parameter.
---@param prefixText? string The text to display before the money.
---@param suffixText? string The text to display after the money.
function SetTooltipMoney(frame, money, type, prefixText, suffixText) end
-- Define the main AdiBags addon object
---@class AdiBags-Proto
---@field ItemDatabase ItemDatabase
---@field db AceDBObject-3.0
---@class FilterModule
---@field isFilter boolean
---@field isBag boolean
---@field bagName string