mirror of
https://github.com/LuanRT/YouTube.js.git
synced 2026-07-02 21:52:48 +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:
@@ -3,7 +3,7 @@ import Button from '../Button';
|
||||
class MenuNavigationItem extends Button {
|
||||
static type = 'MenuNavigationItem';
|
||||
|
||||
constructor(data) {
|
||||
constructor(data: any) {
|
||||
super(data);
|
||||
}
|
||||
}
|
||||
@@ -3,7 +3,7 @@ import Button from '../Button';
|
||||
class MenuServiceItem extends Button {
|
||||
static type = 'MenuServiceItem';
|
||||
|
||||
constructor(data) {
|
||||
constructor(data: any) {
|
||||
super(data);
|
||||
}
|
||||
}
|
||||
@@ -4,7 +4,10 @@ import { YTNode } from '../../helpers';
|
||||
class MenuServiceItemDownload extends YTNode {
|
||||
static type = 'MenuServiceItemDownload';
|
||||
|
||||
constructor(data) {
|
||||
has_separator: boolean;
|
||||
endpoint: NavigationEndpoint;
|
||||
|
||||
constructor(data: any) {
|
||||
super();
|
||||
this.has_separator = data.hasSeparator;
|
||||
this.endpoint = new NavigationEndpoint(data.navigationEndpoint || data.serviceEndpoint);
|
||||
@@ -4,7 +4,11 @@ import { YTNode } from '../../helpers';
|
||||
class MultiPageMenu extends YTNode {
|
||||
static type = 'MultiPageMenu';
|
||||
|
||||
constructor(data) {
|
||||
header;
|
||||
sections;
|
||||
style: string;
|
||||
|
||||
constructor(data: any) {
|
||||
super();
|
||||
this.header = Parser.parse(data.header);
|
||||
this.sections = Parser.parse(data.sections);
|
||||
@@ -4,7 +4,9 @@ import { YTNode } from '../../helpers';
|
||||
class MultiPageMenuNotificationSection extends YTNode {
|
||||
static type = 'MultiPageMenuNotificationSection';
|
||||
|
||||
constructor(data) {
|
||||
items;
|
||||
|
||||
constructor(data: any) {
|
||||
super();
|
||||
this.items = Parser.parse(data.items);
|
||||
}
|
||||
@@ -5,7 +5,10 @@ import { YTNode } from '../../helpers';
|
||||
class SimpleMenuHeader extends YTNode {
|
||||
static type = 'SimpleMenuHeader';
|
||||
|
||||
constructor(data) {
|
||||
title: Text;
|
||||
buttons;
|
||||
|
||||
constructor(data: any) {
|
||||
super();
|
||||
this.title = new Text(data.title);
|
||||
this.buttons = Parser.parse(data.buttons);
|
||||
Reference in New Issue
Block a user