feat: finalize comment section nodes (#280)

* fix: comment translation proto missing channel id

* feat: finalize nodes

* docs: update API ref

* chore: update tests
This commit is contained in:
LuanRT
2023-01-09 08:14:31 -03:00
committed by GitHub
parent 56e6e23453
commit dca61c3a22
28 changed files with 539 additions and 146 deletions

View File

@@ -1,21 +1,22 @@
import Parser from '../../index';
import Thumbnail from '../misc/Thumbnail';
import Text from '../misc/Text';
import type Button from '../Button';
import { YTNode } from '../../helpers';
class CommentSimplebox extends YTNode {
static type = 'CommentSimplebox';
submit_button;
cancel_button;
submit_button: Button | null;
cancel_button: Button | null;
author_thumbnails: Thumbnail[];
placeholder: Text;
avatar_size;
constructor(data: any) {
super();
this.submit_button = Parser.parse(data.submitButton);
this.cancel_button = Parser.parse(data.cancelButton);
this.submit_button = Parser.parseItem<Button>(data.submitButton);
this.cancel_button = Parser.parseItem<Button>(data.cancelButton);
this.author_thumbnails = Thumbnail.fromResponse(data.authorThumbnail);
this.placeholder = new Text(data.placeholderText);
this.avatar_size = data.avatarSize;