mirror of
https://github.com/LuanRT/YouTube.js.git
synced 2026-06-19 12:31:17 +00:00
* dev: finish top-level parsers TS migration
* dev: migrate menu renderers to TS
* chore: fix ts errors
* dev: finish ts migration 🎉
38 lines
1.2 KiB
TypeScript
38 lines
1.2 KiB
TypeScript
import Thumbnail from './misc/Thumbnail';
|
|
import NavigationEndpoint from './NavigationEndpoint';
|
|
import Text from './misc/Text';
|
|
import Parser from '../index';
|
|
import { YTNode } from '../helpers';
|
|
|
|
class ChannelAboutFullMetadata extends YTNode {
|
|
static type = 'ChannelAboutFullMetadata';
|
|
|
|
id: string;
|
|
name: Text;
|
|
avatar: Thumbnail[];
|
|
canonical_channel_url: string;
|
|
views: Text;
|
|
joined: Text;
|
|
description: Text;
|
|
email_reveal: NavigationEndpoint;
|
|
can_reveal_email: boolean;
|
|
country: Text;
|
|
buttons;
|
|
|
|
constructor(data: any) {
|
|
super();
|
|
this.id = data.channelId;
|
|
this.name = new Text(data.title);
|
|
this.avatar = Thumbnail.fromResponse(data.avatar);
|
|
this.canonical_channel_url = data.canonicalChannelUrl;
|
|
this.views = new Text(data.viewCountText);
|
|
this.joined = new Text(data.joinedDateText);
|
|
this.description = new Text(data.description);
|
|
this.email_reveal = new NavigationEndpoint(data.onBusinessEmailRevealClickCommand);
|
|
this.can_reveal_email = !data.signInForBusinessEmail;
|
|
this.country = new Text(data.country);
|
|
this.buttons = Parser.parse(data.actionButtons);
|
|
}
|
|
}
|
|
|
|
export default ChannelAboutFullMetadata; |