mirror of
https://github.com/LuanRT/YouTube.js.git
synced 2026-06-19 12:31:17 +00:00
19 lines
704 B
TypeScript
19 lines
704 B
TypeScript
import Parser, { type RawNode } from '../index.ts';
|
|
import { type ObservedArray, YTNode, observe } from '../helpers.ts';
|
|
import PlaylistPanelVideo from './PlaylistPanelVideo.ts';
|
|
|
|
export default class PlaylistPanelVideoWrapper extends YTNode {
|
|
static type = 'PlaylistPanelVideoWrapper';
|
|
|
|
primary: PlaylistPanelVideo | null;
|
|
counterpart?: ObservedArray<PlaylistPanelVideo>;
|
|
|
|
constructor(data: RawNode) {
|
|
super();
|
|
this.primary = Parser.parseItem(data.primaryRenderer, PlaylistPanelVideo);
|
|
|
|
if (Reflect.has(data, 'counterpart')) {
|
|
this.counterpart = observe(data.counterpart.map((item: RawNode) => Parser.parseItem(item.counterpartRenderer, PlaylistPanelVideo)) || []);
|
|
}
|
|
}
|
|
} |