@quenty/bindtocloseservice 8.32.1 → 8.34.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.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,16 @@
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
+ # [8.34.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/bindtocloseservice@8.33.0...@quenty/bindtocloseservice@8.34.0) (2026-07-18)
7
+
8
+ **Note:** Version bump only for package @quenty/bindtocloseservice
9
+
10
+ # [8.33.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/bindtocloseservice@8.32.1...@quenty/bindtocloseservice@8.33.0) (2026-07-14)
11
+
12
+ ### Features
13
+
14
+ - **bindtocloseservice:** convert package to --!strict ([e90dffb](https://github.com/Quenty/NevermoreEngine/commit/e90dffb75f355e31c5a8d60e2994c8d5fd82249e))
15
+
6
16
  ## [8.32.1](https://github.com/Quenty/NevermoreEngine/compare/@quenty/bindtocloseservice@8.32.0...@quenty/bindtocloseservice@8.32.1) (2026-05-30)
7
17
 
8
18
  **Note:** Version bump only for package @quenty/bindtocloseservice
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quenty/bindtocloseservice",
3
- "version": "8.32.1",
3
+ "version": "8.34.0",
4
4
  "description": "Bind to game close API in a centralized location.",
5
5
  "keywords": [
6
6
  "Roblox",
@@ -32,13 +32,13 @@
32
32
  "dependencies": {
33
33
  "@quenty/loader": "10.11.0",
34
34
  "@quenty/maid": "3.9.0",
35
- "@quenty/promise": "10.18.1",
35
+ "@quenty/promise": "10.19.0",
36
36
  "@quenty/servicebag": "11.18.1",
37
37
  "@quenty/symbol": "3.5.2"
38
38
  },
39
39
  "devDependencies": {
40
- "@quenty/contentproviderutils": "12.31.1",
41
- "@quenty/playerthumbnailutils": "10.18.1"
40
+ "@quenty/contentproviderutils": "12.33.0",
41
+ "@quenty/playerthumbnailutils": "10.19.0"
42
42
  },
43
- "gitHead": "598b2b62b36bdcbdbbd56f7db10c399831cc6eba"
43
+ "gitHead": "cbbb89635bfdcbf32f26a40422ac736292917cca"
44
44
  }
@@ -1,4 +1,4 @@
1
- --!nonstrict
1
+ --!strict
2
2
  --[=[
3
3
  Allows unregisterable BindToClose callbacks. This is important because you can't unbind
4
4
  :BindToClose calls normally, so we need to provide another place to guarantee clean shutdowns.
@@ -19,15 +19,24 @@ local Symbol = require("Symbol")
19
19
  local BindToCloseService = {}
20
20
  BindToCloseService.ServiceName = "BindToCloseService"
21
21
 
22
- function BindToCloseService:Init(serviceBag: ServiceBag.ServiceBag)
23
- assert(not self._serviceBag, "Already initialized")
22
+ export type BindToCloseService = typeof(setmetatable(
23
+ {} :: {
24
+ _serviceBag: ServiceBag.ServiceBag,
25
+ _maid: Maid.Maid,
26
+ _subscriptions: { [Symbol.Symbol]: () -> Promise.Promise<any> },
27
+ },
28
+ {} :: typeof({ __index = BindToCloseService })
29
+ ))
30
+
31
+ function BindToCloseService.Init(self: BindToCloseService, serviceBag: ServiceBag.ServiceBag): ()
32
+ assert(not (self :: any)._serviceBag, "Already initialized")
24
33
  self._serviceBag = assert(serviceBag, "No serviceBag")
25
34
  self._maid = Maid.new()
26
35
 
27
36
  self._subscriptions = {}
28
37
  end
29
38
 
30
- function BindToCloseService:Start()
39
+ function BindToCloseService.Start(self: BindToCloseService): ()
31
40
  if RunService:IsServer() then
32
41
  game:BindToClose(function()
33
42
  local ok, err = self:_promiseClose():Yield()
@@ -46,13 +55,13 @@ function BindToCloseService:Start()
46
55
  end
47
56
  end
48
57
 
49
- function BindToCloseService:_promiseClose()
50
- local promises = {}
58
+ function BindToCloseService._promiseClose(self: BindToCloseService): Promise.Promise<any>
59
+ local promises: { Promise.Promise<any> } = {}
51
60
 
52
61
  for _, caller in self._subscriptions do
53
62
  local promise = caller()
54
63
  if Promise.isPromise(promise) then
55
- table.insert(promises, promise)
64
+ table.insert(promises, promise :: any)
56
65
  else
57
66
  warn("[BindToCloseService.BindToClose] - Bad promise returned from close callback.")
58
67
  end
@@ -67,7 +76,10 @@ end
67
76
  @param saveCallback function
68
77
  @return function -- Call to unregister callback
69
78
  ]=]
70
- function BindToCloseService:RegisterPromiseOnCloseCallback(saveCallback: () -> ())
79
+ function BindToCloseService.RegisterPromiseOnCloseCallback(
80
+ self: BindToCloseService,
81
+ saveCallback: () -> Promise.Promise<any>
82
+ ): () -> ()
71
83
  assert(type(saveCallback) == "function", "Bad saveCallback")
72
84
 
73
85
  local id = Symbol.named("savingCallbackId")
@@ -79,7 +91,7 @@ function BindToCloseService:RegisterPromiseOnCloseCallback(saveCallback: () -> (
79
91
  end
80
92
  end
81
93
 
82
- function BindToCloseService:Destroy()
94
+ function BindToCloseService.Destroy(self: BindToCloseService): ()
83
95
  self._maid:DoCleaning()
84
96
  end
85
97