@quenty/avatareditorutils 7.20.0 → 7.20.1

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,17 @@
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.20.1](https://github.com/Quenty/NevermoreEngine/compare/@quenty/avatareditorutils@7.20.0...@quenty/avatareditorutils@7.20.1) (2025-04-05)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * Add types to packages ([2374fb2](https://github.com/Quenty/NevermoreEngine/commit/2374fb2b043cfbe0e9b507b3316eec46a4e353a0))
12
+
13
+
14
+
15
+
16
+
6
17
  # [7.20.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/avatareditorutils@7.19.4...@quenty/avatareditorutils@7.20.0) (2025-04-02)
7
18
 
8
19
  **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.20.0",
3
+ "version": "7.20.1",
4
4
  "description": "Provides utility functions to work with the Roblox AvatarEditorService",
5
5
  "keywords": [
6
6
  "Roblox",
@@ -25,22 +25,22 @@
25
25
  "Quenty"
26
26
  ],
27
27
  "dependencies": {
28
- "@quenty/aggregator": "^1.4.0",
29
- "@quenty/brio": "^14.17.0",
30
- "@quenty/enumutils": "^3.4.0",
31
- "@quenty/loader": "^10.8.0",
32
- "@quenty/maid": "^3.4.0",
33
- "@quenty/memoize": "^1.6.0",
34
- "@quenty/observablecollection": "^12.20.0",
35
- "@quenty/pagesutils": "^5.11.1",
36
- "@quenty/promise": "^10.10.1",
37
- "@quenty/rx": "^13.17.0",
38
- "@quenty/servicebag": "^11.11.1",
39
- "@quenty/symbol": "^3.4.0",
40
- "@quenty/valueobject": "^13.17.0"
28
+ "@quenty/aggregator": "^1.4.1",
29
+ "@quenty/brio": "^14.17.1",
30
+ "@quenty/enumutils": "^3.4.1",
31
+ "@quenty/loader": "^10.8.1",
32
+ "@quenty/maid": "^3.4.1",
33
+ "@quenty/memoize": "^1.6.1",
34
+ "@quenty/observablecollection": "^12.20.1",
35
+ "@quenty/pagesutils": "^5.11.2",
36
+ "@quenty/promise": "^10.10.2",
37
+ "@quenty/rx": "^13.17.1",
38
+ "@quenty/servicebag": "^11.11.2",
39
+ "@quenty/symbol": "^3.4.1",
40
+ "@quenty/valueobject": "^13.17.1"
41
41
  },
42
42
  "publishConfig": {
43
43
  "access": "public"
44
44
  },
45
- "gitHead": "e8ea56930e65322fcffc05a1556d5df988068f0b"
45
+ "gitHead": "78c3ac0ab08dd18085b6e6e6e4f745e76ed99f68"
46
46
  }
@@ -22,11 +22,11 @@ function AvatarEditorInventory.new()
22
22
  return self
23
23
  end
24
24
 
25
- function AvatarEditorInventory:PromiseProcessPages(inventoryPages)
25
+ function AvatarEditorInventory:PromiseProcessPages(inventoryPages: Pages)
26
26
  return Promise.spawn(function(resolve, reject)
27
27
  local pageData = inventoryPages:GetCurrentPage()
28
28
  while pageData do
29
- for _, data in pairs(pageData) do
29
+ for _, data in pageData do
30
30
  self._assetIdToAsset:Set(data.AssetId, data)
31
31
  end
32
32
 
@@ -42,15 +42,15 @@ function AvatarEditorInventory:PromiseProcessPages(inventoryPages)
42
42
  end
43
43
  end
44
44
 
45
- resolve()
45
+ return resolve()
46
46
  end)
47
47
  end
48
48
 
49
- function AvatarEditorInventory:IsAssetIdInInventory(assetId)
49
+ function AvatarEditorInventory:IsAssetIdInInventory(assetId: number): boolean
50
50
  return self._assetIdToAsset:Get(assetId) ~= nil
51
51
  end
52
52
 
53
- function AvatarEditorInventory:ObserveAssetIdInInventory(assetId)
53
+ function AvatarEditorInventory:ObserveAssetIdInInventory(assetId: number)
54
54
  assert(type(assetId) == "number", "Bad assetId")
