mirror of
https://github.com/LuanRT/YouTube.js.git
synced 2026-06-19 04:21:35 +00:00
refactor(Parser)!: general refactoring of parsers (#344)
* refactor: move common info into MediaInfo * refactor: better inference on Memo * refactor: improved typesafety in parser methods * refactor: remove PlaylistAuthor in favor of Author * refactor: cleanup live chat parsers - Replace non standard author type with Author class - Remove redundant code * fix: new errors due to changes * fix: pass actions to FormatUtils#toDash * refactor!: merge NavigatableText and Text into single class
This commit is contained in:
@@ -3,6 +3,8 @@ import { YTNode } from '../helpers.js';
|
||||
import SearchRefinementCard from './SearchRefinementCard.js';
|
||||
import Button from './Button.js';
|
||||
import MacroMarkersListItem from './MacroMarkersListItem.js';
|
||||
import GameCard from './GameCard.js';
|
||||
import VideoCard from './VideoCard.js';
|
||||
|
||||
class HorizontalCardList extends YTNode {
|
||||
static type = 'HorizontalCardList';
|
||||
@@ -14,10 +16,10 @@ class HorizontalCardList extends YTNode {
|
||||
|
||||
constructor(data: any) {
|
||||
super();
|
||||
this.cards = Parser.parseArray<SearchRefinementCard | MacroMarkersListItem>(data.cards);
|
||||
this.cards = Parser.parseArray(data.cards, [ SearchRefinementCard, MacroMarkersListItem, GameCard, VideoCard ]);
|
||||
this.header = Parser.parseItem(data.header);
|
||||
this.previous_button = Parser.parseItem<Button>(data.previousButton, Button);
|
||||
this.next_button = Parser.parseItem<Button>(data.nextButton, Button);
|
||||
this.previous_button = Parser.parseItem(data.previousButton, Button);
|
||||
this.next_button = Parser.parseItem(data.nextButton, Button);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user