wuira 0.3.2 → 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 (64) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/README.md +27 -9
  3. package/docs/source-converters.md +6 -6
  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/NativeNumberSource.d.ts +1 -1
  8. package/lib/datasources/NativeNumberSource.lua +16 -1
  9. package/lib/datasources/ProgressSource.lua +5 -9
  10. package/lib/datasources/Source.d.ts +18 -0
  11. package/lib/datasources/Source.lua +300 -0
  12. package/lib/datasources/SourceConverter.d.ts +1 -1
  13. package/lib/datasources/SourceConverter.lua +10 -1
  14. package/lib/datasources/TextureSource.d.ts +1 -1
  15. package/lib/datasources/TextureSource.lua +16 -1
  16. package/lib/datasources/TimerSource.d.ts +1 -1
  17. package/lib/datasources/TimerSource.lua +16 -1
  18. package/lib/datasources/UseSource.d.ts +49 -0
  19. package/lib/datasources/UseSource.lua +9 -0
  20. package/lib/datasources/index.d.ts +5 -25
  21. package/lib/datasources/index.lua +49 -69
  22. package/lib/helpers/Auras.d.ts +5 -0
  23. package/lib/helpers/Auras.lua +47 -0
  24. package/lib/helpers/Range.d.ts +2 -0
  25. package/lib/helpers/Range.lua +30 -0
  26. package/lib/helpers/index.d.ts +2 -0
  27. package/lib/helpers/index.lua +12 -0
  28. package/lib/index.d.ts +1 -0
  29. package/lib/index.lua +6 -0
  30. package/lib/platform/forever.d.ts +3 -0
  31. package/lib/rendering/progress.lua +5 -150
  32. package/lib/ui/UnitPortrait.d.ts +1 -2
  33. package/lib/ui/UnitPortrait.lua +11 -18
  34. package/package.json +8 -1
  35. package/lib/datasources/AuraTimer.d.ts +0 -21
  36. package/lib/datasources/AuraTimer.lua +0 -322
  37. package/lib/datasources/Auras.d.ts +0 -32
  38. package/lib/datasources/Auras.lua +0 -284
  39. package/lib/datasources/CastTimer.d.ts +0 -9
  40. package/lib/datasources/CastTimer.lua +0 -240
  41. package/lib/datasources/EditModeLayouts.d.ts +0 -33
  42. package/lib/datasources/EditModeLayouts.lua +0 -689
  43. package/lib/datasources/GroupMembers.d.ts +0 -24
  44. package/lib/datasources/GroupMembers.lua +0 -454
  45. package/lib/datasources/GroupRoster.d.ts +0 -28
  46. package/lib/datasources/GroupRoster.lua +0 -611
  47. package/lib/datasources/KnownSpells.d.ts +0 -33
  48. package/lib/datasources/KnownSpells.lua +0 -1068
  49. package/lib/datasources/ManaRegenTimer.d.ts +0 -29
  50. package/lib/datasources/ManaRegenTimer.lua +0 -674
  51. package/lib/datasources/Resources.d.ts +0 -60
  52. package/lib/datasources/Resources.lua +0 -824
  53. package/lib/datasources/SpellCooldown.d.ts +0 -12
  54. package/lib/datasources/SpellCooldown.lua +0 -218
  55. package/lib/datasources/SpellSource.d.ts +0 -14
  56. package/lib/datasources/SpellSource.lua +0 -224
  57. package/lib/datasources/SwingTimer.d.ts +0 -31
  58. package/lib/datasources/SwingTimer.lua +0 -641
  59. package/lib/datasources/TotemTimer.d.ts +0 -10
  60. package/lib/datasources/TotemTimer.lua +0 -260
  61. package/lib/datasources/UnitInfo.d.ts +0 -51
  62. package/lib/datasources/UnitInfo.lua +0 -783
  63. package/lib/datasources/UnitSource.d.ts +0 -38
  64. package/lib/datasources/UnitSource.lua +0 -602
@@ -2,6 +2,6 @@ import { DataSource } from "./DataSource";
2
2
  /** Read-only API value; no cached assignment or game-state mutation. */
3
3
  export declare class NativeNumberSource extends DataSource<number> {
4
4
  private readonly read;
5
- constructor(read: () => number);
5
+ protected constructor(read: () => number);
6
6
  protected GetValue(): number;
7
7
  }
