mirror of
https://github.com/LuanRT/YouTube.js.git
synced 2026-06-24 23:32:32 +00:00
refactor: migrate parsers to TS (#133)
* dev: finish top-level parsers TS migration
* dev: migrate menu renderers to TS
* chore: fix ts errors
* dev: finish ts migration 🎉
This commit is contained in:
23
src/parser/classes/SearchBox.ts
Normal file
23
src/parser/classes/SearchBox.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
import Parser from '../index';
|
||||
import Text from './misc/Text';
|
||||
import NavigationEndpoint from './NavigationEndpoint';
|
||||
import { YTNode } from '../helpers';
|
||||
|
||||
class SearchBox extends YTNode {
|
||||
static type = 'SearchBox';
|
||||
|
||||
endpoint: NavigationEndpoint;
|
||||
search_button;
|
||||
clear_button;
|
||||
placeholder_text: Text;
|
||||
|
||||
constructor(data: any) {
|
||||
super();
|
||||
this.endpoint = new NavigationEndpoint(data.endpoint);
|
||||
this.search_button = Parser.parse(data.searchButton);
|
||||
this.clear_button = Parser.parse(data.clearButton);
|
||||
this.placeholder_text = new Text(data.placeholderText);
|
||||
}
|
||||
}
|
||||
|
||||
export default SearchBox;
|
||||
Reference in New Issue
Block a user