Files
YouTube.js/src/parser/classes/SearchSuggestion.ts
LuanRT 34281e2445 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 🎉
2022-08-20 03:18:17 -03:00

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;