mirror of
https://github.com/LuanRT/YouTube.js.git
synced 2026-06-17 03:22:15 +00:00
chore(parser): import YTNodes directly to reduce web bundle size
This commit is contained in:
@@ -1,20 +1,22 @@
|
||||
import { ObservedArray, YTNode } from '../helpers.js';
|
||||
import type { RawNode } from '../index.js';
|
||||
import Parser, { YTNodes } from '../index.js';
|
||||
import Parser from '../index.js';
|
||||
import Text from './misc/Text.js';
|
||||
import SearchFilterGroup from './SearchFilterGroup.js';
|
||||
import ToggleButton from './ToggleButton.js';
|
||||
|
||||
class SearchSubMenu extends YTNode {
|
||||
static type = 'SearchSubMenu';
|
||||
|
||||
title: Text;
|
||||
groups: ObservedArray<YTNodes.SearchFilterGroup> | null;
|
||||
button: YTNodes.ToggleButton | null;
|
||||
groups: ObservedArray<SearchFilterGroup> | null;
|
||||
button: ToggleButton | null;
|
||||
|
||||
constructor(data: RawNode) {
|
||||
super();
|
||||
this.title = new Text(data.title);
|
||||
this.groups = Parser.parseArray(data.groups, YTNodes.SearchFilterGroup);
|
||||
this.button = Parser.parseItem(data.button, YTNodes.ToggleButton);
|
||||
this.groups = Parser.parseArray(data.groups, SearchFilterGroup);
|
||||
this.button = Parser.parseItem(data.button, ToggleButton);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user