-
Notifications
You must be signed in to change notification settings - Fork 3
/
annotations.lua
414 lines (276 loc) · 11.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
---@meta
--- MapPinEnhanced specific CallbackHandler annotation
---@alias CallbackEvent 'UpdateSetList'
---@class MPHCallbackHandler
local CallbackHandler = {}
---Register a callback on the given object.
---@param event CallbackEvent
---@param method function
---@param arg any
function CallbackHandler:RegisterCallback(event, method, arg) end
---Unregister a callback on the given object.
---@param event CallbackEvent
function CallbackHandler:UnregisterCallback(event) end
---Unregister all callbacks on the given object.
function CallbackHandler:UnregisterAllCallbacks() end
---@class MPHCallbackHandlerRegistry
---@field OnUnused? fun(registry: CallbackHandlerRegistry, target: table, eventName: CallbackEvent) If defined, called when an event stops.
---@field OnUsed? fun(registry: CallbackHandlerRegistry, target: table, eventName: CallbackEvent) If defined, called when an event starts.
local MPHCallbackHandlerRegistry = {}
---fires the given event/message into the registry
---@param eventname CallbackEvent
---@param ... unknown passed to the functions listening to the event.
function MPHCallbackHandlerRegistry:Fire(eventname, ...) end
---@class PropagateMouseClicks
---@field SetPropagateMouseClicks fun(self:Frame, propagate: boolean)
---@class PropagateMouseMotion
---@field SetPropagateMouseMotion fun(self:Frame, propagate: boolean)
---@param frameType string
---@param parent string?
---@param frameTemplate string?
---@param resetterFunc fun()?
---@param forbidden boolean?
---@return FramePool
function CreateFramePool(frameType, parent, frameTemplate, resetterFunc, forbidden) end
---@class FramePool
local FramePool = {}
---@return string
function FramePool:GetTemplate() end
---@return Frame
function FramePool:Acquire() end
---@param obj Frame
---@return boolean success
function FramePool:Release(obj) end
function FramePool:ReleaseAll() end
function FramePool:EnumerateActive() end
---@return ScriptRegion region
function GetMouseFoci() end
---@class MenuUtil
MenuUtil = {}
function MenuUtil.TraverseMenu(elementDescription, op, condition) end
function MenuUtil.GetSelections(elementDescription, condition) end
function MenuUtil.ShowTooltip(owner, func, ...) end
function MenuUtil.HideTooltip(owner) end
function MenuUtil.HookTooltipScripts(owner, func) end
function MenuUtil.CreateRootMenuDescription(menuMixin) end
function MenuUtil.CreateContextMenu(ownerRegion, generator, ...) end
function MenuUtil.SetElementText(elementDescription, text) end
function MenuUtil.GetElementText(elementDescription) end
function MenuUtil.CreateFrame() end
function MenuUtil.CreateTemplate(template) end
function MenuUtil.CreateTitle(text, color) end
function MenuUtil.CreateButton(text, callback, data) end
function MenuUtil.CreateCheckbox(text, isSelected, setSelected, data) end
function MenuUtil.CreateRadio(text, isSelected, setSelected, data) end
function MenuUtil.CreateColorSwatch(text, callback, colorInfo) end
function MenuUtil.CreateButtonMenu(dropdown, ...) end
function MenuUtil.CreateButtonContextMenu(ownerRegion, ...) end
function MenuUtil.CreateCheckboxMenu(dropdown, isSelected, setSelected, ...) end
function MenuUtil.CreateCheckboxContextMenu(ownerRegion, isSelected, setSelected, ...) end
function MenuUtil.CreateRadioMenu(dropdown, isSelected, setSelected, ...) end
function MenuUtil.CreateRadioContextMenu(ownerRegion, isSelected, setSelected, ...) end
function MenuUtil.CreateEnumRadioMenu(dropdown, enum, enumTranslator, isSelected, setSelected, orderTbl) end
function MenuUtil.CreateEnumRadioContextMenu(dropdown, enum, enumTranslator, isSelected, setSelected, orderTbl) end
function MenuUtil.CreateDivider() end
function MenuUtil.CreateSpacer() end
---@class SubMenuUtil
SubMenuUtil = {}
function SubMenuUtil:TraverseMenu(elementDescription, op, condition) end
function SubMenuUtil:GetSelections(elementDescription, condition) end
function SubMenuUtil:ShowTooltip(owner, func, ...) end
function SubMenuUtil:HideTooltip(owner) end
function SubMenuUtil:HookTooltipScripts(owner, func) end
function SubMenuUtil:CreateRootMenuDescription(menuMixin) end
function SubMenuUtil:CreateContextMenu(ownerRegion, generator, ...) end
function SubMenuUtil:SetElementText(elementDescription, text) end
function SubMenuUtil:GetElementText(elementDescription) end
function SubMenuUtil:CreateFrame() end
function SubMenuUtil:CreateTemplate(template) end
function SubMenuUtil:CreateTitle(text, color) end
function SubMenuUtil:CreateButton(text, callback, data) end
function SubMenuUtil:CreateCheckbox(text, isSelected, setSelected, data) end
function SubMenuUtil:CreateRadio(text, isSelected, setSelected, data) end
function SubMenuUtil:CreateColorSwatch(text, callback, colorInfo) end
function SubMenuUtil:CreateButtonMenu(dropdown, ...) end
function SubMenuUtil:CreateButtonContextMenu(ownerRegion, ...) end
function SubMenuUtil:CreateCheckboxMenu(dropdown, isSelected, setSelected, ...) end
function SubMenuUtil:CreateCheckboxContextMenu(ownerRegion, isSelected, setSelected, ...) end
function SubMenuUtil:CreateRadioMenu(dropdown, isSelected, setSelected, ...) end
function SubMenuUtil:CreateRadioContextMenu(ownerRegion, isSelected, setSelected, ...) end
function SubMenuUtil:CreateEnumRadioMenu(dropdown, enum, enumTranslator, isSelected, setSelected, orderTbl) end
function SubMenuUtil:CreateEnumRadioContextMenu(dropdown, enum, enumTranslator, isSelected, setSelected, orderTbl) end
function SubMenuUtil:CreateDivider() end
function SubMenuUtil:CreateSpacer() end
---@class BaseMenuDescriptionMixin
BaseMenuDescriptionMixin = {}
---@param initializer fun(frame: Frame, elementDescription: BaseMenuDescriptionMixin, menu: BaseMenuDescriptionMixin)
---@param index number?
function BaseMenuDescriptionMixin:AddInitializer(initializer, index) end
---@param isRadio boolean
function BaseMenuDescriptionMixin:SetRadio(isRadio) end
---@return boolean
function BaseMenuDescriptionMixin:IsSelected() end
---@return boolean
function BaseMenuDescriptionMixin:SetIsSelected() end
function BaseMenuDescriptionMixin:SetSelectionIgnored() end
---@param soundKit number
function BaseMenuDescriptionMixin:SetSoundKit(soundKit) end
---@param onEnter fun()
function BaseMenuDescriptionMixin:SetOnEnter(onEnter) end
---@param onLeave fun()
function BaseMenuDescriptionMixin:SetOnLeave(onLeave) end
---@param isEnabled boolean
function BaseMenuDescriptionMixin:SetEnabled(isEnabled) end
---@return boolean
function BaseMenuDescriptionMixin:IsEnabled() end
---@param data table
function BaseMenuDescriptionMixin:SetData(data) end
---@param callback fun(data:table,menuInputData:table, menu: BaseMenuDescriptionMixin):integer
function BaseMenuDescriptionMixin:SetResponder(callback) end
---@param response MenuResponse
function BaseMenuDescriptionMixin:SetResponse(response) end
---@param tooltip fun()
function BaseMenuDescriptionMixin:SetTooltip(tooltip) end
---@param inputContext integer
---@param buttonName string
function BaseMenuDescriptionMixin:Pick(inputContext, buttonName) end
---@type table<string, table>
StaticPopupDialogs = {}
---@param dialogName string
function StaticPopup_Show(dialogName) end
---@class SuperTrackedFrameMixin
SuperTrackedFrameMixin = {}
---@class SuperTrackedFrame : Frame
SuperTrackedFrame = {}
---@class WaypointLocationPinMixin
WaypointLocationPinMixin = {}
---@param NavigationState Enum.NavigationState
---@param alphaValue number
function SuperTrackedFrameMixin:SetTargetAlphaForState(NavigationState, alphaValue) end
---@class UiMapPoint
UiMapPoint = {}
---@param mapID number
---@param x number
---@param y number
---@param z number
---@return UiMapPoint
function UiMapPoint.CreateFromCoordinates(mapID, x, y, z) end
---@param mapID number
---@param position Vector2DMixin
---@param z number
---@return UiMapPoint
function UiMapPoint.CreateFromVector2D(mapID, position, z) end
---@param mapID number
---@param position Vector3DMixin
---@return UiMapPoint
function UiMapPoint.CreateFromVector3D(mapID, position) end
---@meta
---@class WorldMapFrame
---@field pinPools table<string, FramePool>
WorldMapFrame = {}
---@return number
function WorldMapFrame:GetMapID() end
---@class ColorPickerFrame : Frame
ColorPickerFrame = {}
---@return number, number, number
function ColorPickerFrame:GetColorRGB() end
---@return number
function ColorPickerFrame:GetColorAlpha() end
---@class ColorPickerInfo
---@field swatchFunc fun()
---@field hasOpacity boolean
---@field opacityFunc fun()
---@field opacity number
---@field cancelFunc fun()
---@field r number
---@field g number
---@field b number
---@field a number
function ColorPickerFrame:SetupColorPickerAndShow(info) end
---@class DropdownButton : Button
---@field SetupMenu fun(self:DropdownButton, generator:fun(owner:Frame, rootDescription:table))
---@class ScrollableTextarea : ScrollFrame
---@field bg Texture
---@field gainFocus Animation
---@field loseFocus Animation
---@field editBox EditBox
---@field focusButton Frame
---@class ClickPropagatableFrame : Frame, PropagateMouseClicks
---@class ClicksPropagatableButton : Button, PropagateMouseClicks
---@class MousePropagatableFrame : Frame, PropagateMouseMotion
---@class MousePropagatableButton : Button, PropagateMouseMotion
---@class BothPropagatableFrame : Frame, PropagateMouseClicks, PropagateMouseMotion
---@class BothPropagatableButton : Button, PropagateMouseClicks, PropagateMouseMotion
---@class HereBeDragonMapData
---@field mapType Enum.UIMapType
---@field parent number
---@field name string
---@field instance number
---@param mapID number
function OpenWorldMap(mapID) end
MenuConstants =
{
VerticalLinearDirection = 1,
VerticalGridDirection = 2,
HorizontalGridDirection = 3,
AutoCalculateColumns = nil,
ElementPollFrequencySeconds = .2,
PrintSecure = false,
};
--[[
Response values are optional returns from description handlers to inform the menu
structure to remain open, reinitialize all the children, or only close the leafmost menu.
It is common for menus with checkboxes or radio options to return Refresh in order for
the children to visually update.
--]]
---@class MenuResponse
MenuResponse =
{
Open = 1, -- Menu remains open and unchanged
Refresh = 2, -- All frames in the menu are reinitialized
Close = 3, -- Parent menus remain open but this menu closes
CloseAll = 4, -- All menus close
};
--[[
Passed to element handlers to inform which input is responsible for invoking the element handler,
which is relevant in some specialized use cases. See Blizzard_CharacterCustomize.lua.
Can be used to
]] --
---@class MenuInputContext
MenuInputContext =
{
None = 1,
MouseButton = 2,
MouseWheel = 3,
};
---@class AddonCompartmentFrame : Frame
AddonCompartmentFrame = {}
---@param data {text: string, icon: string, notCheckable: boolean, func: fun(_, buttonName: string, menu: Frame)}
function AddonCompartmentFrame:RegisterAddon(data) end
FACTION_HORDE = "Horde"
FACTION_ALLIANCE = "Alliance"
---@type MapPinEnhancedDB
MapPinEnhancedDB = {}
---@class UIErrorsFrame
UIErrorsFrame = {}
function UIErrorsFrame:AddMessage(message, r, g, b, a) end
-- typed only for english client, but that doesnt matter using ingame global anyways
MAP_PIN_HYPERLINK = "|A:Waypoint-MapPin-ChatIcon:13:13:0:0|a Map Pin Location"
---@param editBox EditBox
function ChatEdit_ActivateChat(editBox) end
---@param link string
function ChatEdit_InsertLink(link) end
---@class DEFAULT_CHAT_FRAME
---@field editBox EditBox
---@field Clear fun()
---@field GetNumMessages fun():number
---@field GetMessageInfo fun(_, index: number):string
DEFAULT_CHAT_FRAME = {}
---@class MapPinEnhancedSquareButton : Button
---@field iconTexture string
---@field tooltip? string
---@class ScripRegionWithPinInfo : ScriptRegion
---@field pinTemplate string
-- extend herebedragons type annotation with mapData
---@class HereBeDragons-2.0
---@field mapData table<number, HereBeDragonMapData>