wuira 0.3.2 → 0.3.3
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 +16 -0
- package/README.md +20 -5
- package/docs/source-converters.md +5 -5
- package/lib/datasources/AuraTimer.d.ts +1 -1
- package/lib/datasources/AuraTimer.lua +14 -2
- package/lib/datasources/Auras.d.ts +2 -2
- package/lib/datasources/Auras.lua +18 -2
- package/lib/datasources/CastTimer.d.ts +1 -1
- package/lib/datasources/CastTimer.lua +16 -1
- package/lib/datasources/EditModeLayouts.d.ts +1 -1
- package/lib/datasources/EditModeLayouts.lua +10 -1
- package/lib/datasources/GroupMembers.d.ts +3 -3
- package/lib/datasources/GroupMembers.lua +26 -3
- package/lib/datasources/GroupRoster.d.ts +1 -1
- package/lib/datasources/GroupRoster.lua +19 -8
- package/lib/datasources/KnownSpells.d.ts +1 -1
- package/lib/datasources/KnownSpells.lua +10 -1
- package/lib/datasources/ManaRegenTimer.d.ts +1 -1
- package/lib/datasources/ManaRegenTimer.lua +10 -1
- 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/Resources.d.ts +35 -14
- package/lib/datasources/Resources.lua +141 -58
- 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/SpellCooldown.d.ts +2 -2
- package/lib/datasources/SpellCooldown.lua +24 -2
- package/lib/datasources/SpellSource.d.ts +1 -1
- package/lib/datasources/SpellSource.lua +15 -3
- package/lib/datasources/SwingTimer.d.ts +1 -1
- package/lib/datasources/SwingTimer.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/TotemTimer.d.ts +1 -1
- package/lib/datasources/TotemTimer.lua +16 -1
- package/lib/datasources/UnitInfo.d.ts +2 -2
- package/lib/datasources/UnitInfo.lua +21 -3
- package/lib/datasources/UnitSource.d.ts +1 -1
- package/lib/datasources/UnitSource.lua +13 -2
- package/lib/datasources/UseSource.d.ts +51 -0
- package/lib/datasources/UseSource.lua +9 -0
- package/lib/datasources/index.d.ts +3 -1
- package/lib/datasources/index.lua +10 -1
- package/lib/rendering/progress.lua +2 -2
- package/package.json +1 -1
|
@@ -169,10 +169,18 @@ do
|
|
|
169
169
|
metatable.__newindex = descriptorNewIndex
|
|
170
170
|
end
|
|
171
171
|
end
|
|
172
|
+
|
|
173
|
+
local function __TS__New(target, ...)
|
|
174
|
+
local instance = setmetatable({}, target.prototype)
|
|
175
|
+
instance:____constructor(...)
|
|
176
|
+
return instance
|
|
177
|
+
end
|
|
172
178
|
-- End of Lua Library inline imports
|
|
173
179
|
local ____exports = {}
|
|
174
180
|
local ____TimerSource = require("datasources.TimerSource")
|
|
175
181
|
local TimerSource = ____TimerSource.TimerSource
|
|
182
|
+
local ____Source = require("datasources.Source")
|
|
183
|
+
local registerSource = ____Source.registerSource
|
|
176
184
|
--- Native cooldown duration, including opaque timings during combat.
|
|
177
185
|
____exports.SpellCooldown = __TS__Class()
|
|
178
186
|
local SpellCooldown = ____exports.SpellCooldown
|
|
@@ -207,12 +215,26 @@ __TS__SetDescriptor(
|
|
|
207
215
|
return (C_Spell and C_Spell.GetSpellCooldownDuration) ~= nil
|
|
208
216
|
end},
|
|
209
217
|
true
|
|
210
|
-
)
|
|
218
|
+
);
|
|
219
|
+
(function(self)
|
|
220
|
+
registerSource(
|
|
221
|
+
nil,
|
|
222
|
+
____exports.SpellCooldown,
|
|
223
|
+
function(____, props) return __TS__New(____exports.SpellCooldown, props[1], props[2]) end
|
|
224
|
+
)
|
|
225
|
+
end)(SpellCooldown)
|
|
211
226
|
____exports.GlobalCooldown = __TS__Class()
|
|
212
227
|
local GlobalCooldown = ____exports.GlobalCooldown
|
|
213
228
|
GlobalCooldown.name = "GlobalCooldown"
|
|
214
229
|
__TS__ClassExtends(GlobalCooldown, ____exports.SpellCooldown)
|
|
215
230
|
function GlobalCooldown.prototype.____constructor(self)
|
|
216
231
|
GlobalCooldown.____super.prototype.____constructor(self, 61304)
|
|
217
|
-
end
|
|
232
|
+
end;
|
|
233
|
+
(function(self)
|
|
234
|
+
registerSource(
|
|
235
|
+
nil,
|
|
236
|
+
____exports.GlobalCooldown,
|
|
237
|
+
function() return __TS__New(____exports.GlobalCooldown) end
|
|
238
|
+
)
|
|
239
|
+
end)(GlobalCooldown)
|
|
218
240
|
return ____exports
|
|
@@ -7,7 +7,7 @@ export declare class SpellSource extends DataSource<string | undefined> {
|
|
|
7
7
|
readonly spellId: number;
|
|
8
8
|
readonly Texture: TextureSource;
|
|
9
9
|
readonly Cooldown: SpellCooldown;
|
|
10
|
-
constructor(spellId: number);
|
|
10
|
+
protected constructor(spellId: number);
|
|
11
11
|
protected GetValue(): string | undefined;
|
|
12
12
|
get Identifier(): number | string;
|
|
13
13
|
get Action(): SecureAction;
|
|
@@ -179,6 +179,10 @@ end
|
|
|
179
179
|
local ____exports = {}
|
|
180
180
|
local ____DataSource = require("datasources.DataSource")
|
|
181
181
|
local DataSource = ____DataSource.DataSource
|
|
182
|
+
local ____Source = require("datasources.Source")
|
|
183
|
+
local registerSource = ____Source.registerSource
|
|
184
|
+
local ____UseSource = require("datasources.UseSource")
|
|
185
|
+
local UseSource = ____UseSource.UseSource
|
|
182
186
|
local ____TextureSource = require("datasources.TextureSource")
|
|
183
187
|
local TextureSource = ____TextureSource.TextureSource
|
|
184
188
|
local ____SpellCooldown = require("datasources.SpellCooldown")
|
|
@@ -191,7 +195,8 @@ __TS__ClassExtends(SpellSource, DataSource)
|
|
|
191
195
|
function SpellSource.prototype.____constructor(self, spellId)
|
|
192
196
|
DataSource.prototype.____constructor(self, nil)
|
|
193
197
|
self.spellId = spellId
|
|
194
|
-
self.Texture =
|
|
198
|
+
self.Texture = UseSource(
|
|
199
|
+
nil,
|
|
195
200
|
TextureSource,
|
|
196
201
|
function()
|
|
197
202
|
local ____opt_0 = C_Spell and C_Spell.GetSpellTexture
|
|
@@ -199,12 +204,19 @@ function SpellSource.prototype.____constructor(self, spellId)
|
|
|
199
204
|
end,
|
|
200
205
|
{"SPELLS_CHANGED", "PLAYER_ENTERING_WORLD"}
|
|
201
206
|
)
|
|
202
|
-
self.Cooldown =
|
|
207
|
+
self.Cooldown = UseSource(nil, SpellCooldown, self.Identifier, {ignoreGCD = true})
|
|
203
208
|
end
|
|
204
209
|
function SpellSource.prototype.GetValue(self)
|
|
205
210
|
local ____opt_4 = C_Spell and C_Spell.GetSpellName
|
|
206
211
|
return ____opt_4 and ____opt_4(self.spellId)
|
|
207
|
-
end
|
|
212
|
+
end;
|
|
213
|
+
(function(self)
|
|
214
|
+
registerSource(
|
|
215
|
+
nil,
|
|
216
|
+
____exports.SpellSource,
|
|
217
|
+
function(____, props) return __TS__New(____exports.SpellSource, props[1]) end
|
|
218
|
+
)
|
|
219
|
+
end)(SpellSource)
|
|
208
220
|
__TS__SetDescriptor(
|
|
209
221
|
SpellSource.prototype,
|
|
210
222
|
"Identifier",
|
|
@@ -15,7 +15,7 @@ export declare class SwingTimer extends ProgressSource {
|
|
|
15
15
|
private restricted;
|
|
16
16
|
private events?;
|
|
17
17
|
private readonly bindings;
|
|
18
|
-
constructor(hand?: SwingHand);
|
|
18
|
+
protected constructor(hand?: SwingHand);
|
|
19
19
|
/** False until a readable swing event is received, including after reload/reset. */
|
|
20
20
|
get HasTiming(): boolean;
|
|
21
21
|
get IsActive(): boolean;
|
|
@@ -457,6 +457,8 @@ end
|
|
|
457
457
|
local ____exports = {}
|
|
458
458
|
local ____ProgressSource = require("datasources.ProgressSource")
|
|
459
459
|
local ProgressSource = ____ProgressSource.ProgressSource
|
|
460
|
+
local ____Source = require("datasources.Source")
|
|
461
|
+
local registerSource = ____Source.registerSource
|
|
460
462
|
____exports.SwingHand = {MainHand = "MainHand", OffHand = "OffHand", Ranged = "Ranged"}
|
|
461
463
|
--- Player-only countdown driven by Forever's native PLAYER_SWING event.
|
|
462
464
|
____exports.SwingTimer = __TS__Class()
|
|
@@ -621,7 +623,14 @@ function SwingTimer.prototype.Dispose(self)
|
|
|
621
623
|
____opt_16:Hide()
|
|
622
624
|
end
|
|
623
625
|
self.events = nil
|
|
624
|
-
end
|
|
626
|
+
end;
|
|
627
|
+
(function(self)
|
|
628
|
+
registerSource(
|
|
629
|
+
nil,
|
|
630
|
+
____exports.SwingTimer,
|
|
631
|
+
function(____, props) return __TS__New(____exports.SwingTimer, props[1]) end
|
|
632
|
+
)
|
|
633
|
+
end)(SwingTimer)
|
|
625
634
|
__TS__SetDescriptor(
|
|
626
635
|
SwingTimer.prototype,
|
|
627
636
|
"HasTiming",
|
|
@@ -4,7 +4,7 @@ export declare class TextureSource extends DataSource<string | number | undefine
|
|
|
4
4
|
private readonly read;
|
|
5
5
|
private readonly events;
|
|
6
6
|
private readonly unit?;
|
|
7
|
-
constructor(read: () => string | number | undefined, events: readonly string[], unit?: string | undefined);
|
|
7
|
+
protected constructor(read: () => string | number | undefined, events: readonly string[], unit?: string | undefined);
|
|
8
8
|
protected GetValue(): string | number | undefined;
|
|
9
9
|
BindTo(frame: wuiraNativeFrame, texture: wuiraNativeTexture, onActiveChange?: (active: boolean) => void): void;
|
|
10
10
|
}
|
|
@@ -38,10 +38,18 @@ local function __TS__StringStartsWith(self, searchString, position)
|
|
|
38
38
|
end
|
|
39
39
|
return string.sub(self, position + 1, #searchString + position) == searchString
|
|
40
40
|
end
|
|
41
|
+
|
|
42
|
+
local function __TS__New(target, ...)
|
|
43
|
+
local instance = setmetatable({}, target.prototype)
|
|
44
|
+
instance:____constructor(...)
|
|
45
|
+
return instance
|
|
46
|
+
end
|
|
41
47
|
-- End of Lua Library inline imports
|
|
42
48
|
local ____exports = {}
|
|
43
49
|
local ____DataSource = require("datasources.DataSource")
|
|
44
50
|
local DataSource = ____DataSource.DataSource
|
|
51
|
+
local ____Source = require("datasources.Source")
|
|
52
|
+
local registerSource = ____Source.registerSource
|
|
45
53
|
--- A native texture reader with event-driven updates; no per-frame polling.
|
|
46
54
|
____exports.TextureSource = __TS__Class()
|
|
47
55
|
local TextureSource = ____exports.TextureSource
|
|
@@ -79,5 +87,12 @@ function TextureSource.prototype.BindTo(self, frame, texture, onActiveChange)
|
|
|
79
87
|
frame:RegisterEvent(event)
|
|
80
88
|
end
|
|
81
89
|
refresh(nil)
|
|
82
|
-
end
|
|
90
|
+
end;
|
|
91
|
+
(function(self)
|
|
92
|
+
registerSource(
|
|
93
|
+
nil,
|
|
94
|
+
____exports.TextureSource,
|
|
95
|
+
function(____, props) return __TS__New(____exports.TextureSource, props[1], props[2], props[3]) end
|
|
96
|
+
)
|
|
97
|
+
end)(TextureSource)
|
|
83
98
|
return ____exports
|
|
@@ -11,7 +11,7 @@ export declare class TimerSource extends DataSource<NativeDuration | undefined>
|
|
|
11
11
|
private readonly unit?;
|
|
12
12
|
private boundDuration?;
|
|
13
13
|
private bindingCount;
|
|
14
|
-
constructor(read: () => NativeDuration | undefined, events: readonly string[], unit?: string | undefined);
|
|
14
|
+
protected constructor(read: () => NativeDuration | undefined, events: readonly string[], unit?: string | undefined);
|
|
15
15
|
protected GetValue(): NativeDuration | undefined;
|
|
16
16
|
get IsActive(): boolean;
|
|
17
17
|
/** A native radial cooldown owns timing, countdown text and completion effects. */
|
|
@@ -39,6 +39,12 @@ local function __TS__StringStartsWith(self, searchString, position)
|
|
|
39
39
|
return string.sub(self, position + 1, #searchString + position) == searchString
|
|
40
40
|
end
|
|
41
41
|
|
|
42
|
+
local function __TS__New(target, ...)
|
|
43
|
+
local instance = setmetatable({}, target.prototype)
|
|
44
|
+
instance:____constructor(...)
|
|
45
|
+
return instance
|
|
46
|
+
end
|
|
47
|
+
|
|
42
48
|
local function __TS__CloneDescriptor(____bindingPattern0)
|
|
43
49
|
local value
|
|
44
50
|
local writable
|
|
@@ -180,6 +186,8 @@ end
|
|
|
180
186
|
local ____exports = {}
|
|
181
187
|
local ____DataSource = require("datasources.DataSource")
|
|
182
188
|
local DataSource = ____DataSource.DataSource
|
|
189
|
+
local ____Source = require("datasources.Source")
|
|
190
|
+
local registerSource = ____Source.registerSource
|
|
183
191
|
--- Duration reader whose animation is performed entirely by the native widget.
|
|
184
192
|
____exports.TimerSource = __TS__Class()
|
|
185
193
|
local TimerSource = ____exports.TimerSource
|
|
@@ -309,7 +317,14 @@ function TimerSource.prototype.BindTo(self, frame, options)
|
|
|
309
317
|
disposed = true
|
|
310
318
|
self.bindingCount = self.bindingCount - 1
|
|
311
319
|
end
|
|
312
|
-
end
|
|
320
|
+
end;
|
|
321
|
+
(function(self)
|
|
322
|
+
registerSource(
|
|
323
|
+
nil,
|
|
324
|
+
____exports.TimerSource,
|
|
325
|
+
function(____, props) return __TS__New(____exports.TimerSource, props[1], props[2], props[3]) end
|
|
326
|
+
)
|
|
327
|
+
end)(TimerSource)
|
|
313
328
|
__TS__SetDescriptor(
|
|
314
329
|
TimerSource.prototype,
|
|
315
330
|
"IsActive",
|
|
@@ -4,7 +4,7 @@ export type TotemTimerStatus = "active" | "inactive" | "restricted" | "unavailab
|
|
|
4
4
|
export declare class TotemTimer extends TimerSource {
|
|
5
5
|
readonly spell: number | string;
|
|
6
6
|
private status;
|
|
7
|
-
constructor(spell: number | string);
|
|
7
|
+
protected constructor(spell: number | string);
|
|
8
8
|
get Status(): TotemTimerStatus;
|
|
9
9
|
private ReadDuration;
|
|
10
10
|
}
|
|
@@ -32,6 +32,12 @@ local function __TS__ClassExtends(target, base)
|
|
|
32
32
|
end
|
|
33
33
|
end
|
|
34
34
|
|
|
35
|
+
local function __TS__New(target, ...)
|
|
36
|
+
local instance = setmetatable({}, target.prototype)
|
|
37
|
+
instance:____constructor(...)
|
|
38
|
+
return instance
|
|
39
|
+
end
|
|
40
|
+
|
|
35
41
|
local function __TS__CloneDescriptor(____bindingPattern0)
|
|
36
42
|
local value
|
|
37
43
|
local writable
|
|
@@ -173,6 +179,8 @@ end
|
|
|
173
179
|
local ____exports = {}
|
|
174
180
|
local ____TimerSource = require("datasources.TimerSource")
|
|
175
181
|
local TimerSource = ____TimerSource.TimerSource
|
|
182
|
+
local ____Source = require("datasources.Source")
|
|
183
|
+
local registerSource = ____Source.registerSource
|
|
176
184
|
--- Player-owned ground effects exposed by the game's totem API, across spell ranks.
|
|
177
185
|
____exports.TotemTimer = __TS__Class()
|
|
178
186
|
local TotemTimer = ____exports.TotemTimer
|
|
@@ -247,7 +255,14 @@ function TotemTimer.prototype.ReadDuration(self)
|
|
|
247
255
|
end
|
|
248
256
|
self.status = restricted and "restricted" or "inactive"
|
|
249
257
|
return nil
|
|
250
|
-
end
|
|
258
|
+
end;
|
|
259
|
+
(function(self)
|
|
260
|
+
registerSource(
|
|
261
|
+
nil,
|
|
262
|
+
____exports.TotemTimer,
|
|
263
|
+
function(____, props) return __TS__New(____exports.TotemTimer, props[1]) end
|
|
264
|
+
)
|
|
265
|
+
end)(TotemTimer)
|
|
251
266
|
__TS__SetDescriptor(
|
|
252
267
|
TotemTimer.prototype,
|
|
253
268
|
"Status",
|
|
@@ -12,7 +12,7 @@ export declare class ClassSource extends DataSource<ClassInfo | undefined> {
|
|
|
12
12
|
private events?;
|
|
13
13
|
private stopUnit?;
|
|
14
14
|
readonly target: UnitSource;
|
|
15
|
-
constructor(unit: UnitInput);
|
|
15
|
+
protected constructor(unit: UnitInput);
|
|
16
16
|
get unit(): string;
|
|
17
17
|
protected HasSecretFields(): boolean;
|
|
18
18
|
protected GetValue(): ClassInfo | undefined;
|
|
@@ -37,7 +37,7 @@ export declare class SpecSource extends DataSource<readonly SpecializationInfo[]
|
|
|
37
37
|
private listener?;
|
|
38
38
|
private status;
|
|
39
39
|
readonly target: UnitSource;
|
|
40
|
-
constructor(unit: UnitInput);
|
|
40
|
+
protected constructor(unit: UnitInput);
|
|
41
41
|
get unit(): string;
|
|
42
42
|
get Status(): InspectStatus;
|
|
43
43
|
protected HasSecretFields(): boolean;
|
|
@@ -468,6 +468,10 @@ end
|
|
|
468
468
|
local ____exports = {}
|
|
469
469
|
local ____DataSource = require("datasources.DataSource")
|
|
470
470
|
local DataSource = ____DataSource.DataSource
|
|
471
|
+
local ____Source = require("datasources.Source")
|
|
472
|
+
local registerSource = ____Source.registerSource
|
|
473
|
+
local ____UseSource = require("datasources.UseSource")
|
|
474
|
+
local UseSource = ____UseSource.UseSource
|
|
471
475
|
local ____UnitSource = require("datasources.UnitSource")
|
|
472
476
|
local resolveUnit = ____UnitSource.resolveUnit
|
|
473
477
|
____exports.ClassSource = __TS__Class()
|
|
@@ -561,7 +565,14 @@ end
|
|
|
561
565
|
function ClassSource.prototype.Dispose(self)
|
|
562
566
|
self:StopListening()
|
|
563
567
|
self.listeners:clear()
|
|
564
|
-
end
|
|
568
|
+
end;
|
|
569
|
+
(function(self)
|
|
570
|
+
registerSource(
|
|
571
|
+
nil,
|
|
572
|
+
____exports.ClassSource,
|
|
573
|
+
function(____, props) return __TS__New(____exports.ClassSource, props[1]) end
|
|
574
|
+
)
|
|
575
|
+
end)(ClassSource)
|
|
565
576
|
__TS__SetDescriptor(
|
|
566
577
|
ClassSource.prototype,
|
|
567
578
|
"unit",
|
|
@@ -620,7 +631,7 @@ function SpecSource.prototype.Read(self, inspect)
|
|
|
620
631
|
self.status = "unsupported"
|
|
621
632
|
return nil
|
|
622
633
|
end
|
|
623
|
-
local classes =
|
|
634
|
+
local classes = UseSource(nil, ____exports.ClassSource, self.target)
|
|
624
635
|
if classes:IsSecret() then
|
|
625
636
|
self.restricted = true
|
|
626
637
|
return nil
|
|
@@ -758,7 +769,14 @@ function SpecSource.prototype.Dispose(self)
|
|
|
758
769
|
self.status = "idle"
|
|
759
770
|
self.snapshot = nil
|
|
760
771
|
self.snapshotGUID = nil
|
|
761
|
-
end
|
|
772
|
+
end;
|
|
773
|
+
(function(self)
|
|
774
|
+
registerSource(
|
|
775
|
+
nil,
|
|
776
|
+
____exports.SpecSource,
|
|
777
|
+
function(____, props) return __TS__New(____exports.SpecSource, props[1]) end
|
|
778
|
+
)
|
|
779
|
+
end)(SpecSource)
|
|
762
780
|
__TS__SetDescriptor(
|
|
763
781
|
SpecSource.prototype,
|
|
764
782
|
"unit",
|
|
@@ -22,7 +22,7 @@ export declare class UnitSource extends DataSource<UnitIdentity | undefined> {
|
|
|
22
22
|
private readonly listeners;
|
|
23
23
|
private readonly tokenListeners;
|
|
24
24
|
private events?;
|
|
25
|
-
constructor(token: string);
|
|
25
|
+
protected constructor(token: string);
|
|
26
26
|
get Token(): string;
|
|
27
27
|
/** Keep source objects/subscriptions while a stable identity moves to another unit slot. */
|
|
28
28
|
Retarget(token: string): void;
|
|
@@ -456,6 +456,10 @@ end
|
|
|
456
456
|
local ____exports = {}
|
|
457
457
|
local ____DataSource = require("datasources.DataSource")
|
|
458
458
|
local DataSource = ____DataSource.DataSource
|
|
459
|
+
local ____Source = require("datasources.Source")
|
|
460
|
+
local registerSource = ____Source.registerSource
|
|
461
|
+
local ____UseSource = require("datasources.UseSource")
|
|
462
|
+
local UseSource = ____UseSource.UseSource
|
|
459
463
|
____exports.Unit = {Player = "player", Target = "target", Focus = "focus"}
|
|
460
464
|
____exports.UnitPredicates = __TS__Class()
|
|
461
465
|
local UnitPredicates = ____exports.UnitPredicates
|
|
@@ -594,9 +598,16 @@ __TS__SetDescriptor(
|
|
|
594
598
|
return self.token
|
|
595
599
|
end},
|
|
596
600
|
true
|
|
597
|
-
)
|
|
601
|
+
);
|
|
602
|
+
(function(self)
|
|
603
|
+
registerSource(
|
|
604
|
+
nil,
|
|
605
|
+
____exports.UnitSource,
|
|
606
|
+
function(____, props) return __TS__New(____exports.UnitSource, props[1]) end
|
|
607
|
+
)
|
|
608
|
+
end)(UnitSource)
|
|
598
609
|
--- Reuse explicit unit references; string inputs remain a convenience shorthand.
|
|
599
610
|
function ____exports.resolveUnit(self, unit)
|
|
600
|
-
return type(unit) == "string" and
|
|
611
|
+
return type(unit) == "string" and UseSource(nil, ____exports.UnitSource, unit) or unit
|
|
601
612
|
end
|
|
602
613
|
return ____exports
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import type { UnitInput, UnitSource } from "./UnitSource";
|
|
2
|
+
import type { Absorb, HP, Mana, Prediction } from "./Resources";
|
|
3
|
+
import type { ClassSource, SpecSource } from "./UnitInfo";
|
|
4
|
+
import type { GroupScope, GroupMembers, PartyMembers, RaidMembers } from "./GroupMembers";
|
|
5
|
+
import type { GroupRoster } from "./GroupRoster";
|
|
6
|
+
import type { Buffs, Debuffs } from "./Auras";
|
|
7
|
+
import type { KnownSpells } from "./KnownSpells";
|
|
8
|
+
import type { SpellSource } from "./SpellSource";
|
|
9
|
+
import type { TotemTimer } from "./TotemTimer";
|
|
10
|
+
import type { NativeDuration, TimerSource } from "./TimerSource";
|
|
11
|
+
import type { SpellCooldown, GlobalCooldown } from "./SpellCooldown";
|
|
12
|
+
import type { ManaRegenTimer } from "./ManaRegenTimer";
|
|
13
|
+
import type { CastTimer } from "./CastTimer";
|
|
14
|
+
import type { TextureSource } from "./TextureSource";
|
|
15
|
+
import type { SwingHand, SwingTimer } from "./SwingTimer";
|
|
16
|
+
import type { AuraTimer, AuraTimerOptions } from "./AuraTimer";
|
|
17
|
+
import type { EditModeLayouts } from "./EditModeLayouts";
|
|
18
|
+
import type { SourceConverter, ValueSource } from "./SourceConverter";
|
|
19
|
+
import type { NativeNumberSource } from "./NativeNumberSource";
|
|
20
|
+
export declare function UseSource(source: typeof HP, unit?: UnitInput): HP;
|
|
21
|
+
export declare function UseSource(source: typeof Absorb, unit: UnitInput): Absorb;
|
|
22
|
+
export declare function UseSource(source: typeof Prediction, unit: UnitInput): Prediction;
|
|
23
|
+
export declare function UseSource(source: typeof Mana, unit: UnitInput): Mana;
|
|
24
|
+
export declare function UseSource(source: typeof UnitSource, token: string): UnitSource;
|
|
25
|
+
export declare function UseSource(source: typeof ClassSource, unit: UnitInput): ClassSource;
|
|
26
|
+
export declare function UseSource(source: typeof SpecSource, unit: UnitInput): SpecSource;
|
|
27
|
+
export declare function UseSource(source: typeof GroupMembers, scope?: GroupScope): GroupMembers;
|
|
28
|
+
export declare function UseSource(source: typeof PartyMembers): PartyMembers;
|
|
29
|
+
export declare function UseSource(source: typeof RaidMembers): RaidMembers;
|
|
30
|
+
export declare function UseSource(source: typeof GroupRoster, scope?: GroupScope, options?: {
|
|
31
|
+
pets?: boolean;
|
|
32
|
+
includeSelfWhenSolo?: boolean;
|
|
33
|
+
}): GroupRoster;
|
|
34
|
+
export declare function UseSource(source: typeof Buffs, unit: UnitInput): Buffs;
|
|
35
|
+
export declare function UseSource(source: typeof Debuffs, unit: UnitInput): Debuffs;
|
|
36
|
+
export declare function UseSource(source: typeof KnownSpells): KnownSpells;
|
|
37
|
+
export declare function UseSource(source: typeof SpellSource, spellId: number): SpellSource;
|
|
38
|
+
export declare function UseSource(source: typeof TotemTimer, spell: number | string): TotemTimer;
|
|
39
|
+
export declare function UseSource(source: typeof TimerSource, read: () => NativeDuration | undefined, events: readonly string[], unit?: string): TimerSource;
|
|
40
|
+
export declare function UseSource(source: typeof SpellCooldown, spellId: number | string, options?: {
|
|
41
|
+
ignoreGCD?: boolean;
|
|
42
|
+
}): SpellCooldown;
|
|
43
|
+
export declare function UseSource(source: typeof GlobalCooldown): GlobalCooldown;
|
|
44
|
+
export declare function UseSource(source: typeof ManaRegenTimer, observe: (listener: (event: string, payload: unknown[], value: number) => void) => () => void): ManaRegenTimer;
|
|
45
|
+
export declare function UseSource(source: typeof CastTimer, unit?: UnitInput): CastTimer;
|
|
46
|
+
export declare function UseSource(source: typeof TextureSource, read: () => string | number | undefined, events: readonly string[], unit?: string): TextureSource;
|
|
47
|
+
export declare function UseSource(source: typeof SwingTimer, hand?: SwingHand): SwingTimer;
|
|
48
|
+
export declare function UseSource(source: typeof AuraTimer, unit: UnitInput, options: AuraTimerOptions): AuraTimer;
|
|
49
|
+
export declare function UseSource(source: typeof EditModeLayouts): EditModeLayouts;
|
|
50
|
+
export declare function UseSource<TInput, TOutput>(source: typeof SourceConverter, input: ValueSource<TInput>, convert: (value: TInput) => TOutput): SourceConverter<TInput, TOutput>;
|
|
51
|
+
export declare function UseSource(source: typeof NativeNumberSource, read: () => number): NativeNumberSource;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
--[[ Generated with https://github.com/TypeScriptToLua/TypeScriptToLua ]]
|
|
2
|
+
local ____exports = {}
|
|
3
|
+
local ____Source = require("datasources.Source")
|
|
4
|
+
local openSource = ____Source.openSource
|
|
5
|
+
function ____exports.UseSource(self, source, ...)
|
|
6
|
+
local props = {...}
|
|
7
|
+
return openSource(nil, source, props)
|
|
8
|
+
end
|
|
9
|
+
return ____exports
|
|
@@ -6,7 +6,9 @@ export type { ValueSource } from "./SourceConverter";
|
|
|
6
6
|
export { EditModeLayouts } from "./EditModeLayouts";
|
|
7
7
|
export type { EditModeLayout, EditModeLayoutSnapshot, EditModeLayoutsStatus } from "./EditModeLayouts";
|
|
8
8
|
export { ProgressSource } from "./ProgressSource";
|
|
9
|
-
export { HP, Mana, Unit, DataSources,
|
|
9
|
+
export { HP, Mana, Unit, DataSources, Absorb, Prediction } from "./Resources";
|
|
10
|
+
export { Source } from "./Source";
|
|
11
|
+
export { UseSource } from "./UseSource";
|
|
10
12
|
export { Aura, AuraSource, Buffs, Debuffs } from "./Auras";
|
|
11
13
|
export type { AuraSourceStatus } from "./Auras";
|
|
12
14
|
export { GroupMembers, PartyMembers, RaidMembers } from "./GroupMembers";
|
|
@@ -22,7 +22,16 @@ do
|
|
|
22
22
|
____exports.Mana = ____Resources.Mana
|
|
23
23
|
____exports.Unit = ____Resources.Unit
|
|
24
24
|
____exports.DataSources = ____Resources.DataSources
|
|
25
|
-
____exports.
|
|
25
|
+
____exports.Absorb = ____Resources.Absorb
|
|
26
|
+
____exports.Prediction = ____Resources.Prediction
|
|
27
|
+
end
|
|
28
|
+
do
|
|
29
|
+
local ____Source = require("datasources.Source")
|
|
30
|
+
____exports.Source = ____Source.Source
|
|
31
|
+
end
|
|
32
|
+
do
|
|
33
|
+
local ____UseSource = require("datasources.UseSource")
|
|
34
|
+
____exports.UseSource = ____UseSource.UseSource
|
|
26
35
|
end
|
|
27
36
|
do
|
|
28
37
|
local ____Auras = require("datasources.Auras")
|
|
@@ -162,7 +162,7 @@ function ____exports.renderProgress(self, item, tree, onActiveChange)
|
|
|
162
162
|
end
|
|
163
163
|
return layer
|
|
164
164
|
end
|
|
165
|
-
local ____opt_28 = source.
|
|
165
|
+
local ____opt_28 = source.Prediction
|
|
166
166
|
if (____opt_28 and ____opt_28.IsAvailable) == true and props.healPrediction ~= false then
|
|
167
167
|
local ____props_healPrediction_32 = props.healPrediction
|
|
168
168
|
local ____opt_30 = props.healPrediction
|
|
@@ -172,7 +172,7 @@ function ____exports.renderProgress(self, item, tree, onActiveChange)
|
|
|
172
172
|
true
|
|
173
173
|
)
|
|
174
174
|
end
|
|
175
|
-
local ____opt_33 = source.
|
|
175
|
+
local ____opt_33 = source.Absorb
|
|
176
176
|
if (____opt_33 and ____opt_33.IsAvailable) == true and props.absorbPrediction ~= false then
|
|
177
177
|
local ____props_absorbPrediction_37 = props.absorbPrediction
|
|
178
178
|
local ____opt_35 = props.absorbPrediction
|