mirror of
https://github.com/LuanRT/YouTube.js.git
synced 2026-06-24 15:21:54 +00:00
* dev: finish top-level parsers TS migration
* dev: migrate menu renderers to TS
* chore: fix ts errors
* dev: finish ts migration 🎉
25 lines
649 B
TypeScript
25 lines
649 B
TypeScript
import Text from './misc/Text';
|
|
import NavigationEndpoint from './NavigationEndpoint';
|
|
import { YTNode } from '../helpers';
|
|
|
|
class SearchSuggestion extends YTNode {
|
|
static type = 'SearchSuggestion';
|
|
|
|
suggestion: Text;
|
|
endpoint: NavigationEndpoint;
|
|
icon_type: string;
|
|
service_endpoint;
|
|
|
|
constructor(data: any) {
|
|
super();
|
|
this.suggestion = new Text(data.suggestion);
|
|
this.endpoint = new NavigationEndpoint(data.navigationEndpoint);
|
|
this.icon_type = data.icon.iconType;
|
|
|
|
if (data.serviceEndpoint) {
|
|
this.service_endpoint = new NavigationEndpoint(data.serviceEndpoint);
|
|
}
|
|
}
|
|
}
|
|
|
|
export default SearchSuggestion; |