feat(history): Add ability to remove videos from watch history (#706)

* Use Button class

* Add ability to remove videos from watch history

* Update src/parser/youtube/History.ts

* Fix linting

---------

Co-authored-by: Roger <sonemonu@gmail.com>
This commit is contained in:
Dave Nicolson
2024-10-28 18:01:09 +01:00
committed by GitHub
parent 15d3865398
commit 22dd71d7da
3 changed files with 38 additions and 4 deletions

View File

@@ -2,18 +2,19 @@ import { Parser } from '../../index.js';
import type { ObservedArray } from '../../helpers.js';
import { YTNode } from '../../helpers.js';
import type { RawNode } from '../../index.js';
import Button from '../Button.js';
export default class Menu extends YTNode {
static type = 'Menu';
items: ObservedArray<YTNode>;
top_level_buttons: ObservedArray<YTNode>;
top_level_buttons: ObservedArray<Button>;
label?: string;
constructor(data: RawNode) {
super();
this.items = Parser.parseArray(data.items);
this.top_level_buttons = Parser.parseArray(data.topLevelButtons);
this.top_level_buttons = Parser.parseArray(data.topLevelButtons, Button);
if (Reflect.has(data, 'accessibility') && Reflect.has(data.accessibility, 'accessibilityData')) {
this.label = data.accessibility.accessibilityData.label;