55
55
 
56
56
  return self._assetIdToAsset:ObserveAtKey(assetId):Pipe({
@@ -14,11 +14,12 @@ local MemorizeUtils = require("MemorizeUtils")
14
14
  local Promise = require("Promise")
15
15
  local ValueObject = require("ValueObject")
16
16
  local PagesProxy = require("PagesProxy")
17
+ local _ServiceBag = require("ServiceBag")
17
18
 
18
19
  local AvatarEditorInventoryServiceClient = {}
19
20
  AvatarEditorInventoryServiceClient.ServiceName = "AvatarEditorInventoryServiceClient"
20
21
 
21
- function AvatarEditorInventoryServiceClient:Init(serviceBag)
22
+ function AvatarEditorInventoryServiceClient:Init(serviceBag: _ServiceBag.ServiceBag)
22
23
  assert(not self._serviceBag, "Already initialized")
23
24
  self._serviceBag = assert(serviceBag, "No serviceBag")
24
25
  self._maid = Maid.new()
@@ -1,3 +1,4 @@
1
+ --!strict
1
2
  --[=[
2
3
  Provides utilities to query the AvatarEditorService with a promise wrapper.
3
4
 
@@ -26,6 +27,12 @@ local AvatarEditorUtils = {}
26
27
  .Type string
27
28
  @within AvatarEditorUtils
28
29
  ]=]
30
+ export type AvatarItemBundledItemDetails = {
31
+ Owned: boolean,
32
+ Id: number,
33
+ Name: string,
34
+ Type: string,
35
+ }
29
36
 
30
37
  --[=[
31
38
  Holds premium pricing detail
@@ -35,6 +42,10 @@ local AvatarEditorUtils = {}
35
42
  .PremiumPriceInRobux number
36
43
  @within AvatarEditorUtils
37
44
  ]=]
45
+ export type PremiumPricingItemDetails = {
46
+ PremiumDiscountPercentage: number,
47
+ PremiumPriceInRobux: number,
48
+ }
38
49
 
39
50
  --[=[
40
51
  A table with a variety of information about avatar items and details.
@@ -68,6 +79,33 @@ local AvatarEditorUtils = {}
68
79
  .FavoriteCount number
69
80
  @within AvatarEditorUtils
70
81
  ]=]
82
+ export type AvatarItemDetails = {
83
+ IsForRent: boolean,
84
+ ExpectedSellerId: number,
85
+ Owned: boolean,
86
+ IsPurchasable: boolean,
87
+ Id: number,
88
+ ItemType: "Asset" | "Bundle" | string,
89
+ AssetType: "Image" | string,
90
+ BundleType: "BodyParts" | string,
91
+ Name: string,
92
+ Description: string,
93
+ ProductId: number,
94
+ Genres: { string },
95
+ BundledItems: { AvatarItemBundledItemDetails },
96
+ ItemStatus: { string },
97
+ ItemRestrictions: "ThirteenPlus",
98
+ CreatorType: "User" | string,
99
+ CreatorTargetId: number,
100
+ CreatorName: string,
101
+ Price: number,
102
+ PremiumPricing: PremiumPricingItemDetails,
103
+ LowestPrice: number,
104
+ PriceStatus: string,
105
+ UnitsAvailableForConsumption: number,
106
+ PurchaseCount: number,
107
+ FavoriteCount: number,
108
+ }
71
109
 
72
110
  --[=[
73
111
  This function returns the item details for the given item.
@@ -78,12 +116,15 @@ local AvatarEditorUtils = {}
78
116
  @param itemId number
79
117
  @return Promise<AvatarItemDetails>
80
118
  ]=]
81
- function AvatarEditorUtils.promiseItemDetails(itemId: number, itemType: AvatarItemType)
119
+ function AvatarEditorUtils.promiseItemDetails(
120
+ itemId: number,
121
+ itemType: Enum.AvatarItemType
122
+ ): Promise.Promise<AvatarItemDetails>
82
123
  assert(type(itemId) == "number", "Bad itemId")
83
124
  assert(EnumUtils.isOfType(Enum.AvatarItemType, itemType), "Bad itemType")
84
125
 
85
126
  return Promise.spawn(function(resolve, reject)
86
- local itemDetails
127
+ local itemDetails: AvatarItemDetails
87
128
  local ok, err = pcall(function()
88
129
  itemDetails = AvatarEditorService:GetItemDetails(itemId, itemType)
89
130
  end)
@@ -108,12 +149,15 @@ end
108
149
  @param itemType AvatarItemType
109
150
  @return Promise<{ { AvatarItemDetails } >
110
151
  ]=]
111
- function AvatarEditorUtils.promiseBatchItemDetails(itemIds: { number }, itemType: AvatarItemType)
152
+ function AvatarEditorUtils.promiseBatchItemDetails(
153
+ itemIds: { number },
154
+ itemType: Enum.AvatarItemType
155
+ ): Promise.Promise<{ AvatarItemDetails }>
112
156
  assert(type(itemIds) == "table", "Bad itemIds")
113
157
  assert(EnumUtils.isOfType(Enum.AvatarItemType, itemType), "Bad itemType")
114
158
 
115
159
  return Promise.spawn(function(resolve, reject)
116
- local batchItemDetailsList
160
+ local batchItemDetailsList: { AvatarItemDetails }
117
161
  local ok, err = pcall(function()
118
162
  batchItemDetailsList = AvatarEditorService:GetBatchItemDetails(itemIds, itemType)
119
163
  end)
@@ -140,8 +184,11 @@ end
140
184
  @param humanoidDescription HumanoidDescription
141
185
  @return Promise<HumanoidDescription?>
142
186
  ]=]
143
- function AvatarEditorUtils.promiseCheckApplyDefaultClothing(humanoidDescription: HumanoidDescription)
144
- assert(typeof(humanoidDescription) == "Instance" and humanoidDescription:IsA("HumanoidDescription"), "Bad humanoidDescription")
187
+ function AvatarEditorUtils.promiseCheckApplyDefaultClothing(humanoidDescription: HumanoidDescription): Promise.Promise<HumanoidDescription?>
188
+ assert(
189
+ typeof(humanoidDescription) == "Instance" and humanoidDescription:IsA("HumanoidDescription"),
190
+ "Bad humanoidDescription"
191
+ )
145
192
 
146
193
  return Promise.spawn(function(resolve, reject)
147
194
  local newDescriptionOrNil
@@ -150,7 +197,9 @@ function AvatarEditorUtils.promiseCheckApplyDefaultClothing(humanoidDescription:
150
197
  end)
151
198
 
152
199
  if not ok then
153
- return reject(err or "[AvatarEditorUtils.promiseCheckApplyDefaultClothing] - Failed to CheckApplyDefaultClothing")
200
+ return reject(
201
+ err or "[AvatarEditorUtils.promiseCheckApplyDefaultClothing] - Failed to CheckApplyDefaultClothing"
202
+ )
154
203
  end
155
204
 
156
205
  if newDescriptionOrNil == nil then
@@ -172,7 +221,10 @@ end
172
221
  @return Promise<HumanoidDescription>
173
222
  ]=]