@@ -31,10 +31,18 @@ local function __TS__ClassExtends(target, base)
31
31
  target.prototype.__tostring = base.prototype.__tostring
32
32
  end
33
33
  end
34
+
35
+ local function __TS__New(target, ...)
36
+ local instance = setmetatable({}, target.prototype)
37
+ instance:____constructor(...)
38
+ return instance
39
+ end
34
40
  -- End of Lua Library inline imports
35
41
  local ____exports = {}
36
42
  local ____DataSource = require("datasources.DataSource")
37
43
  local DataSource = ____DataSource.DataSource
44
+ local ____Source = require("datasources.Source")
45
+ local registerSource = ____Source.registerSource
38
46
  --- Read-only API value; no cached assignment or game-state mutation.
39
47
  ____exports.NativeNumberSource = __TS__Class()
40
48
  local NativeNumberSource = ____exports.NativeNumberSource
@@ -46,5 +54,12 @@ function NativeNumberSource.prototype.____constructor(self, read)
46
54
  end
47
55
  function NativeNumberSource.prototype.GetValue(self)
48
56
  return self:read()
49
- end
57
+ end;
58
+ (function(self)
59
+ registerSource(
60
+ nil,
61
+ ____exports.NativeNumberSource,
62
+ function(____, props) return __TS__New(____exports.NativeNumberSource, props[1]) end
63
+ )
64
+ end)(NativeNumberSource)
50
65
  return ____exports
@@ -31,18 +31,14 @@ local function __TS__ClassExtends(target, base)
31
31
  target.prototype.__tostring = base.prototype.__tostring
32
32
  end
33
33
  end
34
-
35
- local function __TS__New(target, ...)
36
- local instance = setmetatable({}, target.prototype)
37
- instance:____constructor(...)
38
- return instance
39
- end
40
34
  -- End of Lua Library inline imports
41
35
  local ____exports = {}
42
36
  local ____DataSource = require("datasources.DataSource")
43
37
  local DataSource = ____DataSource.DataSource
44
38
  local ____NativeNumberSource = require("datasources.NativeNumberSource")
45
39
  local NativeNumberSource = ____NativeNumberSource.NativeNumberSource
40
+ local ____UseSource = require("datasources.UseSource")
41
+ local UseSource = ____UseSource.UseSource
46
42
  --- Shared contract for health, power, cooldowns, and other progress values.
47
43
  ____exports.ProgressSource = __TS__Class()
48
44
  local ProgressSource = ____exports.ProgressSource
@@ -51,9 +47,9 @@ __TS__ClassExtends(ProgressSource, DataSource)
51
47
  function ProgressSource.prototype.____constructor(self, readers)
52
48
  DataSource.prototype.____constructor(self, 0)
53
49
  self.readers = readers
54
- self.Min = __TS__New(NativeNumberSource, readers.min)
55
- self.Max = __TS__New(NativeNumberSource, readers.max)
56
- self.Percent = __TS__New(NativeNumberSource, readers.percent)
50
+ self.Min = UseSource(nil, NativeNumberSource, readers.min)
51
+ self.Max = UseSource(nil, NativeNumberSource, readers.max)
52
+ self.Percent = UseSource(nil, NativeNumberSource, readers.percent)
57
53
  end
58
54
  function ProgressSource.prototype.GetValue(self)
59
55
  return self.readers:current()
