mirror of
https://github.com/LuanRT/YouTube.js.git
synced 2026-06-28 09:06:51 +00:00
refactor: migrate parsers to TS (#133)
* dev: finish top-level parsers TS migration
* dev: migrate menu renderers to TS
* chore: fix ts errors
* dev: finish ts migration 🎉
This commit is contained in:
26
src/parser/classes/WatchCardRichHeader.ts
Normal file
26
src/parser/classes/WatchCardRichHeader.ts
Normal file
@@ -0,0 +1,26 @@
|
||||
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;
|
||||
Reference in New Issue
Block a user