@quenty/avatareditorutils 7.39.1 → 7.40.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,12 @@
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
+ # [7.40.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/avatareditorutils@7.39.1...@quenty/avatareditorutils@7.40.0) (2026-07-14)
7
+
8
+ ### Features
9
+
10
+ - **avatareditorutils:** convert package to --!strict ([3c907b7](https://github.com/Quenty/NevermoreEngine/commit/3c907b74f87ae696f769b16acdac38ebc8d1dfc3))
11
+
6
12
  ## [7.39.1](https://github.com/Quenty/NevermoreEngine/compare/@quenty/avatareditorutils@7.39.0...@quenty/avatareditorutils@7.39.1) (2026-05-30)
7
13
 
8
14
  **Note:** Version bump only for package @quenty/avatareditorutils
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quenty/avatareditorutils",
3
- "version": "7.39.1",
3
+ "version": "7.40.0",
4
4
  "description": "Provides utility functions to work with the Roblox AvatarEditorService",
5
5
  "keywords": [
6
6
  "Roblox",
@@ -28,14 +28,14 @@
28
28
  "Quenty"
29
29
  ],
30
30
  "dependencies": {
31
- "@quenty/aggregator": "1.15.3",
31
+ "@quenty/aggregator": "1.16.0",
32
32
  "@quenty/baseobject": "10.13.0",
33
33
  "@quenty/brio": "14.30.1",
34
34
  "@quenty/enumutils": "3.4.6",
35
35
  "@quenty/loader": "10.11.0",
36
36
  "@quenty/maid": "3.9.0",
37
- "@quenty/memoize": "1.9.1",
38
- "@quenty/observablecollection": "12.38.1",
37
+ "@quenty/memoize": "1.10.0",
38
+ "@quenty/observablecollection": "12.39.0",
39
39
  "@quenty/pagesutils": "5.19.1",
40
40
  "@quenty/promise": "10.18.1",
41
41
  "@quenty/rx": "13.28.3",
@@ -46,5 +46,5 @@
46
46
  "publishConfig": {
47
47
  "access": "public"
48
48
  },
49
- "gitHead": "598b2b62b36bdcbdbbd56f7db10c399831cc6eba"
49
+ "gitHead": "13f0162f4971a77378e55e9b7236aea94f0dd3a8"
50
50
  }
@@ -1,4 +1,4 @@
1
- --!nonstrict
1
+ --!strict
2
2
  --[=[
3
3
  @class AvatarEditorInventoryServiceClient
4
4
  ]=]
@@ -24,11 +24,18 @@ export type AvatarEditorInventoryServiceClient = typeof(setmetatable(
24
24
  {} :: {
25
25
  _maid: Maid.Maid,
26
26
  _serviceBag: ServiceBag.ServiceBag,
27
+ _isAccessAllowed: ValueObject.ValueObject<boolean>,
28
+ _assetTypeToInventoryPromises: { [Enum.AvatarAssetType]: any },
29
+ _promiseInventoryPages: any,
30
+ _currentAccessPromise: any,
27
31
  },
28
32
  {} :: typeof({ __index = AvatarEditorInventoryServiceClient })
29
33
  ))
30
34
 
31
- function AvatarEditorInventoryServiceClient:Init(serviceBag: ServiceBag.ServiceBag)
35
+ function AvatarEditorInventoryServiceClient.Init(
36
+ self: AvatarEditorInventoryServiceClient,
37
+ serviceBag: ServiceBag.ServiceBag
38
+ ): ()
32
39
  assert(not self._serviceBag, "Already initialized")
33
40
  self._serviceBag = assert(serviceBag, "No serviceBag")
34
41
  self._maid = Maid.new()
@@ -42,25 +49,37 @@ function AvatarEditorInventoryServiceClient:Init(serviceBag: ServiceBag.ServiceB
42
49
  end
43
50
  end))
44
51
 
45
- self._promiseInventoryPages = MemorizeUtils.memoize(function(avatarAssetTypes)
46
- return AvatarEditorUtils.promiseInventoryPages(avatarAssetTypes):Then(function(catalogPages)
47
- -- Allow for replay
48
- return PagesProxy.new(catalogPages)
49
- end)
52
+ self._promiseInventoryPages = MemorizeUtils.memoize(function(avatarAssetTypes: { Enum.AvatarAssetType })
53
+ return (
54
+ AvatarEditorUtils.promiseInventoryPages(avatarAssetTypes):Then(function(catalogPages)
55
+ -- Allow for replay
56
+ return PagesProxy.new(catalogPages)
57
+ end)
58
+ ) :: any
50
59
  end)
51
60
  end
52
61
 
53
- function AvatarEditorInventoryServiceClient:PromiseInventoryPages(avatarAssetTypes: Enum.AvatarAssetType)
54
- return self:PromiseEnsureAccess()
55
- :Then(function()
56
- return self._promiseInventoryPages(avatarAssetTypes)
57
- end)
58
- :Then(function(pagesProxy)
59
- return pagesProxy:Clone()
60
- end)
62
+ function AvatarEditorInventoryServiceClient.PromiseInventoryPages(
63
+ self: AvatarEditorInventoryServiceClient,
64
+ avatarAssetTypes: Enum.AvatarAssetType
65
+ ): Promise.Promise<PagesProxy.PagesProxy>
66
+ return (
67
+ self:PromiseEnsureAccess()
68
+ :Then(function()
69
+ return self._promiseInventoryPages(avatarAssetTypes)
70
+ end)
71
+ :Then(function(pagesProxy)
72
+ return pagesProxy:Clone()
73
+ end)
74
+ ) :: any
61
75
  end
62
76
 
63
- function AvatarEditorInventoryServiceClient:PromiseInventoryForAvatarAssetType(avatarAssetType: Enum.AvatarAssetType)
77
+ function AvatarEditorInventoryServiceClient.PromiseInventoryForAvatarAssetType(
78
+ self: AvatarEditorInventoryServiceClient,
79
+ avatarAssetType: Enum.AvatarAssetType
80
+ ): Promise.Promise<
81
+ AvatarEditorInventory.AvatarEditorInventory
82
+ >
64
83
  assert(EnumUtils.isOfType(Enum.AvatarAssetType, avatarAssetType), "Bad avatarAssetType")
65
84
 
66
85
  if self._assetTypeToInventoryPromises[avatarAssetType] then
@@ -69,37 +88,43 @@ function AvatarEditorInventoryServiceClient:PromiseInventoryForAvatarAssetType(a
69
88
 
70
89
  local inventory = self._maid:Add(AvatarEditorInventory.new())
71
90
 
72
- self._assetTypeToInventoryPromises[avatarAssetType] = AvatarEditorUtils.promiseInventoryPages({
73
- avatarAssetType,
74
- })
75
- :Then(function(inventoryPages)
76
- return inventory:PromiseProcessPages(inventoryPages)
77
- end)
78
- :Then(function()
79
- return inventory
80
- end)
91
+ self._assetTypeToInventoryPromises[avatarAssetType] = (
92
+ AvatarEditorUtils.promiseInventoryPages({
93
+ avatarAssetType,
94
+ })
95
+ :Then(function(inventoryPages)
96
+ return inventory:PromiseProcessPages(inventoryPages)
97
+ end)
98
+ :Then(function()
99
+ return inventory
100
+ end)
101
+ ) :: any
81
102
 
82
103
  return self._assetTypeToInventoryPromises[avatarAssetType]
83
104
  end
84
105
 
85
- function AvatarEditorInventoryServiceClient:IsInventoryAccessAllowed(): boolean
106
+ function AvatarEditorInventoryServiceClient.IsInventoryAccessAllowed(self: AvatarEditorInventoryServiceClient): boolean
86
107
  return self._isAccessAllowed.Value
87
108
  end
88
109
 
89
- function AvatarEditorInventoryServiceClient:ObserveIsInventoryAccessAllowed()
110
+ function AvatarEditorInventoryServiceClient.ObserveIsInventoryAccessAllowed(
111
+ self: AvatarEditorInventoryServiceClient
112
+ ): any
90
113
  return self._isAccessAllowed:Observe()
91
114
  end
92
115
 
93
- function AvatarEditorInventoryServiceClient:PromiseEnsureAccess(): Promise.Promise<()>
116
+ function AvatarEditorInventoryServiceClient.PromiseEnsureAccess(
117
+ self: AvatarEditorInventoryServiceClient
118
+ ): Promise.Promise<()>
94
119
  if self._isAccessAllowed.Value then
95
- return Promise.resolved()
120
+ return (Promise :: any).resolved()
96
121
  end
97
122
 
98
123
  if self._currentAccessPromise and self._currentAccessPromise:IsPending() then
99
124
  return self._currentAccessPromise
100
125
  end
101
126
 
102
- local promise = self._maid:GivePromise(AvatarEditorUtils.promptAllowInventoryReadAccess())
127
+ local promise: any = self._maid:GivePromise(AvatarEditorUtils.promptAllowInventoryReadAccess())
103
128
 
104
129
  promise:Then(function(avatarPromptResult)
105
130
  if avatarPromptResult == Enum.AvatarPromptResult.Success then
@@ -109,10 +134,10 @@ function AvatarEditorInventoryServiceClient:PromiseEnsureAccess(): Promise.Promi
109
134
 
110
135
  self._currentAccessPromise = promise
111
136
 
112
- return self._currentAccessPromise
137
+ return promise
113
138
  end
114
139
 
115
- function AvatarEditorInventoryServiceClient:Destroy()
140
+ function AvatarEditorInventoryServiceClient.Destroy(self: AvatarEditorInventoryServiceClient): ()
116
141
  self._maid:DoCleaning()
117
142
  end
118
143
 
@@ -1,4 +1,4 @@
1
- --!nonstrict
1
+ --!strict
2
2
  --[=[
3
3
  @class CatalogSearchServiceCache
4
4
  ]=]
@@ -10,6 +10,7 @@ local AvatarEditorUtils = require("AvatarEditorUtils")
10
10
  local Maid = require("Maid")
11
11
  local MemorizeUtils = require("MemorizeUtils")
12
12
  local PagesProxy = require("PagesProxy")
13
+ local Promise = require("Promise")
13
14
  local ServiceBag = require("ServiceBag")
14
15
 
15
16
  local CatalogSearchServiceCache = {}
@@ -19,44 +20,56 @@ export type CatalogSearchServiceCache = typeof(setmetatable(
19
20
  {} :: {
20
21
  _maid: Maid.Maid,
21
22
  _serviceBag: ServiceBag.ServiceBag,
23
+ _promiseSearchCatalog: any,
24
+ _assetAggregator: Aggregator.Aggregator<{ AvatarEditorUtils.AvatarItemDetails }>,
25
+ _bundleAggregator: Aggregator.Aggregator<{ AvatarEditorUtils.AvatarItemDetails }>,
26
+ _avatarRulesPromise: Promise.Promise<AvatarEditorUtils.AvatarRules>?,
22
27
  },
23
28
  {} :: typeof({ __index = CatalogSearchServiceCache })
24
29
  ))
25
30
 
26
- function CatalogSearchServiceCache:Init(serviceBag: ServiceBag.ServiceBag)
27
- assert(not self._serviceBag, "Already initialized")
31
+ function CatalogSearchServiceCache.Init(self: CatalogSearchServiceCache, serviceBag: ServiceBag.ServiceBag): ()
32
+ assert(not (self :: any)._serviceBag, "Already initialized")
28
33
  self._serviceBag = assert(serviceBag, "No serviceBag")
29
34
  self._maid = Maid.new()
30
35
 
31
36
  -- TODO: If you scroll down long enough this leaks memory
32
- self._promiseSearchCatalog = MemorizeUtils.memoize(function(params)
37
+ self._promiseSearchCatalog = MemorizeUtils.memoize(function(params: CatalogSearchParams)
33
38
  return AvatarEditorUtils.promiseSearchCatalog(params):Then(function(catalogPages)
34
39
  return PagesProxy.new(catalogPages)
35
40
  end)
36
41
  end)
37
42
 
38
- self._assetAggregator = self._maid:Add(Aggregator.new("AvatarEditorUtils.promiseBatchItemDetails", function(itemIds)
39
- return AvatarEditorUtils.promiseBatchItemDetails(itemIds, Enum.AvatarItemType.Asset)
40
- end))
43
+ self._assetAggregator =
44
+ self._maid:Add(Aggregator.new("AvatarEditorUtils.promiseBatchItemDetails", function(itemIds: { number })
45
+ return AvatarEditorUtils.promiseBatchItemDetails(itemIds, Enum.AvatarItemType.Asset)
46
+ end))
41
47
  self._assetAggregator:SetMaxBatchSize(100)
42
48
 
43
49
  self._bundleAggregator =
44
- self._maid:Add(Aggregator.new("AvatarEditorUtils.promiseBatchItemDetails", function(itemIds)
50
+ self._maid:Add(Aggregator.new("AvatarEditorUtils.promiseBatchItemDetails", function(itemIds: { number })
45
51
  return AvatarEditorUtils.promiseBatchItemDetails(itemIds, Enum.AvatarItemType.Bundle)
46
52
  end))
47
53
  self._bundleAggregator:SetMaxBatchSize(100)
48
54
  end
49
55
 
50
- function CatalogSearchServiceCache:PromiseAvatarRules()
56
+ function CatalogSearchServiceCache.PromiseAvatarRules(
57
+ self: CatalogSearchServiceCache
58
+ ): Promise.Promise<AvatarEditorUtils.AvatarRules>
51
59
  if self._avatarRulesPromise then
52
60
  return self._avatarRulesPromise
53
61
  end
54
62
 
55
- self._avatarRulesPromise = AvatarEditorUtils.promiseAvatarRules()
56
- return self._avatarRulesPromise
63
+ local promise = AvatarEditorUtils.promiseAvatarRules() :: Promise.Promise<AvatarEditorUtils.AvatarRules>
64
+ self._avatarRulesPromise = promise
65
+ return promise
57
66
  end
58
67
 
59
- function CatalogSearchServiceCache:PromiseItemDetails(assetId, avatarItemType)
68
+ function CatalogSearchServiceCache.PromiseItemDetails(
69
+ self: CatalogSearchServiceCache,
70
+ assetId: number,
71
+ avatarItemType: Enum.AvatarItemType
72
+ ): Promise.Promise<{ AvatarEditorUtils.AvatarItemDetails }>
60
73
  if avatarItemType == Enum.AvatarItemType.Asset then
61
74
  return self._assetAggregator:Promise(assetId)
62
75
  elseif avatarItemType == Enum.AvatarItemType.Bundle then
@@ -66,13 +79,18 @@ function CatalogSearchServiceCache:PromiseItemDetails(assetId, avatarItemType)
66
79
  end
67
80
  end
68
81
 
69
- function CatalogSearchServiceCache:PromiseSearchCatalog(params)
70
- return self._promiseSearchCatalog(params):Then(function(pagesProxy)
71
- return pagesProxy:Clone()
72
- end)
82
+ function CatalogSearchServiceCache.PromiseSearchCatalog(
83
+ self: CatalogSearchServiceCache,
84
+ params: CatalogSearchParams
85
+ ): Promise.Promise<PagesProxy.PagesProxy>
86
+ return (self._promiseSearchCatalog :: any)(params):Then(
87
+ function(pagesProxy: PagesProxy.PagesProxy)
88
+ return pagesProxy:Clone()
89
+ end
90
+ ) :: Promise.Promise<PagesProxy.PagesProxy>
73
91
  end
74
92
 
75
- function CatalogSearchServiceCache:Destroy()
93
+ function CatalogSearchServiceCache.Destroy(self: CatalogSearchServiceCache): ()
76
94
  self._maid:DoCleaning()
77
95
  end
78
96