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 CommentReplyDialog extends YTNode {
static type = 'CommentReplyDialog';
reply_button;
cancel_button;
author_thumbnail;
placeholder;
error_message;
reply_button: Button | null;
cancel_button: Button | null;
author_thumbnail: Thumbnail[];
placeholder: Text;
error_message: Text;
constructor(data: any) {
super();
this.reply_button = Parser.parse(data.replyButton);
this.cancel_button = Parser.parse(data.cancelButton);
this.reply_button = Parser.parseItem<Button>(data.replyButton);
this.cancel_button = Parser.parseItem<Button>(data.cancelButton);
this.author_thumbnail = Thumbnail.fromResponse(data.authorThumbnail);
this.placeholder = new Text(data.placeholderText);
this.error_message = new Text(data.errorMessage);