wuira 0.3.0 → 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.
Files changed (74) hide show
  1. package/CHANGELOG.md +32 -0
  2. package/README.md +20 -5
  3. package/docs/source-converters.md +5 -5
  4. package/lib/datasources/AuraTimer.d.ts +1 -1
  5. package/lib/datasources/AuraTimer.lua +14 -2
  6. package/lib/datasources/Auras.d.ts +2 -2
  7. package/lib/datasources/Auras.lua +18 -2
  8. package/lib/datasources/CastTimer.d.ts +1 -1
  9. package/lib/datasources/CastTimer.lua +16 -1
  10. package/lib/datasources/EditModeLayouts.d.ts +1 -1
  11. package/lib/datasources/EditModeLayouts.lua +10 -1
  12. package/lib/datasources/GroupMembers.d.ts +3 -3
  13. package/lib/datasources/GroupMembers.lua +26 -3
  14. package/lib/datasources/GroupRoster.d.ts +1 -1
  15. package/lib/datasources/GroupRoster.lua +19 -8
  16. package/lib/datasources/KnownSpells.d.ts +1 -1
  17. package/lib/datasources/KnownSpells.lua +10 -1
  18. package/lib/datasources/ManaRegenTimer.d.ts +1 -1
  19. package/lib/datasources/ManaRegenTimer.lua +10 -1
  20. package/lib/datasources/NativeNumberSource.d.ts +1 -1
  21. package/lib/datasources/NativeNumberSource.lua +16 -1
  22. package/lib/datasources/ProgressSource.lua +5 -9
  23. package/lib/datasources/Resources.d.ts +35 -14
  24. package/lib/datasources/Resources.lua +141 -58
  25. package/lib/datasources/Source.d.ts +18 -0
  26. package/lib/datasources/Source.lua +300 -0
  27. package/lib/datasources/SourceConverter.d.ts +1 -1
  28. package/lib/datasources/SourceConverter.lua +10 -1
  29. package/lib/datasources/SpellCooldown.d.ts +2 -2
  30. package/lib/datasources/SpellCooldown.lua +24 -2
  31. package/lib/datasources/SpellSource.d.ts +1 -1
  32. package/lib/datasources/SpellSource.lua +15 -3
  33. package/lib/datasources/SwingTimer.d.ts +1 -1
  34. package/lib/datasources/SwingTimer.lua +10 -1
  35. package/lib/datasources/TextureSource.d.ts +1 -1
  36. package/lib/datasources/TextureSource.lua +16 -1
  37. package/lib/datasources/TimerSource.d.ts +1 -1
  38. package/lib/datasources/TimerSource.lua +16 -1
  39. package/lib/datasources/TotemTimer.d.ts +1 -1
  40. package/lib/datasources/TotemTimer.lua +16 -1
  41. package/lib/datasources/UnitInfo.d.ts +2 -2
  42. package/lib/datasources/UnitInfo.lua +21 -3
  43. package/lib/datasources/UnitSource.d.ts +1 -1
  44. package/lib/datasources/UnitSource.lua +13 -2
  45. package/lib/datasources/UseSource.d.ts +51 -0
  46. package/lib/datasources/UseSource.lua +9 -0
  47. package/lib/datasources/index.d.ts +3 -1
  48. package/lib/datasources/index.lua +10 -1
  49. package/lib/platform/forever.d.ts +2 -1
  50. package/lib/rendering/layout.lua +2 -2
  51. package/lib/rendering/progress.lua +11 -5
  52. package/lib/rendering/widgets.lua +8 -1
  53. package/lib/ui/Cell.d.ts +1 -1
  54. package/lib/ui/FlowLayout.d.ts +16 -4
  55. package/lib/ui/GridLayout.d.ts +10 -1
  56. package/lib/ui/ScrollHost.lua +9 -4
  57. package/lib/ui/decorations/backgroundTextures.d.ts +2 -22
  58. package/lib/ui/decorations/backgroundTextures.lua +3 -7
  59. package/lib/ui/decorations/borderTextures.d.ts +2 -37
  60. package/lib/ui/decorations/borderTextures.lua +3 -9
  61. package/lib/ui/decorations/statusBarTextures.d.ts +5 -12
  62. package/lib/ui/decorations/statusBarTextures.lua +83 -4
  63. package/lib/ui/index.d.ts +5 -0
  64. package/lib/ui/index.lua +15 -0
  65. package/lib/ui/layout/calculateFlow.d.ts +16 -4
  66. package/lib/ui/layout/calculateFlow.lua +153 -46
  67. package/lib/ui/layout/calculateGrid.d.ts +6 -5
  68. package/lib/ui/layout/calculateGrid.lua +80 -6
  69. package/lib/ui/layout/measureLayout.lua +118 -39
  70. package/lib/ui/media/clientMedia.d.ts +177 -0
  71. package/lib/ui/media/clientMedia.lua +49 -0
  72. package/lib/ui/overlayGlow.d.ts +21 -0
  73. package/lib/ui/overlayGlow.lua +350 -0
  74. 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 = __TS__New(
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 = __TS__New(SpellCooldown, self.Identifier, {ignoreGCD = true})
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 = __TS__New(____exports.ClassSource, self.target)
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 __TS__New(____exports.UnitSource, unit) or unit
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, HealthPrediction } from "./Resources";
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.HealthPrediction = ____Resources.HealthPrediction
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")
@@ -7,6 +7,7 @@ interface wuiraNativeTexture {
7
7
  SetAllPoints(frame: wuiraNativeFrame): void;
8
8
  SetColorTexture(red: number, green: number, blue: number, alpha: number): void;
9
9
  SetTexture(path: string | number | undefined): void;
10
+ SetAtlas(atlas: string): void;
10
11
  SetVertexColor(red: number, green: number, blue: number, alpha: number): void;
11
12
  SetBlendMode(mode: import("../types/Texture").BlendMode): void;
12
13
  SetHorizTile(enabled: boolean): void;
@@ -101,7 +102,7 @@ interface wuiraNativeStatusBar extends wuiraNativeFrame {
101
102
  GetStatusBarTexture(): wuiraNativeTexture;
102
103
  SetMinMaxValues(min: number, max: number): void;
103
104
  SetValue(value: number): void;
104
- SetStatusBarTexture(path: string): void;
105
+ SetStatusBarTexture(path: string | number): void;
105
106
  SetStatusBarColor(red: number, green: number, blue: number, alpha: number): void;
106
107
  SetOrientation(orientation: "HORIZONTAL" | "VERTICAL"): void;
107
108
  SetReverseFill(reverse: boolean): void;
@@ -463,8 +463,8 @@ function ____exports.prepareLayout(self, element, parent, mountedFrames)
463
463
  nil,
464
464
  element,
465
465
  {
466
- width = rootProps.width == "inherit" and parent:GetWidth() or nil,
467
- height = rootProps.height == "inherit" and parent:GetHeight() or nil
466
+ width = (rootProps.width == "inherit" or rootProps.width == "fill") and parent:GetWidth() or nil,
467
+ height = (rootProps.height == "inherit" or rootProps.height == "fill") and parent:GetHeight() or nil
468
468
  }
469
469
  )
470
470
  local ____temp_3 = parent ~= UIParent
@@ -54,16 +54,18 @@ local ____exports = {}
54
54
  local ____Resources = require("datasources.Resources")
55
55
  local HP = ____Resources.HP
56
56
  local ____statusBarTextures = require("ui.decorations.statusBarTextures")
57
+ local applyStatusBarTexture = ____statusBarTextures.applyStatusBarTexture
57
58
  local resolveStatusBarTexture = ____statusBarTextures.resolveStatusBarTexture
58
59
  function ____exports.renderProgress(self, item, tree, onActiveChange)
59
60
  local props = item.cell.props
60
61
  local bar = item.frame
61
62
  local ____opt_0 = props.foreground
62
63
  local color = ____opt_0 and ____opt_0.color or props.color
63
- local ____bar_SetStatusBarTexture_5 = bar.SetStatusBarTexture
64
+ local ____applyStatusBarTexture_5 = applyStatusBarTexture
64
65
  local ____resolveStatusBarTexture_4 = resolveStatusBarTexture
65
66
  local ____opt_2 = props.foreground
66
- ____bar_SetStatusBarTexture_5(
67
+ ____applyStatusBarTexture_5(
68
+ nil,
67
69
  bar,
68
70
  ____resolveStatusBarTexture_4(nil, ____opt_2 and ____opt_2.texture or props.texture or "solid")
69
71
  )
@@ -107,7 +109,11 @@ function ____exports.renderProgress(self, item, tree, onActiveChange)
107
109
  layer:EnableMouse(false)
108
110
  layer:SetFrameLevel(bar:GetFrameLevel())
109
111
  layer:SetSize(item.width, item.height)
110
- layer:SetStatusBarTexture(resolveStatusBarTexture(nil, style.texture or "solid"))
112
+ applyStatusBarTexture(
113
+ nil,
114
+ layer,
115
+ resolveStatusBarTexture(nil, style.texture or "solid")
116
+ )
111
117
  local tint = style.color
112
118
  layer:SetStatusBarColor(tint.r, tint.g, tint.b, tint.a or 0.5)
113
119
  local texture = layer:GetStatusBarTexture()
@@ -156,7 +162,7 @@ function ____exports.renderProgress(self, item, tree, onActiveChange)
156
162
  end
157
163
  return layer
158
164
  end
159
- local ____opt_28 = source.HealPrediction
165
+ local ____opt_28 = source.Prediction
160
166
  if (____opt_28 and ____opt_28.IsAvailable) == true and props.healPrediction ~= false then
161
167
  local ____props_healPrediction_32 = props.healPrediction
162
168
  local ____opt_30 = props.healPrediction
@@ -166,7 +172,7 @@ function ____exports.renderProgress(self, item, tree, onActiveChange)
166
172
  true
167
173
  )
168
174
  end
169
- local ____opt_33 = source.AbsorbPrediction
175
+ local ____opt_33 = source.Absorb
170
176
  if (____opt_33 and ____opt_33.IsAvailable) == true and props.absorbPrediction ~= false then
171
177
  local ____props_absorbPrediction_37 = props.absorbPrediction
172
178
  local ____opt_35 = props.absorbPrediction
@@ -6,6 +6,9 @@ local ____secureButton = require("rendering.secureButton")
6
6
  local renderSecureButton = ____secureButton.renderSecureButton
7
7
  local ____progress = require("rendering.progress")
8
8
  local renderProgress = ____progress.renderProgress
9
+ local ____clientMedia = require("ui.media.clientMedia")
10
+ local resolveMediaPath = ____clientMedia.resolveMediaPath
11
+ local clientFonts = ____clientMedia.clientFonts
9
12
  function ____exports.createWidget(self, cell, parent)
10
13
  local frame = cell.kind == "progress" and CreateFrame("StatusBar", nil, parent) or (cell.kind == "secureButton" and createSecureButton(nil, parent, cell.props) or (cell.kind == "button" and CreateFrame("Button", nil, parent) or CreateFrame("Frame", nil, parent)))
11
14
  frame:Hide()
@@ -43,7 +46,11 @@ function ____exports.renderWidget(self, item, tree, updates, onActiveChange)
43
46
  local props = item.cell.props
44
47
  local label = item.frame:CreateFontString(nil, "OVERLAY")
45
48
  label:SetAllPoints(item.frame)
46
- label:SetFont(props.font or "Fonts\\FRIZQT__.TTF", props.fontSize or 12, "OUTLINE")
49
+ label:SetFont(
50
+ resolveMediaPath(nil, clientFonts, props.font or "friz"),
51
+ props.fontSize or 12,
52
+ "OUTLINE"
53
+ )
47
54
  label:SetJustifyH(props.align or "LEFT")
48
55
  label:SetJustifyV("MIDDLE")
49
56
  local color = props.color
package/lib/ui/Cell.d.ts CHANGED
@@ -2,7 +2,7 @@ import type { Element } from "./primitives/jsx";
2
2
  import type { Decorations } from "./decorations/Decorations";
3
3
  import type { Position } from "../types/Position";
4
4
  import type { Spacing } from "../types/Spacing";
5
- export type Size = number | "inherit";
5
+ export type Size = number | "inherit" | "fill";
6
6
  /** Common visual descriptor accepted by the mounting API. */
7
7
  export interface Cell extends Element {
8
8
  }
@@ -1,12 +1,24 @@
1
1
  import type { LayoutProps, ILayout } from "./Layout";
2
2
  import type { Element, Children } from "./primitives/jsx";
3
+ export type FlowDirection = "ltr" | "rtl" | "ttb" | "btt" | "horizontal" | "vertical" | "horizontalReverse" | "verticalReverse";
3
4
  export interface FlowOptions {
4
- direction: "horizontal" | "vertical";
5
- /** Wrap to another row (horizontal) or column (vertical) when full. */
5
+ /** ltr packs left to right. rtl packs right to left. ttb packs top to bottom. btt packs bottom to top. horizontal and vertical remain readable. */
6
+ direction: FlowDirection;
7
+ /** Wrap to another row or column when full. */
6
8
  grow?: boolean;
7
- /** Space between rows/columns; defaults to gap. */
9
+ /** Horizontal space between children. Falls back to gap or lineGap, depending on direction. */
10
+ columnGap?: number;
11
+ /** Vertical space between children. Falls back to gap or lineGap, depending on direction. */
12
+ rowGap?: number;
13
+ /** Older shared spacing, used when columnGap or rowGap is unset. */
14
+ gap?: number;
15
+ /** Older cross-axis spacing, used when the matching axis gap is unset. */
8
16
  lineGap?: number;
9
- /** Align each row/column along the flow direction. Defaults to start. */
17
+ /** Places the arranged lines on the horizontal axis. */
18
+ alignX?: "left" | "center" | "right";
19
+ /** Places the arranged lines on the vertical axis. */
20
+ alignY?: "top" | "center" | "bottom";
21
+ /** Older main-axis alignment, used when the matching axis position is unset. */
10
22
  justify?: "start" | "center" | "end";
11
23
  }
12
24
  export type FlowLayoutProps = LayoutProps & FlowOptions;
@@ -1,9 +1,18 @@
1
1
  import type { LayoutProps, ILayout } from "./Layout";
2
+ import type { FlowDirection } from "./FlowLayout";
2
3
  import type { Element, Children } from "./primitives/jsx";
3
4
  export interface GridOptions {
4
5
  columns: number;
5
- rowGap?: number;
6
+ /** ltr fills rows left to right. ttb fills columns top to bottom. Older horizontal and vertical values remain readable. */
7
+ direction?: FlowDirection;
8
+ /** Places the whole grid on the horizontal axis. */
9
+ alignX?: "left" | "center" | "right";
10
+ /** Places the whole grid on the vertical axis. */
11
+ alignY?: "top" | "center" | "bottom";
12
+ /** Horizontal space between columns. Falls back to gap. */
6
13
  columnGap?: number;
14
+ /** Vertical space between rows. Falls back to gap. */
15
+ rowGap?: number;
7
16
  /** Defaults to the maximum child width/height. Does not resize children. */
8
17
  cellWidth?: number;
9
18
  cellHeight?: number;