@@ -0,0 +1,18 @@
1
+ import { DataSource } from "./DataSource";
2
+ /** Lets a protected constructor stay closed while UseSource can still open it. */
3
+ export declare function registerSource(ctor: Function, open: (props: readonly unknown[]) => unknown): boolean;
4
+ export declare function openSource(ctor: Function, props: readonly unknown[]): unknown;
5
+ /** Opens a registered source. Public call sites use the typed overloads in UseSource.ts. */
6
+ export declare function UseSource<T>(source: {
7
+ prototype: T;
8
+ }, ...props: unknown[]): T;
9
+ /**
10
+ * One query. Construction stores the props; every read passes those same props back in.
11
+ * The source value is the reading.
12
+ */
13
+ export declare abstract class Source<TReading, TProps extends readonly unknown[] = []> extends DataSource<TReading> {
14
+ protected readonly props: TProps;
15
+ protected constructor(initial: TReading, ...props: TProps);
16
+ protected abstract read(props: TProps): TReading;
17
+ protected GetValue(): TReading;
18
+ }
@@ -0,0 +1,300 @@
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 __TS__Symbol, Symbol
11
+ do
12
+ local symbolMetatable = {__tostring = function(self)
13
+ return ("Symbol(" .. (self.description or "")) .. ")"
14
+ end}
15
+ function __TS__Symbol(description)
16
+ return setmetatable({description = description}, symbolMetatable)
17
+ end
18
+ Symbol = {
19
+ asyncDispose = __TS__Symbol("Symbol.asyncDispose"),
20
+ dispose = __TS__Symbol("Symbol.dispose"),
21
+ iterator = __TS__Symbol("Symbol.iterator"),
22
+ hasInstance = __TS__Symbol("Symbol.hasInstance"),
23
+ species = __TS__Symbol("Symbol.species"),
24
+ toStringTag = __TS__Symbol("Symbol.toStringTag")
25
+ }
26
+ end
27
+
28
+ local __TS__Iterator
29
+ do
30
+ local function iteratorGeneratorStep(self)
31
+ local co = self.____coroutine
32
+ local status, value = coroutine.resume(co)
33
+ if not status then
34
+ error(value, 0)
35
+ end
36
+ if coroutine.status(co) == "dead" then
37
+ return
38
+ end
39
+ return true, value
40
+ end
41
+ local function iteratorIteratorStep(self)
42
+ local result = self:next()
43
+ if result.done then
44
+ return
45
+ end
46
+ return true, result.value
47
+ end
48
+ local function iteratorStringStep(self, index)
49
+ index = index + 1
50
+ if index > #self then
51
+ return
52
+ end
53
+ return index, string.sub(self, index, index)
54
+ end
55
+ function __TS__Iterator(iterable)
56
+ if type(iterable) == "string" then
57
+ return iteratorStringStep, iterable, 0
58
+ elseif iterable.____coroutine ~= nil then
59
+ return iteratorGeneratorStep, iterable
60
+ elseif iterable[Symbol.iterator] then
61
+ local iterator = iterable[Symbol.iterator](iterable)
62
+ return iteratorIteratorStep, iterator
63
+ else
64
+ return ipairs(iterable)
65
+ end
66
+ end
67
+ end
68
+
69
+ local Map
70
+ do
71
+ Map = __TS__Class()
72
+ Map.name = "Map"
73
+ function Map.prototype.____constructor(self, entries)
74
+ self[Symbol.toStringTag] = "Map"
75
+ self.items = {}
76
+ self.size = 0
77
+ self.nextKey = {}
78
+ self.previousKey = {}
79
+ if entries == nil then
80
+ return
81
+ end
82
+ local iterable = entries
83
+ if iterable[Symbol.iterator] then
84
+ local iterator = iterable[Symbol.iterator](iterable)
85
+ while true do
86
+ local result = iterator:next()
87
+ if result.done then
88
+ break
89
+ end
90
+ local value = result.value
91
+ self:set(value[1], value[2])
92
+ end
93
+ else
94
+ local array = entries
95
+ for ____, kvp in ipairs(array) do
96
+ self:set(kvp[1], kvp[2])
97
+ end
98
+ end
99
+ end
100
+ function Map.prototype.clear(self)
101
+ self.items = {}
102
+ self.nextKey = {}
103
+ self.previousKey = {}
104
+ self.firstKey = nil
105
+ self.lastKey = nil
106
+ self.size = 0
107
+ end
108
+ function Map.prototype.delete(self, key)
109
+ local contains = self:has(key)
110
+ if contains then
111
+ self.size = self.size - 1
112
+ local next = self.nextKey[key]
113
+ local previous = self.previousKey[key]
114
+ if next ~= nil and previous ~= nil then
115
+ self.nextKey[previous] = next
116
+ self.previousKey[next] = previous
117
+ elseif next ~= nil then
118
+ self.firstKey = next
119
+ self.previousKey[next] = nil
120
+ elseif previous ~= nil then
121
+ self.lastKey = previous
122
+ self.nextKey[previous] = nil
123
+ else
124
+ self.firstKey = nil
125
+ self.lastKey = nil
126
+ end
127
+ self.nextKey[key] = nil
128
+ self.previousKey[key] = nil
129
+ end
130
+ self.items[key] = nil
131
+ return contains
132
+ end
133
+ function Map.prototype.forEach(self, callback)
134
+ for ____, key in __TS__Iterator(self:keys()) do
135
+ callback(nil, self.items[key], key, self)
136
+ end
137
+ end
138
+ function Map.prototype.get(self, key)
139
+ return self.items[key]
140
+ end
141
+ function Map.prototype.has(self, key)
142
+ return self.nextKey[key] ~= nil or self.lastKey == key
143
+ end
144
+ function Map.prototype.set(self, key, value)
145
+ local isNewValue = not self:has(key)
146
+ if isNewValue then
147
+ self.size = self.size + 1
148
+ end
149
+ self.items[key] = value
150
+ if self.firstKey == nil then
151
+ self.firstKey = key
152
+ self.lastKey = key
153
+ elseif isNewValue then
154
+ self.nextKey[self.lastKey] = key
155
+ self.previousKey[key] = self.lastKey
156
+ self.lastKey = key
157
+ end
158
+ return self
159
+ end
160
+ Map.prototype[Symbol.iterator] = function(self)
161
+ return self:entries()
162
+ end
163
+ function Map.prototype.entries(self)
164
+ local function getFirstKey()
165
+ return self.firstKey
166
+ end
167
+ local items = self.items
168
+ local nextKey = self.nextKey
169
+ local key
170
+ local started = false
171
+ return {
172
+ [Symbol.iterator] = function(self)
173
+ return self
174
+ end,
175
+ next = function(self)
176
+ if not started then
177
+ started = true
178
+ key = getFirstKey(nil)
179
+ else
180
+ key = nextKey[key]
181
+ end
182
+ return {done = not key, value = {key, items[key]}}
183
+ end
184
+ }
185
+ end
186
+ function Map.prototype.keys(self)
187
+ local function getFirstKey()
188
+ return self.firstKey
189
+ end
190
+ local nextKey = self.nextKey
191
+ local key
192
+ local started = false
193
+ return {
194
+ [Symbol.iterator] = function(self)
195
+ return self
196
+ end,
197
+ next = function(self)
198
+ if not started then
199
+ started = true
200
+ key = getFirstKey(nil)
201
+ else
202
+ key = nextKey[key]
203
+ end
204
+ return {done = not key, value = key}
205
+ end
206
+ }
207
+ end
208
+ function Map.prototype.values(self)
209
+ local function getFirstKey()
210
+ return self.firstKey
211
+ end
212
+ local items = self.items
213
+ local nextKey = self.nextKey
214
+ local key
215
+ local started = false
216
+ return {
217
+ [Symbol.iterator] = function(self)
218
+ return self
219
+ end,
220
+ next = function(self)
221
+ if not started then
222
+ started = true
223
+ key = getFirstKey(nil)
224
+ else
225
+ key = nextKey[key]
226
+ end
227
+ return {done = not key, value = items[key]}
228
+ end
229
+ }
230
+ end
231
+ Map[Symbol.species] = Map
232
+ end
233
+
234
+ local function __TS__New(target, ...)
235
+ local instance = setmetatable({}, target.prototype)
236
+ instance:____constructor(...)
237
+ return instance
238
+ end
239
+
240
+ local function __TS__ClassExtends(target, base)
241
+ target.____super = base
242
+ local staticMetatable = setmetatable({__index = base}, base)
243
+ setmetatable(target, staticMetatable)
244
+ local baseMetatable = getmetatable(base)
245
+ if baseMetatable then
246
+ if type(baseMetatable.__index) == "function" then
247
+ staticMetatable.__index = baseMetatable.__index
248
+ end
249
+ if type(baseMetatable.__newindex) == "function" then
250
+ staticMetatable.__newindex = baseMetatable.__newindex
251
+ end
252
+ end
253
+ setmetatable(target.prototype, base.prototype)
254
+ if type(base.prototype.__index) == "function" then
255
+ target.prototype.__index = base.prototype.__index
256
+ end
257
+ if type(base.prototype.__newindex) == "function" then
258
+ target.prototype.__newindex = base.prototype.__newindex
259
+ end
260
+ if type(base.prototype.__tostring) == "function" then
261
+ target.prototype.__tostring = base.prototype.__tostring
262
+ end
263
+ end
264
+ -- End of Lua Library inline imports
265
+ local ____exports = {}
266
+ local ____DataSource = require("datasources.DataSource")
267
+ local DataSource = ____DataSource.DataSource
268
+ local openers = __TS__New(Map)
269
+ --- Lets a protected constructor stay closed while UseSource can still open it.
270
+ function ____exports.registerSource(self, ctor, open)
271
+ openers:set(ctor, open)
272
+ return true
273
+ end
274
+ function ____exports.openSource(self, ctor, props)
275
+ local open = openers:get(ctor)
276
+ if open == nil then
277
+ error("UseSource: this source is not registered")
278
+ end
279
+ return open(nil, props)
280
+ end
281
+ --- Opens a registered source. Public call sites use the typed overloads in UseSource.ts.
282
+ function ____exports.UseSource(self, source, ...)
283
+ local props = {...}
284
+ return ____exports.openSource(nil, source, props)
285
+ end
286
+ --- One query. Construction stores the props; every read passes those same props back in.
287
+ -- The source value is the reading.
288
+ ____exports.Source = __TS__Class()
289
+ local Source = ____exports.Source
290
+ Source.name = "Source"
291
+ __TS__ClassExtends(Source, DataSource)
292
+ function Source.prototype.____constructor(self, initial, ...)
293
+ local props = {...}
294
+ DataSource.prototype.____constructor(self, initial)
295
+ self.props = props
296
+ end
297
+ function Source.prototype.GetValue(self)
298
+ return self:read(self.props)
299
+ end
300
+ return ____exports
@@ -17,7 +17,7 @@ export declare class SourceConverter<TInput, TOutput> extends DataSource<TOutput
17
17
  private blocked;
