mirror of
https://github.com/LuanRT/YouTube.js.git
synced 2026-06-16 11:02:10 +00:00
* dev: finish top-level parsers TS migration
* dev: migrate menu renderers to TS
* chore: fix ts errors
* dev: finish ts migration 🎉
26 lines
598 B
TypeScript
26 lines
598 B
TypeScript
import Parser from '../index';
|
|
import NavigationEndpoint from './NavigationEndpoint';
|
|
import Text from './misc/Text';
|
|
import { YTNode } from '../helpers';
|
|
|
|
class ReelShelf extends YTNode {
|
|
static type = 'ReelShelf';
|
|
|
|
title: Text;
|
|
items;
|
|
endpoint: NavigationEndpoint | null;
|
|
|
|
constructor(data: any) {
|
|
super();
|
|
this.title = new Text(data.title);
|
|
this.items = Parser.parse(data.items);
|
|
this.endpoint = data.endpoint ? new NavigationEndpoint(data.endpoint) : null;
|
|
}
|
|
|
|
// XXX: alias for consistency
|
|
get contents() {
|
|
return this.items;
|
|
}
|
|
}
|
|
|
|
export default ReelShelf; |