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:
21
src/parser/classes/SearchRefinementCard.ts
Normal file
21
src/parser/classes/SearchRefinementCard.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
import NavigationEndpoint from './NavigationEndpoint';
|
||||
import Thumbnail from './misc/Thumbnail';
|
||||
import Text from './misc/Text';
|
||||
import { YTNode } from '../helpers';
|
||||
|
||||
class SearchRefinementCard extends YTNode {
|
||||
static type = 'SearchRefinementCard';
|
||||
|
||||
thumbnails: Thumbnail[];
|
||||
endpoint: NavigationEndpoint;
|
||||
query: string;
|
||||
|
||||
constructor(data: any) {
|
||||
super();
|
||||
this.thumbnails = Thumbnail.fromResponse(data.thumbnail);
|
||||
this.endpoint = new NavigationEndpoint(data.searchEndpoint);
|
||||
this.query = new Text(data.query).toString();
|
||||
}
|
||||
}
|
||||
|
||||
export default SearchRefinementCard;
|
||||
Reference in New Issue
Block a user