Files
YouTube.js/src/parser/classes/VideoInfoCardContent.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
803 B
TypeScript

import Text from './misc/Text';
import Thumbnail from './misc/Thumbnail';
import NavigationEndpoint from './NavigationEndpoint';
import { YTNode } from '../helpers';
class VideoInfoCardContent extends YTNode {
static type = 'VideoInfoCardContent';
title: Text;
channel_name: Text;
view_count: Text;
video_thumbnails: Thumbnail[];
duration: Text;
endpoint: NavigationEndpoint;
constructor(data: any) {
super();
this.title = new Text(data.videoTitle);
this.channel_name = new Text(data.channelName);
this.view_count = new Text(data.viewCountText);
this.video_thumbnails = Thumbnail.fromResponse(data.videoThumbnail);
this.duration = new Text(data.lengthString);
this.endpoint = new NavigationEndpoint(data.action);
}
}
export default VideoInfoCardContent;