Files
YouTube.js/src/parser/classes/WatchCardRichHeader.ts
2022-11-30 19:02:49 -03:00

26 lines
767 B
TypeScript

import Author from './misc/Author';
import NavigationEndpoint from './NavigationEndpoint';
import Text from './misc/Text';
import { YTNode } from '../helpers';
class WatchCardRichHeader extends YTNode {
static type = 'WatchCardRichHeader';
title: Text;
title_endpoint: NavigationEndpoint;
subtitle: Text;
author: Author;
style: string;
constructor(data: any) {
super();
this.title = new Text(data.title);
this.title_endpoint = new NavigationEndpoint(data.titleNavigationEndpoint);
this.subtitle = new Text(data.subtitle);
this.author = new Author(data, data.titleBadge ? [ data.titleBadge ] : null, data.avatar);
this.author.name = this.title.toString();
this.style = data.style;
}
}
export default WatchCardRichHeader;