wuira 0.3.2 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +27 -0
- package/README.md +27 -9
- package/docs/source-converters.md +6 -6
- package/docs/spells.md +1 -1
- package/lib/datasources/NativeApi.d.ts +319 -0
- package/lib/datasources/NativeApi.lua +1114 -0
- package/lib/datasources/NativeNumberSource.d.ts +1 -1
- package/lib/datasources/NativeNumberSource.lua +16 -1
- package/lib/datasources/ProgressSource.lua +5 -9
- package/lib/datasources/Source.d.ts +18 -0
- package/lib/datasources/Source.lua +300 -0
- package/lib/datasources/SourceConverter.d.ts +1 -1
- package/lib/datasources/SourceConverter.lua +10 -1
- package/lib/datasources/TextureSource.d.ts +1 -1
- package/lib/datasources/TextureSource.lua +16 -1
- package/lib/datasources/TimerSource.d.ts +1 -1
- package/lib/datasources/TimerSource.lua +16 -1
- package/lib/datasources/UseSource.d.ts +49 -0
- package/lib/datasources/UseSource.lua +9 -0
- package/lib/datasources/index.d.ts +5 -25
- package/lib/datasources/index.lua +49 -69
- package/lib/helpers/Auras.d.ts +5 -0
- package/lib/helpers/Auras.lua +47 -0
- package/lib/helpers/Range.d.ts +2 -0
- package/lib/helpers/Range.lua +30 -0
- package/lib/helpers/index.d.ts +2 -0
- package/lib/helpers/index.lua +12 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.lua +6 -0
- package/lib/platform/forever.d.ts +3 -0
- package/lib/rendering/progress.lua +5 -150
- package/lib/ui/UnitPortrait.d.ts +1 -2
- package/lib/ui/UnitPortrait.lua +11 -18
- package/package.json +8 -1
- package/lib/datasources/AuraTimer.d.ts +0 -21
- package/lib/datasources/AuraTimer.lua +0 -322
- package/lib/datasources/Auras.d.ts +0 -32
- package/lib/datasources/Auras.lua +0 -284
- package/lib/datasources/CastTimer.d.ts +0 -9
- package/lib/datasources/CastTimer.lua +0 -240
- package/lib/datasources/EditModeLayouts.d.ts +0 -33
- package/lib/datasources/EditModeLayouts.lua +0 -689
- package/lib/datasources/GroupMembers.d.ts +0 -24
- package/lib/datasources/GroupMembers.lua +0 -454
- package/lib/datasources/GroupRoster.d.ts +0 -28
- package/lib/datasources/GroupRoster.lua +0 -611
- package/lib/datasources/KnownSpells.d.ts +0 -33
- package/lib/datasources/KnownSpells.lua +0 -1068
- package/lib/datasources/ManaRegenTimer.d.ts +0 -29
- package/lib/datasources/ManaRegenTimer.lua +0 -674
- package/lib/datasources/Resources.d.ts +0 -60
- package/lib/datasources/Resources.lua +0 -824
- package/lib/datasources/SpellCooldown.d.ts +0 -12
- package/lib/datasources/SpellCooldown.lua +0 -218
- package/lib/datasources/SpellSource.d.ts +0 -14
- package/lib/datasources/SpellSource.lua +0 -224
- package/lib/datasources/SwingTimer.d.ts +0 -31
- package/lib/datasources/SwingTimer.lua +0 -641
- package/lib/datasources/TotemTimer.d.ts +0 -10
- package/lib/datasources/TotemTimer.lua +0 -260
- package/lib/datasources/UnitInfo.d.ts +0 -51
- package/lib/datasources/UnitInfo.lua +0 -783
- package/lib/datasources/UnitSource.d.ts +0 -38
- package/lib/datasources/UnitSource.lua +0 -602
|
@@ -1,322 +0,0 @@
|
|
|
1
|
-
--[[ Generated with https://github.com/TypeScriptToLua/TypeScriptToLua ]]
|
|
2
|
-
-- Lua Library inline imports
|
|
3
|
-
local function __TS__Class(self)
|
|
4
|
-
local c = {prototype = {}}
|
|
5
|
-
c.prototype.__index = c.prototype
|
|
6
|
-
c.prototype.constructor = c
|
|
7
|
-
return c
|
|
8
|
-
end
|
|
9
|
-
|
|
10
|
-
local function __TS__ClassExtends(target, base)
|
|
11
|
-
target.____super = base
|
|
12
|
-
local staticMetatable = setmetatable({__index = base}, base)
|
|
13
|
-
setmetatable(target, staticMetatable)
|
|
14
|
-
local baseMetatable = getmetatable(base)
|
|
15
|
-
if baseMetatable then
|
|
16
|
-
if type(baseMetatable.__index) == "function" then
|
|
17
|
-
staticMetatable.__index = baseMetatable.__index
|
|
18
|
-
end
|
|
19
|
-
if type(baseMetatable.__newindex) == "function" then
|
|
20
|
-
staticMetatable.__newindex = baseMetatable.__newindex
|
|
21
|
-
end
|
|
22
|
-
end
|
|
23
|
-
setmetatable(target.prototype, base.prototype)
|
|
24
|
-
if type(base.prototype.__index) == "function" then
|
|
25
|
-
target.prototype.__index = base.prototype.__index
|
|
26
|
-
end
|
|
27
|
-
if type(base.prototype.__newindex) == "function" then
|
|
28
|
-
target.prototype.__newindex = base.prototype.__newindex
|
|
29
|
-
end
|
|
30
|
-
if type(base.prototype.__tostring) == "function" then
|
|
31
|
-
target.prototype.__tostring = base.prototype.__tostring
|
|
32
|
-
end
|
|
33
|
-
end
|
|
34
|
-
|
|
35
|
-
local function __TS__New(target, ...)
|
|
36
|
-
local instance = setmetatable({}, target.prototype)
|
|
37
|
-
instance:____constructor(...)
|
|
38
|
-
return instance
|
|
39
|
-
end
|
|
40
|
-
|
|
41
|
-
local function __TS__CloneDescriptor(____bindingPattern0)
|
|
42
|
-
local value
|
|
43
|
-
local writable
|
|
44
|
-
local set
|
|
45
|
-
local get
|
|
46
|
-
local configurable
|
|
47
|
-
local enumerable
|
|
48
|
-
enumerable = ____bindingPattern0.enumerable
|
|
49
|
-
configurable = ____bindingPattern0.configurable
|
|
50
|
-
get = ____bindingPattern0.get
|
|
51
|
-
set = ____bindingPattern0.set
|
|
52
|
-
writable = ____bindingPattern0.writable
|
|
53
|
-
value = ____bindingPattern0.value
|
|
54
|
-
local descriptor = {enumerable = enumerable == true, configurable = configurable == true}
|
|
55
|
-
local hasGetterOrSetter = get ~= nil or set ~= nil
|
|
56
|
-
local hasValueOrWritableAttribute = writable ~= nil or value ~= nil
|
|
57
|
-
if hasGetterOrSetter and hasValueOrWritableAttribute then
|
|
58
|
-
error("Invalid property descriptor. Cannot both specify accessors and a value or writable attribute.", 0)
|
|
59
|
-
end
|
|
60
|
-
if get or set then
|
|
61
|
-
descriptor.get = get
|
|
62
|
-
descriptor.set = set
|
|
63
|
-
else
|
|
64
|
-
descriptor.value = value
|
|
65
|
-
descriptor.writable = writable == true
|
|
66
|
-
end
|
|
67
|
-
return descriptor
|
|
68
|
-
end
|
|
69
|
-
|
|
70
|
-
local __TS__DescriptorGet
|
|
71
|
-
do
|
|
72
|
-
local getmetatable = _G.getmetatable
|
|
73
|
-
local ____rawget = _G.rawget
|
|
74
|
-
function __TS__DescriptorGet(self, metatable, key)
|
|
75
|
-
while metatable do
|
|
76
|
-
local rawResult = ____rawget(metatable, key)
|
|
77
|
-
if rawResult ~= nil then
|
|
78
|
-
return rawResult
|
|
79
|
-
end
|
|
80
|
-
local descriptors = ____rawget(metatable, "_descriptors")
|
|
81
|
-
if descriptors then
|
|
82
|
-
local descriptor = descriptors[key]
|
|
83
|
-
if descriptor ~= nil then
|
|
84
|
-
if descriptor.get then
|
|
85
|
-
return descriptor.get(self)
|
|
86
|
-
end
|
|
87
|
-
return descriptor.value
|
|
88
|
-
end
|
|
89
|
-
end
|
|
90
|
-
metatable = getmetatable(metatable)
|
|
91
|
-
end
|
|
92
|
-
end
|
|
93
|
-
end
|
|
94
|
-
|
|
95
|
-
local __TS__DescriptorSet
|
|
96
|
-
do
|
|
97
|
-
local getmetatable = _G.getmetatable
|
|
98
|
-
local ____rawget = _G.rawget
|
|
99
|
-
local rawset = _G.rawset
|
|
100
|
-
function __TS__DescriptorSet(self, metatable, key, value)
|
|
101
|
-
while metatable do
|
|
102
|
-
local descriptors = ____rawget(metatable, "_descriptors")
|
|
103
|
-
if descriptors then
|
|
104
|
-
local descriptor = descriptors[key]
|
|
105
|
-
if descriptor ~= nil then
|
|
106
|
-
if descriptor.set then
|
|
107
|
-
descriptor.set(self, value)
|
|
108
|
-
else
|
|
109
|
-
if descriptor.writable == false then
|
|
110
|
-
error(
|
|
111
|
-
((("Cannot assign to read only property '" .. key) .. "' of object '") .. tostring(self)) .. "'",
|
|
112
|
-
0
|
|
113
|
-
)
|
|
114
|
-
end
|
|
115
|
-
descriptor.value = value
|
|
116
|
-
end
|
|
117
|
-
return
|
|
118
|
-
end
|
|
119
|
-
end
|
|
120
|
-
metatable = getmetatable(metatable)
|
|
121
|
-
end
|
|
122
|
-
rawset(self, key, value)
|
|
123
|
-
end
|
|
124
|
-
end
|
|
125
|
-
|
|
126
|
-
local __TS__SetDescriptor
|
|
127
|
-
do
|
|
128
|
-
local getmetatable = _G.getmetatable
|
|
129
|
-
local function descriptorIndex(self, key)
|
|
130
|
-
return __TS__DescriptorGet(
|
|
131
|
-
self,
|
|
132
|
-
getmetatable(self),
|
|
133
|
-
key
|
|
134
|
-
)
|
|
135
|
-
end
|
|
136
|
-
local function descriptorNewIndex(self, key, value)
|
|
137
|
-
return __TS__DescriptorSet(
|
|
138
|
-
self,
|
|
139
|
-
getmetatable(self),
|
|
140
|
-
key,
|
|
141
|
-
value
|
|
142
|
-
)
|
|
143
|
-
end
|
|
144
|
-
function __TS__SetDescriptor(target, key, desc, isPrototype)
|
|
145
|
-
if isPrototype == nil then
|
|
146
|
-
isPrototype = false
|
|
147
|
-
end
|
|
148
|
-
local ____isPrototype_0
|
|
149
|
-
if isPrototype then
|
|
150
|
-
____isPrototype_0 = target
|
|
151
|
-
else
|
|
152
|
-
____isPrototype_0 = getmetatable(target)
|
|
153
|
-
end
|
|
154
|
-
local metatable = ____isPrototype_0
|
|
155
|
-
if not metatable then
|
|
156
|
-
metatable = {}
|
|
157
|
-
setmetatable(target, metatable)
|
|
158
|
-
end
|
|
159
|
-
if not isPrototype and not rawget(metatable, "_isOwnDescriptorMetatable") then
|
|
160
|
-
local instanceMetatable = {}
|
|
161
|
-
instanceMetatable._isOwnDescriptorMetatable = true
|
|
162
|
-
setmetatable(instanceMetatable, metatable)
|
|
163
|
-
setmetatable(target, instanceMetatable)
|
|
164
|
-
metatable = instanceMetatable
|
|
165
|
-
end
|
|
166
|
-
local value = rawget(target, key)
|
|
167
|
-
if value ~= nil then
|
|
168
|
-
rawset(target, key, nil)
|
|
169
|
-
end
|
|
170
|
-
if not rawget(metatable, "_descriptors") then
|
|
171
|
-
metatable._descriptors = {}
|
|
172
|
-
end
|
|
173
|
-
metatable._descriptors[key] = __TS__CloneDescriptor(desc)
|
|
174
|
-
metatable.__index = descriptorIndex
|
|
175
|
-
metatable.__newindex = descriptorNewIndex
|
|
176
|
-
end
|
|
177
|
-
end
|
|
178
|
-
-- End of Lua Library inline imports
|
|
179
|
-
local ____exports = {}
|
|
180
|
-
local ____TimerSource = require("datasources.TimerSource")
|
|
181
|
-
local TimerSource = ____TimerSource.TimerSource
|
|
182
|
-
local ____TextureSource = require("datasources.TextureSource")
|
|
183
|
-
local TextureSource = ____TextureSource.TextureSource
|
|
184
|
-
local ____UnitSource = require("datasources.UnitSource")
|
|
185
|
-
local resolveUnit = ____UnitSource.resolveUnit
|
|
186
|
-
--- Selected aura duration and icon; selection policy belongs to the application.
|
|
187
|
-
____exports.AuraTimer = __TS__Class()
|
|
188
|
-
local AuraTimer = ____exports.AuraTimer
|
|
189
|
-
AuraTimer.name = "AuraTimer"
|
|
190
|
-
__TS__ClassExtends(AuraTimer, TimerSource)
|
|
191
|
-
function AuraTimer.prototype.____constructor(self, unit, options)
|
|
192
|
-
local target = resolveUnit(nil, unit)
|
|
193
|
-
local events = {
|
|
194
|
-
"UNIT_AURA",
|
|
195
|
-
"PLAYER_ENTERING_WORLD",
|
|
196
|
-
"PLAYER_TARGET_CHANGED",
|
|
197
|
-
"PLAYER_FOCUS_CHANGED",
|
|
198
|
-
"SPELLS_CHANGED"
|
|
199
|
-
}
|
|
200
|
-
TimerSource.prototype.____constructor(
|
|
201
|
-
self,
|
|
202
|
-
function() return self:ReadDuration() end,
|
|
203
|
-
events,
|
|
204
|
-
target.Token
|
|
205
|
-
)
|
|
206
|
-
self.options = options
|
|
207
|
-
self.status = "inactive"
|
|
208
|
-
self.target = target
|
|
209
|
-
self.Texture = __TS__New(
|
|
210
|
-
TextureSource,
|
|
211
|
-
function()
|
|
212
|
-
local ____opt_0 = self:ReadAura()
|
|
213
|
-
return ____opt_0 and ____opt_0.icon
|
|
214
|
-
end,
|
|
215
|
-
events,
|
|
216
|
-
target.Token
|
|
217
|
-
)
|
|
218
|
-
end
|
|
219
|
-
function AuraTimer.prototype.ReadAura(self)
|
|
220
|
-
local query = C_UnitAuras and C_UnitAuras.GetAuraDataBySpellName
|
|
221
|
-
local getName = C_Spell and C_Spell.GetSpellName
|
|
222
|
-
if query == nil or getName == nil then
|
|
223
|
-
self.status = "unavailable"
|
|
224
|
-
return nil
|
|
225
|
-
end
|
|
226
|
-
do
|
|
227
|
-
local function ____catch()
|
|
228
|
-
self.status = "unavailable"
|
|
229
|
-
end
|
|
230
|
-
local ____try, ____hasReturned, ____returnValue = pcall(function()
|
|
231
|
-
for ____, id in ipairs(self.options.spellIds) do
|
|
232
|
-
do
|
|
233
|
-
local __continue8
|
|
234
|
-
repeat
|
|
235
|
-
local name = getName(id)
|
|
236
|
-
if issecretvalue(name) then
|
|
237
|
-
self.status = "restricted"
|
|
238
|
-
return true, nil
|
|
239
|
-
end
|
|
240
|
-
if name == nil then
|
|
241
|
-
__continue8 = true
|
|
242
|
-
break
|
|
243
|
-
end
|
|
244
|
-
local aura = query(self.target.Token, name, self.options.filter or "HELPFUL")
|
|
245
|
-
if issecretvalue(aura) then
|
|
246
|
-
self.status = "restricted"
|
|
247
|
-
return true, nil
|
|
248
|
-
end
|
|
249
|
-
if aura ~= nil then
|
|
250
|
-
self.status = "active"
|
|
251
|
-
return true, aura
|
|
252
|
-
end
|
|
253
|
-
__continue8 = true
|
|
254
|
-
until true
|
|
255
|
-
if not __continue8 then
|
|
256
|
-
break
|
|
257
|
-
end
|
|
258
|
-
end
|
|
259
|
-
end
|
|
260
|
-
local ____opt_6 = C_Secrets and C_Secrets.ShouldAurasBeSecret
|
|
261
|
-
local restricted = ____opt_6 and ____opt_6()
|
|
262
|
-
self.status = (issecretvalue(restricted) or restricted == true) and "restricted" or "inactive"
|
|
263
|
-
end)
|
|
264
|
-
if not ____try then
|
|
265
|
-
____hasReturned, ____returnValue = ____catch()
|
|
266
|
-
end
|
|
267
|
-
if ____hasReturned then
|
|
268
|
-
return ____returnValue
|
|
269
|
-
end
|
|
270
|
-
end
|
|
271
|
-
return nil
|
|
272
|
-
end
|
|
273
|
-
function AuraTimer.prototype.ReadDuration(self)
|
|
274
|
-
local aura = self:ReadAura()
|
|
275
|
-
if aura == nil then
|
|
276
|
-
return nil
|
|
277
|
-
end
|
|
278
|
-
do
|
|
279
|
-
local function ____catch()
|
|
280
|
-
self.status = "unavailable"
|
|
281
|
-
return true, nil
|
|
282
|
-
end
|
|
283
|
-
local ____try, ____hasReturned, ____returnValue = pcall(function()
|
|
284
|
-
local id = aura.auraInstanceID
|
|
285
|
-
if (C_UnitAuras and C_UnitAuras.GetAuraDuration) ~= nil and (issecretvalue(id) or id ~= nil) then
|
|
286
|
-
return true, C_UnitAuras.GetAuraDuration(self.target.Token, id)
|
|
287
|
-
end
|
|
288
|
-
local total = aura.duration
|
|
289
|
-
local ____end = aura.expirationTime
|
|
290
|
-
if issecretvalue(total) or issecretvalue(____end) then
|
|
291
|
-
self.status = "restricted"
|
|
292
|
-
return true, nil
|
|
293
|
-
end
|
|
294
|
-
if total == nil or ____end == nil or total <= 0 then
|
|
295
|
-
return true, nil
|
|
296
|
-
end
|
|
297
|
-
if C_DurationUtil == nil then
|
|
298
|
-
self.status = "unavailable"
|
|
299
|
-
return true, nil
|
|
300
|
-
end
|
|
301
|
-
local timer = C_DurationUtil.CreateDuration()
|
|
302
|
-
timer:SetTimeFromStart(____end - total, total)
|
|
303
|
-
return true, timer
|
|
304
|
-
end)
|
|
305
|
-
if not ____try then
|
|
306
|
-
____hasReturned, ____returnValue = ____catch()
|
|
307
|
-
end
|
|
308
|
-
if ____hasReturned then
|
|
309
|
-
return ____returnValue
|
|
310
|
-
end
|
|
311
|
-
end
|
|
312
|
-
end
|
|
313
|
-
__TS__SetDescriptor(
|
|
314
|
-
AuraTimer.prototype,
|
|
315
|
-
"Status",
|
|
316
|
-
{get = function(self)
|
|
317
|
-
self:ReadAura()
|
|
318
|
-
return self.status
|
|
319
|
-
end},
|
|
320
|
-
true
|
|
321
|
-
)
|
|
322
|
-
return ____exports
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { DataSource } from "./DataSource";
|
|
2
|
-
import { UnitSource } from "./UnitSource";
|
|
3
|
-
import type { UnitInput } from "./UnitSource";
|
|
4
|
-
export type AuraSourceStatus = "known" | "unknown" | "restricted";
|
|
5
|
-
/** Readable aura snapshot. Unit tokens describe the source at snapshot time. */
|
|
6
|
-
export declare class Aura {
|
|
7
|
-
readonly spellId: number;
|
|
8
|
-
readonly name: string;
|
|
9
|
-
readonly icon: number;
|
|
10
|
-
readonly sourceUnit: string | undefined;
|
|
11
|
-
readonly sourceStatus: AuraSourceStatus;
|
|
12
|
-
private readonly sourceSelf;
|
|
13
|
-
constructor(spellId: number, name: string, icon: number, sourceUnit: string | undefined, sourceStatus: AuraSourceStatus, sourceSelf: boolean | undefined);
|
|
14
|
-
/** Undefined means ownership could not be established; it does not mean another caster. */
|
|
15
|
-
isSourceSelf(): boolean | undefined;
|
|
16
|
-
}
|
|
17
|
-
/** Reads a fresh snapshot on access; it does not install listeners or poll. */
|
|
18
|
-
export declare abstract class AuraSource extends DataSource<readonly Aura[]> {
|
|
19
|
-
private readonly filter;
|
|
20
|
-
private restricted;
|
|
21
|
-
readonly target: UnitSource;
|
|
22
|
-
protected constructor(unit: UnitInput, filter: "HELPFUL" | "HARMFUL");
|
|
23
|
-
get unit(): string;
|
|
24
|
-
protected HasSecretFields(): boolean;
|
|
25
|
-
protected GetValue(): readonly Aura[];
|
|
26
|
-
}
|
|
27
|
-
export declare class Buffs extends AuraSource {
|
|
28
|
-
constructor(unit: UnitInput);
|
|
29
|
-
}
|
|
30
|
-
export declare class Debuffs extends AuraSource {
|
|
31
|
-
constructor(unit: UnitInput);
|
|
32
|
-
}
|
|
@@ -1,284 +0,0 @@
|
|
|
1
|
-
--[[ Generated with https://github.com/TypeScriptToLua/TypeScriptToLua ]]
|
|
2
|
-
-- Lua Library inline imports
|
|
3
|
-
local function __TS__Class(self)
|
|
4
|
-
local c = {prototype = {}}
|
|
5
|
-
c.prototype.__index = c.prototype
|
|
6
|
-
c.prototype.constructor = c
|
|
7
|
-
return c
|
|
8
|
-
end
|
|
9
|
-
|
|
10
|
-
local function __TS__ClassExtends(target, base)
|
|
11
|
-
target.____super = base
|
|
12
|
-
local staticMetatable = setmetatable({__index = base}, base)
|
|
13
|
-
setmetatable(target, staticMetatable)
|
|
14
|
-
local baseMetatable = getmetatable(base)
|
|
15
|
-
if baseMetatable then
|
|
16
|
-
if type(baseMetatable.__index) == "function" then
|
|
17
|
-
staticMetatable.__index = baseMetatable.__index
|
|
18
|
-
end
|
|
19
|
-
if type(baseMetatable.__newindex) == "function" then
|
|
20
|
-
staticMetatable.__newindex = baseMetatable.__newindex
|
|
21
|
-
end
|
|
22
|
-
end
|
|
23
|
-
setmetatable(target.prototype, base.prototype)
|
|
24
|
-
if type(base.prototype.__index) == "function" then
|
|
25
|
-
target.prototype.__index = base.prototype.__index
|
|
26
|
-
end
|
|
27
|
-
if type(base.prototype.__newindex) == "function" then
|
|
28
|
-
target.prototype.__newindex = base.prototype.__newindex
|
|
29
|
-
end
|
|
30
|
-
if type(base.prototype.__tostring) == "function" then
|
|
31
|
-
target.prototype.__tostring = base.prototype.__tostring
|
|
32
|
-
end
|
|
33
|
-
end
|
|
34
|
-
|
|
35
|
-
local function __TS__New(target, ...)
|
|
36
|
-
local instance = setmetatable({}, target.prototype)
|
|
37
|
-
instance:____constructor(...)
|
|
38
|
-
return instance
|
|
39
|
-
end
|
|
40
|
-
|
|
41
|
-
local function __TS__CloneDescriptor(____bindingPattern0)
|
|
42
|
-
local value
|
|
43
|
-
local writable
|
|
44
|
-
local set
|
|
45
|
-
local get
|
|
46
|
-
local configurable
|
|
47
|
-
local enumerable
|
|
48
|
-
enumerable = ____bindingPattern0.enumerable
|
|
49
|
-
configurable = ____bindingPattern0.configurable
|
|
50
|
-
get = ____bindingPattern0.get
|
|
51
|
-
set = ____bindingPattern0.set
|
|
52
|
-
writable = ____bindingPattern0.writable
|
|
53
|
-
value = ____bindingPattern0.value
|
|
54
|
-
local descriptor = {enumerable = enumerable == true, configurable = configurable == true}
|
|
55
|
-
local hasGetterOrSetter = get ~= nil or set ~= nil
|
|
56
|
-
local hasValueOrWritableAttribute = writable ~= nil or value ~= nil
|
|
57
|
-
if hasGetterOrSetter and hasValueOrWritableAttribute then
|
|
58
|
-
error("Invalid property descriptor. Cannot both specify accessors and a value or writable attribute.", 0)
|
|
59
|
-
end
|
|
60
|
-
if get or set then
|
|
61
|
-
descriptor.get = get
|
|
62
|
-
descriptor.set = set
|
|
63
|
-
else
|
|
64
|
-
descriptor.value = value
|
|
65
|
-
descriptor.writable = writable == true
|
|
66
|
-
end
|
|
67
|
-
return descriptor
|
|
68
|
-
end
|
|
69
|
-
|
|
70
|
-
local __TS__DescriptorGet
|
|
71
|
-
do
|
|
72
|
-
local getmetatable = _G.getmetatable
|
|
73
|
-
local ____rawget = _G.rawget
|
|
74
|
-
function __TS__DescriptorGet(self, metatable, key)
|
|
75
|
-
while metatable do
|
|
76
|
-
local rawResult = ____rawget(metatable, key)
|
|
77
|
-
if rawResult ~= nil then
|
|
78
|
-
return rawResult
|
|
79
|
-
end
|
|
80
|
-
local descriptors = ____rawget(metatable, "_descriptors")
|
|
81
|
-
if descriptors then
|
|
82
|
-
local descriptor = descriptors[key]
|
|
83
|
-
if descriptor ~= nil then
|
|
84
|
-
if descriptor.get then
|
|
85
|
-
return descriptor.get(self)
|
|
86
|
-
end
|
|
87
|
-
return descriptor.value
|
|
88
|
-
end
|
|
89
|
-
end
|
|
90
|
-
metatable = getmetatable(metatable)
|
|
91
|
-
end
|
|
92
|
-
end
|
|
93
|
-
end
|
|
94
|
-
|
|
95
|
-
local __TS__DescriptorSet
|
|
96
|
-
do
|
|
97
|
-
local getmetatable = _G.getmetatable
|
|
98
|
-
local ____rawget = _G.rawget
|
|
99
|
-
local rawset = _G.rawset
|
|
100
|
-
function __TS__DescriptorSet(self, metatable, key, value)
|
|
101
|
-
while metatable do
|
|
102
|
-
local descriptors = ____rawget(metatable, "_descriptors")
|
|
103
|
-
if descriptors then
|
|
104
|
-
local descriptor = descriptors[key]
|
|
105
|
-
if descriptor ~= nil then
|
|
106
|
-
if descriptor.set then
|
|
107
|
-
descriptor.set(self, value)
|
|
108
|
-
else
|
|
109
|
-
if descriptor.writable == false then
|
|
110
|
-
error(
|
|
111
|
-
((("Cannot assign to read only property '" .. key) .. "' of object '") .. tostring(self)) .. "'",
|
|
112
|
-
0
|
|
113
|
-
)
|
|
114
|
-
end
|
|
115
|
-
descriptor.value = value
|
|
116
|
-
end
|
|
117
|
-
return
|
|
118
|
-
end
|
|
119
|
-
end
|
|
120
|
-
metatable = getmetatable(metatable)
|
|
121
|
-
end
|
|
122
|
-
rawset(self, key, value)
|
|
123
|
-
end
|
|
124
|
-
end
|
|
125
|
-
|
|
126
|
-
local __TS__SetDescriptor
|
|
127
|
-
do
|
|
128
|
-
local getmetatable = _G.getmetatable
|
|
129
|
-
local function descriptorIndex(self, key)
|
|
130
|
-
return __TS__DescriptorGet(
|
|
131
|
-
self,
|
|
132
|
-
getmetatable(self),
|
|
133
|
-
key
|
|
134
|
-
)
|
|
135
|
-
end
|
|
136
|
-
local function descriptorNewIndex(self, key, value)
|
|
137
|
-
return __TS__DescriptorSet(
|
|
138
|
-
self,
|
|
139
|
-
getmetatable(self),
|
|
140
|
-
key,
|
|
141
|
-
value
|
|
142
|
-
)
|
|
143
|
-
end
|
|
144
|
-
function __TS__SetDescriptor(target, key, desc, isPrototype)
|
|
145
|
-
if isPrototype == nil then
|
|
146
|
-
isPrototype = false
|
|
147
|
-
end
|
|
148
|
-
local ____isPrototype_0
|
|
149
|
-
if isPrototype then
|
|
150
|
-
____isPrototype_0 = target
|
|
151
|
-
else
|
|
152
|
-
____isPrototype_0 = getmetatable(target)
|
|
153
|
-
end
|
|
154
|
-
local metatable = ____isPrototype_0
|
|
155
|
-
if not metatable then
|
|
156
|
-
metatable = {}
|
|
157
|
-
setmetatable(target, metatable)
|
|
158
|
-
end
|
|
159
|
-
if not isPrototype and not rawget(metatable, "_isOwnDescriptorMetatable") then
|
|
160
|
-
local instanceMetatable = {}
|
|
161
|
-
instanceMetatable._isOwnDescriptorMetatable = true
|
|
162
|
-
setmetatable(instanceMetatable, metatable)
|
|
163
|
-
setmetatable(target, instanceMetatable)
|
|
164
|
-
metatable = instanceMetatable
|
|
165
|
-
end
|
|
166
|
-
local value = rawget(target, key)
|
|
167
|
-
if value ~= nil then
|
|
168
|
-
rawset(target, key, nil)
|
|
169
|
-
end
|
|
170
|
-
if not rawget(metatable, "_descriptors") then
|
|
171
|
-
metatable._descriptors = {}
|
|
172
|
-
end
|
|
173
|
-
metatable._descriptors[key] = __TS__CloneDescriptor(desc)
|
|
174
|
-
metatable.__index = descriptorIndex
|
|
175
|
-
metatable.__newindex = descriptorNewIndex
|
|
176
|
-
end
|
|
177
|
-
end
|
|
178
|
-
-- End of Lua Library inline imports
|
|
179
|
-
local ____exports = {}
|
|
180
|
-
local ____DataSource = require("datasources.DataSource")
|
|
181
|
-
local DataSource = ____DataSource.DataSource
|
|
182
|
-
local ____UnitSource = require("datasources.UnitSource")
|
|
183
|
-
local resolveUnit = ____UnitSource.resolveUnit
|
|
184
|
-
--- Readable aura snapshot. Unit tokens describe the source at snapshot time.
|
|
185
|
-
____exports.Aura = __TS__Class()
|
|
186
|
-
local Aura = ____exports.Aura
|
|
187
|
-
Aura.name = "Aura"
|
|
188
|
-
function Aura.prototype.____constructor(self, spellId, name, icon, sourceUnit, sourceStatus, sourceSelf)
|
|
189
|
-
self.spellId = spellId
|
|
190
|
-
self.name = name
|
|
191
|
-
self.icon = icon
|
|
192
|
-
self.sourceUnit = sourceUnit
|
|
193
|
-
self.sourceStatus = sourceStatus
|
|
194
|
-
self.sourceSelf = sourceSelf
|
|
195
|
-
end
|
|
196
|
-
function Aura.prototype.isSourceSelf(self)
|
|
197
|
-
return self.sourceSelf
|
|
198
|
-
end
|
|
199
|
-
--- Reads a fresh snapshot on access; it does not install listeners or poll.
|
|
200
|
-
____exports.AuraSource = __TS__Class()
|
|
201
|
-
local AuraSource = ____exports.AuraSource
|
|
202
|
-
AuraSource.name = "AuraSource"
|
|
203
|
-
__TS__ClassExtends(AuraSource, DataSource)
|
|
204
|
-
function AuraSource.prototype.____constructor(self, unit, filter)
|
|
205
|
-
DataSource.prototype.____constructor(self, {})
|
|
206
|
-
self.filter = filter
|
|
207
|
-
self.restricted = false
|
|
208
|
-
self.target = resolveUnit(nil, unit)
|
|
209
|
-
end
|
|
210
|
-
function AuraSource.prototype.HasSecretFields(self)
|
|
211
|
-
return self.restricted
|
|
212
|
-
end
|
|
213
|
-
function AuraSource.prototype.GetValue(self)
|
|
214
|
-
self.restricted = false
|
|
215
|
-
local read = C_UnitAuras and C_UnitAuras.GetAuraDataByIndex
|
|
216
|
-
if read == nil then
|
|
217
|
-
error("AuraSource: this client does not expose C_UnitAuras.GetAuraDataByIndex")
|
|
218
|
-
end
|
|
219
|
-
local result = {}
|
|
220
|
-
do
|
|
221
|
-
local index = 1
|
|
222
|
-
while index <= 1024 do
|
|
223
|
-
local raw = read(self.unit, index, self.filter)
|
|
224
|
-
if issecretvalue(raw) then
|
|
225
|
-
self.restricted = true
|
|
226
|
-
return {}
|
|
227
|
-
end
|
|
228
|
-
if raw == nil then
|
|
229
|
-
return result
|
|
230
|
-
end
|
|
231
|
-
if issecretvalue(raw.spellId) or issecretvalue(raw.name) or issecretvalue(raw.icon) then
|
|
232
|
-
self.restricted = true
|
|
233
|
-
return {}
|
|
234
|
-
end
|
|
235
|
-
local sourceUnit
|
|
236
|
-
local sourceSelf
|
|
237
|
-
local status = "unknown"
|
|
238
|
-
if issecretvalue(raw.sourceUnit) then
|
|
239
|
-
status = "restricted"
|
|
240
|
-
elseif raw.sourceUnit ~= nil then
|
|
241
|
-
sourceUnit = raw.sourceUnit
|
|
242
|
-
status = "known"
|
|
243
|
-
local ____self = UnitIsUnit(sourceUnit, "player")
|
|
244
|
-
if not issecretvalue(____self) then
|
|
245
|
-
sourceSelf = ____self
|
|
246
|
-
end
|
|
247
|
-
end
|
|
248
|
-
result[#result + 1] = __TS__New(
|
|
249
|
-
____exports.Aura,
|
|
250
|
-
raw.spellId,
|
|
251
|
-
raw.name,
|
|
252
|
-
raw.icon,
|
|
253
|
-
sourceUnit,
|
|
254
|
-
status,
|
|
255
|
-
sourceSelf
|
|
256
|
-
)
|
|
257
|
-
index = index + 1
|
|
258
|
-
end
|
|
259
|
-
end
|
|
260
|
-
error("AuraSource: aura enumeration exceeded its safety limit")
|
|
261
|
-
end
|
|
262
|
-
__TS__SetDescriptor(
|
|
263
|
-
AuraSource.prototype,
|
|
264
|
-
"unit",
|
|
265
|
-
{get = function(self)
|
|
266
|
-
return self.target.Token
|
|
267
|
-
end},
|
|
268
|
-
true
|
|
269
|
-
)
|
|
270
|
-
____exports.Buffs = __TS__Class()
|
|
271
|
-
local Buffs = ____exports.Buffs
|
|
272
|
-
Buffs.name = "Buffs"
|
|
273
|
-
__TS__ClassExtends(Buffs, ____exports.AuraSource)
|
|
274
|
-
function Buffs.prototype.____constructor(self, unit)
|
|
275
|
-
Buffs.____super.prototype.____constructor(self, unit, "HELPFUL")
|
|
276
|
-
end
|
|
277
|
-
____exports.Debuffs = __TS__Class()
|
|
278
|
-
local Debuffs = ____exports.Debuffs
|
|
279
|
-
Debuffs.name = "Debuffs"
|
|
280
|
-
__TS__ClassExtends(Debuffs, ____exports.AuraSource)
|
|
281
|
-
function Debuffs.prototype.____constructor(self, unit)
|
|
282
|
-
Debuffs.____super.prototype.____constructor(self, unit, "HARMFUL")
|
|
283
|
-
end
|
|
284
|
-
return ____exports
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { TimerSource } from "./TimerSource";
|
|
2
|
-
import { UnitSource } from "./UnitSource";
|
|
3
|
-
import type { UnitInput } from "./UnitSource";
|
|
4
|
-
/** Remaining cast/channel time using the native duration object. */
|
|
5
|
-
export declare class CastTimer extends TimerSource {
|
|
6
|
-
readonly target: UnitSource;
|
|
7
|
-
get SpellName(): string;
|
|
8
|
-
constructor(unit?: UnitInput);
|
|
9
|
-
}
|