From 95f713ff539be36006a5e1a2b0bcd459ded44f11 Mon Sep 17 00:00:00 2001 From: LuanRT Date: Fri, 10 Jun 2022 15:06:27 -0300 Subject: [PATCH] chore: update type definitions --- typings/lib/Innertube.d.ts | 2 + typings/lib/core/Music.d.ts | 17 ++++ .../contents/classes/ChipCloudChip.d.ts | 3 +- .../parser/contents/classes/DidYouMean.d.ts | 9 +++ .../contents/classes/EmergencyOnebox.d.ts | 9 +++ .../contents/classes/MerchandiseItem.d.ts | 17 ++++ .../contents/classes/MerchandiseShelf.d.ts | 8 ++ .../lib/parser/contents/classes/Message.d.ts | 6 ++ .../parser/contents/classes/MusicHeader.d.ts | 6 ++ .../contents/classes/MusicInlineBadge.d.ts | 7 ++ .../classes/MusicItemThumbnailOverlay.d.ts | 8 ++ .../contents/classes/MusicPlayButton.d.ts | 12 +++ .../classes/MusicResponsiveListItem.d.ts | 38 +++++++++ .../MusicResponsiveListItemFlexColumn.d.ts | 8 ++ .../parser/contents/classes/MusicShelf.d.ts | 12 +++ .../contents/classes/NavigationEndpoint.d.ts | 15 ++-- .../contents/classes/PlayerErrorMessage.d.ts | 11 +++ .../parser/contents/classes/SectionList.d.ts | 1 + .../contents/classes/ShowingResultsFor.d.ts | 10 +++ .../classes/SingleActionEmergencySupport.d.ts | 12 +++ .../classes/ToggleMenuServiceItem.d.ts | 12 +++ typings/lib/parser/contents/index.d.ts | 4 +- typings/lib/parser/youtube/Analytics.d.ts | 1 + typings/lib/parser/youtube/History.d.ts | 4 +- typings/lib/parser/youtube/Library.d.ts | 5 +- typings/lib/parser/youtube/Search.d.ts | 4 +- typings/lib/parser/youtube/VideoInfo.d.ts | 80 ++++++++++++------- typings/lib/parser/ytmusic/Search.d.ts | 45 +++++++++++ typings/lib/utils/Utils.d.ts | 8 ++ 29 files changed, 327 insertions(+), 47 deletions(-) create mode 100644 typings/lib/core/Music.d.ts create mode 100644 typings/lib/parser/contents/classes/DidYouMean.d.ts create mode 100644 typings/lib/parser/contents/classes/EmergencyOnebox.d.ts create mode 100644 typings/lib/parser/contents/classes/MerchandiseItem.d.ts create mode 100644 typings/lib/parser/contents/classes/MerchandiseShelf.d.ts create mode 100644 typings/lib/parser/contents/classes/Message.d.ts create mode 100644 typings/lib/parser/contents/classes/MusicHeader.d.ts create mode 100644 typings/lib/parser/contents/classes/MusicInlineBadge.d.ts create mode 100644 typings/lib/parser/contents/classes/MusicItemThumbnailOverlay.d.ts create mode 100644 typings/lib/parser/contents/classes/MusicPlayButton.d.ts create mode 100644 typings/lib/parser/contents/classes/MusicResponsiveListItem.d.ts create mode 100644 typings/lib/parser/contents/classes/MusicResponsiveListItemFlexColumn.d.ts create mode 100644 typings/lib/parser/contents/classes/MusicShelf.d.ts create mode 100644 typings/lib/parser/contents/classes/PlayerErrorMessage.d.ts create mode 100644 typings/lib/parser/contents/classes/ShowingResultsFor.d.ts create mode 100644 typings/lib/parser/contents/classes/SingleActionEmergencySupport.d.ts create mode 100644 typings/lib/parser/contents/classes/ToggleMenuServiceItem.d.ts create mode 100644 typings/lib/parser/ytmusic/Search.d.ts diff --git a/typings/lib/Innertube.d.ts b/typings/lib/Innertube.d.ts index cbb6c6dd..c053d941 100644 --- a/typings/lib/Innertube.d.ts +++ b/typings/lib/Innertube.d.ts @@ -57,6 +57,7 @@ declare class Innertube { account: AccountManager; playlist: PlaylistManager; interact: InteractionManager; + music: YTMusic; /** * Signs in to a google account. * @@ -334,6 +335,7 @@ import Actions = require("./core/Actions"); import AccountManager = require("./core/AccountManager"); import PlaylistManager = require("./core/PlaylistManager"); import InteractionManager = require("./core/InteractionManager"); +import YTMusic = require("./core/Music"); import VideoInfo = require("./parser/youtube/VideoInfo"); import Search = require("./parser/youtube/Search"); import Stream = require("stream"); diff --git a/typings/lib/core/Music.d.ts b/typings/lib/core/Music.d.ts new file mode 100644 index 00000000..32963e70 --- /dev/null +++ b/typings/lib/core/Music.d.ts @@ -0,0 +1,17 @@ +export = Music; +/** @namespace */ +declare class Music { + /** + * @param {Innertube} session + * @constructor + */ + constructor(session: Innertube); + /** + * Search on YouTube Music. + * @param {string} query + * @returns {Promise.} + */ + search(query: string): Promise; + #private; +} +import Search = require("../parser/ytmusic/Search"); diff --git a/typings/lib/parser/contents/classes/ChipCloudChip.d.ts b/typings/lib/parser/contents/classes/ChipCloudChip.d.ts index 73d98c7a..70304f7c 100644 --- a/typings/lib/parser/contents/classes/ChipCloudChip.d.ts +++ b/typings/lib/parser/contents/classes/ChipCloudChip.d.ts @@ -2,9 +2,8 @@ export = ChipCloudChip; declare class ChipCloudChip { constructor(data: any); type: string; - text: Text; + text: any; endpoint: NavigationEndpoint; is_selected: any; } -import Text = require("./Text"); import NavigationEndpoint = require("./NavigationEndpoint"); diff --git a/typings/lib/parser/contents/classes/DidYouMean.d.ts b/typings/lib/parser/contents/classes/DidYouMean.d.ts new file mode 100644 index 00000000..8065eab0 --- /dev/null +++ b/typings/lib/parser/contents/classes/DidYouMean.d.ts @@ -0,0 +1,9 @@ +export = DidYouMean; +declare class DidYouMean { + constructor(data: any); + type: string; + corrected_query: Text; + endpoint: NavigationEndpoint; +} +import Text = require("./Text"); +import NavigationEndpoint = require("./NavigationEndpoint"); diff --git a/typings/lib/parser/contents/classes/EmergencyOnebox.d.ts b/typings/lib/parser/contents/classes/EmergencyOnebox.d.ts new file mode 100644 index 00000000..ee3c761a --- /dev/null +++ b/typings/lib/parser/contents/classes/EmergencyOnebox.d.ts @@ -0,0 +1,9 @@ +export = EmergencyOnebox; +declare class EmergencyOnebox { + constructor(data: any); + type: string; + title: Text; + first_option: any; + menu: any; +} +import Text = require("./Text"); diff --git a/typings/lib/parser/contents/classes/MerchandiseItem.d.ts b/typings/lib/parser/contents/classes/MerchandiseItem.d.ts new file mode 100644 index 00000000..0ba9a032 --- /dev/null +++ b/typings/lib/parser/contents/classes/MerchandiseItem.d.ts @@ -0,0 +1,17 @@ +export = MerchandiseItem; +declare class MerchandiseItem { + constructor(data: any); + type: string; + title: any; + description: any; + thumbnails: any; + price: any; + vendor_name: any; + button_text: any; + button_accessibility_text: any; + from_vendor_text: any; + additional_fees_text: any; + region_format: any; + endpoint: NavigationEndpoint; +} +import NavigationEndpoint = require("./NavigationEndpoint"); diff --git a/typings/lib/parser/contents/classes/MerchandiseShelf.d.ts b/typings/lib/parser/contents/classes/MerchandiseShelf.d.ts new file mode 100644 index 00000000..4376ff7f --- /dev/null +++ b/typings/lib/parser/contents/classes/MerchandiseShelf.d.ts @@ -0,0 +1,8 @@ +export = MerchandiseShelf; +declare class MerchandiseShelf { + constructor(data: any); + type: string; + title: any; + menu: any; + items: any; +} diff --git a/typings/lib/parser/contents/classes/Message.d.ts b/typings/lib/parser/contents/classes/Message.d.ts new file mode 100644 index 00000000..e6c55a64 --- /dev/null +++ b/typings/lib/parser/contents/classes/Message.d.ts @@ -0,0 +1,6 @@ +export = Message; +declare class Message { + constructor(data: any); + type: string; + text: any; +} diff --git a/typings/lib/parser/contents/classes/MusicHeader.d.ts b/typings/lib/parser/contents/classes/MusicHeader.d.ts new file mode 100644 index 00000000..52b880bb --- /dev/null +++ b/typings/lib/parser/contents/classes/MusicHeader.d.ts @@ -0,0 +1,6 @@ +export = MusicHeader; +declare class MusicHeader { + constructor(data: any); + type: string; + header: any; +} diff --git a/typings/lib/parser/contents/classes/MusicInlineBadge.d.ts b/typings/lib/parser/contents/classes/MusicInlineBadge.d.ts new file mode 100644 index 00000000..bc3471d8 --- /dev/null +++ b/typings/lib/parser/contents/classes/MusicInlineBadge.d.ts @@ -0,0 +1,7 @@ +export = MusicInlineBadge; +declare class MusicInlineBadge { + constructor(data: any); + type: string; + icon_type: any; + label: any; +} diff --git a/typings/lib/parser/contents/classes/MusicItemThumbnailOverlay.d.ts b/typings/lib/parser/contents/classes/MusicItemThumbnailOverlay.d.ts new file mode 100644 index 00000000..87f479bf --- /dev/null +++ b/typings/lib/parser/contents/classes/MusicItemThumbnailOverlay.d.ts @@ -0,0 +1,8 @@ +export = MusicItemThumbnailOverlay; +declare class MusicItemThumbnailOverlay { + constructor(data: any); + type: string; + content: any; + content_position: any; + display_style: any; +} diff --git a/typings/lib/parser/contents/classes/MusicPlayButton.d.ts b/typings/lib/parser/contents/classes/MusicPlayButton.d.ts new file mode 100644 index 00000000..d76f1fa1 --- /dev/null +++ b/typings/lib/parser/contents/classes/MusicPlayButton.d.ts @@ -0,0 +1,12 @@ +export = MusicPlayButton; +declare class MusicPlayButton { + constructor(data: any); + type: string; + endpoint: NavigationEndpoint; + play_icon_type: any; + pause_icon_type: any; + play_label: any; + pause_label: any; + icon_color: any; +} +import NavigationEndpoint = require("./NavigationEndpoint"); diff --git a/typings/lib/parser/contents/classes/MusicResponsiveListItem.d.ts b/typings/lib/parser/contents/classes/MusicResponsiveListItem.d.ts new file mode 100644 index 00000000..25a8ebee --- /dev/null +++ b/typings/lib/parser/contents/classes/MusicResponsiveListItem.d.ts @@ -0,0 +1,38 @@ +export = MusicResponsiveListItem; +declare class MusicResponsiveListItem { + constructor(data: any, ctx: any); + type: any; + endpoint: NavigationEndpoint; + thumbnails: any; + badges: any; + menu: any; + overlay: any; + id: any; + title: any; + artist: any; + album: any; + duration: { + text: any; + seconds: number; + } | { + text: any; + seconds: number; + }; + views: any; + author: { + name: any; + channel_id: any; + } | { + name: any; + channel_id: any; + } | { + name: any; + channel_id: any; + }; + name: any; + subscribers: any; + year: any; + item_count: number; + #private; +} +import NavigationEndpoint = require("./NavigationEndpoint"); diff --git a/typings/lib/parser/contents/classes/MusicResponsiveListItemFlexColumn.d.ts b/typings/lib/parser/contents/classes/MusicResponsiveListItemFlexColumn.d.ts new file mode 100644 index 00000000..c8a13503 --- /dev/null +++ b/typings/lib/parser/contents/classes/MusicResponsiveListItemFlexColumn.d.ts @@ -0,0 +1,8 @@ +export = MusicResponsiveListItemFlexColumn; +declare class MusicResponsiveListItemFlexColumn { + constructor(data: any); + type: string; + title: Text; + display_priority: any; +} +import Text = require("./Text"); diff --git a/typings/lib/parser/contents/classes/MusicShelf.d.ts b/typings/lib/parser/contents/classes/MusicShelf.d.ts new file mode 100644 index 00000000..0a4be719 --- /dev/null +++ b/typings/lib/parser/contents/classes/MusicShelf.d.ts @@ -0,0 +1,12 @@ +export = MusicShelf; +declare class MusicShelf { + constructor(data: any); + type: string; + title: Text; + contents: any; + endpoint: NavigationEndpoint; + continuation: any; + bottom_text: Text; +} +import Text = require("./Text"); +import NavigationEndpoint = require("./NavigationEndpoint"); diff --git a/typings/lib/parser/contents/classes/NavigationEndpoint.d.ts b/typings/lib/parser/contents/classes/NavigationEndpoint.d.ts index 0a4d77bb..9ff85ac2 100644 --- a/typings/lib/parser/contents/classes/NavigationEndpoint.d.ts +++ b/typings/lib/parser/contents/classes/NavigationEndpoint.d.ts @@ -2,12 +2,7 @@ export = NavigationEndpoint; declare class NavigationEndpoint { constructor(data: any); type: string; - metadata: { - url: any; - page_type: any; - api_url: any; - send_post: any; - }; + metadata: {}; browse: { id: any; params: any; @@ -20,6 +15,10 @@ declare class NavigationEndpoint { index: any; supported_onesie_config: any; }; + search: { + query: any; + params: any; + }; subscribe: { channel_ids: any; params: any; @@ -32,6 +31,7 @@ declare class NavigationEndpoint { status: any; target: { video_id: any; + playlist_id: any; }; remove_like_params: any; }; @@ -64,7 +64,7 @@ declare class NavigationEndpoint { get_report_form: { params: any; }; - call(actions: any): Promise<{ + call(actions: any, client: any): Promise<{ contents: any; on_response_received_actions: any; on_response_received_endpoints: any; @@ -79,6 +79,7 @@ declare class NavigationEndpoint { player_overlays: any; playability_status: { status: number; + error_screen: any; embeddable: boolean; reason: string; }; diff --git a/typings/lib/parser/contents/classes/PlayerErrorMessage.d.ts b/typings/lib/parser/contents/classes/PlayerErrorMessage.d.ts new file mode 100644 index 00000000..b319a20f --- /dev/null +++ b/typings/lib/parser/contents/classes/PlayerErrorMessage.d.ts @@ -0,0 +1,11 @@ +export = PlayerErrorMessage; +declare class PlayerErrorMessage { + constructor(data: any); + type: string; + subreason: Text; + reason: Text; + proceed_button: any; + thumbnails: any; + icon_type: any; +} +import Text = require("./Text"); diff --git a/typings/lib/parser/contents/classes/SectionList.d.ts b/typings/lib/parser/contents/classes/SectionList.d.ts index 14ef3065..9d7dc710 100644 --- a/typings/lib/parser/contents/classes/SectionList.d.ts +++ b/typings/lib/parser/contents/classes/SectionList.d.ts @@ -4,4 +4,5 @@ declare class SectionList { type: string; target_id: any; contents: any; + header: any; } diff --git a/typings/lib/parser/contents/classes/ShowingResultsFor.d.ts b/typings/lib/parser/contents/classes/ShowingResultsFor.d.ts new file mode 100644 index 00000000..277aa7f2 --- /dev/null +++ b/typings/lib/parser/contents/classes/ShowingResultsFor.d.ts @@ -0,0 +1,10 @@ +export = ShowingResultsFor; +declare class ShowingResultsFor { + constructor(data: any); + type: string; + corrected_query: Text; + endpoint: NavigationEndpoint; + original_query_endpoint: NavigationEndpoint; +} +import Text = require("./Text"); +import NavigationEndpoint = require("./NavigationEndpoint"); diff --git a/typings/lib/parser/contents/classes/SingleActionEmergencySupport.d.ts b/typings/lib/parser/contents/classes/SingleActionEmergencySupport.d.ts new file mode 100644 index 00000000..2b7b34e9 --- /dev/null +++ b/typings/lib/parser/contents/classes/SingleActionEmergencySupport.d.ts @@ -0,0 +1,12 @@ +export = SingleActionEmergencySupport; +declare class SingleActionEmergencySupport { + constructor(data: any); + type: string; + action_text: Text; + nav_text: Text; + details: Text; + icon_type: any; + endpoint: NavigationEndpoint; +} +import Text = require("./Text"); +import NavigationEndpoint = require("./NavigationEndpoint"); diff --git a/typings/lib/parser/contents/classes/ToggleMenuServiceItem.d.ts b/typings/lib/parser/contents/classes/ToggleMenuServiceItem.d.ts new file mode 100644 index 00000000..796a1546 --- /dev/null +++ b/typings/lib/parser/contents/classes/ToggleMenuServiceItem.d.ts @@ -0,0 +1,12 @@ +export = ToggleMenuServiceItem; +declare class ToggleMenuServiceItem { + constructor(data: any); + type: string; + text: Text; + toggled_text: Text; + icon_type: any; + toggled_icon_type: any; + endpoint: NavigationEndpoint; +} +import Text = require("./Text"); +import NavigationEndpoint = require("./NavigationEndpoint"); diff --git a/typings/lib/parser/contents/index.d.ts b/typings/lib/parser/contents/index.d.ts index 84ee6d04..d6bcf2ca 100644 --- a/typings/lib/parser/contents/index.d.ts +++ b/typings/lib/parser/contents/index.d.ts @@ -18,6 +18,7 @@ declare class Parser { playability_status: { /** @type {number} */ status: number; + error_screen: any; /** @type {boolean} */ embeddable: boolean; /** @type {string} */ @@ -43,12 +44,13 @@ declare class Parser { }; static parseRR(actions: any): any; static parseFormats(formats: any): any; - static parse(data: any): any; + static parse(data: any, ctx: any): any; static formatError({ classname, classdata, err }: { classname: any; classdata: any; err: any; }): void; static sanitizeClassName(input: any): any; + static shouldIgnore(classname: any): boolean; } import VideoDetails = require("./classes/VideoDetails"); diff --git a/typings/lib/parser/youtube/Analytics.d.ts b/typings/lib/parser/youtube/Analytics.d.ts index 735b22d6..4a248852 100644 --- a/typings/lib/parser/youtube/Analytics.d.ts +++ b/typings/lib/parser/youtube/Analytics.d.ts @@ -22,6 +22,7 @@ declare class Analytics { player_overlays: any; playability_status: { status: number; + error_screen: any; embeddable: boolean; reason: string; }; diff --git a/typings/lib/parser/youtube/History.d.ts b/typings/lib/parser/youtube/History.d.ts index 7b28665d..10dd1e02 100644 --- a/typings/lib/parser/youtube/History.d.ts +++ b/typings/lib/parser/youtube/History.d.ts @@ -3,11 +3,11 @@ export = History; declare class History { /** * @param {object} page - parsed data. - * @param {import('./Actions')} actions + * @param {import('../../core/Actions')} actions * @param {boolean} is_continuation * @constructor */ - constructor(page: object, actions: any, is_continuation: boolean); + constructor(page: object, actions: import('../../core/Actions'), is_continuation: boolean); sections: any; getContinuation(): Promise; get has_continuation(): boolean; diff --git a/typings/lib/parser/youtube/Library.d.ts b/typings/lib/parser/youtube/Library.d.ts index bf1b46d1..53ebf9b9 100644 --- a/typings/lib/parser/youtube/Library.d.ts +++ b/typings/lib/parser/youtube/Library.d.ts @@ -3,10 +3,10 @@ export = Library; declare class Library { /** * @param {object} response - API response. - * @param {import('./Actions')} actions + * @param {import('../../core/Actions')} actions * @constructor */ - constructor(response: object, actions: any); + constructor(response: object, actions: import('../../core/Actions')); profile: { stats: any; user_info: any; @@ -27,6 +27,7 @@ declare class Library { player_overlays: any; playability_status: { status: number; + error_screen: any; embeddable: boolean; reason: string; }; diff --git a/typings/lib/parser/youtube/Search.d.ts b/typings/lib/parser/youtube/Search.d.ts index 01760ac2..12c86648 100644 --- a/typings/lib/parser/youtube/Search.d.ts +++ b/typings/lib/parser/youtube/Search.d.ts @@ -3,11 +3,11 @@ export = Search; declare class Search { /** * @param {object} response - API response. - * @param {import('./Actions')} actions + * @param {import('../../core/Actions')} actions * @param {boolean} is_continuation * @constructor */ - constructor(response: object, actions: any, is_continuation: boolean); + constructor(response: object, actions: import('../../core/Actions'), is_continuation: boolean); estimated_results: any; refinements: any; results: any; diff --git a/typings/lib/parser/youtube/VideoInfo.d.ts b/typings/lib/parser/youtube/VideoInfo.d.ts index 781edaba..9f2cb944 100644 --- a/typings/lib/parser/youtube/VideoInfo.d.ts +++ b/typings/lib/parser/youtube/VideoInfo.d.ts @@ -3,32 +3,36 @@ export = VideoInfo; declare class VideoInfo { /** * @param {object} data - API response. - * @param {import('./Actions')} actions - * @param {import('./Player')} player + * @param {import('../../core/Actions')} actions + * @param {import('../../core/Player')} player * @constructor */ - constructor(data: object, actions: any, player: any); + constructor(data: object, actions: import('../../core/Actions'), player: import('../../core/Player')); /** - * @type {import('../parser/contents/classes/VideoDetails')} + * @type {import('../contents/classes/VideoDetails')} */ - basic_info: any; + basic_info: import('../contents/classes/VideoDetails'); /** - * @type {import('../parser/contents/classes/VideoPrimaryInfo')} + * @type {import('../contents/classes/VideoPrimaryInfo')} */ - primary_info: any; + primary_info: import('../contents/classes/VideoPrimaryInfo'); /** - * @type {import('../parser/contents/classes/VideoSecondaryInfo')} + * @type {import('../contents/classes/VideoSecondaryInfo')} */ - secondary_info: any; + secondary_info: import('../contents/classes/VideoSecondaryInfo'); /** - * @type {import('../parser/contents/classes/ChipCloud')} + * @type {import('../contents/classes/MerchandiseShelf')} */ - related_chip_cloud: any; + merchandise: import('../contents/classes/MerchandiseShelf'); + /** + * @type {import('../contents/classes/ChipCloud')} + */ + related_chip_cloud: import('../contents/classes/ChipCloud'); watch_next_feed: any; /** - * @type {import('../parser/contents/classes/PlayerOverlay')} + * @type {import('../contents/classes/PlayerOverlay')} */ - player_overlays: any; + player_overlays: import('../contents/classes/PlayerOverlay'); streaming_data: { expires: Date; formats: import("../contents/classes/Format")[]; @@ -38,35 +42,47 @@ declare class VideoInfo { }; playability_status: { status: number; + error_screen: any; embeddable: boolean; - reason: string; /** - * @type {import('../parser/contents/classes/ChipCloud')} - */ + reason: string; }; /** - * @type {import('../parser/contents/classes/PlayerAnnotationsExpanded')[]} + * @type {import('../contents/classes/PlayerAnnotationsExpanded')[]} */ - annotations: any[]; + annotations: import('../contents/classes/PlayerAnnotationsExpanded')[]; /** - * @type {import('../parser/contents/classes/PlayerStoryboardSpec')} + * @type {import('../contents/classes/PlayerStoryboardSpec')} */ - storyboards: any; + storyboards: import('../contents/classes/PlayerStoryboardSpec'); /** - * @type {import('../parser/contents/classes/Endscreen')} + * @type {import('../contents/classes/Endscreen')} */ - endscreen: any; + endscreen: import('../contents/classes/Endscreen'); /** - * @type {import('../parser/contents/classes/PlayerCaptionsTracklist')} + * @type {import('../contents/classes/PlayerCaptionsTracklist')} */ - captions: any; + captions: import('../contents/classes/PlayerCaptionsTracklist'); /** - * @type {import('../parser/contents/classes/CardCollection')} + * @type {import('../contents/classes/CardCollection')} */ - cards: any; + cards: import('../contents/classes/CardCollection'); /** - * @type {import('../parser/contents/classes/CommentsEntryPointHeader')} + * @type {import('../contents/classes/CommentsEntryPointHeader')} */ - comments_entry_point_header: any; + comments_entry_point_header: import('../contents/classes/CommentsEntryPointHeader'); + /** + * Applies given filter to the watch next feed. + * @param {string} name + * @returns {Promise.} + */ + selectFilter(name: string): Promise; + /** + * Retrieves watch next feed continuation. + * @returns {Promise.} + */ + getWatchNextContinuation(): Promise; + /** @type {string[]} */ + get filters(): string[]; get page(): { contents: any; on_response_received_actions: any; @@ -82,10 +98,9 @@ declare class VideoInfo { player_overlays: any; playability_status: { status: number; + error_screen: any; embeddable: boolean; - reason: string; /** - * @type {import('../parser/contents/classes/ChipCloud')} - */ + reason: string; }; streaming_data: { expires: Date; @@ -99,6 +114,9 @@ declare class VideoInfo { annotations: any; storyboards: any; endscreen: import("../contents/classes/Endscreen"); + /** + * @type {import('../contents/classes/PlayerAnnotationsExpanded')[]} + */ cards: import("../contents/classes/CardCollection"); }[]; #private; diff --git a/typings/lib/parser/ytmusic/Search.d.ts b/typings/lib/parser/ytmusic/Search.d.ts new file mode 100644 index 00000000..b35489b7 --- /dev/null +++ b/typings/lib/parser/ytmusic/Search.d.ts @@ -0,0 +1,45 @@ +export = Search; +/** @namespace */ +declare class Search { + /** + * @param {object} response - API response. + * @param {import('../../core/Actions')} actions + * @param {boolean} is_continuation + * @constructor + */ + constructor(response: object, actions: import('../../core/Actions'), is_continuation: boolean); + /** + * @type {import('../contents/classes/DidYouMean')} + */ + did_you_mean: import('../contents/classes/DidYouMean'); + /** + * @type {import('../contents/classes/ShowingResultsFor')} + */ + showing_results_for: import('../contents/classes/ShowingResultsFor'); + results: any; + sections: any; + getContinuation(): Promise; + /** + * Applies given filter to the search. + * @param {string} name + * @returns {Promise.} + */ + selectFilter(name: string): Promise; + /** @type {boolean} */ + get has_continuation(): boolean; + /** @type {string[]} */ + get filters(): string[]; + /** @type {import('../contents/classes/MusicResponsiveListItem')[]} */ + get songs(): import("../contents/classes/MusicResponsiveListItem")[]; + /** @type {import('../contents/classes/MusicResponsiveListItem')[]} */ + get videos(): import("../contents/classes/MusicResponsiveListItem")[]; + /** @type {import('../contents/classes/MusicResponsiveListItem')[]} */ + get albums(): import("../contents/classes/MusicResponsiveListItem")[]; + /** @type {import('../contents/classes/MusicResponsiveListItem')[]} */ + get artists(): import("../contents/classes/MusicResponsiveListItem")[]; + /** @type {import('../contents/classes/MusicResponsiveListItem')[]} */ + get playlists(): import("../contents/classes/MusicResponsiveListItem")[]; + /** @type {import('../contents/classes/MusicResponsiveListItem')[]} */ + get page(): import("../contents/classes/MusicResponsiveListItem")[]; + #private; +} diff --git a/typings/lib/utils/Utils.d.ts b/typings/lib/utils/Utils.d.ts index 318c3716..e4082158 100644 --- a/typings/lib/utils/Utils.d.ts +++ b/typings/lib/utils/Utils.d.ts @@ -27,6 +27,14 @@ export class NoStreamingDataError extends InnertubeError { * @returns {object|Array.} */ export function findNode(obj: object, key: string, target: string, depth: number, safe?: boolean): object | Array; +/** + * Creates a trap to intercept property access + * and add utilities to an object. + * + * @param {*} obj + * @returns + */ +export function observe(obj: any): any; /** * Returns a random user agent. *