import { Snowflake } from '@discordtypesmodules/discordtypes-api-structures/v9'; export declare const AllowedImageExtensions: string[]; /** * An enum with all extensions */ export declare enum ImageExtensions { webp = "webp", png = "png", jpeg = "jpeg", gif = "gif" } /** * All the extensions allowed to make an url */ export declare type ExtensionsLike = keyof typeof ImageExtensions; /** * All the image size allowed */ export declare type ImageSize = 16 | 23 | 64 | 128 | 512 | 1024 | 2048 | 4096; /** * The CDN options */ interface CDNOptions { /** * The base url to create an url * @var string * @default 'https://cdn.discord.com'' */ baseUrl?: string; } /** * The base image url options */ interface BaseImageUrlOptions { /** * The extension of the image * @var string * @default webp */ extension?: string; /** * The size of the image * @var ImageSize */ size?: ImageSize; } /** * The url options used to make an image url */ interface ImageURLOptions extends BaseImageUrlOptions { /** * If the image must be static or not * @var boolean */ forceStatic?: boolean; } /** * The options used when we make a cdn url */ interface MakeURLOptions { /** * All the allowed extensions * @var ImageExtensions */ allowedExtensions?: ReadonlyArray; /** * The extension for the image * @var string * @default webp; */ extension?: string; /** * The size of the image * @var ImageSize */ size?: ImageSize; } export declare class CDN { /** * The CDN options * @var CDNOptions */ options?: CDNOptions; constructor(options?: Partial); /** * Resolve the cdn options * @returns */ resolveCDNOptions(): Required; /** * Get an application asset * @param Snowflake applicationId * @param Snowflake assetId * @param BaseImageUrlOptions options * @returns */ applicationAsset(applicationId: Snowflake, assetId: Snowflake, options?: BaseImageUrlOptions): string; /** * Get an application cover * @param Snowflake applicationId * @param string hash * @param BaseImageUrlOptions options * @returns */ applicationCover(applicationId: Snowflake, hash: string, options?: BaseImageUrlOptions): string; /** * Get an application icon * @param Snowflake applicationId * @param string hash * @param BaseImageUrlOptions options * @returns */ applicationIcon(applicationId: Snowflake, hash: string, options?: BaseImageUrlOptions): string; /** * Get a custom emoji * @param Snowflake emojiId * @param BaseImageUrlOptions options * @returns */ customEmoji(emojiId: Snowflake, options?: BaseImageUrlOptions): string; /** * Get a default avatar user url * @param string|number userDiscriminator * @param BaseImageUrlOptions options * @returns */ defaultUserAvatarUrl(userDiscriminator: string | number, options?: BaseImageUrlOptions): string; /** * Get a guild banner * @param Snowflake guildId * @param string hash * @param BaseImageUrlOptions options * @returns */ guildBanner(guildId: Snowflake, hash: string, options?: BaseImageUrlOptions): string; /** * Get a guild discovery splash * @param Snowflake guildId * @param string hash * @param BaseImageUrlOptions options * @returns */ guidDiscoverySplash(guildId: Snowflake, hash: string, options?: BaseImageUrlOptions): string; /** * Get a guild icon * @param Snowflake guildId * @param string hash * @param BaseImageUrlOptions options * @returns */ guildIcon(guildId: Snowflake, hash: string, options?: BaseImageUrlOptions): string; /** * Get a guild member avatar * @param Snowflake guildId * @param Snowflake userId * @param string hash * @param BaseImageUrlOptions options * @returns */ guildMemberAvatar(guildId: Snowflake, userId: Snowflake, hash: string, options?: BaseImageUrlOptions): string; /** * Get a guild scheduled event cover * @param Snowflake scheduledEventId * @param string hash * @param BaseImageUrlOptions options * @returns */ getGuildScheduledEventCover(scheduledEventId: Snowflake, hash: string, options?: BaseImageUrlOptions): string; /** * Get a guild splash * @param Snowflake guildId * @param string hash * @param BaseImageUrlOptions options * @returns */ guildSplash(guildId: Snowflake, hash: string, options?: BaseImageUrlOptions): string; /** * Get a role icon * @param Snowflake roleId * @param string hash * @param BaseImageUrlOptions options * @returns */ roleIcon(roleId: Snowflake, hash: string, options?: BaseImageUrlOptions): string; /** * Get a sticker * @param Snowflake stickerId * @param BaseImageUrlOptions options * @returns */ sticker(stickerId: Snowflake, options?: BaseImageUrlOptions): string; /** * Get a sticker pack banner * @param Snowflake stickerPackId * @param BaseImageUrlOptions options * @returns */ stickerPackBanner(stickerPackId: Snowflake, options?: BaseImageUrlOptions): string; /** * Get a team icon * @param Snowflake teamId * @param string hash * @param BaseImageUrlOptions options * @returns */ teamIcon(teamId: Snowflake, hash: string, options?: BaseImageUrlOptions): string; /** * Get a user avatar * @param Snowflake userId * @param string hash * @param BaseImageUrlOptions options * @returns */ userAvatar(userId: Snowflake, hash: string, options?: BaseImageUrlOptions): string; /** * Get a user banner * @param Snowflake userId * @param string hash * @param BaseImageUrlOptions options * @returns */ userBanner(userId: Snowflake, hash: string, options?: BaseImageUrlOptions): string; /** * Determine if an image hash is animate and return it's url * @param string route * @param string hash * @param forceStatic boolean * @param options ImageURLOptions * @returns */ dynamicURL(route: string, hash: string, { forceStatic, ...options }?: ImageURLOptions): string; /** * Make the image url with the options passed in parameters * @param string route * @param AllowedImageExtensions allowedExtensions * @param string extension * @param size * @returns */ makeURL(route: string, { allowedExtensions, extension, size, }?: MakeURLOptions): string; } export {};