mirror of
https://github.com/LuanRT/YouTube.js.git
synced 2026-06-17 11:32:27 +00:00
38 lines
1.2 KiB
TypeScript
38 lines
1.2 KiB
TypeScript
import Parser from '..';
|
|
import { ObservedArray, YTNode } from '../helpers';
|
|
|
|
import Text from './misc/Text';
|
|
import Thumbnail from './misc/Thumbnail';
|
|
import SubscribeButton from './SubscribeButton';
|
|
import MetadataBadge from './MetadataBadge';
|
|
import Button from './Button';
|
|
|
|
class InteractiveTabbedHeader extends YTNode {
|
|
static type = 'InteractiveTabbedHeader';
|
|
|
|
header_type: string;
|
|
title: Text;
|
|
description: Text;
|
|
metadata: Text;
|
|
badges: MetadataBadge[];
|
|
box_art: Thumbnail[];
|
|
banner: Thumbnail[];
|
|
buttons: ObservedArray<SubscribeButton | Button>;
|
|
auto_generated: Text;
|
|
|
|
constructor(data: any) {
|
|
super();
|
|
|
|
this.header_type = data.type;
|
|
this.title = new Text(data.title);
|
|
this.description = new Text(data.description);
|
|
this.metadata = new Text(data.metadata);
|
|
this.badges = Parser.parseArray<MetadataBadge>(data.badges, MetadataBadge);
|
|
this.box_art = Thumbnail.fromResponse(data.boxArt);
|
|
this.banner = Thumbnail.fromResponse(data.banner);
|
|
this.buttons = Parser.parseArray<SubscribeButton | Button>(data.buttons, [ SubscribeButton, Button ]);
|
|
this.auto_generated = new Text(data.autoGenerated);
|
|
}
|
|
}
|
|
|
|
export default InteractiveTabbedHeader; |