wuira 0.3.3 → 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.
Files changed (52) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/README.md +15 -12
  3. package/docs/source-converters.md +5 -5
  4. package/docs/spells.md +1 -1
  5. package/lib/datasources/NativeApi.d.ts +319 -0
  6. package/lib/datasources/NativeApi.lua +1114 -0
  7. package/lib/datasources/UseSource.d.ts +41 -43
  8. package/lib/datasources/index.d.ts +3 -25
  9. package/lib/datasources/index.lua +45 -74
  10. package/lib/helpers/Auras.d.ts +5 -0
  11. package/lib/helpers/Auras.lua +47 -0
  12. package/lib/helpers/Range.d.ts +2 -0
  13. package/lib/helpers/Range.lua +30 -0
  14. package/lib/helpers/index.d.ts +2 -0
  15. package/lib/helpers/index.lua +12 -0
  16. package/lib/index.d.ts +1 -0
  17. package/lib/index.lua +6 -0
  18. package/lib/platform/forever.d.ts +3 -0
  19. package/lib/rendering/progress.lua +5 -150
  20. package/lib/ui/UnitPortrait.d.ts +1 -2
  21. package/lib/ui/UnitPortrait.lua +11 -18
  22. package/package.json +8 -1
  23. package/lib/datasources/AuraTimer.d.ts +0 -21
  24. package/lib/datasources/AuraTimer.lua +0 -334
  25. package/lib/datasources/Auras.d.ts +0 -32
  26. package/lib/datasources/Auras.lua +0 -300
  27. package/lib/datasources/CastTimer.d.ts +0 -9
  28. package/lib/datasources/CastTimer.lua +0 -255
  29. package/lib/datasources/EditModeLayouts.d.ts +0 -33
  30. package/lib/datasources/EditModeLayouts.lua +0 -698
  31. package/lib/datasources/GroupMembers.d.ts +0 -24
  32. package/lib/datasources/GroupMembers.lua +0 -477
  33. package/lib/datasources/GroupRoster.d.ts +0 -28
  34. package/lib/datasources/GroupRoster.lua +0 -622
  35. package/lib/datasources/KnownSpells.d.ts +0 -33
  36. package/lib/datasources/KnownSpells.lua +0 -1077
  37. package/lib/datasources/ManaRegenTimer.d.ts +0 -29
  38. package/lib/datasources/ManaRegenTimer.lua +0 -683
  39. package/lib/datasources/Resources.d.ts +0 -81
  40. package/lib/datasources/Resources.lua +0 -907
  41. package/lib/datasources/SpellCooldown.d.ts +0 -12
  42. package/lib/datasources/SpellCooldown.lua +0 -240
  43. package/lib/datasources/SpellSource.d.ts +0 -14
  44. package/lib/datasources/SpellSource.lua +0 -236
  45. package/lib/datasources/SwingTimer.d.ts +0 -31
  46. package/lib/datasources/SwingTimer.lua +0 -650
  47. package/lib/datasources/TotemTimer.d.ts +0 -10
  48. package/lib/datasources/TotemTimer.lua +0 -275
  49. package/lib/datasources/UnitInfo.d.ts +0 -51
  50. package/lib/datasources/UnitInfo.lua +0 -801
  51. package/lib/datasources/UnitSource.d.ts +0 -38
  52. package/lib/datasources/UnitSource.lua +0 -613
@@ -1,81 +0,0 @@
1
- import { ProgressSource } from "./ProgressSource";
2
- import { UnitSource } from "./UnitSource";
3
- import type { UnitInput } from "./UnitSource";
4
- import type { ProgressOverrides } from "./ProgressSource";
5
- import { ManaRegenTimer } from "./ManaRegenTimer";
6
- import { Source } from "./Source";
7
- export { Unit } from "./UnitSource";
8
- /** Direct API-to-widget binding; opaque values are never compared or calculated. */
9
- declare abstract class Resource extends ProgressSource {
10
- private readonly unitReference;
11
- private readonly events;
12
- private readonly listeners;
13
- private eventFrame?;
14
- private dispatching;
15
- private eventValue;
16
- private stopUnit?;
17
- protected constructor(current: () => number, maximum: () => number, percent: () => number, unitReference: UnitSource, events: string[]);
18
- protected AddEvents(...events: string[]): void;
19
- protected GetValue(): number;
20
- /** Future readable value changes only. Unsubscribe when the consumer is removed. */
21
- onChange(listener: (value: number) => void): () => void;
22
- /** One native event frame is shared by widgets, observers, and accessories. */
23
- protected Observe(listener: (event: string, payload: unknown[], value: number) => void): () => void;
24
- protected Listen(_frame: wuiraNativeFrame, refresh: () => void): () => void;
25
- }
26
- /** One optional unit amount. A missing native function stays unavailable and is never called. */
27
- declare abstract class UnitAmount extends Source<number, [UnitInput]> {
28
- readonly target: UnitSource;
29
- abstract get IsAvailable(): boolean;
30
- protected constructor(unit: UnitInput);
31
- ApplyTo(frame: wuiraNativeStatusBar, maximum: number): void;
32
- }
33
- /** Total absorbs on a unit. `UnitGetTotalAbsorbs`. */
34
- export declare class Absorb extends UnitAmount {
35
- get IsAvailable(): boolean;
36
- protected constructor(unit: UnitInput);
37
- protected read(props: [UnitInput]): number;
38
- }
39
- /** Incoming heals on a unit. `UnitGetIncomingHeals`. */
40
- export declare class Prediction extends UnitAmount {
41
- get IsAvailable(): boolean;
42
- protected constructor(unit: UnitInput);
43
- protected read(props: [UnitInput]): number;
44
- }
45
- export declare class HP extends Resource {
46
- private absorb?;
47
- private prediction?;
48
- /** Same object as `UseSource(Absorb, unit)`. Absent until `UseAbsorb`. */
49
- get Absorb(): Absorb | undefined;
50
- /** Same object as `UseSource(Prediction, unit)`. Absent until `UsePrediction`. */
51
- get Prediction(): Prediction | undefined;
52
- /** @deprecated Use Absorb. */
53
- get AbsorbPrediction(): Absorb | undefined;
54
- /** @deprecated Use Prediction. */
55
- get HealPrediction(): Prediction | undefined;
56
- UseAbsorb(): this;
57
- UsePrediction(): this;
58
- /** @deprecated Use UseAbsorb. */
59
- UseAbsorbPrediction(): this;
60
- /** @deprecated Use UsePrediction. */
61
- UseHealPrediction(): this;
62
- BindTo(frame: wuiraNativeStatusBar, options?: ProgressOverrides): () => void;
63
- readonly target: UnitSource;
64
- get unit(): string;
65
- protected constructor(unit?: UnitInput);
66
- }
67
- /** Explicit mana (power type 0), even while the unit uses rage/energy. */
68
- export declare class Mana extends Resource {
69
- private regenTimer?;
70
- get RegenTimer(): ManaRegenTimer | undefined;
71
- UseRegenTimer(): this;
72
- readonly target: UnitSource;
73
- get unit(): string;
74
- protected constructor(unit: UnitInput);
75
- }
76
- export declare const DataSources: {
77
- Resources: {
78
- HP: typeof HP;
79
- Mana: typeof Mana;
80
- };
81
- };