Files
YouTube.js/src/parser/classes/comments/CommentSimplebox.ts
Chinmay Kumar cfc1a183e0 refactor(parser): type YTNodes' data arg as RawNode (wip) (#339)
* replaced YTNode's data arg as RawNode

* updated documentation

* removed unused import

---- Note that there are still many nodes that need to be updated, hence the WIP status.
2023-03-07 02:02:07 -03:00

27 lines
855 B
TypeScript

import Parser from '../../index.js';
import Thumbnail from '../misc/Thumbnail.js';
import Text from '../misc/Text.js';
import type Button from '../Button.js';
import { YTNode } from '../../helpers.js';
import type { RawNode } from '../../index.js';
class CommentSimplebox extends YTNode {
static type = 'CommentSimplebox';
submit_button: Button | null;
cancel_button: Button | null;
author_thumbnails: Thumbnail[];
placeholder: Text;
avatar_size;
constructor(data: RawNode) {
super();
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;
}
}
export default CommentSimplebox;