mirror of
https://github.com/LuanRT/YouTube.js.git
synced 2026-06-18 12:02:11 +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
27 lines
766 B
TypeScript
27 lines
766 B
TypeScript
import { YTNode } from '../helpers.js';
|
|
import Parser, { type RawNode } from '../index.js';
|
|
import InfoPanelContent from './InfoPanelContent.js';
|
|
import Menu from './menus/Menu.js';
|
|
import Text from './misc/Text.js';
|
|
|
|
export default class InfoPanelContainer extends YTNode {
|
|
static type = 'InfoPanelContainer';
|
|
|
|
title: Text;
|
|
menu: Menu | null;
|
|
content: InfoPanelContent | null;
|
|
background: string;
|
|
icon_type?: string;
|
|
|
|
constructor(data: RawNode) {
|
|
super();
|
|
this.title = new Text(data.title);
|
|
this.menu = Parser.parseItem(data.menu, Menu);
|
|
this.content = Parser.parseItem(data.content, InfoPanelContent);
|
|
this.background = data.background;
|
|
|
|
if (Reflect.has(data, 'icon')) {
|
|
this.icon_type = data.icon?.iconType;
|
|
}
|
|
}
|
|
} |