174
223
  function AvatarEditorUtils.promiseConformToAvatarRules(humanoidDescription: HumanoidDescription)
175
- assert(typeof(humanoidDescription) == "Instance" and humanoidDescription:IsA("HumanoidDescription"), "Bad humanoidDescription")
224
+ assert(
225
+ typeof(humanoidDescription) == "Instance" and humanoidDescription:IsA("HumanoidDescription"),
226
+ "Bad humanoidDescription"
227
+ )
176
228
 
177
229
  return Promise.spawn(function(resolve, reject)
178
230
  local newDescription
@@ -181,7 +233,9 @@ function AvatarEditorUtils.promiseConformToAvatarRules(humanoidDescription: Huma
181
233
  end)
182
234
 
183
235
  if not ok then
184
- return reject(err or "[AvatarEditorUtils.promiseConformToAvatarRules] - Failed to CheckApplyDefaultClothing")
236
+ return reject(
237
+ err or "[AvatarEditorUtils.promiseConformToAvatarRules] - Failed to CheckApplyDefaultClothing"
238
+ )
185
239
  end
186
240
 
187
241
  if not (typeof(newDescription) == "Instance" and newDescription:IsA("HumanoidDescription")) then
@@ -201,6 +255,11 @@ end
201
255
  .Name string
202
256
  @within AvatarEditorUtils
203
257
  ]=]
