mirror of
https://github.com/LuanRT/YouTube.js.git
synced 2026-06-20 04:51:16 +00:00
* 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.
24 lines
559 B
TypeScript
24 lines
559 B
TypeScript
import Parser from '../../index.js';
|
|
import { YTNode } from '../../helpers.js';
|
|
import type { RawNode } from '../../index.js';
|
|
class Menu extends YTNode {
|
|
static type = 'Menu';
|
|
|
|
items;
|
|
top_level_buttons;
|
|
label;
|
|
|
|
constructor(data: RawNode) {
|
|
super();
|
|
this.items = Parser.parseArray(data.items);
|
|
this.top_level_buttons = Parser.parseArray(data.topLevelButtons);
|
|
this.label = data.accessibility?.accessibilityData?.label || null;
|
|
}
|
|
|
|
// XXX: alias for consistency
|
|
get contents() {
|
|
return this.items;
|
|
}
|
|
}
|
|
|
|
export default Menu; |