mirror of
https://github.com/LuanRT/YouTube.js.git
synced 2026-06-13 01:22:11 +00:00
32 lines
720 B
TypeScript
32 lines
720 B
TypeScript
import { YTNode } from '../helpers.js';
|
|
import type { RawNode } from '../index.js';
|
|
|
|
export default class ThumbnailBadgeView extends YTNode {
|
|
static type = 'ThumbnailBadgeView';
|
|
|
|
icon_name?: string;
|
|
text: string;
|
|
badge_style: string;
|
|
background_color?: {
|
|
light_theme: number;
|
|
dark_theme: number;
|
|
};
|
|
|
|
constructor(data: RawNode) {
|
|
super();
|
|
|
|
this.text = data.text;
|
|
this.badge_style = data.badgeStyle;
|
|
|
|
if (data.backgroundColor) {
|
|
this.background_color = {
|
|
light_theme: data.backgroundColor.lightTheme,
|
|
dark_theme: data.backgroundColor.darkTheme
|
|
};
|
|
}
|
|
|
|
if (data.icon) {
|
|
this.icon_name = data.icon.sources[0].clientResource.imageName;
|
|
}
|
|
}
|
|
} |