wuira 0.1.4 → 0.1.6
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 +102 -1
- package/README.md +347 -0
- package/lib/Spells.d.ts +21 -0
- package/lib/Spells.lua +41 -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/KnownSpells.d.ts +21 -0
- package/lib/datasources/KnownSpells.lua +794 -0
- package/lib/datasources/ManaRegenTimer.d.ts +29 -0
- package/lib/datasources/ManaRegenTimer.lua +674 -0
- package/lib/datasources/ProgressSource.d.ts +6 -2
- package/lib/datasources/ProgressSource.lua +34 -3
- package/lib/datasources/Resources.d.ts +33 -2
- package/lib/datasources/Resources.lua +562 -10
- package/lib/datasources/SpellCooldown.d.ts +12 -0
- package/lib/datasources/SpellCooldown.lua +218 -0
- package/lib/datasources/SpellSource.d.ts +14 -0
- package/lib/datasources/SpellSource.lua +224 -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 +20 -0
- package/lib/datasources/TimerSource.lua +338 -0
- package/lib/datasources/TotemTimer.d.ts +10 -0
- package/lib/datasources/TotemTimer.lua +260 -0
- package/lib/datasources/index.d.ts +16 -1
- package/lib/datasources/index.lua +43 -0
- package/lib/index.d.ts +11 -0
- package/lib/index.lua +24 -0
- package/lib/platform/ActionBars.d.ts +27 -0
- package/lib/platform/ActionBars.lua +726 -0
- package/lib/platform/AddonSettings.d.ts +9 -0
- package/lib/platform/AddonSettings.lua +36 -0
- package/lib/platform/BlizzardUI.d.ts +17 -0
- package/lib/platform/BlizzardUI.lua +689 -0
- package/lib/platform/MicroMenu.d.ts +15 -0
- package/lib/platform/MicroMenu.lua +219 -0
- package/lib/platform/SecureButton.d.ts +5 -0
- package/lib/platform/SecureButton.lua +196 -0
- package/lib/platform/SlashCommands.d.ts +3 -0
- package/lib/platform/SlashCommands.lua +309 -0
- package/lib/platform/forever.d.ts +115 -2
- package/lib/skins/MicroBar.d.ts +8 -0
- package/lib/skins/MicroBar.lua +65 -0
- package/lib/skins/NativeSkin.d.ts +26 -0
- package/lib/skins/NativeSkin.lua +601 -0
- package/lib/skins/index.d.ts +3 -0
- package/lib/skins/index.lua +11 -0
- package/lib/store/index.lua +13 -0
- package/lib/ui/Button.d.ts +10 -0
- package/lib/ui/Button.lua +9 -0
- package/lib/ui/Cell.d.ts +7 -1
- package/lib/ui/FrameMover.d.ts +21 -0
- package/lib/ui/FrameMover.lua +123 -0
- package/lib/ui/HoverTracker.d.ts +20 -0
- package/lib/ui/HoverTracker.lua +88 -0
- package/lib/ui/Icon.d.ts +8 -0
- package/lib/ui/Icon.lua +8 -0
- package/lib/ui/KeybindCapture.d.ts +20 -0
- package/lib/ui/KeybindCapture.lua +488 -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/SecureButton.d.ts +44 -0
- package/lib/ui/SecureButton.lua +9 -0
- package/lib/ui/index.d.ts +13 -0
- package/lib/ui/index.lua +28 -0
- package/lib/ui/layout/measureLayout.lua +11 -2
- package/lib/ui/mount.lua +679 -74
- package/lib/ui/primitives/jsx.d.ts +15 -2
- package/lib/wuira.d.ts +3 -0
- package/lib/wuira.lua +5 -0
- package/package.json +8 -1
- package/tools/build-library.mjs +1 -1
|
@@ -3,6 +3,10 @@ export interface ProgressOverrides {
|
|
|
3
3
|
min?: number;
|
|
4
4
|
max?: number;
|
|
5
5
|
current?: number;
|
|
6
|
+
onActiveChange?: (active: boolean) => void;
|
|
7
|
+
onRefresh?: () => void;
|
|
8
|
+
healPredictionBar?: wuiraNativeStatusBar;
|
|
9
|
+
absorbPredictionBar?: wuiraNativeStatusBar;
|
|
6
10
|
}
|
|
7
11
|
/** Shared contract for health, power, cooldowns, and other progress values. */
|
|
8
12
|
export declare abstract class ProgressSource extends DataSource<number> {
|
|
@@ -18,6 +22,6 @@ export declare abstract class ProgressSource extends DataSource<number> {
|
|
|
18
22
|
});
|
|
19
23
|
protected GetValue(): number;
|
|
20
24
|
IsSecret(): boolean;
|
|
21
|
-
BindTo(frame: wuiraNativeStatusBar, options?: ProgressOverrides): void;
|
|
22
|
-
protected abstract Listen(frame: wuiraNativeFrame, refresh: () => void): void;
|
|
25
|
+
BindTo(frame: wuiraNativeStatusBar, options?: ProgressOverrides): void | (() => void);
|
|
26
|
+
protected abstract Listen(frame: wuiraNativeFrame, refresh: () => void): void | (() => void);
|
|
23
27
|
}
|
|
@@ -66,14 +66,45 @@ function ProgressSource.prototype.BindTo(self, frame, options)
|
|
|
66
66
|
options = {}
|
|
67
67
|
end
|
|
68
68
|
local function refresh()
|
|
69
|
-
local
|
|
69
|
+
local sourceValue = self:GetValue()
|
|
70
|
+
local active = self:CanEmit(sourceValue)
|
|
71
|
+
local ____this_1
|
|
72
|
+
____this_1 = options
|
|
73
|
+
local ____opt_0 = ____this_1.onActiveChange
|
|
74
|
+
if ____opt_0 ~= nil then
|
|
75
|
+
____opt_0(____this_1, active)
|
|
76
|
+
end
|
|
77
|
+
if not active then
|
|
78
|
+
return
|
|
79
|
+
end
|
|
80
|
+
local current = options.current ~= nil and options.current or sourceValue
|
|
70
81
|
frame:SetMinMaxValues(
|
|
71
82
|
options.min ~= nil and options.min or self.readers:min(),
|
|
72
83
|
options.max ~= nil and options.max or self.readers:max()
|
|
73
84
|
)
|
|
74
85
|
frame:SetValue(current)
|
|
86
|
+
local ____this_3
|
|
87
|
+
____this_3 = options
|
|
88
|
+
local ____opt_2 = ____this_3.onRefresh
|
|
89
|
+
if ____opt_2 ~= nil then
|
|
90
|
+
____opt_2(____this_3)
|
|
91
|
+
end
|
|
92
|
+
end
|
|
93
|
+
local dispose = self:Listen(frame, refresh)
|
|
94
|
+
do
|
|
95
|
+
local function ____catch(failure)
|
|
96
|
+
if dispose ~= nil then
|
|
97
|
+
dispose(nil)
|
|
98
|
+
end
|
|
99
|
+
error(failure, 0)
|
|
100
|
+
end
|
|
101
|
+
local ____try, ____hasReturned = pcall(function()
|
|
102
|
+
refresh(nil)
|
|
103
|
+
end)
|
|
104
|
+
if not ____try then
|
|
105
|
+
____catch(____hasReturned)
|
|
106
|
+
end
|
|
75
107
|
end
|
|
76
|
-
|
|
77
|
-
refresh(nil)
|
|
108
|
+
return dispose
|
|
78
109
|
end
|
|
79
110
|
return ____exports
|
|
@@ -1,21 +1,52 @@
|
|
|
1
1
|
import { ProgressSource } from "./ProgressSource";
|
|
2
2
|
import { UnitSource } from "./UnitSource";
|
|
3
3
|
import type { UnitInput } from "./UnitSource";
|
|
4
|
+
import { DataSource } from "./DataSource";
|
|
5
|
+
import type { ProgressOverrides } from "./ProgressSource";
|
|
6
|
+
import { ManaRegenTimer } from "./ManaRegenTimer";
|
|
4
7
|
export { Unit } from "./UnitSource";
|
|
5
8
|
/** Direct API-to-widget binding; opaque values are never compared or calculated. */
|
|
6
9
|
declare abstract class Resource extends ProgressSource {
|
|
7
10
|
private readonly unitToken;
|
|
8
11
|
private readonly events;
|
|
12
|
+
private readonly listeners;
|
|
13
|
+
private eventFrame?;
|
|
14
|
+
private dispatching;
|
|
15
|
+
private eventValue;
|
|
9
16
|
protected constructor(current: () => number, maximum: () => number, percent: () => number, unitToken: string, events: string[]);
|
|
10
|
-
protected
|
|
17
|
+
protected AddEvents(...events: string[]): void;
|
|
18
|
+
protected GetValue(): number;
|
|
19
|
+
/** Future readable value changes only. Unsubscribe when the consumer is removed. */
|
|
20
|
+
onChange(listener: (value: number) => void): () => void;
|
|
21
|
+
/** One native event frame is shared by widgets, observers, and accessories. */
|
|
22
|
+
protected Observe(listener: (event: string, payload: unknown[], value: number) => void): () => void;
|
|
23
|
+
protected Listen(_frame: wuiraNativeFrame, refresh: () => void): () => void;
|
|
24
|
+
}
|
|
25
|
+
/** Live optional prediction channel. Secret amounts only travel to native sinks. */
|
|
26
|
+
export declare class HealthPrediction extends DataSource<number> {
|
|
27
|
+
private readonly read;
|
|
28
|
+
constructor(read: (() => number | undefined) | undefined);
|
|
29
|
+
get IsAvailable(): boolean;
|
|
30
|
+
protected GetValue(): number;
|
|
31
|
+
ApplyTo(frame: wuiraNativeStatusBar, maximum: number): void;
|
|
11
32
|
}
|
|
12
33
|
export declare class HP extends Resource {
|
|
34
|
+
private healPrediction?;
|
|
35
|
+
private absorbPrediction?;
|
|
36
|
+
get HealPrediction(): HealthPrediction | undefined;
|
|
37
|
+
get AbsorbPrediction(): HealthPrediction | undefined;
|
|
38
|
+
UseHealPrediction(): this;
|
|
39
|
+
UseAbsorbPrediction(): this;
|
|
40
|
+
BindTo(frame: wuiraNativeStatusBar, options?: ProgressOverrides): () => void;
|
|
13
41
|
readonly target: UnitSource;
|
|
14
42
|
get unit(): string;
|
|
15
|
-
constructor(unit
|
|
43
|
+
constructor(unit?: UnitInput);
|
|
16
44
|
}
|
|
17
45
|
/** Explicit mana (power type 0), even while the unit uses rage/energy. */
|
|
18
46
|
export declare class Mana extends Resource {
|
|
47
|
+
private regenTimer?;
|
|
48
|
+
get RegenTimer(): ManaRegenTimer | undefined;
|
|
49
|
+
UseRegenTimer(): this;
|
|
19
50
|
readonly target: UnitSource;
|
|
20
51
|
get unit(): string;
|
|
21
52
|
constructor(unit: UnitInput);
|