mirror of
https://github.com/LuanRT/YouTube.js.git
synced 2026-07-02 04:58:42 +00:00
chore: v3.2.0 release
This commit is contained in:
38
deno/src/parser/classes/SharedPost.ts
Normal file
38
deno/src/parser/classes/SharedPost.ts
Normal file
@@ -0,0 +1,38 @@
|
||||
import { YTNode } from '../helpers.ts';
|
||||
import { Menu } from '../map.ts';
|
||||
import Parser from '../parser.ts';
|
||||
import BackstagePost from './BackstagePost.ts';
|
||||
import Button from './Button.ts';
|
||||
import Author from './misc/Author.ts';
|
||||
import Text from './misc/Text.ts';
|
||||
import Thumbnail from './misc/Thumbnail.ts';
|
||||
import NavigationEndpoint from './NavigationEndpoint.ts';
|
||||
|
||||
class SharedPost extends YTNode {
|
||||
static type = 'SharedPost';
|
||||
|
||||
thumbnail: Thumbnail[];
|
||||
content: Text;
|
||||
published: Text;
|
||||
menu: Menu | null;
|
||||
original_post: BackstagePost | null;
|
||||
id: string;
|
||||
endpoint: NavigationEndpoint;
|
||||
expand_button: Button | null;
|
||||
author: Author;
|
||||
|
||||
constructor(data: any) {
|
||||
super();
|
||||
this.thumbnail = Thumbnail.fromResponse(data.thumbnail);
|
||||
this.content = new Text(data.content);
|
||||
this.published = new Text(data.publishedTimeText);
|
||||
this.menu = Parser.parseItem(data.actionMenu, Menu);
|
||||
this.original_post = Parser.parseItem(data.originalPost, BackstagePost);
|
||||
this.id = data.postId;
|
||||
this.endpoint = new NavigationEndpoint(data.navigationEndpoint);
|
||||
this.expand_button = Parser.parseItem(data.expandButton, Button);
|
||||
this.author = new Author(data.displayName, undefined);
|
||||
}
|
||||
}
|
||||
|
||||
export default SharedPost;
|
||||
Reference in New Issue
Block a user