@quenty/rbxthumb 5.9.1 → 5.9.2
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 +11 -0
- package/package.json +4 -4
- package/src/Shared/RbxThumbUtils.lua +52 -35
- package/src/Shared/RbxThumbnailTypes.lua +23 -10
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
|
+
## [5.9.2](https://github.com/Quenty/NevermoreEngine/compare/@quenty/rbxthumb@5.9.1...@quenty/rbxthumb@5.9.2) (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
|
## [5.9.1](https://github.com/Quenty/NevermoreEngine/compare/@quenty/rbxthumb@5.9.0...@quenty/rbxthumb@5.9.1) (2025-03-21)
|
|
7
18
|
|
|
8
19
|
**Note:** Version bump only for package @quenty/rbxthumb
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quenty/rbxthumb",
|
|
3
|
-
"version": "5.9.
|
|
3
|
+
"version": "5.9.2",
|
|
4
4
|
"description": "Wraps the rbxthumb URL api surface.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Roblox",
|
|
@@ -29,8 +29,8 @@
|
|
|
29
29
|
"access": "public"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@quenty/loader": "^10.8.
|
|
33
|
-
"@quenty/table": "^3.7.
|
|
32
|
+
"@quenty/loader": "^10.8.1",
|
|
33
|
+
"@quenty/table": "^3.7.2"
|
|
34
34
|
},
|
|
35
|
-
"gitHead": "
|
|
35
|
+
"gitHead": "78c3ac0ab08dd18085b6e6e6e4f745e76ed99f68"
|
|
36
36
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
--!strict
|
|
1
2
|
--[=[
|
|
2
3
|
Wraps the rbxthumb URL api surface to generate a URL for a thumbnail on the cloud.
|
|
3
4
|
|
|
@@ -10,6 +11,17 @@ local require = require(script.Parent.loader).load(script)
|
|
|
10
11
|
|
|
11
12
|
local RbxThumbnailTypes = require("RbxThumbnailTypes")
|
|
12
13
|
|
|
14
|
+
export type RbxThumbnailTypes =
|
|
15
|
+
"Asset"
|
|
16
|
+
| "Avatar"
|
|
17
|
+
| "AvatarHeadShot"
|
|
18
|
+
| "BadgeIcon"
|
|
19
|
+
| "BundleThumbnail"
|
|
20
|
+
| "GameIcon"
|
|
21
|
+
| "GamePass"
|
|
22
|
+
| "GroupIcon"
|
|
23
|
+
| "Outfit"
|
|
24
|
+
|
|
13
25
|
local RbxThumbUtils = {}
|
|
14
26
|
|
|
15
27
|
--[=[
|
|
@@ -35,7 +47,12 @@ local RbxThumbUtils = {}
|
|
|
35
47
|
@param height number
|
|
36
48
|
@return string
|
|
37
49
|
]=]
|
|
38
|
-
function RbxThumbUtils.getThumbnailUrl(
|
|
50
|
+
function RbxThumbUtils.getThumbnailUrl(
|
|
51
|
+
thumbnailType: RbxThumbnailTypes,
|
|
52
|
+
targetId: number,
|
|
53
|
+
width: number,
|
|
54
|
+
height: number
|
|
55
|
+
): string
|
|
39
56
|
assert(type(thumbnailType) == "string", "Bad thumbnailType")
|
|
40
57
|
assert(type(targetId) == "number", "Bad targetId")
|
|
41
58
|
assert(type(width) == "number", "Bad width")
|
|
@@ -49,7 +66,7 @@ end
|
|
|
49
66
|
@param avatarItemType AvatarItemType
|
|
50
67
|
@return string
|
|
51
68
|
]=]
|
|
52
|
-
function RbxThumbUtils.avatarItemTypeToThumbnailType(avatarItemType)
|
|
69
|
+
function RbxThumbUtils.avatarItemTypeToThumbnailType(avatarItemType: Enum.AvatarItemType): RbxThumbnailTypes
|
|
53
70
|
if avatarItemType == Enum.AvatarItemType.Asset then
|
|
54
71
|
return RbxThumbnailTypes.ASSET
|
|
55
72
|
elseif avatarItemType == Enum.AvatarItemType.Bundle then
|
|
@@ -69,7 +86,7 @@ end
|
|
|
69
86
|
@param height number?
|
|
70
87
|
@return string
|
|
71
88
|
]=]
|
|
72
|
-
function RbxThumbUtils.getAssetThumbnailUrl(targetId, width, height)
|
|
89
|
+
function RbxThumbUtils.getAssetThumbnailUrl(targetId: number, width: number, height: number): string
|
|
73
90
|
assert(type(targetId) == "number", "Bad targetId")
|
|
74
91
|
|
|
75
92
|
width = width or 150
|
|
@@ -88,13 +105,13 @@ end
|
|
|
88
105
|
@param height number?
|
|
89
106
|
@return string
|
|
90
107
|
]=]
|
|
91
|
-
function RbxThumbUtils.getAvatarThumbnailUrl(targetId, width
|
|
108
|
+
function RbxThumbUtils.getAvatarThumbnailUrl(targetId: number, width: number?, height: number?): string
|
|
92
109
|
assert(type(targetId) == "number", "Bad targetId")
|
|
93
110
|
|
|
94
|
-
|
|
95
|
-
|
|
111
|
+
local thumbnailWidth = width or 150
|
|
112
|
+
local thumbnailHeight = height or 150
|
|
96
113
|
|
|
97
|
-
return RbxThumbUtils.getThumbnailUrl(RbxThumbnailTypes.AVATAR, targetId,
|
|
114
|
+
return RbxThumbUtils.getThumbnailUrl(RbxThumbnailTypes.AVATAR, targetId, thumbnailWidth, thumbnailHeight)
|
|
98
115
|
end
|
|
99
116
|
|
|
100
117
|
--[=[
|
|
@@ -107,13 +124,13 @@ end
|
|
|
107
124
|
@param height number?
|
|
108
125
|
@return string
|
|
109
126
|
]=]
|
|
110
|
-
function RbxThumbUtils.getAvatarHeadShotThumbnailUrl(targetId, width
|
|
127
|
+
function RbxThumbUtils.getAvatarHeadShotThumbnailUrl(targetId: number, width: number?, height: number?): string
|
|
111
128
|
assert(type(targetId) == "number", "Bad targetId")
|
|
112
129
|
|
|
113
|
-
|
|
114
|
-
|
|
130
|
+
local thumbnailWidth = width or 150
|
|
131
|
+
local thumbnailHeight = height or 150
|
|
115
132
|
|
|
116
|
-
return RbxThumbUtils.getThumbnailUrl(RbxThumbnailTypes.AVATAR_HEAD_SHOT, targetId,
|
|
133
|
+
return RbxThumbUtils.getThumbnailUrl(RbxThumbnailTypes.AVATAR_HEAD_SHOT, targetId, thumbnailWidth, thumbnailHeight)
|
|
117
134
|
end
|
|
118
135
|
|
|
119
136
|
--[=[
|
|
@@ -126,13 +143,13 @@ end
|
|
|
126
143
|
@param height number?
|
|
127
144
|
@return string
|
|
128
145
|
]=]
|
|
129
|
-
function RbxThumbUtils.getBadgeIconThumbnailUrl(targetId, width
|
|
146
|
+
function RbxThumbUtils.getBadgeIconThumbnailUrl(targetId: number, width: number?, height: number?): string
|
|
130
147
|
assert(type(targetId) == "number", "Bad targetId")
|
|
131
148
|
|
|
132
|
-
|
|
133
|
-
|
|
149
|
+
local thumbnailWidth = width or 150
|
|
150
|
+
local thumbnailHeight = height or 150
|
|
134
151
|
|
|
135
|
-
return RbxThumbUtils.getThumbnailUrl(RbxThumbnailTypes.BADGE, targetId,
|
|
152
|
+
return RbxThumbUtils.getThumbnailUrl(RbxThumbnailTypes.BADGE, targetId, thumbnailWidth, thumbnailHeight)
|
|
136
153
|
end
|
|
137
154
|
|
|
138
155
|
--[=[
|
|
@@ -145,13 +162,13 @@ end
|
|
|
145
162
|
@param height number?
|
|
146
163
|
@return string
|
|
147
164
|
]=]
|
|
148
|
-
function RbxThumbUtils.getBundleThumbnailThumbnailUrl(targetId, width
|
|
165
|
+
function RbxThumbUtils.getBundleThumbnailThumbnailUrl(targetId: number, width: number?, height: number?): string
|
|
149
166
|
assert(type(targetId) == "number", "Bad targetId")
|
|
150
167
|
|
|
151
|
-
|
|
152
|
-
|
|
168
|
+
local thumbnailWidth = width or 150
|
|
169
|
+
local thumbnailHeight = height or 150
|
|
153
170
|
|
|
154
|
-
return RbxThumbUtils.getThumbnailUrl(RbxThumbnailTypes.BUNDLE, targetId,
|
|
171
|
+
return RbxThumbUtils.getThumbnailUrl(RbxThumbnailTypes.BUNDLE, targetId, thumbnailWidth, thumbnailHeight)
|
|
155
172
|
end
|
|
156
173
|
|
|
157
174
|
--[=[
|
|
@@ -164,13 +181,13 @@ end
|
|
|
164
181
|
@param height number?
|
|
165
182
|
@return string
|
|
166
183
|
]=]
|
|
167
|
-
function RbxThumbUtils.getGameIconThumbnailUrl(targetId, width
|
|
184
|
+
function RbxThumbUtils.getGameIconThumbnailUrl(targetId: number, width: number?, height: number?): string
|
|
168
185
|
assert(type(targetId) == "number", "Bad targetId")
|
|
169
186
|
|
|
170
|
-
|
|
171
|
-
|
|
187
|
+
local thumbnailWidth = width or 150
|
|
188
|
+
local thumbnailHeight = height or 150
|
|
172
189
|
|
|
173
|
-
return RbxThumbUtils.getThumbnailUrl(RbxThumbnailTypes.GAME_ICON, targetId,
|
|
190
|
+
return RbxThumbUtils.getThumbnailUrl(RbxThumbnailTypes.GAME_ICON, targetId, thumbnailWidth, thumbnailHeight)
|
|
174
191
|
end
|
|
175
192
|
|
|
176
193
|
--[=[
|
|
@@ -183,13 +200,13 @@ end
|
|
|
183
200
|
@param height number?
|
|
184
201
|
@return string
|
|
185
202
|
]=]
|
|
186
|
-
function RbxThumbUtils.getGamePassThumbnailUrl(targetId, width
|
|
203
|
+
function RbxThumbUtils.getGamePassThumbnailUrl(targetId: number, width: number?, height: number?): string
|
|
187
204
|
assert(type(targetId) == "number", "Bad targetId")
|
|
188
205
|
|
|
189
|
-
|
|
190
|
-
|
|
206
|
+
local thumbnailWidth = width or 150
|
|
207
|
+
local thumbnailHeight = height or 150
|
|
191
208
|
|
|
192
|
-
return RbxThumbUtils.getThumbnailUrl(RbxThumbnailTypes.GAME_PASS, targetId,
|
|
209
|
+
return RbxThumbUtils.getThumbnailUrl(RbxThumbnailTypes.GAME_PASS, targetId, thumbnailWidth, thumbnailHeight)
|
|
193
210
|
end
|
|
194
211
|
|
|
195
212
|
--[=[
|
|
@@ -202,13 +219,13 @@ end
|
|
|
202
219
|
@param height number?
|
|
203
220
|
@return string
|
|
204
221
|
]=]
|
|
205
|
-
function RbxThumbUtils.getGroupIconThumbnailUrl(targetId, width
|
|
222
|
+
function RbxThumbUtils.getGroupIconThumbnailUrl(targetId: number, width: number?, height: number?): string
|
|
206
223
|
assert(type(targetId) == "number", "Bad targetId")
|
|
207
224
|
|
|
208
|
-
|
|
209
|
-
|
|
225
|
+
local thumbnailWidth = width or 150
|
|
226
|
+
local thumbnailHeight = height or 150
|
|
210
227
|
|
|
211
|
-
return RbxThumbUtils.getThumbnailUrl(RbxThumbnailTypes.GROUP_ICON, targetId,
|
|
228
|
+
return RbxThumbUtils.getThumbnailUrl(RbxThumbnailTypes.GROUP_ICON, targetId, thumbnailWidth, thumbnailHeight)
|
|
212
229
|
end
|
|
213
230
|
|
|
214
231
|
--[=[
|
|
@@ -221,13 +238,13 @@ end
|
|
|
221
238
|
@param height number?
|
|
222
239
|
@return string
|
|
223
240
|
]=]
|
|
224
|
-
function RbxThumbUtils.getOutfitThumbnailUrl(targetId, width
|
|
241
|
+
function RbxThumbUtils.getOutfitThumbnailUrl(targetId: number, width: number?, height: number?): string
|
|
225
242
|
assert(type(targetId) == "number", "Bad targetId")
|
|
226
243
|
|
|
227
|
-
|
|
228
|
-
|
|
244
|
+
local thumbnailWidth = width or 150
|
|
245
|
+
local thumbnailHeight = height or 150
|
|
229
246
|
|
|
230
|
-
return RbxThumbUtils.getThumbnailUrl(RbxThumbnailTypes.OUTFIT, targetId,
|
|
247
|
+
return RbxThumbUtils.getThumbnailUrl(RbxThumbnailTypes.OUTFIT, targetId, thumbnailWidth, thumbnailHeight)
|
|
231
248
|
end
|
|
232
249
|
|
|
233
250
|
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
--!strict
|
|
1
2
|
--[=[
|
|
2
3
|
Canonical RbxThumbnailTypes
|
|
3
4
|
@class RbxThumbnailTypes
|
|
@@ -7,14 +8,26 @@ local require = require(script.Parent.loader).load(script)
|
|
|
7
8
|
|
|
8
9
|
local Table = require("Table")
|
|
9
10
|
|
|
11
|
+
export type RbxThumbnailTypes = {
|
|
12
|
+
ASSET: "Asset",
|
|
13
|
+
AVATAR: "Avatar",
|
|
14
|
+
AVATAR_HEAD_SHOT: "AvatarHeadShot",
|
|
15
|
+
BADGE: "BadgeIcon",
|
|
16
|
+
BUNDLE: "BundleThumbnail",
|
|
17
|
+
GAME_ICON: "GameIcon",
|
|
18
|
+
GAME_PASS: "GamePass",
|
|
19
|
+
GROUP_ICON: "GroupIcon",
|
|
20
|
+
OUTFIT: "Outfit",
|
|
21
|
+
}
|
|
22
|
+
|
|
10
23
|
return Table.readonly({
|
|
11
|
-
ASSET = "Asset"
|
|
12
|
-
AVATAR = "Avatar"
|
|
13
|
-
AVATAR_HEAD_SHOT = "AvatarHeadShot"
|
|
14
|
-
BADGE = "BadgeIcon"
|
|
15
|
-
BUNDLE = "BundleThumbnail"
|
|
16
|
-
GAME_ICON = "GameIcon"
|
|
17
|
-
GAME_PASS = "GamePass"
|
|
18
|
-
GROUP_ICON = "GroupIcon"
|
|
19
|
-
OUTFIT = "Outfit"
|
|
20
|
-
})
|
|
24
|
+
ASSET = "Asset",
|
|
25
|
+
AVATAR = "Avatar",
|
|
26
|
+
AVATAR_HEAD_SHOT = "AvatarHeadShot",
|
|
27
|
+
BADGE = "BadgeIcon",
|
|
28
|
+
BUNDLE = "BundleThumbnail",
|
|
29
|
+
GAME_ICON = "GameIcon",
|
|
30
|
+
GAME_PASS = "GamePass",
|
|
31
|
+
GROUP_ICON = "GroupIcon",
|
|
32
|
+
OUTFIT = "Outfit",
|
|
33
|
+
} :: RbxThumbnailTypes)
|