mirror of
https://github.com/LuanRT/YouTube.js.git
synced 2026-07-03 09:35:05 +00:00
refactor: migrate parsers to TS (#133)
* dev: finish top-level parsers TS migration
* dev: migrate menu renderers to TS
* chore: fix ts errors
* dev: finish ts migration 🎉
This commit is contained in:
21
src/parser/classes/RichShelf.ts
Normal file
21
src/parser/classes/RichShelf.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
import Parser from '../index';
|
||||
import NavigationEndpoint from './NavigationEndpoint';
|
||||
import Text from './misc/Text';
|
||||
import { YTNode } from '../helpers';
|
||||
|
||||
class RichShelf extends YTNode {
|
||||
static type = 'RichShelf';
|
||||
|
||||
title: Text;
|
||||
contents;
|
||||
endpoint: NavigationEndpoint | null;
|
||||
|
||||
constructor(data: any) {
|
||||
super();
|
||||
this.title = new Text(data.title);
|
||||
this.contents = Parser.parse(data.contents);
|
||||
this.endpoint = data.endpoint ? new NavigationEndpoint(data.endpoint) : null;
|
||||
}
|
||||
}
|
||||
|
||||
export default RichShelf;
|
||||
Reference in New Issue
Block a user