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,240 +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 __TS__Unpack = table.unpack or unpack
|
|
36
|
-
|
|
37
|
-
local function __TS__CloneDescriptor(____bindingPattern0)
|
|
38
|
-
local value
|
|
39
|
-
local writable
|
|
40
|
-
local set
|
|
41
|
-
local get
|
|
42
|
-
local configurable
|
|
43
|
-
local enumerable
|
|
44
|
-
enumerable = ____bindingPattern0.enumerable
|
|
45
|
-
configurable = ____bindingPattern0.configurable
|
|
46
|
-
get = ____bindingPattern0.get
|
|
47
|
-
set = ____bindingPattern0.set
|
|
48
|
-
writable = ____bindingPattern0.writable
|
|
49
|
-
value = ____bindingPattern0.value
|
|
50
|
-
local descriptor = {enumerable = enumerable == true, configurable = configurable == true}
|
|
51
|
-
local hasGetterOrSetter = get ~= nil or set ~= nil
|
|
52
|
-
local hasValueOrWritableAttribute = writable ~= nil or value ~= nil
|
|
53
|
-
if hasGetterOrSetter and hasValueOrWritableAttribute then
|
|
54
|
-
error("Invalid property descriptor. Cannot both specify accessors and a value or writable attribute.", 0)
|
|
55
|
-
end
|
|
56
|
-
if get or set then
|
|
57
|
-
descriptor.get = get
|
|
58
|
-
descriptor.set = set
|
|
59
|
-
else
|
|
60
|
-
descriptor.value = value
|
|
61
|
-
descriptor.writable = writable == true
|
|
62
|
-
end
|
|
63
|
-
return descriptor
|
|
64
|
-
end
|
|
65
|
-
|
|
66
|
-
local __TS__DescriptorGet
|
|
67
|
-
do
|
|
68
|
-
local getmetatable = _G.getmetatable
|
|
69
|
-
local ____rawget = _G.rawget
|
|
70
|
-
function __TS__DescriptorGet(self, metatable, key)
|
|
71
|
-
while metatable do
|
|
72
|
-
local rawResult = ____rawget(metatable, key)
|
|
73
|
-
if rawResult ~= nil then
|
|
74
|
-
return rawResult
|
|
75
|
-
end
|
|
76
|
-
local descriptors = ____rawget(metatable, "_descriptors")
|
|
77
|
-
if descriptors then
|
|
78
|
-
local descriptor = descriptors[key]
|
|
79
|
-
if descriptor ~= nil then
|
|
80
|
-
if descriptor.get then
|
|
81
|
-
return descriptor.get(self)
|
|
82
|
-
end
|
|
83
|
-
return descriptor.value
|
|
84
|
-
end
|
|
85
|
-
end
|
|
86
|
-
metatable = getmetatable(metatable)
|
|
87
|
-
end
|
|
88
|
-
end
|
|
89
|
-
end
|
|
90
|
-
|
|
91
|
-
local __TS__DescriptorSet
|
|
92
|
-
do
|
|
93
|
-
local getmetatable = _G.getmetatable
|
|
94
|
-
local ____rawget = _G.rawget
|
|
95
|
-
local rawset = _G.rawset
|
|
96
|
-
function __TS__DescriptorSet(self, metatable, key, value)
|
|
97
|
-
while metatable do
|
|
98
|
-
local descriptors = ____rawget(metatable, "_descriptors")
|
|
99
|
-
if descriptors then
|
|
100
|
-
local descriptor = descriptors[key]
|
|
101
|
-
if descriptor ~= nil then
|
|
102
|
-
if descriptor.set then
|
|
103
|
-
descriptor.set(self, value)
|
|
104
|
-
else
|
|
105
|
-
if descriptor.writable == false then
|
|
106
|
-
error(
|
|
107
|
-
((("Cannot assign to read only property '" .. key) .. "' of object '") .. tostring(self)) .. "'",
|
|
108
|
-
0
|
|
109
|
-
)
|
|
110
|
-
end
|
|
111
|
-
descriptor.value = value
|
|
112
|
-
end
|
|
113
|
-
return
|
|
114
|
-
end
|
|
115
|
-
end
|
|
116
|
-
metatable = getmetatable(metatable)
|
|
117
|
-
end
|
|
118
|
-
rawset(self, key, value)
|
|
119
|
-
end
|
|
120
|
-
end
|
|
121
|
-
|
|
122
|
-
local __TS__SetDescriptor
|
|
123
|
-
do
|
|
124
|
-
local getmetatable = _G.getmetatable
|
|
125
|
-
local function descriptorIndex(self, key)
|
|
126
|
-
return __TS__DescriptorGet(
|
|
127
|
-
self,
|
|
128
|
-
getmetatable(self),
|
|
129
|
-
key
|
|
130
|
-
)
|
|
131
|
-
end
|
|
132
|
-
local function descriptorNewIndex(self, key, value)
|
|
133
|
-
return __TS__DescriptorSet(
|
|
134
|
-
self,
|
|
135
|
-
getmetatable(self),
|
|
136
|
-
key,
|
|
137
|
-
value
|
|
138
|
-
)
|
|
139
|
-
end
|
|
140
|
-
function __TS__SetDescriptor(target, key, desc, isPrototype)
|
|
141
|
-
if isPrototype == nil then
|
|
142
|
-
isPrototype = false
|
|
143
|
-
end
|
|
144
|
-
local ____isPrototype_0
|
|
145
|
-
if isPrototype then
|
|
146
|
-
____isPrototype_0 = target
|
|
147
|
-
else
|
|
148
|
-
____isPrototype_0 = getmetatable(target)
|
|
149
|
-
end
|
|
150
|
-
local metatable = ____isPrototype_0
|
|
151
|
-
if not metatable then
|
|
152
|
-
metatable = {}
|
|
153
|
-
setmetatable(target, metatable)
|
|
154
|
-
end
|
|
155
|
-
if not isPrototype and not rawget(metatable, "_isOwnDescriptorMetatable") then
|
|
156
|
-
local instanceMetatable = {}
|
|
157
|
-
instanceMetatable._isOwnDescriptorMetatable = true
|
|
158
|
-
setmetatable(instanceMetatable, metatable)
|
|
159
|
-
setmetatable(target, instanceMetatable)
|
|
160
|
-
metatable = instanceMetatable
|
|
161
|
-
end
|
|
162
|
-
local value = rawget(target, key)
|
|
163
|
-
if value ~= nil then
|
|
164
|
-
rawset(target, key, nil)
|
|
165
|
-
end
|
|
166
|
-
if not rawget(metatable, "_descriptors") then
|
|
167
|
-
metatable._descriptors = {}
|
|
168
|
-
end
|
|
169
|
-
metatable._descriptors[key] = __TS__CloneDescriptor(desc)
|
|
170
|
-
metatable.__index = descriptorIndex
|
|
171
|
-
metatable.__newindex = descriptorNewIndex
|
|
172
|
-
end
|
|
173
|
-
end
|
|
174
|
-
-- End of Lua Library inline imports
|
|
175
|
-
local ____exports = {}
|
|
176
|
-
local ____TimerSource = require("datasources.TimerSource")
|
|
177
|
-
local TimerSource = ____TimerSource.TimerSource
|
|
178
|
-
local ____UnitSource = require("datasources.UnitSource")
|
|
179
|
-
local Unit = ____UnitSource.Unit
|
|
180
|
-
local resolveUnit = ____UnitSource.resolveUnit
|
|
181
|
-
--- Remaining cast/channel time using the native duration object.
|
|
182
|
-
____exports.CastTimer = __TS__Class()
|
|
183
|
-
local CastTimer = ____exports.CastTimer
|
|
184
|
-
CastTimer.name = "CastTimer"
|
|
185
|
-
__TS__ClassExtends(CastTimer, TimerSource)
|
|
186
|
-
function CastTimer.prototype.____constructor(self, unit)
|
|
187
|
-
if unit == nil then
|
|
188
|
-
unit = Unit.Player
|
|
189
|
-
end
|
|
190
|
-
local target = resolveUnit(nil, unit)
|
|
191
|
-
if UnitCastingDuration == nil or UnitChannelDuration == nil then
|
|
192
|
-
error("CastTimer: native cast/channel durations are unavailable")
|
|
193
|
-
end
|
|
194
|
-
TimerSource.prototype.____constructor(
|
|
195
|
-
self,
|
|
196
|
-
function()
|
|
197
|
-
local casting = UnitCastingDuration(target.Token)
|
|
198
|
-
if issecretvalue(casting) or casting ~= nil then
|
|
199
|
-
return casting
|
|
200
|
-
end
|
|
201
|
-
return UnitChannelDuration(target.Token)
|
|
202
|
-
end,
|
|
203
|
-
{
|
|
204
|
-
"UNIT_SPELLCAST_START",
|
|
205
|
-
"UNIT_SPELLCAST_STOP",
|
|
206
|
-
"UNIT_SPELLCAST_DELAYED",
|
|
207
|
-
"UNIT_SPELLCAST_INTERRUPTED",
|
|
208
|
-
"UNIT_SPELLCAST_FAILED",
|
|
209
|
-
"UNIT_SPELLCAST_SUCCEEDED",
|
|
210
|
-
"UNIT_SPELLCAST_CHANNEL_START",
|
|
211
|
-
"UNIT_SPELLCAST_CHANNEL_UPDATE",
|
|
212
|
-
"UNIT_SPELLCAST_CHANNEL_STOP",
|
|
213
|
-
"PLAYER_ENTERING_WORLD",
|
|
214
|
-
"PLAYER_TARGET_CHANGED",
|
|
215
|
-
"PLAYER_FOCUS_CHANGED"
|
|
216
|
-
},
|
|
217
|
-
target.Token
|
|
218
|
-
)
|
|
219
|
-
self.target = target
|
|
220
|
-
end
|
|
221
|
-
__TS__SetDescriptor(
|
|
222
|
-
CastTimer.prototype,
|
|
223
|
-
"SpellName",
|
|
224
|
-
{get = function(self)
|
|
225
|
-
local casting = __TS__Unpack(UnitCastingInfo ~= nil and ({UnitCastingInfo(self.target.Token)}) or ({nil}))
|
|
226
|
-
if issecretvalue(casting) then
|
|
227
|
-
return casting
|
|
228
|
-
end
|
|
229
|
-
if casting ~= nil then
|
|
230
|
-
return casting
|
|
231
|
-
end
|
|
232
|
-
local channel = __TS__Unpack(UnitChannelInfo ~= nil and ({UnitChannelInfo(self.target.Token)}) or ({nil}))
|
|
233
|
-
if issecretvalue(channel) then
|
|
234
|
-
return channel
|
|
235
|
-
end
|
|
236
|
-
return channel or ""
|
|
237
|
-
end},
|
|
238
|
-
true
|
|
239
|
-
)
|
|
240
|
-
return ____exports
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { DataSource } from "./DataSource";
|
|
2
|
-
export type EditModeLayoutsStatus = "ready" | "unavailable" | "restricted";
|
|
3
|
-
export interface EditModeLayout {
|
|
4
|
-
/** Native one-based index. Deleting another layout can change this number. */
|
|
5
|
-
readonly index: number;
|
|
6
|
-
readonly name: string;
|
|
7
|
-
readonly type: number;
|
|
8
|
-
readonly interfaceStyle?: number;
|
|
9
|
-
/** Derived from native type, interface style and name; changes on rename. */
|
|
10
|
-
readonly key: string;
|
|
11
|
-
}
|
|
12
|
-
export interface EditModeLayoutSnapshot {
|
|
13
|
-
readonly layouts: readonly EditModeLayout[];
|
|
14
|
-
readonly active?: EditModeLayout;
|
|
15
|
-
}
|
|
16
|
-
/** Read-only native Edit Mode layouts, refreshed by events without polling. */
|
|
17
|
-
export declare class EditModeLayouts extends DataSource<EditModeLayoutSnapshot> {
|
|
18
|
-
private snapshot;
|
|
19
|
-
private status;
|
|
20
|
-
private readonly listeners;
|
|
21
|
-
private readonly frame;
|
|
22
|
-
private disposed;
|
|
23
|
-
constructor();
|
|
24
|
-
get Status(): EditModeLayoutsStatus;
|
|
25
|
-
get Layouts(): readonly EditModeLayout[];
|
|
26
|
-
get Active(): EditModeLayout | undefined;
|
|
27
|
-
protected HasSecretFields(): boolean;
|
|
28
|
-
protected GetValue(): EditModeLayoutSnapshot;
|
|
29
|
-
/** No initial emission. Availability changes also notify observers. */
|
|
30
|
-
onChange(listener: (value: EditModeLayoutSnapshot) => void): () => void;
|
|
31
|
-
private Refresh;
|
|
32
|
-
Dispose(): void;
|
|
33
|
-
}
|