18
18
  private previous?;
19
19
  private readable;
20
- constructor(input: ValueSource<TInput>, convert: (value: TInput) => TOutput);
20
+ protected constructor(input: ValueSource<TInput>, convert: (value: TInput) => TOutput);
21
21
  protected GetValue(): TOutput;
22
22
  private Convert;
23
23
  protected HasSecretFields(value: TOutput): boolean;
@@ -323,6 +323,8 @@ end
323
323
  local ____exports = {}
324
324
  local ____DataSource = require("datasources.DataSource")
325
325
  local DataSource = ____DataSource.DataSource
326
+ local ____Source = require("datasources.Source")
327
+ local registerSource = ____Source.registerSource
326
328
  local function restricted(self, value, seen, depth)
327
329
  if seen == nil then
328
330
  seen = __TS__New(Set)
@@ -471,5 +473,12 @@ function SourceConverter.prototype.Dispose(self)
471
473
  end
472
474
  self.stop = nil
473
475
  self.listeners:clear()
474
- end
476
+ end;
477
+ (function(self)
478
+ registerSource(
479
+ nil,
480
+ ____exports.SourceConverter,
481
+ function(____, props) return __TS__New(____exports.SourceConverter, props[1], props[2]) end
482
+ )
483
+ end)(SourceConverter)
475
484
  return ____exports