258
+ export type AvatarRulesWearableAssetType = {
259
+ MaxNumber: number,
260
+ Id: number,
261
+ Name: string,
262
+ }
204
263
 
205
264
  --[=[
206
265
  https://create.roblox.com/docs/reference/engine/classes/AvatarEditorService#GetAvatarRules
@@ -211,6 +270,11 @@ end
211
270
  .Name string
212
271
  @within AvatarEditorUtils
213
272
  ]=]
273
+ export type AvatarRulesBodyColor = {
274
+ BrickColorId: number,
275
+ NexColor: string,
276
+ Name: string,
277
+ }
214
278
 
215
279
  --[=[
216
280
  @interface AvatarRuleDefaultClothingAssetLists
@@ -218,6 +282,10 @@ end
218
282
  .DefaultPantAssetIds { number }
219
283
  @within AvatarEditorUtils
220
284
  ]=]
285
+ export type AvatarRuleDefaultClothingAssetLists = {
286
+ DefaultShirtAssetIds: { number },
287
+ DefaultPantAssetIds: { number },
288
+ }
221
289
 
222
290
  --[=[
223
291
  https://create.roblox.com/docs/reference/engine/classes/AvatarEditorService#GetAvatarRules
@@ -235,6 +303,18 @@ end
235
303
  .EmotesEnabledForUser boolean
236
304
  @within AvatarEditorUtils
237
305
  ]=]
306
+ export type AvatarRules = {
307
+ PlayerAvatarTypes: "R6" | "R15" | string,
308
+ Scales: { [string]: number },
309
+ WearableAssetTypes: { AvatarRulesWearableAssetType },
310
+ BodyColorsPalette: { AvatarRulesBodyColor },
311
+ BasicBodyColorsPalette: { AvatarRulesBodyColor },
312
+ MinimumDeltaEBodyColorDifference: number,
313
+ ProportionsAndBodyTypeEnabledForUser: boolean,
314
+ DefaultClothingAssetLists: AvatarRuleDefaultClothingAssetLists,
315
+ BundlesEnabledForUser: boolean,
316
+ EmotesEnabledForUser: boolean,
317
+ }
238
318
 
239
319
  --[=[
240
320
  Returns the platform Avatar rules for things such as scaling, default shirts and pants, number of wearable assets.
@@ -245,7 +325,7 @@ end
245
325
  ]=]
246
326
  function AvatarEditorUtils.promiseAvatarRules()
247
327
  return Promise.spawn(function(resolve, reject)
248
- local avatarRulesTable
328
+ local avatarRulesTable: AvatarRules
249
329
  local ok, err = pcall(function()
250
330
  avatarRulesTable = AvatarEditorService:GetAvatarRules()
251
331
  end)
@@ -269,12 +349,12 @@ end
269
349
  @param itemType AvatarItemType
270
350
  @return Promise<boolean>
271
351
  ]=]
272
- function AvatarEditorUtils.promiseIsFavorited(itemId: number, itemType: AvatarItemType)
352
+ function AvatarEditorUtils.promiseIsFavorited(itemId: number, itemType: Enum.AvatarItemType)
273
353
  assert(type(itemId) == "number", "Bad itemId")
274
354
  assert(EnumUtils.isOfType(Enum.AvatarItemType, itemType), "Bad itemType")
275
355
 
276
356
  return Promise.spawn(function(resolve, reject)
277
- local isFavorited
357
+ local isFavorited: boolean
278
358
  local ok, err = pcall(function()
279
359
  isFavorited = AvatarEditorService:GetFavorite(itemId, itemType)
280
360
  end)
@@ -301,7 +381,7 @@ function AvatarEditorUtils.promiseSearchCatalog(catalogSearchParams: CatalogSear
301
381
  assert(typeof(catalogSearchParams) == "CatalogSearchParams", "Bad catalogSearchParams")
302
382
 
303
383
  return Promise.spawn(function(resolve, reject)
304
- local catalogPages
384
+ local catalogPages: CatalogPages
305
385
  local ok, err = pcall(function()
306
386
  catalogPages = AvatarEditorService:SearchCatalog(catalogSearchParams)
307
387
  end)
@@ -324,7 +404,7 @@ end
324
404
  @param assetTypes { AvatarAssetType }
325
405
  @return Promise<InventoryPages>
326
406
  ]=]
327
- function AvatarEditorUtils.promiseInventoryPages(assetTypes: { AvatarAssetType })
407
+ function AvatarEditorUtils.promiseInventoryPages(assetTypes: { Enum.AvatarAssetType })
328
408
  assert(type(assetTypes) == "table", "Bad assetTypes")
329
409
 
330
410
  return Promise.spawn(function(resolve, reject)
@@ -355,12 +435,12 @@ end
355
435
  @param outfitType OutfitType
356
436
  @return Promise<OutfitPages>
357
437
  ]=]
