@quenty/coreguienabler 12.18.2 → 12.18.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.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,14 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [12.18.3](https://github.com/Quenty/NevermoreEngine/compare/@quenty/coreguienabler@12.18.2...@quenty/coreguienabler@12.18.3) (2025-04-10)
7
+
8
+ **Note:** Version bump only for package @quenty/coreguienabler
9
+
10
+
11
+
12
+
13
+
6
14
  ## [12.18.2](https://github.com/Quenty/NevermoreEngine/compare/@quenty/coreguienabler@12.18.0...@quenty/coreguienabler@12.18.2) (2025-04-07)
7
15
 
8
16
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quenty/coreguienabler",
3
- "version": "12.18.2",
3
+ "version": "12.18.3",
4
4
  "description": "Key based CoreGuiEnabler, singleton Use this class to load/unload CoreGuis / other GUIs, by disabling based upon keys Keys are additive, so if you have more than 1 disabled, it's ok.",
5
5
  "keywords": [
6
6
  "Roblox",
@@ -24,14 +24,14 @@
24
24
  "Quenty"
25
25
  ],
26
26
  "dependencies": {
27
- "@quenty/characterutils": "^12.18.2",
28
- "@quenty/loader": "^10.8.2",
29
- "@quenty/maid": "^3.4.2",
30
- "@quenty/rx": "^13.17.2",
27
+ "@quenty/characterutils": "^12.18.3",
28
+ "@quenty/loader": "^10.8.3",
29
+ "@quenty/maid": "^3.4.3",
30
+ "@quenty/rx": "^13.17.3",
31
31
  "@quenty/symbol": "^3.4.2"
32
32
  },
33
33
  "publishConfig": {
34
34
  "access": "public"
35
35
  },
36
- "gitHead": "64def70499ec067077ee39f279936b620b217847"
36
+ "gitHead": "b06c070ae91d5dab7bd8de6e290ad2caabb15d8f"
37
37
  }
@@ -1,10 +1,10 @@
1
+ --!strict
1
2
  --[=[
2
3
  Key based CoreGuiEnabler, singleton
3
4
  Use this class to load/unload CoreGuis / other GUIs, by disabling based upon keys
4
5
  Keys are additive, so if you have more than 1 disabled, it's ok.
5
6
 
6
7
  ```lua
7
-
8
8
  local CoreGuiEnabler = require("CoreGuiEnabler")
9
9
 
10
10
  -- Disable the backpack for 5 seconds
@@ -35,13 +35,22 @@ local CoreGuiEnabler = {}
35
35
  CoreGuiEnabler.__index = CoreGuiEnabler
36
36
  CoreGuiEnabler.ClassName = "CoreGuiEnabler"
37
37
 
38
- function CoreGuiEnabler.new()
39
- local self = setmetatable({}, CoreGuiEnabler)
38
+ export type CoreGuiEnabler = typeof(setmetatable(
39
+ {} :: {
40
+ _maid: Maid.Maid,
41
+ _states: { [any]: { lastState: boolean, onChangeCallback: (boolean) -> (), disabledBy: { [any]: any } } },
42
+ _stateSubs: ObservableSubscriptionTable.ObservableSubscriptionTable<boolean>,
43
+ },
44
+ {} :: typeof({ __index = CoreGuiEnabler })
45
+ ))
46
+
47
+ function CoreGuiEnabler.new(): CoreGuiEnabler
48
+ local self: CoreGuiEnabler = setmetatable({} :: any, CoreGuiEnabler)
40
49
 
41
50
  self._maid = Maid.new()
42
51
  self._states = {}
43
52
 
44
- self._stateSubs = self._maid:Add(ObservableSubscriptionTable.new())
53
+ self._stateSubs = self._maid:Add(ObservableSubscriptionTable.new() :: any)
45
54
 
46
55
  self:AddState(Enum.CoreGuiType.Backpack, function(isEnabled)
47
56
  StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, isEnabled)
@@ -136,12 +145,11 @@ function CoreGuiEnabler:ObserveIsEnabled(coreGuiState)
136
145
  error(string.format("[CoreGuiEnabler] - State '%s' does not exist.", tostring(coreGuiState)))
137
146
  end
138
147
 
139
- return self._stateSubs:Observe(coreGuiState)
140
- :Pipe({
141
- Rx.startFrom(function()
142
- return { self:IsEnabled(coreGuiState) }
143
- end)
144
- })
148
+ return self._stateSubs:Observe(coreGuiState):Pipe({
149
+ Rx.startFrom(function()
150
+ return { self:IsEnabled(coreGuiState) }
151
+ end),
152
+ })
145
153
  end
146
154
 
147
155
  --[=[
@@ -154,9 +162,9 @@ function CoreGuiEnabler:AddState(coreGuiState, onChangeCallback)
154
162
  assert(self._states[coreGuiState] == nil, "state already exists")
155
163
 
156
164
  self._states[coreGuiState] = {
157
- lastState = true;
158
- onChangeCallback = onChangeCallback;
159
- disabledBy = {};
165
+ lastState = true,
166
+ onChangeCallback = onChangeCallback,
167
+ disabledBy = {},
160
168
  }
161
169
  end
162
170
 
@@ -225,4 +233,4 @@ function CoreGuiEnabler:Enable(key, coreGuiState)
225
233
  self:_setDisabledByKey(coreGuiState, key, nil)
226
234
  end
227
235
 
228
- return CoreGuiEnabler.new()
236
+ return CoreGuiEnabler.new()