Files
YouTube.js/src/parser/classes/EndScreenPlaylist.ts
LuanRT 34281e2445 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 🎉
2022-08-20 03:18:17 -03:00

27 lines
756 B
TypeScript

import Text from './misc/Text';
import Thumbnail from './misc/Thumbnail';
import NavigationEndpoint from './NavigationEndpoint';
import { YTNode } from '../helpers';
class EndScreenPlaylist extends YTNode {
static type = 'EndScreenPlaylist';
id: string;
title: Text;
author: Text;
endpoint: NavigationEndpoint;
thumbnails: Thumbnail[];
video_count: Text;
constructor(data: any) {
super();
this.id = data.playlistId;
this.title = new Text(data.title);
this.author = new Text(data.longBylineText);
this.endpoint = new NavigationEndpoint(data.navigationEndpoint);
this.thumbnails = Thumbnail.fromResponse(data.thumbnail);
this.video_count = new Text(data.videoCountText);
}
}
export default EndScreenPlaylist;