UNPKG

openblox

Version:

Roblox API Wrapper For Both Classic And OpenCloud APIs.

99 lines (98 loc) 4.38 kB
import type { Identifier, ObjectPrettify, UnionPrettify, Url } from "typeforge"; export type ThumbnailFormat = "Png" | "WebP"; export type ThumbnailReturnPolicy = "PlaceHolder" | "AutoGenerated" | "ForceAutoGenerated"; type ThumbnailVersion = UnionPrettify<"TN2" | "TN3">; export type ThumbnailData<TargetId extends Identifier | undefined = undefined> = ((TargetId extends undefined ? {} : { targetId: TargetId; }) & { state: "Completed" | "Pending" | "Error"; imageUrl: Url; version: ThumbnailVersion; }); export type RawThumbnailsData<UserId extends Identifier> = { data: ThumbnailData<UserId>[]; }; export type PrettifiedThumbnailsData<UserId extends Identifier> = { [Key in UserId]: ThumbnailData | undefined; }; export type AssetSize = "30x30" | "42x42" | "50x50" | "60x62" | "75x75" | "110x110" | "140x140" | "150x150" | "160x100" | "160x600" | "250x250" | "256x144" | "300x250" | "304x166" | "384x216" | "396x216" | "420x420" | "480x270" | "512x512" | "576x324" | "700x700" | "728x90" | "768x432" | "1200x80"; export type AssetAnimatedThumbnailData<AssetId extends Identifier> = { targetId: AssetId; state: "Completed" | "Pending" | "Error"; imageUrl: string; version: ThumbnailVersion; }; export type BundleSize = "150x150" | "420x420"; export type DeveloperProductSize = "150x150" | "420x420"; export type GameThumbnailSize = "256x144" | "384x216" | "480x270" | "576x324" | "768x432"; type GamesThumbnailsData = ObjectPrettify<{ error: null; thumbnails: { targetId: number; state: "Completed" | "Pending" | "Error"; imageUrl: Url; version: ThumbnailVersion; }[]; }> | ObjectPrettify<{ error: { code: number; message: string; userFacingMessage: string; field: string; fieldData: string; }; thumbnails: null; }>; export type RawGamesThumbnailsData<UniverseId extends Identifier> = { data: ({ universeId: UniverseId; } & GamesThumbnailsData)[]; }; export type PrettifiedGamesThumbnailsData<UniverseId extends Identifier> = { [Key in UniverseId]: GamesThumbnailsData | undefined; }; export type GamesIconSize = "50x50" | "128x128" | "150x150" | "256x256" | "512x512"; export type GroupEmblemSize = "150x150" | "420x420"; export type ThumbnailsMetadataData = ObjectPrettify<{ isWebappUseCacheEnabled: boolean; webappCacheExpirationTimspan: string; }>; export type PlaceThumbnailSize = "50x50" | "128x128" | "150x150" | "256x256" | "512x512"; export type AvatarsFullThumbnailsSize = UnionPrettify<"30x30" | "48x48" | "60x60" | "75x75" | "100x100" | "110x110" | "140x140" | "150x150" | "180x180" | "250x250" | "352x352" | "420x420" | "720x720">; export type AvatarBustThumbnailsSize = "48x48" | "50x50" | "60x60" | "75x75" | "100x100" | "150x150" | "180x180" | "352x352" | "420x420"; export type AvatarHeadshotThumbnailsSize = "48x48" | "50x50" | "60x60" | "75x75" | "100x100" | "110x110" | "150x150" | "180x180" | "352x352" | "420x420" | "720x720"; export type OutfitSize = "150x150" | "420x420"; export type BatchType = "Avatar" | "AvatarHeadShot" | "GameIcon" | "BadgeIcon" | "GameThumbnail" | "GamePass" | "Asset" | "BundleThumbnail" | "Outfit" | "GroupIcon" | "DeveloperProduct" | "AutoGeneratedAsset" | "AvatarBust" | "PlaceIcon" | "AutoGeneratedGameIcon" | "ForceAutoGeneratedGameIcon"; export type BatchRequest<BType = BatchType, Size = `${number}x${number}`> = { requestId?: string; targetId: Identifier; token?: string; alias?: string; type: BType; size: UnionPrettify<Size>; format: string; isCircular: boolean; }; export type BatchResponseElement<RequestId extends string | null = null> = { requestId: NonNullable<RequestId> extends string | null ? RequestId : string | null; errorCode: number; errorMessage: string; targetId: number; state: "Completed" | "Pending" | "Error"; imageUrl?: string; version?: string; }; export type RawBatchThumbnailsData = ObjectPrettify<{ data: BatchResponseElement[]; }>; export type PrettifiedBatchThumbnailsData<Request extends BatchRequest> = { [Key in Request["type"]]: { requestId: string | null; errorCode: number; errorMessage: string; state: "Completed" | "Pending" | "Error"; imageUrl: Url; version: ThumbnailVersion; }; }; export {};