358
- function AvatarEditorUtils.promiseOutfitPages(outfitSource: OutfitSource, outfitType: OutfitType)
438
+ function AvatarEditorUtils.promiseOutfitPages(outfitSource: Enum.OutfitSource, outfitType: Enum.OutfitType)
359
439
  assert(EnumUtils.isOfType(Enum.OutfitSource, outfitSource), "Bad outfitSource")
360
440
  assert(EnumUtils.isOfType(Enum.OutfitType, outfitType), "Bad outfitType")
361
441
 
362
442
  return Promise.spawn(function(resolve, reject)
363
- local outfitPages
443
+ local outfitPages: OutfitPages
364
444
  local ok, err = pcall(function()
365
445
  outfitPages = AvatarEditorService:GetOutfits(outfitSource, outfitSource, outfitType)
366
446
  end)
@@ -391,14 +471,14 @@ end
391
471
  @param contextAssetId number? -- Optional. if not provided just gives recommendations in general
392
472
  @return Promise<{ number }>
393
473
  ]=]
394
- function AvatarEditorUtils.promiseRecommendedAssets(assetType: AvatarAssetType, contextAssetId: number)
474
+ function AvatarEditorUtils.promiseRecommendedAssets(assetType: Enum.AvatarAssetType, contextAssetId: number?)
395
475
  assert(EnumUtils.isOfType(Enum.AvatarAssetType, assetType), "Bad assetType")
396
476
  assert(type(contextAssetId) == "number" or contextAssetId == nil, "Bad contextAssetId")
397
477
 
398
478
  contextAssetId = contextAssetId or 0
399
479
 
400
480
  return Promise.spawn(function(resolve, reject)
401
- local result
481
+ local result: { number }
402
482
  local ok, err = pcall(function()
403
483
  result = AvatarEditorService:GetRecommendedAssets(assetType, contextAssetId)
404
484
  end)
@@ -421,7 +501,7 @@ function AvatarEditorUtils.promiseRecommendedBundles(bundleId: number)
421
501
  assert(type(bundleId) == "number", "Bad bundleId")
422
502
 
423
503
  return Promise.spawn(function(resolve, reject)
424
- local recommendedBundleIds
504
+ local recommendedBundleIds: { number }
425
505
  local ok, err = pcall(function()
426
506
  recommendedBundleIds = AvatarEditorService:GetRecommendedBundles(bundleId)
427
507
  end)
@@ -485,7 +565,7 @@ end
485
565
  @param rigType HumanoidRigType
486
566
  @return Promise<AvatarPromptResult>
487
567
  ]=]
488
- function AvatarEditorUtils.promptCreateOutfit(outfit: HumanoidDescription, rigType: HumanoidRigType)
568
+ function AvatarEditorUtils.promptCreateOutfit(outfit: HumanoidDescription, rigType: Enum.HumanoidRigType)
489
569
  assert(typeof(outfit) == "Instance" and outfit:IsA("HumanoidDescription"), "Bad outfit")
490
570
  assert(EnumUtils.isOfType(Enum.HumanoidRigType, rigType), "Bad rigType")
491
571
 
@@ -533,13 +613,15 @@ function AvatarEditorUtils.promptDeleteOutfit(outfitId: number)
533
613
  maid:DoCleaning()
534
614
  end)
535
615
 
