mirror of
https://github.com/LuanRT/YouTube.js.git
synced 2026-06-20 04:51:16 +00:00
22 lines
619 B
TypeScript
22 lines
619 B
TypeScript
import { YTNode, type ObservedArray } from '../helpers.js';
|
|
import { Parser, type RawNode } from '../index.js';
|
|
import NavigationEndpoint from './NavigationEndpoint.js';
|
|
import Text from './misc/Text.js';
|
|
|
|
export default class RichShelf extends YTNode {
|
|
static type = 'RichShelf';
|
|
|
|
title: Text;
|
|
contents: ObservedArray<YTNode>;
|
|
endpoint?: NavigationEndpoint;
|
|
|
|
constructor(data: RawNode) {
|
|
super();
|
|
this.title = new Text(data.title);
|
|
this.contents = Parser.parseArray(data.contents);
|
|
|
|
if (Reflect.has(data, 'endpoint')) {
|
|
this.endpoint = new NavigationEndpoint(data.endpoint);
|
|
}
|
|
}
|
|
} |