refactor(parser): fix many minor inconsistencies

This commit is contained in:
LuanRT
2023-03-15 06:43:04 -03:00
parent 1a2fc3abd7
commit 3d3436472f
35 changed files with 144 additions and 144 deletions

View File

@@ -1,8 +1,8 @@
import Parser from '../index.js';
import { YTNode } from '../helpers.js';
import Parser, { RawNode } from '../index.js';
import Text from './misc/Text.js';
import Thumbnail from './misc/Thumbnail.js';
import NavigationEndpoint from './NavigationEndpoint.js';
import { YTNode } from '../helpers.js';
class Notification extends YTNode {
static type = 'Notification';
@@ -11,13 +11,13 @@ class Notification extends YTNode {
video_thumbnails: Thumbnail[];
short_message: Text;
sent_time: Text;
notification_id: any;
notification_id: string;
endpoint: NavigationEndpoint;
record_click_endpoint: NavigationEndpoint;
menu;
read: boolean;
constructor(data: any) {
constructor(data: RawNode) {
super();
this.thumbnails = Thumbnail.fromResponse(data.thumbnail);
this.video_thumbnails = Thumbnail.fromResponse(data.videoThumbnail);
@@ -26,7 +26,7 @@ class Notification extends YTNode {
this.notification_id = data.notificationId;
this.endpoint = new NavigationEndpoint(data.navigationEndpoint);
this.record_click_endpoint = new NavigationEndpoint(data.recordClickEndpoint);
this.menu = Parser.parse(data.contextualMenu);
this.menu = Parser.parseItem(data.contextualMenu);
this.read = data.read;
}
}