mirror of
https://github.com/LuanRT/YouTube.js.git
synced 2026-06-16 11:02:10 +00:00
* tests: improve coverage * refactor: clean up nodes * chore: lint * feat(parser): ignore `BrandVideoShelf` Seems to be used for ads. * feat(parser): ignore `BrandVideoSingleton` too
24 lines
705 B
TypeScript
24 lines
705 B
TypeScript
import Parser, { type RawNode } from '../index.js';
|
|
import { YTNode } from '../helpers.js';
|
|
import Button from './Button.js';
|
|
import Text from './misc/Text.js';
|
|
import Thumbnail from './misc/Thumbnail.js';
|
|
|
|
export default class RecognitionShelf extends YTNode {
|
|
static type = 'RecognitionShelf';
|
|
|
|
title: Text;
|
|
subtitle: Text;
|
|
avatars: Thumbnail[];
|
|
button: Button | null;
|
|
surface: string;
|
|
|
|
constructor(data: RawNode) {
|
|
super();
|
|
this.title = new Text(data.title);
|
|
this.subtitle = new Text(data.subtitle);
|
|
this.avatars = data.avatars.map((avatar: RawNode) => new Thumbnail(avatar));
|
|
this.button = Parser.parseItem(data.button, Button);
|
|
this.surface = data.surface;
|
|
}
|
|
} |