innertuber-rn
Version:
A wrapper around YouTube's private API. Supports YouTube, YouTube Music, YouTube Kids and YouTube Studio (WIP).
45 lines • 1.89 kB
JavaScript
import { YTNode } from '../helpers.js';
import { Parser } from '../index.js';
import Button from './Button.js';
import NavigationEndpoint from './NavigationEndpoint.js';
import CommentActionButtons from './comments/CommentActionButtons.js';
import Menu from './menus/Menu.js';
import Author from './misc/Author.js';
import Text from './misc/Text.js';
class BackstagePost extends YTNode {
constructor(data) {
super();
this.id = data.postId;
this.author = new Author(Object.assign(Object.assign({}, data.authorText), { navigationEndpoint: data.authorEndpoint }), null, data.authorThumbnail);
this.content = new Text(data.contentText);
this.published = new Text(data.publishedTimeText);
if (Reflect.has(data, 'pollStatus')) {
this.poll_status = data.pollStatus;
}
if (Reflect.has(data, 'voteStatus')) {
this.vote_status = data.voteStatus;
}
if (Reflect.has(data, 'voteCount')) {
this.vote_count = new Text(data.voteCount);
}
if (Reflect.has(data, 'actionMenu')) {
this.menu = Parser.parseItem(data.actionMenu, Menu);
}
if (Reflect.has(data, 'actionButtons')) {
this.action_buttons = Parser.parseItem(data.actionButtons, CommentActionButtons);
}
if (Reflect.has(data, 'voteButton')) {
this.vote_button = Parser.parseItem(data.voteButton, Button);
}
if (Reflect.has(data, 'navigationEndpoint')) {
this.endpoint = new NavigationEndpoint(data.navigationEndpoint);
}
if (Reflect.has(data, 'backstageAttachment')) {
this.attachment = Parser.parseItem(data.backstageAttachment);
}
this.surface = data.surface;
}
}
BackstagePost.type = 'BackstagePost';
export default BackstagePost;
//# sourceMappingURL=BackstagePost.js.map