mirror of
https://github.com/LuanRT/YouTube.js.git
synced 2026-06-19 20:41:17 +00:00
* dev: finish top-level parsers TS migration
* dev: migrate menu renderers to TS
* chore: fix ts errors
* dev: finish ts migration 🎉
42 lines
1.1 KiB
TypeScript
42 lines
1.1 KiB
TypeScript
import Parser from '../index';
|
|
import Text from './misc/Text';
|
|
import Author from './misc/Author';
|
|
import Thumbnail from './misc/Thumbnail';
|
|
import NavigationEndpoint from './NavigationEndpoint';
|
|
import { YTNode } from '../helpers';
|
|
|
|
class EndScreenVideo extends YTNode {
|
|
static type = 'EndScreenVideo';
|
|
|
|
id: string;
|
|
title: Text;
|
|
thumbnails: Thumbnail[];
|
|
thumbnail_overlays;
|
|
author: Author;
|
|
endpoint: NavigationEndpoint;
|
|
short_view_count: Text;
|
|
badges;
|
|
|
|
duration: {
|
|
text: string;
|
|
seconds: number;
|
|
};
|
|
|
|
constructor(data: any) {
|
|
super();
|
|
this.id = data.videoId;
|
|
this.title = new Text(data.title);
|
|
this.thumbnails = Thumbnail.fromResponse(data.thumbnail);
|
|
this.thumbnail_overlays = Parser.parse(data.thumbnailOverlays);
|
|
this.author = new Author(data.shortBylineText, data.ownerBadges);
|
|
this.endpoint = new NavigationEndpoint(data.navigationEndpoint);
|
|
this.short_view_count = new Text(data.shortViewCountText);
|
|
this.badges = Parser.parse(data.badges);
|
|
this.duration = {
|
|
text: new Text(data.lengthText).toString(),
|
|
seconds: data.lengthInSeconds
|
|
};
|
|
}
|
|
}
|
|
|
|
export default EndScreenVideo; |