mirror of
https://github.com/LuanRT/YouTube.js.git
synced 2026-06-30 18:06:15 +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:
20
src/parser/classes/UniversalWatchCard.ts
Normal file
20
src/parser/classes/UniversalWatchCard.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
import Parser from '../index';
|
||||
import { YTNode } from '../helpers';
|
||||
|
||||
class UniversalWatchCard extends YTNode {
|
||||
static type = 'UniversalWatchCard';
|
||||
|
||||
header;
|
||||
call_to_action;
|
||||
sections;
|
||||
|
||||
constructor(data: any) {
|
||||
super();
|
||||
// TODO: use parseItem / parseArray for these
|
||||
this.header = Parser.parse(data.header);
|
||||
this.call_to_action = Parser.parse(data.callToAction);
|
||||
this.sections = Parser.parse(data.sections);
|
||||
}
|
||||
}
|
||||
|
||||
export default UniversalWatchCard;
|
||||
Reference in New Issue
Block a user