wuira 0.1.3 → 0.1.5
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 +50 -0
- package/README.md +181 -0
- package/lib/Spells.d.ts +10 -0
- package/lib/Spells.lua +19 -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/ProgressSource.d.ts +6 -2
- package/lib/datasources/ProgressSource.lua +20 -2
- package/lib/datasources/Resources.d.ts +21 -2
- package/lib/datasources/Resources.lua +473 -0
- package/lib/datasources/SpellCooldown.d.ts +10 -0
- package/lib/datasources/SpellCooldown.lua +207 -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 +18 -0
- package/lib/datasources/TimerSource.lua +284 -0
- package/lib/datasources/index.d.ts +9 -1
- package/lib/datasources/index.lua +27 -0
- package/lib/index.d.ts +5 -0
- package/lib/index.lua +13 -0
- package/lib/platform/BlizzardUI.d.ts +12 -0
- package/lib/platform/BlizzardUI.lua +352 -0
- package/lib/platform/forever.d.ts +40 -2
- package/lib/store/index.d.ts +37 -0
- package/lib/store/index.lua +921 -0
- package/lib/ui/Cell.d.ts +3 -1
- package/lib/ui/Icon.d.ts +8 -0
- package/lib/ui/Icon.lua +8 -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/index.d.ts +4 -0
- package/lib/ui/index.lua +8 -0
- package/lib/ui/layout/measureLayout.lua +8 -1
- package/lib/ui/mount.lua +267 -45
- package/lib/ui/primitives/jsx.d.ts +7 -2
- package/package.json +8 -1
- package/tools/build-library.mjs +1 -1
|
@@ -0,0 +1,352 @@
|
|
|
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 function __TS__ArrayPush(self, ...)
|
|
11
|
+
local items = {...}
|
|
12
|
+
local len = #self
|
|
13
|
+
for i = 1, #items do
|
|
14
|
+
len = len + 1
|
|
15
|
+
self[len] = items[i]
|
|
16
|
+
end
|
|
17
|
+
return len
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
local __TS__Symbol, Symbol
|
|
21
|
+
do
|
|
22
|
+
local symbolMetatable = {__tostring = function(self)
|
|
23
|
+
return ("Symbol(" .. (self.description or "")) .. ")"
|
|
24
|
+
end}
|
|
25
|
+
function __TS__Symbol(description)
|
|
26
|
+
return setmetatable({description = description}, symbolMetatable)
|
|
27
|
+
end
|
|
28
|
+
Symbol = {
|
|
29
|
+
asyncDispose = __TS__Symbol("Symbol.asyncDispose"),
|
|
30
|
+
dispose = __TS__Symbol("Symbol.dispose"),
|
|
31
|
+
iterator = __TS__Symbol("Symbol.iterator"),
|
|
32
|
+
hasInstance = __TS__Symbol("Symbol.hasInstance"),
|
|
33
|
+
species = __TS__Symbol("Symbol.species"),
|
|
34
|
+
toStringTag = __TS__Symbol("Symbol.toStringTag")
|
|
35
|
+
}
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
local __TS__Iterator
|
|
39
|
+
do
|
|
40
|
+
local function iteratorGeneratorStep(self)
|
|
41
|
+
local co = self.____coroutine
|
|
42
|
+
local status, value = coroutine.resume(co)
|
|
43
|
+
if not status then
|
|
44
|
+
error(value, 0)
|
|
45
|
+
end
|
|
46
|
+
if coroutine.status(co) == "dead" then
|
|
47
|
+
return
|
|
48
|
+
end
|
|
49
|
+
return true, value
|
|
50
|
+
end
|
|
51
|
+
local function iteratorIteratorStep(self)
|
|
52
|
+
local result = self:next()
|
|
53
|
+
if result.done then
|
|
54
|
+
return
|
|
55
|
+
end
|
|
56
|
+
return true, result.value
|
|
57
|
+
end
|
|
58
|
+
local function iteratorStringStep(self, index)
|
|
59
|
+
index = index + 1
|
|
60
|
+
if index > #self then
|
|
61
|
+
return
|
|
62
|
+
end
|
|
63
|
+
return index, string.sub(self, index, index)
|
|
64
|
+
end
|
|
65
|
+
function __TS__Iterator(iterable)
|
|
66
|
+
if type(iterable) == "string" then
|
|
67
|
+
return iteratorStringStep, iterable, 0
|
|
68
|
+
elseif iterable.____coroutine ~= nil then
|
|
69
|
+
return iteratorGeneratorStep, iterable
|
|
70
|
+
elseif iterable[Symbol.iterator] then
|
|
71
|
+
local iterator = iterable[Symbol.iterator](iterable)
|
|
72
|
+
return iteratorIteratorStep, iterator
|
|
73
|
+
else
|
|
74
|
+
return ipairs(iterable)
|
|
75
|
+
end
|
|
76
|
+
end
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
local Map
|
|
80
|
+
do
|
|
81
|
+
Map = __TS__Class()
|
|
82
|
+
Map.name = "Map"
|
|
83
|
+
function Map.prototype.____constructor(self, entries)
|
|
84
|
+
self[Symbol.toStringTag] = "Map"
|
|
85
|
+
self.items = {}
|
|
86
|
+
self.size = 0
|
|
87
|
+
self.nextKey = {}
|
|
88
|
+
self.previousKey = {}
|
|
89
|
+
if entries == nil then
|
|
90
|
+
return
|
|
91
|
+
end
|
|
92
|
+
local iterable = entries
|
|
93
|
+
if iterable[Symbol.iterator] then
|
|
94
|
+
local iterator = iterable[Symbol.iterator](iterable)
|
|
95
|
+
while true do
|
|
96
|
+
local result = iterator:next()
|
|
97
|
+
if result.done then
|
|
98
|
+
break
|
|
99
|
+
end
|
|
100
|
+
local value = result.value
|
|
101
|
+
self:set(value[1], value[2])
|
|
102
|
+
end
|
|
103
|
+
else
|
|
104
|
+
local array = entries
|
|
105
|
+
for ____, kvp in ipairs(array) do
|
|
106
|
+
self:set(kvp[1], kvp[2])
|
|
107
|
+
end
|
|
108
|
+
end
|
|
109
|
+
end
|
|
110
|
+
function Map.prototype.clear(self)
|
|
111
|
+
self.items = {}
|
|
112
|
+
self.nextKey = {}
|
|
113
|
+
self.previousKey = {}
|
|
114
|
+
self.firstKey = nil
|
|
115
|
+
self.lastKey = nil
|
|
116
|
+
self.size = 0
|
|
117
|
+
end
|
|
118
|
+
function Map.prototype.delete(self, key)
|
|
119
|
+
local contains = self:has(key)
|
|
120
|
+
if contains then
|
|
121
|
+
self.size = self.size - 1
|
|
122
|
+
local next = self.nextKey[key]
|
|
123
|
+
local previous = self.previousKey[key]
|
|
124
|
+
if next ~= nil and previous ~= nil then
|
|
125
|
+
self.nextKey[previous] = next
|
|
126
|
+
self.previousKey[next] = previous
|
|
127
|
+
elseif next ~= nil then
|
|
128
|
+
self.firstKey = next
|
|
129
|
+
self.previousKey[next] = nil
|
|
130
|
+
elseif previous ~= nil then
|
|
131
|
+
self.lastKey = previous
|
|
132
|
+
self.nextKey[previous] = nil
|
|
133
|
+
else
|
|
134
|
+
self.firstKey = nil
|
|
135
|
+
self.lastKey = nil
|
|
136
|
+
end
|
|
137
|
+
self.nextKey[key] = nil
|
|
138
|
+
self.previousKey[key] = nil
|
|
139
|
+
end
|
|
140
|
+
self.items[key] = nil
|
|
141
|
+
return contains
|
|
142
|
+
end
|
|
143
|
+
function Map.prototype.forEach(self, callback)
|
|
144
|
+
for ____, key in __TS__Iterator(self:keys()) do
|
|
145
|
+
callback(nil, self.items[key], key, self)
|
|
146
|
+
end
|
|
147
|
+
end
|
|
148
|
+
function Map.prototype.get(self, key)
|
|
149
|
+
return self.items[key]
|
|
150
|
+
end
|
|
151
|
+
function Map.prototype.has(self, key)
|
|
152
|
+
return self.nextKey[key] ~= nil or self.lastKey == key
|
|
153
|
+
end
|
|
154
|
+
function Map.prototype.set(self, key, value)
|
|
155
|
+
local isNewValue = not self:has(key)
|
|
156
|
+
if isNewValue then
|
|
157
|
+
self.size = self.size + 1
|
|
158
|
+
end
|
|
159
|
+
self.items[key] = value
|
|
160
|
+
if self.firstKey == nil then
|
|
161
|
+
self.firstKey = key
|
|
162
|
+
self.lastKey = key
|
|
163
|
+
elseif isNewValue then
|
|
164
|
+
self.nextKey[self.lastKey] = key
|
|
165
|
+
self.previousKey[key] = self.lastKey
|
|
166
|
+
self.lastKey = key
|
|
167
|
+
end
|
|
168
|
+
return self
|
|
169
|
+
end
|
|
170
|
+
Map.prototype[Symbol.iterator] = function(self)
|
|
171
|
+
return self:entries()
|
|
172
|
+
end
|
|
173
|
+
function Map.prototype.entries(self)
|
|
174
|
+
local function getFirstKey()
|
|
175
|
+
return self.firstKey
|
|
176
|
+
end
|
|
177
|
+
local items = self.items
|
|
178
|
+
local nextKey = self.nextKey
|
|
179
|
+
local key
|
|
180
|
+
local started = false
|
|
181
|
+
return {
|
|
182
|
+
[Symbol.iterator] = function(self)
|
|
183
|
+
return self
|
|
184
|
+
end,
|
|
185
|
+
next = function(self)
|
|
186
|
+
if not started then
|
|
187
|
+
started = true
|
|
188
|
+
key = getFirstKey(nil)
|
|
189
|
+
else
|
|
190
|
+
key = nextKey[key]
|
|
191
|
+
end
|
|
192
|
+
return {done = not key, value = {key, items[key]}}
|
|
193
|
+
end
|
|
194
|
+
}
|
|
195
|
+
end
|
|
196
|
+
function Map.prototype.keys(self)
|
|
197
|
+
local function getFirstKey()
|
|
198
|
+
return self.firstKey
|
|
199
|
+
end
|
|
200
|
+
local nextKey = self.nextKey
|
|
201
|
+
local key
|
|
202
|
+
local started = false
|
|
203
|
+
return {
|
|
204
|
+
[Symbol.iterator] = function(self)
|
|
205
|
+
return self
|
|
206
|
+
end,
|
|
207
|
+
next = function(self)
|
|
208
|
+
if not started then
|
|
209
|
+
started = true
|
|
210
|
+
key = getFirstKey(nil)
|
|
211
|
+
else
|
|
212
|
+
key = nextKey[key]
|
|
213
|
+
end
|
|
214
|
+
return {done = not key, value = key}
|
|
215
|
+
end
|
|
216
|
+
}
|
|
217
|
+
end
|
|
218
|
+
function Map.prototype.values(self)
|
|
219
|
+
local function getFirstKey()
|
|
220
|
+
return self.firstKey
|
|
221
|
+
end
|
|
222
|
+
local items = self.items
|
|
223
|
+
local nextKey = self.nextKey
|
|
224
|
+
local key
|
|
225
|
+
local started = false
|
|
226
|
+
return {
|
|
227
|
+
[Symbol.iterator] = function(self)
|
|
228
|
+
return self
|
|
229
|
+
end,
|
|
230
|
+
next = function(self)
|
|
231
|
+
if not started then
|
|
232
|
+
started = true
|
|
233
|
+
key = getFirstKey(nil)
|
|
234
|
+
else
|
|
235
|
+
key = nextKey[key]
|
|
236
|
+
end
|
|
237
|
+
return {done = not key, value = items[key]}
|
|
238
|
+
end
|
|
239
|
+
}
|
|
240
|
+
end
|
|
241
|
+
Map[Symbol.species] = Map
|
|
242
|
+
end
|
|
243
|
+
|
|
244
|
+
local function __TS__New(target, ...)
|
|
245
|
+
local instance = setmetatable({}, target.prototype)
|
|
246
|
+
instance:____constructor(...)
|
|
247
|
+
return instance
|
|
248
|
+
end
|
|
249
|
+
-- End of Lua Library inline imports
|
|
250
|
+
local ____exports = {}
|
|
251
|
+
--- Opt-in stock UI visibility. Native buttons, bindings and event handlers remain intact.
|
|
252
|
+
____exports.BlizzardUI = __TS__Class()
|
|
253
|
+
local BlizzardUI = ____exports.BlizzardUI
|
|
254
|
+
BlizzardUI.name = "BlizzardUI"
|
|
255
|
+
function BlizzardUI.prototype.____constructor(self)
|
|
256
|
+
end
|
|
257
|
+
function BlizzardUI.Hide(self, options)
|
|
258
|
+
local names = {}
|
|
259
|
+
if options.actionBars then
|
|
260
|
+
__TS__ArrayPush(
|
|
261
|
+
names,
|
|
262
|
+
"MainActionBar",
|
|
263
|
+
"MainMenuBar",
|
|
264
|
+
"MultiBarBottomLeft",
|
|
265
|
+
"MultiBarBottomRight",
|
|
266
|
+
"MultiBarRight",
|
|
267
|
+
"MultiBarLeft",
|
|
268
|
+
"MultiBar5",
|
|
269
|
+
"MultiBar6",
|
|
270
|
+
"MultiBar7",
|
|
271
|
+
"StanceBar",
|
|
272
|
+
"PetActionBar"
|
|
273
|
+
)
|
|
274
|
+
end
|
|
275
|
+
if options.player then
|
|
276
|
+
names[#names + 1] = "PlayerFrame"
|
|
277
|
+
end
|
|
278
|
+
if options.target then
|
|
279
|
+
names[#names + 1] = "TargetFrame"
|
|
280
|
+
end
|
|
281
|
+
if options.focus then
|
|
282
|
+
names[#names + 1] = "FocusFrame"
|
|
283
|
+
end
|
|
284
|
+
local hidden = CreateFrame("Frame", nil, UIParent)
|
|
285
|
+
hidden:SetAllPoints(UIParent)
|
|
286
|
+
hidden:Hide()
|
|
287
|
+
local listener = CreateFrame("Frame", nil, UIParent)
|
|
288
|
+
local parents = __TS__New(Map)
|
|
289
|
+
local enabled = true
|
|
290
|
+
local function apply()
|
|
291
|
+
if InCombatLockdown() then
|
|
292
|
+
return
|
|
293
|
+
end
|
|
294
|
+
if not enabled then
|
|
295
|
+
for ____, ____value in __TS__Iterator(parents) do
|
|
296
|
+
local frame = ____value[1]
|
|
297
|
+
local parent = ____value[2]
|
|
298
|
+
if frame:GetParent() == hidden then
|
|
299
|
+
frame:SetParent(parent)
|
|
300
|
+
end
|
|
301
|
+
end
|
|
302
|
+
parents:clear()
|
|
303
|
+
listener:UnregisterAllEvents()
|
|
304
|
+
listener:SetScript("OnEvent", nil)
|
|
305
|
+
listener:Hide()
|
|
306
|
+
return
|
|
307
|
+
end
|
|
308
|
+
for ____, name in ipairs(names) do
|
|
309
|
+
do
|
|
310
|
+
local __continue14
|
|
311
|
+
repeat
|
|
312
|
+
local frame = _G[name]
|
|
313
|
+
if frame == nil then
|
|
314
|
+
__continue14 = true
|
|
315
|
+
break
|
|
316
|
+
end
|
|
317
|
+
if not parents:has(frame) then
|
|
318
|
+
parents:set(
|
|
319
|
+
frame,
|
|
320
|
+
frame:GetParent()
|
|
321
|
+
)
|
|
322
|
+
frame:HookScript(
|
|
323
|
+
"OnShow",
|
|
324
|
+
function()
|
|
325
|
+
if enabled and not InCombatLockdown() and frame:GetParent() ~= hidden then
|
|
326
|
+
frame:SetParent(hidden)
|
|
327
|
+
end
|
|
328
|
+
end
|
|
329
|
+
)
|
|
330
|
+
end
|
|
331
|
+
if frame:GetParent() ~= hidden then
|
|
332
|
+
frame:SetParent(hidden)
|
|
333
|
+
end
|
|
334
|
+
__continue14 = true
|
|
335
|
+
until true
|
|
336
|
+
if not __continue14 then
|
|
337
|
+
break
|
|
338
|
+
end
|
|
339
|
+
end
|
|
340
|
+
end
|
|
341
|
+
end
|
|
342
|
+
listener:RegisterEvent("PLAYER_REGEN_ENABLED")
|
|
343
|
+
listener:RegisterEvent("PLAYER_ENTERING_WORLD")
|
|
344
|
+
listener:RegisterEvent("ADDON_LOADED")
|
|
345
|
+
listener:SetScript("OnEvent", apply)
|
|
346
|
+
apply(nil)
|
|
347
|
+
return function()
|
|
348
|
+
enabled = false
|
|
349
|
+
apply(nil)
|
|
350
|
+
end
|
|
351
|
+
end
|
|
352
|
+
return ____exports
|
|
@@ -5,7 +5,7 @@ type wuiraDrawLayer = "BACKGROUND" | "OVERLAY";
|
|
|
5
5
|
interface wuiraNativeTexture {
|
|
6
6
|
SetAllPoints(frame: wuiraNativeFrame): void;
|
|
7
7
|
SetColorTexture(red: number, green: number, blue: number, alpha: number): void;
|
|
8
|
-
SetTexture(path: string): void;
|
|
8
|
+
SetTexture(path: string | number | undefined): void;
|
|
9
9
|
SetVertexColor(red: number, green: number, blue: number, alpha: number): void;
|
|
10
10
|
SetBlendMode(mode: import("../types/Texture").BlendMode): void;
|
|
11
11
|
SetHorizTile(enabled: boolean): void;
|
|
@@ -20,14 +20,19 @@ interface wuiraNativeTexture {
|
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
interface wuiraNativeFrame {
|
|
23
|
+
SetClipsChildren(clips: boolean): void;
|
|
24
|
+
GetFrameLevel(): number;
|
|
25
|
+
SetFrameLevel(level: number): void;
|
|
26
|
+
CreateFontString(name: undefined, layer: "OVERLAY"): wuiraNativeFontString;
|
|
23
27
|
EnableMouse(enabled: boolean): void;
|
|
24
28
|
RegisterEvent(event: string): void;
|
|
25
29
|
UnregisterAllEvents(): void;
|
|
26
30
|
SetScript(script: "OnEvent", handler: ((this: void, frame: wuiraNativeFrame, event: string, unit?: string) => void) | undefined): void;
|
|
31
|
+
SetScript(script: "OnUpdate", handler: ((this: void, frame: wuiraNativeFrame, elapsed: number) => void) | undefined): void;
|
|
27
32
|
GetWidth(): number;
|
|
28
33
|
GetHeight(): number;
|
|
29
34
|
SetSize(width: number, height: number): void;
|
|
30
|
-
SetPoint(point: wuiraAnchor, relativeTo: wuiraNativeFrame, relativePoint: wuiraAnchor, x: number, y: number): void;
|
|
35
|
+
SetPoint(point: wuiraAnchor, relativeTo: wuiraNativeFrame | wuiraNativeTexture, relativePoint: wuiraAnchor, x: number, y: number): void;
|
|
31
36
|
CreateTexture(name: undefined, layer: wuiraDrawLayer): wuiraNativeTexture;
|
|
32
37
|
Show(): void;
|
|
33
38
|
Hide(): void;
|
|
@@ -38,6 +43,15 @@ interface wuiraNativeFrame {
|
|
|
38
43
|
SetBackdropBorderColor(red: number, green: number, blue: number, alpha: number): void;
|
|
39
44
|
}
|
|
40
45
|
|
|
46
|
+
interface wuiraNativeFontString {
|
|
47
|
+
SetAllPoints(frame: wuiraNativeFrame): void;
|
|
48
|
+
SetFont(path: string, size: number, flags?: string): boolean;
|
|
49
|
+
SetText(text: string): void;
|
|
50
|
+
SetTextColor(r: number, g: number, b: number, a: number): void;
|
|
51
|
+
SetJustifyH(align: "LEFT" | "CENTER" | "RIGHT"): void;
|
|
52
|
+
SetJustifyV(align: "MIDDLE"): void;
|
|
53
|
+
}
|
|
54
|
+
|
|
41
55
|
declare const UIParent: wuiraNativeFrame;
|
|
42
56
|
interface wuiraNativeStatusBar extends wuiraNativeFrame {
|
|
43
57
|
GetStatusBarTexture(): wuiraNativeTexture;
|
|
@@ -55,8 +69,32 @@ declare function error(this: void, message: string): never;
|
|
|
55
69
|
declare function issecretvalue(this: void, value: unknown): boolean;
|
|
56
70
|
declare function UnitHealth(this: void, unit: string): number;
|
|
57
71
|
declare function UnitHealthMax(this: void, unit: string): number;
|
|
72
|
+
declare const UnitGetIncomingHeals: ((this: void, unit: string) => number | undefined) | undefined;
|
|
73
|
+
declare const UnitGetTotalAbsorbs: ((this: void, unit: string) => number | undefined) | undefined;
|
|
58
74
|
declare function UnitPower(this: void, unit: string, powerType: number): number;
|
|
59
75
|
declare function UnitPowerMax(this: void, unit: string, powerType: number): number;
|
|
60
76
|
declare const CurveConstants: { readonly ScaleTo100: unknown };
|
|
61
77
|
declare function UnitHealthPercent(this: void, unit: string, predicted: boolean, curve: unknown): number;
|
|
62
78
|
declare function UnitPowerPercent(this: void, unit: string, powerType: number, predicted: boolean, curve: unknown): number;
|
|
79
|
+
|
|
80
|
+
interface wuiraNativeAuraData {
|
|
81
|
+
name?: string;
|
|
82
|
+
icon?: number;
|
|
83
|
+
auraInstanceID?: number;
|
|
84
|
+
duration?: number;
|
|
85
|
+
expirationTime?: number;
|
|
86
|
+
}
|
|
87
|
+
declare const C_UnitAuras: {
|
|
88
|
+
GetAuraDataBySpellName?: (this: void, unit: string, name: string, filter: string) => wuiraNativeAuraData | undefined;
|
|
89
|
+
GetAuraDuration?: (this: void, unit: string, id: number) => import("../datasources/TimerSource").NativeDuration | undefined;
|
|
90
|
+
} | undefined;
|
|
91
|
+
declare const C_Spell: {
|
|
92
|
+
GetSpellName?: (this: void, id: number) => string | undefined;
|
|
93
|
+
GetSpellCooldownDuration?: (this: void, id: number) => import("../datasources/TimerSource").NativeDuration | undefined;
|
|
94
|
+
} | undefined;
|
|
95
|
+
declare const C_DurationUtil: {
|
|
96
|
+
CreateDuration(this: void): import("../datasources/TimerSource").NativeDuration & {
|
|
97
|
+
SetTimeFromStart(start: number, duration: number): void;
|
|
98
|
+
};
|
|
99
|
+
} | undefined;
|
|
100
|
+
declare const C_Secrets: { ShouldAurasBeSecret?: (this: void) => boolean } | undefined;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/// <reference path="../platform/forever.d.ts" />
|
|
2
|
+
/** Extend with data fields and defaults. A stable static Token opts into persistence. */
|
|
3
|
+
export declare abstract class Store {
|
|
4
|
+
}
|
|
5
|
+
export interface StoreClass<T extends Store> {
|
|
6
|
+
new (): T;
|
|
7
|
+
readonly Token?: string;
|
|
8
|
+
}
|
|
9
|
+
export type ReadonlyData<T> = T extends object ? {
|
|
10
|
+
readonly [K in keyof T]: ReadonlyData<T[K]>;
|
|
11
|
+
} : T;
|
|
12
|
+
export interface SavedStoreOptions {
|
|
13
|
+
addon: string;
|
|
14
|
+
variable: string;
|
|
15
|
+
}
|
|
16
|
+
export declare class StoreRegistry {
|
|
17
|
+
private readonly options?;
|
|
18
|
+
private readonly memory;
|
|
19
|
+
private readonly observers;
|
|
20
|
+
private readonly tokens;
|
|
21
|
+
private readonly updating;
|
|
22
|
+
private saved?;
|
|
23
|
+
private listener?;
|
|
24
|
+
private readyCallbacks;
|
|
25
|
+
constructor(options?: SavedStoreOptions | undefined);
|
|
26
|
+
private Load;
|
|
27
|
+
get IsReady(): boolean;
|
|
28
|
+
onReady(callback: () => void): void;
|
|
29
|
+
private Read;
|
|
30
|
+
/** One-time detached snapshot, with no subscription or mutable access to stored data. */
|
|
31
|
+
get<T extends Store>(schema: StoreClass<T>): ReadonlyData<T>;
|
|
32
|
+
/** Commit only after the updater succeeds; observers receive detached snapshots. */
|
|
33
|
+
set<T extends Store>(schema: StoreClass<T>, update: (settings: T) => T): void;
|
|
34
|
+
/** Observe future commits. Call get() separately for the initial snapshot. */
|
|
35
|
+
subscribe<T extends Store>(schema: StoreClass<T>, observer: (settings: ReadonlyData<T>) => void): () => void;
|
|
36
|
+
Dispose(): void;
|
|
37
|
+
}
|