mirror of
https://github.com/discordjs/discord-api-types.git
synced 2026-05-30 07:20:10 +00:00
fix(CDNRoutes): make format optional and default to png (#869)
This commit is contained in:
@@ -934,6 +934,14 @@ export const Routes = {
|
||||
|
||||
export const StickerPackApplicationId = '710982414301790216';
|
||||
|
||||
export enum ImageFormat {
|
||||
JPEG = 'jpeg',
|
||||
PNG = 'png',
|
||||
WebP = 'webp',
|
||||
GIF = 'gif',
|
||||
Lottie = 'json',
|
||||
}
|
||||
|
||||
export const CDNRoutes = {
|
||||
/**
|
||||
* Route for:
|
||||
@@ -1112,7 +1120,7 @@ export const CDNRoutes = {
|
||||
*
|
||||
* This route supports the extensions: PNG, JPEG, WebP
|
||||
*/
|
||||
storePageAsset(applicationId: Snowflake, assetId: string, format: StorePageAssetFormat) {
|
||||
storePageAsset(applicationId: Snowflake, assetId: string, format: StorePageAssetFormat = ImageFormat.PNG) {
|
||||
return `/app-assets/${applicationId}/store/${assetId}.${format}` as const;
|
||||
},
|
||||
|
||||
@@ -1194,14 +1202,6 @@ export type RoleIconFormat = Exclude<ImageFormat, ImageFormat.Lottie | ImageForm
|
||||
export type GuildScheduledEventCoverFormat = Exclude<ImageFormat, ImageFormat.Lottie | ImageFormat.GIF>;
|
||||
export type GuildMemberBannerFormat = Exclude<ImageFormat, ImageFormat.Lottie>;
|
||||
|
||||
export enum ImageFormat {
|
||||
JPEG = 'jpeg',
|
||||
PNG = 'png',
|
||||
WebP = 'webp',
|
||||
GIF = 'gif',
|
||||
Lottie = 'json',
|
||||
}
|
||||
|
||||
export interface CDNQuery {
|
||||
/**
|
||||
* The returned image can have the size changed by using this query parameter
|
||||
|
||||
@@ -943,6 +943,14 @@ export const Routes = {
|
||||
|
||||
export const StickerPackApplicationId = '710982414301790216';
|
||||
|
||||
export enum ImageFormat {
|
||||
JPEG = 'jpeg',
|
||||
PNG = 'png',
|
||||
WebP = 'webp',
|
||||
GIF = 'gif',
|
||||
Lottie = 'json',
|
||||
}
|
||||
|
||||
export const CDNRoutes = {
|
||||
/**
|
||||
* Route for:
|
||||
@@ -1121,7 +1129,7 @@ export const CDNRoutes = {
|
||||
*
|
||||
* This route supports the extensions: PNG, JPEG, WebP
|
||||
*/
|
||||
storePageAsset(applicationId: Snowflake, assetId: string, format: StorePageAssetFormat) {
|
||||
storePageAsset(applicationId: Snowflake, assetId: string, format: StorePageAssetFormat = ImageFormat.PNG) {
|
||||
return `/app-assets/${applicationId}/store/${assetId}.${format}` as const;
|
||||
},
|
||||
|
||||
@@ -1203,14 +1211,6 @@ export type RoleIconFormat = Exclude<ImageFormat, ImageFormat.Lottie | ImageForm
|
||||
export type GuildScheduledEventCoverFormat = Exclude<ImageFormat, ImageFormat.Lottie | ImageFormat.GIF>;
|
||||
export type GuildMemberBannerFormat = Exclude<ImageFormat, ImageFormat.Lottie>;
|
||||
|
||||
export enum ImageFormat {
|
||||
JPEG = 'jpeg',
|
||||
PNG = 'png',
|
||||
WebP = 'webp',
|
||||
GIF = 'gif',
|
||||
Lottie = 'json',
|
||||
}
|
||||
|
||||
export interface CDNQuery {
|
||||
/**
|
||||
* The returned image can have the size changed by using this query parameter
|
||||
|
||||
@@ -934,6 +934,14 @@ export const Routes = {
|
||||
|
||||
export const StickerPackApplicationId = '710982414301790216';
|
||||
|
||||
export enum ImageFormat {
|
||||
JPEG = 'jpeg',
|
||||
PNG = 'png',
|
||||
WebP = 'webp',
|
||||
GIF = 'gif',
|
||||
Lottie = 'json',
|
||||
}
|
||||
|
||||
export const CDNRoutes = {
|
||||
/**
|
||||
* Route for:
|
||||
@@ -1112,7 +1120,7 @@ export const CDNRoutes = {
|
||||
*
|
||||
* This route supports the extensions: PNG, JPEG, WebP
|
||||
*/
|
||||
storePageAsset(applicationId: Snowflake, assetId: string, format: StorePageAssetFormat) {
|
||||
storePageAsset(applicationId: Snowflake, assetId: string, format: StorePageAssetFormat = ImageFormat.PNG) {
|
||||
return `/app-assets/${applicationId}/store/${assetId}.${format}` as const;
|
||||
},
|
||||
|
||||
@@ -1194,14 +1202,6 @@ export type RoleIconFormat = Exclude<ImageFormat, ImageFormat.Lottie | ImageForm
|
||||
export type GuildScheduledEventCoverFormat = Exclude<ImageFormat, ImageFormat.Lottie | ImageFormat.GIF>;
|
||||
export type GuildMemberBannerFormat = Exclude<ImageFormat, ImageFormat.Lottie>;
|
||||
|
||||
export enum ImageFormat {
|
||||
JPEG = 'jpeg',
|
||||
PNG = 'png',
|
||||
WebP = 'webp',
|
||||
GIF = 'gif',
|
||||
Lottie = 'json',
|
||||
}
|
||||
|
||||
export interface CDNQuery {
|
||||
/**
|
||||
* The returned image can have the size changed by using this query parameter
|
||||
|
||||
@@ -943,6 +943,14 @@ export const Routes = {
|
||||
|
||||
export const StickerPackApplicationId = '710982414301790216';
|
||||
|
||||
export enum ImageFormat {
|
||||
JPEG = 'jpeg',
|
||||
PNG = 'png',
|
||||
WebP = 'webp',
|
||||
GIF = 'gif',
|
||||
Lottie = 'json',
|
||||
}
|
||||
|
||||
export const CDNRoutes = {
|
||||
/**
|
||||
* Route for:
|
||||
@@ -1121,7 +1129,7 @@ export const CDNRoutes = {
|
||||
*
|
||||
* This route supports the extensions: PNG, JPEG, WebP
|
||||
*/
|
||||
storePageAsset(applicationId: Snowflake, assetId: string, format: StorePageAssetFormat) {
|
||||
storePageAsset(applicationId: Snowflake, assetId: string, format: StorePageAssetFormat = ImageFormat.PNG) {
|
||||
return `/app-assets/${applicationId}/store/${assetId}.${format}` as const;
|
||||
},
|
||||
|
||||
@@ -1203,14 +1211,6 @@ export type RoleIconFormat = Exclude<ImageFormat, ImageFormat.Lottie | ImageForm
|
||||
export type GuildScheduledEventCoverFormat = Exclude<ImageFormat, ImageFormat.Lottie | ImageFormat.GIF>;
|
||||
export type GuildMemberBannerFormat = Exclude<ImageFormat, ImageFormat.Lottie>;
|
||||
|
||||
export enum ImageFormat {
|
||||
JPEG = 'jpeg',
|
||||
PNG = 'png',
|
||||
WebP = 'webp',
|
||||
GIF = 'gif',
|
||||
Lottie = 'json',
|
||||
}
|
||||
|
||||
export interface CDNQuery {
|
||||
/**
|
||||
* The returned image can have the size changed by using this query parameter
|
||||
|
||||
Reference in New Issue
Block a user