-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
af54b10
commit 0e1fc02
Showing
14 changed files
with
205 additions
and
125 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import type BloxFetch from "../../../../main.js"; | ||
import type { LegacyFetchOptions } from "../../../../types/internal/LegacyFetchHandler.js"; | ||
import type { fetchedImage } from "../../../../types/legacy/Thumbnails.js"; | ||
import { GamePassImageFormat, GamePassImageSize } from "../../../../types/legacy/ThumbnailsEnums.js"; | ||
|
||
export type fetchGamepassIconsResponse = { data: fetchedImage[] }; | ||
|
||
export type fetchGamepassIconsType = ( | ||
this: BloxFetch, | ||
|
||
gamePassIds: number | number[], | ||
size: GamePassImageSize, | ||
format: GamePassImageFormat, | ||
isCircular: boolean, | ||
|
||
fetchOptions?: Partial<LegacyFetchOptions>, | ||
) => Promise<fetchedImage[]>; | ||
|
||
export default async function ( | ||
this: BloxFetch, | ||
|
||
gamePassIds: number | number[], | ||
size: GamePassImageSize = GamePassImageSize["150x150"], | ||
format: GamePassImageFormat = GamePassImageFormat.Png, | ||
isCircular = false, | ||
|
||
fetchOptions?: Partial<LegacyFetchOptions>, | ||
): Promise<fetchedImage[]> { | ||
return ( | ||
await this.LegacyFetchHandler.fetch<fetchGamepassIconsResponse>("GET", "ThumbnailsV1", "/v1/badges/icons", { | ||
params: { | ||
gamePassIds: Array.isArray(gamePassIds) ? gamePassIds : [gamePassIds], | ||
|
||
size: size, | ||
format: format, | ||
isCircular: isCircular, | ||
}, | ||
body: {}, | ||
useCache: fetchOptions?.useCache ?? true, | ||
}) | ||
).data; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,82 +1,6 @@ | ||
export type fetchedBadgeIcon = { | ||
export type fetchedImage = { | ||
targetId: number; | ||
state: string; | ||
imageUrl: string; | ||
version: string; | ||
}; | ||
|
||
//? Enums | ||
|
||
// User Avatar | ||
|
||
export enum UserAvatarImageSize { | ||
"48x48" = "48x49", | ||
"50x50" = "50x50", | ||
"60x60" = "60x60", | ||
"75x75" = "75x75", | ||
"100x100" = "100x100", | ||
"110x110" = "110x110", | ||
"150x150" = "150x150", | ||
"180x180" = "180x180", | ||
"352x352" = "352x352", | ||
"420x420" = "420x420", | ||
"720x720" = "720x720", | ||
} | ||
|
||
export enum UserAvatarImageFormat { | ||
Png = "Png", | ||
Jpeg = "Jpeg", | ||
Webp = "Webp", | ||
} | ||
|
||
// User Avatar Bust | ||
|
||
export enum UserAvatarBustImageSize { | ||
"48x48" = "48x49", | ||
"50x50" = "50x50", | ||
"60x60" = "60x60", | ||
"75x75" = "75x75", | ||
"100x100" = "100x100", | ||
"150x150" = "150x150", | ||
"180x180" = "180x180", | ||
"352x352" = "352x352", | ||
"420x420" = "420x420", | ||
} | ||
|
||
export enum UserAvatarImageFormat { | ||
Png = "Png", | ||
Webp = "Webp", | ||
} | ||
|
||
// User Avatar Headshot | ||
|
||
export enum UserAvatarHeadshotImageSize { | ||
"48x48" = "48x49", | ||
"50x50" = "50x50", | ||
"60x60" = "60x60", | ||
"75x75" = "75x75", | ||
"100x100" = "100x100", | ||
"110x110" = "110x110", | ||
"150x150" = "150x150", | ||
"180x180" = "180x180", | ||
"352x352" = "352x352", | ||
"420x420" = "420x420", | ||
"720x720" = "720x720", | ||
} | ||
|
||
export enum UserAvatarHeadshotImageFormat { | ||
Png = "Png", | ||
Jpeg = "Jpeg", | ||
Webp = "Webp", | ||
} | ||
|
||
// Badge Icon | ||
|
||
export enum BadgeIconImageSize { | ||
"150x150" = "150x150", | ||
} | ||
|
||
export enum BadgeIconImageFormat { | ||
Png = "Png", | ||
Webp = "Webp", | ||
} |
Oops, something went wrong.