536
- maid:GiveTask(AvatarEditorService.PromptDeleteOutfitCompleted:Connect(function(avatarPromptResult)
537
- if avatarPromptResult == Enum.AvatarPromptResult.Success then
538
- promise:Resolve(avatarPromptResult)
539
- else
540
- promise:Reject(avatarPromptResult)
541
- end
542
- end))
616
+ maid:GiveTask(
617
+ AvatarEditorService.PromptDeleteOutfitCompleted:Connect(function(avatarPromptResult: Enum.AvatarPromptResult)
618
+ if avatarPromptResult == Enum.AvatarPromptResult.Success then
619
+ promise:Resolve(avatarPromptResult)
620
+ else
621
+ promise:Reject(avatarPromptResult)
622
+ end
623
+ end)
624
+ )
543
625
 
544
626
  local ok, err = pcall(function()
545
627
  AvatarEditorService:PromptDeleteOutfit(outfitId)
@@ -569,13 +651,15 @@ function AvatarEditorUtils.promptRenameOutfit(outfitId: number)
569
651
  maid:DoCleaning()
570
652
  end)
571
653
 
572
- maid:GiveTask(AvatarEditorService.PromptRenameOutfitCompleted:Connect(function(avatarPromptResult)
573
- if avatarPromptResult == Enum.AvatarPromptResult.Success then
574
- promise:Resolve(avatarPromptResult)
575
- else
576
- promise:Reject(avatarPromptResult)
577
- end
578
- end))
654
+ maid:GiveTask(
655
+ AvatarEditorService.PromptRenameOutfitCompleted:Connect(function(avatarPromptResult: Enum.AvatarPromptResult)
656
+ if avatarPromptResult == Enum.AvatarPromptResult.Success then
657
+ promise:Resolve(avatarPromptResult)
658
+ else
659
+ promise:Reject(avatarPromptResult)
660
+ end
661
+ end)
662
+ )
579
663
 
580
664
  local ok, err = pcall(function()
581
665
  AvatarEditorService:PromptRenameOutfit(outfitId)
@@ -593,8 +677,11 @@ end
593
677
  @param rigType HumanoidRigType
594
678
  @return Promise<AvatarPromptResult>
595
679
  ]=]
596
- function AvatarEditorUtils.promptSaveAvatar(humanoidDescription: HumanoidDescription, rigType: HumanoidRigType)
597
- assert(typeof(humanoidDescription) == "Instance" and humanoidDescription:IsA("HumanoidDescription"), "Bad humanoidDescription")
680
+ function AvatarEditorUtils.promptSaveAvatar(humanoidDescription: HumanoidDescription, rigType: Enum.HumanoidRigType)
681
+ assert(
682
+ typeof(humanoidDescription) == "Instance" and humanoidDescription:IsA("HumanoidDescription"),
683
+ "Bad humanoidDescription"
684
+ )
598
685
  assert(EnumUtils.isOfType(Enum.HumanoidRigType, rigType), "Bad rigType")
599
686
 
600
687
  local maid = Maid.new()
@@ -605,13 +692,15 @@ function AvatarEditorUtils.promptSaveAvatar(humanoidDescription: HumanoidDescrip
605
692
  maid:DoCleaning()
606
693
  end)
607
694
 
608
- maid:GiveTask(AvatarEditorService.PromptSaveAvatarCompleted:Connect(function(avatarPromptResult)
609
- if avatarPromptResult == Enum.AvatarPromptResult.Success then
610
- promise:Resolve(avatarPromptResult)
611
- else
612
- promise:Reject(avatarPromptResult)
613
- end
614
- end))
695
+ maid:GiveTask(
696
+ AvatarEditorService.PromptSaveAvatarCompleted:Connect(function(avatarPromptResult: Enum.AvatarPromptResult)
697
+ if avatarPromptResult == Enum.AvatarPromptResult.Success then
698
+ promise:Resolve(avatarPromptResult)
699
+ else
700
+ promise:Reject(avatarPromptResult)
701
+ end
702
+ end)
703
+ )
615
704
 
616
705
  local ok, err = pcall(function()
617
706
  AvatarEditorService:PromptSaveAvatar(humanoidDescription, rigType)
@@ -628,11 +717,11 @@ end
628
717
  This function prompts the Players.LocalPlayer to favorite or unfavorite the given asset or bundle.
629
718
 
630
719
  @param itemId number
631
- @param itemType AvatarItemType
720
+ @param itemType Enum.AvatarItemType
632
721
  @param shouldFavorite boolean
633
722
  @return Promise<AvatarPromptResult>
634
723
  ]=]
