mirror of
https://github.com/LuanRT/YouTube.js.git
synced 2026-07-04 03:51:00 +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/VerticalWatchCardList.ts
Normal file
23
src/parser/classes/VerticalWatchCardList.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 VerticalWatchCardList extends YTNode {
|
||||
static type = 'VerticalWatchCardList';
|
||||
|
||||
items;
|
||||
contents;
|
||||
view_all_text: Text;
|
||||
view_all_endpoint: NavigationEndpoint;
|
||||
|
||||
constructor(data: any) {
|
||||
super();
|
||||
this.items = Parser.parse(data.items);
|
||||
this.contents = this.items; // XXX: alias for consistency
|
||||
this.view_all_text = new Text(data.viewAllText);
|
||||
this.view_all_endpoint = new NavigationEndpoint(data.viewAllEndpoint);
|
||||
}
|
||||
}
|
||||
|
||||
export default VerticalWatchCardList;
|
||||
Reference in New Issue
Block a user