@@ -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",
@@ -0,0 +1,49 @@
1
+ import type { NativeDuration, TimerSource } from "./TimerSource";
2
+ import type { TextureSource } from "./TextureSource";
3
+ import type { SourceConverter, ValueSource } from "./SourceConverter";
4
+ import type { NativeNumberSource } from "./NativeNumberSource";
5
+ import type { GetAuraDataByIndex, GetAuraDataBySpellName, GetAuraDuration, GetLayouts, GetNumGroupMembers, GetNumSpellBookSkillLines, GetNumSpecializationsForClassID, GetNumSpellTabs, GetNumTotemSlots, GetRaidRosterInfo, GetSpecializationInfo, GetSpellBookItemInfo, GetSpellBookSkillLineInfo, GetSpellCooldownDuration, GetSpellName, GetSpellPowerCost, GetSpellTabInfo, GetSpellTexture, GetTotemDuration, GetTotemInfo, IsInRaid, IsSpellPassive, UnitCastingDuration, UnitCastingInfo, UnitChannelDuration, UnitChannelInfo, UnitClass, UnitExists, UnitFullName, UnitGUID, UnitGetIncomingHeals, UnitGetTotalAbsorbs, UnitHealth, UnitHealthMax, UnitHealthPercent, UnitIsPlayer, UnitIsUnit, UnitPower, UnitPowerMax, UnitPowerPercent } from "./NativeApi";
6
+ export declare function UseSource(source: typeof GetNumGroupMembers): GetNumGroupMembers;
7
+ export declare function UseSource(source: typeof IsInRaid): IsInRaid;
8
+ export declare function UseSource(source: typeof UnitGUID, unit: string): UnitGUID;
9
+ export declare function UseSource(source: typeof UnitFullName, unit: string): UnitFullName;
10
+ export declare function UseSource(source: typeof UnitExists, unit: string): UnitExists;
11
+ export declare function UseSource(source: typeof GetRaidRosterInfo, index: number): GetRaidRosterInfo;
12
+ export declare function UseSource(source: typeof GetAuraDataByIndex, unit: string, index: number, filter: string): GetAuraDataByIndex;
13
+ export declare function UseSource(source: typeof GetAuraDataBySpellName, unit: string, name: string, filter: string): GetAuraDataBySpellName;
14
+ export declare function UseSource(source: typeof UnitHealth, unit: string): UnitHealth;
15
+ export declare function UseSource(source: typeof UnitHealthMax, unit: string): UnitHealthMax;
16
+ export declare function UseSource(source: typeof UnitPower, unit: string, powerType: number): UnitPower;
17
+ export declare function UseSource(source: typeof UnitPowerMax, unit: string, powerType: number): UnitPowerMax;
18
+ export declare function UseSource(source: typeof UnitGetTotalAbsorbs, unit: string): UnitGetTotalAbsorbs;
19
+ export declare function UseSource(source: typeof UnitGetIncomingHeals, unit: string): UnitGetIncomingHeals;
20
+ export declare function UseSource(source: typeof UnitClass, unit: string): UnitClass;
21
+ export declare function UseSource(source: typeof UnitIsPlayer, unit: string): UnitIsPlayer;
22
+ export declare function UseSource(source: typeof UnitIsUnit, first: string, second: string): UnitIsUnit;
23
+ export declare function UseSource(source: typeof GetSpellName, spellId: number | string): GetSpellName;
24
+ export declare function UseSource(source: typeof GetSpellTexture, spellId: number | string): GetSpellTexture;
25
+ export declare function UseSource(source: typeof GetSpellCooldownDuration, spellId: number | string, ignoreGCD?: boolean): GetSpellCooldownDuration;
26
+ export declare function UseSource(source: typeof IsSpellPassive, spellId: number | string): IsSpellPassive;
27
+ export declare function UseSource(source: typeof GetTotemInfo, slot: number): GetTotemInfo;
28
+ export declare function UseSource(source: typeof GetNumTotemSlots): GetNumTotemSlots;
29
+ export declare function UseSource(source: typeof GetLayouts): GetLayouts;
30
+ export declare function UseSource(source: typeof GetNumSpecializationsForClassID, classId: number): GetNumSpecializationsForClassID;
31
+ export declare function UseSource(source: typeof GetSpecializationInfo, index: number, inspect?: boolean, pet?: boolean, unit?: string, sex?: number, group?: number, classId?: number): GetSpecializationInfo;
32
+ export declare function UseSource(source: typeof GetNumSpellBookSkillLines): GetNumSpellBookSkillLines;
33
+ export declare function UseSource(source: typeof GetSpellBookItemInfo, slot: number, bank: number): GetSpellBookItemInfo;
34
+ export declare function UseSource(source: typeof UnitHealthPercent, unit: string, predicted: boolean, curve: unknown): UnitHealthPercent;
35
+ export declare function UseSource(source: typeof UnitPowerPercent, unit: string, powerType: number, predicted: boolean, curve: unknown): UnitPowerPercent;
36
+ export declare function UseSource(source: typeof UnitCastingDuration, unit: string): UnitCastingDuration;
37
+ export declare function UseSource(source: typeof UnitChannelDuration, unit: string): UnitChannelDuration;
38
+ export declare function UseSource(source: typeof UnitCastingInfo, unit: string): UnitCastingInfo;
39
+ export declare function UseSource(source: typeof UnitChannelInfo, unit: string): UnitChannelInfo;
40
+ export declare function UseSource(source: typeof GetTotemDuration, slot: number): GetTotemDuration;
41
+ export declare function UseSource(source: typeof GetNumSpellTabs): GetNumSpellTabs;
42
+ export declare function UseSource(source: typeof GetSpellTabInfo, tab: number): GetSpellTabInfo;
43
+ export declare function UseSource(source: typeof GetAuraDuration, unit: string, spellId: number): GetAuraDuration;
44
+ export declare function UseSource(source: typeof GetSpellPowerCost, spellId: number): GetSpellPowerCost;
45
+ export declare function UseSource(source: typeof GetSpellBookSkillLineInfo, line: number): GetSpellBookSkillLineInfo;
46
+ export declare function UseSource(source: typeof TimerSource, read: () => NativeDuration | undefined, events: readonly string[], unit?: string): TimerSource;
47
+ export declare function UseSource(source: typeof TextureSource, read: () => string | number | undefined, events: readonly string[], unit?: string): TextureSource;
48
+ export declare function UseSource<TInput, TOutput>(source: typeof SourceConverter, input: ValueSource<TInput>, convert: (value: TInput) => TOutput): SourceConverter<TInput, TOutput>;
49
+ 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
@@ -3,32 +3,12 @@ export { DataSource } from "./DataSource";
3
3
  export type { ReadResult } from "./DataSource";
