wuira 0.1.3 → 0.1.5
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 +50 -0
- package/README.md +181 -0
- package/lib/Spells.d.ts +10 -0
- package/lib/Spells.lua +19 -0
- package/lib/datasources/AuraTimer.d.ts +21 -0
- package/lib/datasources/AuraTimer.lua +322 -0
- package/lib/datasources/CastTimer.d.ts +9 -0
- package/lib/datasources/CastTimer.lua +240 -0
- package/lib/datasources/DataSource.d.ts +4 -0
- package/lib/datasources/DataSource.lua +24 -0
- package/lib/datasources/ProgressSource.d.ts +6 -2
- package/lib/datasources/ProgressSource.lua +20 -2
- package/lib/datasources/Resources.d.ts +21 -2
- package/lib/datasources/Resources.lua +473 -0
- package/lib/datasources/SpellCooldown.d.ts +10 -0
- package/lib/datasources/SpellCooldown.lua +207 -0
- package/lib/datasources/SwingTimer.d.ts +31 -0
- package/lib/datasources/SwingTimer.lua +641 -0
- package/lib/datasources/TextureSource.d.ts +10 -0
- package/lib/datasources/TextureSource.lua +83 -0
- package/lib/datasources/TimerSource.d.ts +18 -0
- package/lib/datasources/TimerSource.lua +284 -0
- package/lib/datasources/index.d.ts +9 -1
- package/lib/datasources/index.lua +27 -0
- package/lib/index.d.ts +5 -0
- package/lib/index.lua +13 -0
- package/lib/platform/BlizzardUI.d.ts +12 -0
- package/lib/platform/BlizzardUI.lua +352 -0
- package/lib/platform/forever.d.ts +40 -2
- package/lib/store/index.d.ts +37 -0
- package/lib/store/index.lua +921 -0
- package/lib/ui/Cell.d.ts +3 -1
- package/lib/ui/Icon.d.ts +8 -0
- package/lib/ui/Icon.lua +8 -0
- package/lib/ui/Label.d.ts +10 -0
- package/lib/ui/Label.lua +8 -0
- package/lib/ui/ProgressBar.d.ts +5 -1
- package/lib/ui/index.d.ts +4 -0
- package/lib/ui/index.lua +8 -0
- package/lib/ui/layout/measureLayout.lua +8 -1
- package/lib/ui/mount.lua +267 -45
- package/lib/ui/primitives/jsx.d.ts +7 -2
- package/package.json +8 -1
- package/tools/build-library.mjs +1 -1
|
@@ -0,0 +1,207 @@
|
|
|
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__CloneDescriptor(____bindingPattern0)
|
|
36
|
+
local value
|
|
37
|
+
local writable
|
|
38
|
+
local set
|
|
39
|
+
local get
|
|
40
|
+
local configurable
|
|
41
|
+
local enumerable
|
|
42
|
+
enumerable = ____bindingPattern0.enumerable
|
|
43
|
+
configurable = ____bindingPattern0.configurable
|
|
44
|
+
get = ____bindingPattern0.get
|
|
45
|
+
set = ____bindingPattern0.set
|
|
46
|
+
writable = ____bindingPattern0.writable
|
|
47
|
+
value = ____bindingPattern0.value
|
|
48
|
+
local descriptor = {enumerable = enumerable == true, configurable = configurable == true}
|
|
49
|
+
local hasGetterOrSetter = get ~= nil or set ~= nil
|
|
50
|
+
local hasValueOrWritableAttribute = writable ~= nil or value ~= nil
|
|
51
|
+
if hasGetterOrSetter and hasValueOrWritableAttribute then
|
|
52
|
+
error("Invalid property descriptor. Cannot both specify accessors and a value or writable attribute.", 0)
|
|
53
|
+
end
|
|
54
|
+
if get or set then
|
|
55
|
+
descriptor.get = get
|
|
56
|
+
descriptor.set = set
|
|
57
|
+
else
|
|
58
|
+
descriptor.value = value
|
|
59
|
+
descriptor.writable = writable == true
|
|
60
|
+
end
|
|
61
|
+
return descriptor
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
local __TS__DescriptorGet
|
|
65
|
+
do
|
|
66
|
+
local getmetatable = _G.getmetatable
|
|
67
|
+
local ____rawget = _G.rawget
|
|
68
|
+
function __TS__DescriptorGet(self, metatable, key)
|
|
69
|
+
while metatable do
|
|
70
|
+
local rawResult = ____rawget(metatable, key)
|
|
71
|
+
if rawResult ~= nil then
|
|
72
|
+
return rawResult
|
|
73
|
+
end
|
|
74
|
+
local descriptors = ____rawget(metatable, "_descriptors")
|
|
75
|
+
if descriptors then
|
|
76
|
+
local descriptor = descriptors[key]
|
|
77
|
+
if descriptor ~= nil then
|
|
78
|
+
if descriptor.get then
|
|
79
|
+
return descriptor.get(self)
|
|
80
|
+
end
|
|
81
|
+
return descriptor.value
|
|
82
|
+
end
|
|
83
|
+
end
|
|
84
|
+
metatable = getmetatable(metatable)
|
|
85
|
+
end
|
|
86
|
+
end
|
|
87
|
+
end
|
|
88
|
+
|
|
89
|
+
local __TS__DescriptorSet
|
|
90
|
+
do
|
|
91
|
+
local getmetatable = _G.getmetatable
|
|
92
|
+
local ____rawget = _G.rawget
|
|
93
|
+
local rawset = _G.rawset
|
|
94
|
+
function __TS__DescriptorSet(self, metatable, key, value)
|
|
95
|
+
while metatable do
|
|
96
|
+
local descriptors = ____rawget(metatable, "_descriptors")
|
|
97
|
+
if descriptors then
|
|
98
|
+
local descriptor = descriptors[key]
|
|
99
|
+
if descriptor ~= nil then
|
|
100
|
+
if descriptor.set then
|
|
101
|
+
descriptor.set(self, value)
|
|
102
|
+
else
|
|
103
|
+
if descriptor.writable == false then
|
|
104
|
+
error(
|
|
105
|
+
((("Cannot assign to read only property '" .. key) .. "' of object '") .. tostring(self)) .. "'",
|
|
106
|
+
0
|
|
107
|
+
)
|
|
108
|
+
end
|
|
109
|
+
descriptor.value = value
|
|
110
|
+
end
|
|
111
|
+
return
|
|
112
|
+
end
|
|
113
|
+
end
|
|
114
|
+
metatable = getmetatable(metatable)
|
|
115
|
+
end
|
|
116
|
+
rawset(self, key, value)
|
|
117
|
+
end
|
|
118
|
+
end
|
|
119
|
+
|
|
120
|
+
local __TS__SetDescriptor
|
|
121
|
+
do
|
|
122
|
+
local getmetatable = _G.getmetatable
|
|
123
|
+
local function descriptorIndex(self, key)
|
|
124
|
+
return __TS__DescriptorGet(
|
|
125
|
+
self,
|
|
126
|
+
getmetatable(self),
|
|
127
|
+
key
|
|
128
|
+
)
|
|
129
|
+
end
|
|
130
|
+
local function descriptorNewIndex(self, key, value)
|
|
131
|
+
return __TS__DescriptorSet(
|
|
132
|
+
self,
|
|
133
|
+
getmetatable(self),
|
|
134
|
+
key,
|
|
135
|
+
value
|
|
136
|
+
)
|
|
137
|
+
end
|
|
138
|
+
function __TS__SetDescriptor(target, key, desc, isPrototype)
|
|
139
|
+
if isPrototype == nil then
|
|
140
|
+
isPrototype = false
|
|
141
|
+
end
|
|
142
|
+
local ____isPrototype_0
|
|
143
|
+
if isPrototype then
|
|
144
|
+
____isPrototype_0 = target
|
|
145
|
+
else
|
|
146
|
+
____isPrototype_0 = getmetatable(target)
|
|
147
|
+
end
|
|
148
|
+
local metatable = ____isPrototype_0
|
|
149
|
+
if not metatable then
|
|
150
|
+
metatable = {}
|
|
151
|
+
setmetatable(target, metatable)
|
|
152
|
+
end
|
|
153
|
+
if not isPrototype and not rawget(metatable, "_isOwnDescriptorMetatable") then
|
|
154
|
+
local instanceMetatable = {}
|
|
155
|
+
instanceMetatable._isOwnDescriptorMetatable = true
|
|
156
|
+
setmetatable(instanceMetatable, metatable)
|
|
157
|
+
setmetatable(target, instanceMetatable)
|
|
158
|
+
metatable = instanceMetatable
|
|
159
|
+
end
|
|
160
|
+
local value = rawget(target, key)
|
|
161
|
+
if value ~= nil then
|
|
162
|
+
rawset(target, key, nil)
|
|
163
|
+
end
|
|
164
|
+
if not rawget(metatable, "_descriptors") then
|
|
165
|
+
metatable._descriptors = {}
|
|
166
|
+
end
|
|
167
|
+
metatable._descriptors[key] = __TS__CloneDescriptor(desc)
|
|
168
|
+
metatable.__index = descriptorIndex
|
|
169
|
+
metatable.__newindex = descriptorNewIndex
|
|
170
|
+
end
|
|
171
|
+
end
|
|
172
|
+
-- End of Lua Library inline imports
|
|
173
|
+
local ____exports = {}
|
|
174
|
+
local ____TimerSource = require("datasources.TimerSource")
|
|
175
|
+
local TimerSource = ____TimerSource.TimerSource
|
|
176
|
+
--- Native cooldown duration, including opaque timings during combat.
|
|
177
|
+
____exports.SpellCooldown = __TS__Class()
|
|
178
|
+
local SpellCooldown = ____exports.SpellCooldown
|
|
179
|
+
SpellCooldown.name = "SpellCooldown"
|
|
180
|
+
__TS__ClassExtends(SpellCooldown, TimerSource)
|
|
181
|
+
function SpellCooldown.prototype.____constructor(self, spellId)
|
|
182
|
+
TimerSource.prototype.____constructor(
|
|
183
|
+
self,
|
|
184
|
+
function()
|
|
185
|
+
local ____opt_0 = C_Spell and C_Spell.GetSpellCooldownDuration
|
|
186
|
+
return ____opt_0 and ____opt_0(spellId)
|
|
187
|
+
end,
|
|
188
|
+
{"SPELL_UPDATE_COOLDOWN", "PLAYER_ENTERING_WORLD", "SPELLS_CHANGED"}
|
|
189
|
+
)
|
|
190
|
+
self.spellId = spellId
|
|
191
|
+
end
|
|
192
|
+
__TS__SetDescriptor(
|
|
193
|
+
SpellCooldown.prototype,
|
|
194
|
+
"IsAvailable",
|
|
195
|
+
{get = function(self)
|
|
196
|
+
return (C_Spell and C_Spell.GetSpellCooldownDuration) ~= nil
|
|
197
|
+
end},
|
|
198
|
+
true
|
|
199
|
+
)
|
|
200
|
+
____exports.GlobalCooldown = __TS__Class()
|
|
201
|
+
local GlobalCooldown = ____exports.GlobalCooldown
|
|
202
|
+
GlobalCooldown.name = "GlobalCooldown"
|
|
203
|
+
__TS__ClassExtends(GlobalCooldown, ____exports.SpellCooldown)
|
|
204
|
+
function GlobalCooldown.prototype.____constructor(self)
|
|
205
|
+
GlobalCooldown.____super.prototype.____constructor(self, 61304)
|
|
206
|
+
end
|
|
207
|
+
return ____exports
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { ProgressSource } from "./ProgressSource";
|
|
2
|
+
import type { ProgressOverrides } from "./ProgressSource";
|
|
3
|
+
export declare const SwingHand: {
|
|
4
|
+
readonly MainHand: "MainHand";
|
|
5
|
+
readonly OffHand: "OffHand";
|
|
6
|
+
readonly Ranged: "Ranged";
|
|
7
|
+
};
|
|
8
|
+
export type SwingHand = typeof SwingHand[keyof typeof SwingHand];
|
|
9
|
+
/** Player-only countdown driven by Forever's native PLAYER_SWING event. */
|
|
10
|
+
export declare class SwingTimer extends ProgressSource {
|
|
11
|
+
readonly hand: SwingHand;
|
|
12
|
+
private duration;
|
|
13
|
+
private endTime;
|
|
14
|
+
private known;
|
|
15
|
+
private restricted;
|
|
16
|
+
private events?;
|
|
17
|
+
private readonly bindings;
|
|
18
|
+
constructor(hand?: SwingHand);
|
|
19
|
+
/** False until a readable swing event is received, including after reload/reset. */
|
|
20
|
+
get HasTiming(): boolean;
|
|
21
|
+
get IsActive(): boolean;
|
|
22
|
+
protected HasSecretFields(): boolean;
|
|
23
|
+
private Remaining;
|
|
24
|
+
Start(): void;
|
|
25
|
+
private Reset;
|
|
26
|
+
private Notify;
|
|
27
|
+
BindTo(frame: wuiraNativeStatusBar, options?: ProgressOverrides): () => void;
|
|
28
|
+
protected Listen(): void;
|
|
29
|
+
/** Dispose when the owning feature is removed; unmount only detaches its bars. */
|
|
30
|
+
Dispose(): void;
|
|
31
|
+
}
|