635
- function AvatarEditorUtils.promptSetFavorite(itemId: number, itemType: AvatarItemType, shouldFavorite: boolean)
724
+ function AvatarEditorUtils.promptSetFavorite(itemId: number, itemType: Enum.AvatarItemType, shouldFavorite: boolean)
636
725
  assert(type(itemId) == "number", "Bad itemId")
637
726
  assert(EnumUtils.isOfType(Enum.AvatarItemType, itemType), "Bad itemType")
638
727
  assert(type(shouldFavorite) == "boolean", "Bad shouldFavorite")
@@ -645,13 +734,15 @@ function AvatarEditorUtils.promptSetFavorite(itemId: number, itemType: AvatarIte
645
734
  maid:DoCleaning()
646
735
  end)
647
736
 
648
- maid:GiveTask(AvatarEditorService.PromptSetFavoriteCompleted:Connect(function(avatarPromptResult)
649
- if avatarPromptResult == Enum.AvatarPromptResult.Success then
650
- promise:Resolve(avatarPromptResult)
651
- else
652
- promise:Reject(avatarPromptResult)
653
- end
654
- end))
737
+ maid:GiveTask(
738
+ AvatarEditorService.PromptSetFavoriteCompleted:Connect(function(avatarPromptResult: Enum.AvatarPromptResult)
739
+ if avatarPromptResult == Enum.AvatarPromptResult.Success then
740
+ promise:Resolve(avatarPromptResult)
741
+ else
742
+ promise:Reject(avatarPromptResult)
743
+ end
744
+ end)
745
+ )
655
746
 
656
747
  local ok, err = pcall(function()
657
748
  AvatarEditorService:PromptSetFavorite(itemId, itemType, shouldFavorite)
@@ -672,7 +763,7 @@ end
672
763
  @param rigType HumanoidRigType
673
764
  @return Promise<AvatarPromptResult>
674
765
  ]=]
675
- function AvatarEditorUtils.promptUpdateOutfit(outfitId: number, updatedOutfit: HumanoidDescription, rigType: HumanoidRigType)
766
+ function AvatarEditorUtils.promptUpdateOutfit(outfitId: number, updatedOutfit: HumanoidDescription, rigType: Enum.HumanoidRigType)
676
767
  assert(type(outfitId) == "number", "Bad outfitId")
677
768
  assert(typeof(updatedOutfit) == "Instance" and updatedOutfit:IsA("HumanoidDescription"), "Bad updatedOutfit")
678
769
  assert(EnumUtils.isOfType(Enum.HumanoidRigType, rigType), "Bad rigType")
@@ -685,7 +776,7 @@ function AvatarEditorUtils.promptUpdateOutfit(outfitId: number, updatedOutfit: H
685
776
  maid:DoCleaning()
686
777
  end)
687
778
 
688
- maid:GiveTask(AvatarEditorService.PromptUpdateOutfitCompleted:Connect(function(avatarPromptResult)
779
+ maid:GiveTask(AvatarEditorService.PromptUpdateOutfitCompleted:Connect(function(avatarPromptResult: Enum.AvatarPromptResult)
689
780
  if avatarPromptResult == Enum.AvatarPromptResult.Success then
690
781
  promise:Resolve(avatarPromptResult)
691
782
  else
@@ -9,11 +9,12 @@ local AvatarEditorUtils = require("AvatarEditorUtils")
9
9
  local Aggregator = require("Aggregator")
10
10
  local Maid = require("Maid")
11
11
  local PagesProxy = require("PagesProxy")
12
+ local _ServiceBag = require("ServiceBag")
12
13
 
13
14
  local CatalogSearchServiceCache = {}
14
15
  CatalogSearchServiceCache.ServiceName = "CatalogSearchServiceCache"
15
16
 
16
- function CatalogSearchServiceCache:Init(serviceBag)
17
+ function CatalogSearchServiceCache:Init(serviceBag: _ServiceBag.ServiceBag)
17
18
  assert(not self._serviceBag, "Already initialized")
18
19
  self._serviceBag = assert(serviceBag, "No serviceBag")
19
20
  self._maid = Maid.new()