4
4
  export { SourceConverter } from "./SourceConverter";
5
5
  export type { ValueSource } from "./SourceConverter";
6
- export { EditModeLayouts } from "./EditModeLayouts";
7
- export type { EditModeLayout, EditModeLayoutSnapshot, EditModeLayoutsStatus } from "./EditModeLayouts";
8
6
  export { ProgressSource } from "./ProgressSource";
9
- export { HP, Mana, Unit, DataSources, HealthPrediction } from "./Resources";
10
- export { Aura, AuraSource, Buffs, Debuffs } from "./Auras";
11
- export type { AuraSourceStatus } from "./Auras";
12
- export { GroupMembers, PartyMembers, RaidMembers } from "./GroupMembers";
13
- export type { GroupScope } from "./GroupMembers";
14
- export { GroupRoster, getPetUnitToken } from "./GroupRoster";
15
- export type { GroupRosterMember } from "./GroupRoster";
16
- export { ClassSource, SpecSource, Specializations } from "./UnitInfo";
17
- export type { ClassInfo, SpecializationInfo, InspectStatus } from "./UnitInfo";
18
- export { UnitSource, resolveUnit } from "./UnitSource";
19
- export type { UnitInput, UnitIdentity } from "./UnitSource";
20
- export { SwingTimer, SwingHand } from "./SwingTimer";
7
+ export { Source } from "./Source";
8
+ export { UseSource } from "./UseSource";
21
9
  export { TimerSource } from "./TimerSource";
