@twurple/common
Advanced tools
Comparing version 5.0.0-pre.15 to 5.0.0-pre.16
@@ -5,9 +5,34 @@ import { DataObject } from '../DataObject'; | ||
code: string; | ||
id: number; | ||
id: string; | ||
} | ||
/** | ||
* The different possible emote size identifiers. | ||
* The possible animation settings for an emote image. | ||
*/ | ||
export declare type EmoteAnimationSettings = 'default' | 'static' | 'animated'; | ||
/** | ||
* The possible background types to optimize the emote display for. | ||
*/ | ||
export declare type EmoteBackgroundType = 'light' | 'dark'; | ||
/** | ||
* The possible emote size multipliers. | ||
*/ | ||
export declare type EmoteSize = '1.0' | '2.0' | '3.0'; | ||
/** | ||
* The display settings for an emote. | ||
*/ | ||
export interface EmoteSettings { | ||
/** | ||
* The animation settings of the emote. | ||
*/ | ||
animationSettings: EmoteAnimationSettings; | ||
/** | ||
* The background type of the emote. | ||
*/ | ||
backgroundType: EmoteBackgroundType; | ||
/** | ||
* The size multiplier of the emote. | ||
*/ | ||
size: EmoteSize; | ||
} | ||
/** | ||
* A chat emote. | ||
@@ -19,3 +44,3 @@ */ | ||
*/ | ||
get id(): number; | ||
get id(): string; | ||
/** | ||
@@ -28,6 +53,6 @@ * The emote code, i.e. how you write it in chat. | ||
* | ||
* @param size The pixel density of the emote image. | ||
* @param settings The display settings of the emote image. | ||
*/ | ||
getUrl(size: EmoteSize): string; | ||
getUrl(settings: EmoteSettings): string; | ||
} | ||
//# sourceMappingURL=ChatEmote.d.ts.map |
@@ -26,6 +26,7 @@ "use strict"; | ||
* | ||
* @param size The pixel density of the emote image. | ||
* @param settings The display settings of the emote image. | ||
*/ | ||
getUrl(size) { | ||
return `https://static-cdn.jtvnw.net/emoticons/v1/${this.id}/${size}`; | ||
getUrl(settings) { | ||
const { animationSettings = 'default', backgroundType = 'dark', size = '1.0' } = settings; | ||
return `https://static-cdn.jtvnw.net/emoticons/v2/${this.id}/${animationSettings}/${backgroundType}/${size}`; | ||
} | ||
@@ -32,0 +33,0 @@ }; |
{ | ||
"name": "@twurple/common", | ||
"version": "5.0.0-pre.15", | ||
"version": "5.0.0-pre.16", | ||
"publishConfig": { | ||
@@ -47,3 +47,3 @@ "access": "public" | ||
}, | ||
"gitHead": "bc84b6a9e404cd76197fe65d9d99f8667e4337bb" | ||
"gitHead": "6884845a0d7715ce8bfabcc27c74e2cc75f75e7c" | ||
} |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
32498
848