feat(parser): Add AlertWithButton (#486)

This commit is contained in:
absidue
2023-08-27 21:29:23 +02:00
committed by GitHub
parent ed7be2a675
commit 8b69587787
4 changed files with 25 additions and 3 deletions

View File

@@ -0,0 +1,19 @@
import Button from './Button.js';
import Text from './misc/Text.js';
import { YTNode } from '../helpers.js';
import { Parser, type RawNode } from '../index.js';
export default class AlertWithButton extends YTNode {
static type = 'AlertWithButton';
text: Text;
alert_type: string;
dismiss_button: Button | null;
constructor(data: RawNode) {
super();
this.text = new Text(data.text);
this.alert_type = data.type;
this.dismiss_button = Parser.parseItem(data.dismissButton, Button);
}
}