mirror of
https://github.com/LuanRT/YouTube.js.git
synced 2026-06-14 10:02:16 +00:00
* tests: improve coverage * refactor: clean up nodes * chore: lint * feat(parser): ignore `BrandVideoShelf` Seems to be used for ads. * feat(parser): ignore `BrandVideoSingleton` too
35 lines
1.2 KiB
TypeScript
35 lines
1.2 KiB
TypeScript
import Button from './Button.js';
|
|
import MetadataBadge from './MetadataBadge.js';
|
|
import SubscribeButton from './SubscribeButton.js';
|
|
import Text from './misc/Text.js';
|
|
import Thumbnail from './misc/Thumbnail.js';
|
|
|
|
import { YTNode, type ObservedArray } from '../helpers.js';
|
|
import Parser, { type RawNode } from '../index.js';
|
|
|
|
export default 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: RawNode) {
|
|
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(data.badges, MetadataBadge);
|
|
this.box_art = Thumbnail.fromResponse(data.boxArt);
|
|
this.banner = Thumbnail.fromResponse(data.banner);
|
|
this.buttons = Parser.parseArray(data.buttons, [ SubscribeButton, Button ]);
|
|
this.auto_generated = new Text(data.autoGenerated);
|
|
}
|
|
} |