Files
YouTube.js/src/parser/classes/RecognitionShelf.ts
LuanRT 3cbcd71a3a feat: add support for topic/auto-generated channels and fix minor parsing errors (#233)
* dev: add support for topic channels

* dev(parser): do not try to parse empty nodes

* dev: add support for auto-generated game channels
2022-11-11 00:38:44 -03:00

26 lines
668 B
TypeScript

import Parser from '..';
import { YTNode } from '../helpers';
import Button from './Button';
import Text from './misc/Text';
import Thumbnail from './misc/Thumbnail';
export default class RecognitionShelf extends YTNode {
static type = 'RecognitionShelf';
title: Text;
subtitle: Text;
avatars: Thumbnail[];
button: Button | null;
surface: string;
constructor(data: any) {
super();
this.title = new Text(data.title);
this.subtitle = new Text(data.subtitle);
this.avatars = data.avatars.map((avatar: any) => new Thumbnail(avatar));
this.button = Parser.parseItem<Button>(data.button, Button);
this.surface = data.surface;
}
}