mirror of
https://github.com/LuanRT/YouTube.js.git
synced 2026-06-25 07:42:11 +00:00
refactor(parser): fix many minor inconsistencies
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user