mirror of
https://github.com/LuanRT/YouTube.js.git
synced 2026-06-19 12:31:17 +00:00
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user