22
- export { TotemTimer } from "./TotemTimer";
23
- export type { TotemTimerStatus } from "./TotemTimer";
24
10
  export type { NativeDuration } from "./TimerSource";
25
11
  export { TextureSource } from "./TextureSource";
26
- export { CastTimer } from "./CastTimer";
27
- export { AuraTimer } from "./AuraTimer";
28
- export type { AuraTimerOptions, AuraTimerStatus } from "./AuraTimer";
29
- export { SpellCooldown, GlobalCooldown } from "./SpellCooldown";
30
- export { SpellSource } from "./SpellSource";
31
- export { KnownSpells } from "./KnownSpells";
32
- export type { KnownSpellsStatus, KnownSpell } from "./KnownSpells";
33
- export { ManaRegenTimer } from "./ManaRegenTimer";
34
- export type { ManaRegenPhase } from "./ManaRegenTimer";
12
+ export { NativeNumberSource } from "./NativeNumberSource";
13
+ export { GetAuraDataByIndex, GetAuraDataBySpellName, GetAuraDuration, GetLayouts, GetNumGroupMembers, GetNumSpellBookSkillLines, GetNumSpecializationsForClassID, GetNumSpellTabs, GetNumTotemSlots, GetRaidRosterInfo, GetSpecializationInfo, GetSpellBookItemInfo, GetSpellBookSkillLineInfo, GetSpellCooldownDuration, GetSpellName, GetSpellPowerCost, GetSpellTabInfo, GetSpellTexture, GetTotemDuration, GetTotemInfo, IsInRaid, IsSpellPassive, UnitCastingDuration, UnitCastingInfo, UnitChannelDuration, UnitChannelInfo, UnitClass, UnitExists, UnitFullName, UnitGUID, UnitGetIncomingHeals, UnitGetTotalAbsorbs, UnitHealth, UnitHealthMax, UnitHealthPercent, UnitIsPlayer, UnitIsUnit, UnitPower, UnitPowerMax, UnitPowerPercent, } from "./NativeApi";
14
+ export type { AuraData, CastInfo, ChannelInfo, EditModeLayoutList, EditModeLayoutRow, NativeDurationHandle, RaidRosterInfo, SpecializationRow, SpellBookSkillLine, SpellCooldownDuration, SpellPowerCost, SpellTabInfo, TotemInfo, UnitClassInfo, UnitName } from "./NativeApi";