mirror of
https://github.com/LuanRT/YouTube.js.git
synced 2026-06-16 19:12:24 +00:00
* feat: add `PlaylistPanelVideoWrapper` parser * fix: `PlaylistPanelVideoWrapper` no counterpart
18 lines
599 B
TypeScript
18 lines
599 B
TypeScript
import Parser from '..';
|
|
import { YTNode } from '../helpers';
|
|
import PlaylistPanelVideo from './PlaylistPanelVideo';
|
|
|
|
class PlaylistPanelVideoWrapper extends YTNode {
|
|
static type = 'PlaylistPanelVideoWrapper';
|
|
|
|
primary: PlaylistPanelVideo | null;
|
|
counterpart: Array<PlaylistPanelVideo | null>;
|
|
|
|
constructor(data: any) {
|
|
super();
|
|
this.primary = Parser.parseItem<PlaylistPanelVideo>(data.primaryRenderer);
|
|
this.counterpart = data.counterpart?.map((item: any) => Parser.parseItem<PlaylistPanelVideo>(item.counterpartRenderer)) || [];
|
|
}
|
|
}
|
|
|
|
export default PlaylistPanelVideoWrapper; |