feat(parser): Add SearchHeader

We may want to remove the old SearchSubMenu node in the future but YouTube still uses it sometimes, so we will keep it for now.

Closes #452
This commit is contained in:
LuanRT
2023-07-24 20:26:05 -03:00
parent 18cbc8c038
commit 6997982cf2
7 changed files with 68 additions and 21 deletions

View File

@@ -0,0 +1,18 @@
import { YTNode } from '../helpers.js';
import { Parser, type RawNode } from '../index.js';
import Button from './Button.js';
import ChipCloud from './ChipCloud.js';
export default class SearchHeader extends YTNode {
static type = 'SearchHeader';
chip_bar: ChipCloud | null;
search_filter_button: Button | null;
constructor(data: RawNode) {
super();
this.chip_bar = Parser.parseItem(data.chipBar, ChipCloud);
this.search_filter_button = Parser.parseItem(data.searchFilterButton, Button);
console.log(this.search_filter_button?.endpoint.open_popup);
}
}