Skip to content

Commit

Permalink
chore: update type definitions
Browse files Browse the repository at this point in the history
  • Loading branch information
LuanRT committed Jun 10, 2022
1 parent 5396563 commit 95f713f
Show file tree
Hide file tree
Showing 29 changed files with 327 additions and 47 deletions.
2 changes: 2 additions & 0 deletions typings/lib/Innertube.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ declare class Innertube {
account: AccountManager;
playlist: PlaylistManager;
interact: InteractionManager;
music: YTMusic;
/**
* Signs in to a google account.
*
Expand Down Expand Up @@ -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");
17 changes: 17 additions & 0 deletions typings/lib/core/Music.d.ts
Original file line number Diff line number Diff line change
@@ -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>}
*/
search(query: string): Promise<Search>;
#private;
}
import Search = require("../parser/ytmusic/Search");
3 changes: 1 addition & 2 deletions typings/lib/parser/contents/classes/ChipCloudChip.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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");
9 changes: 9 additions & 0 deletions typings/lib/parser/contents/classes/DidYouMean.d.ts
Original file line number Diff line number Diff line change
@@ -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");
9 changes: 9 additions & 0 deletions typings/lib/parser/contents/classes/EmergencyOnebox.d.ts
Original file line number Diff line number Diff line change
@@ -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");
17 changes: 17 additions & 0 deletions typings/lib/parser/contents/classes/MerchandiseItem.d.ts
Original file line number Diff line number Diff line change
@@ -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");
8 changes: 8 additions & 0 deletions typings/lib/parser/contents/classes/MerchandiseShelf.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
export = MerchandiseShelf;
declare class MerchandiseShelf {
constructor(data: any);
type: string;
title: any;
menu: any;
items: any;
}
6 changes: 6 additions & 0 deletions typings/lib/parser/contents/classes/Message.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export = Message;
declare class Message {
constructor(data: any);
type: string;
text: any;
}
6 changes: 6 additions & 0 deletions typings/lib/parser/contents/classes/MusicHeader.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export = MusicHeader;
declare class MusicHeader {
constructor(data: any);
type: string;
header: any;
}
7 changes: 7 additions & 0 deletions typings/lib/parser/contents/classes/MusicInlineBadge.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export = MusicInlineBadge;
declare class MusicInlineBadge {
constructor(data: any);
type: string;
icon_type: any;
label: any;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
export = MusicItemThumbnailOverlay;
declare class MusicItemThumbnailOverlay {
constructor(data: any);
type: string;
content: any;
content_position: any;
display_style: any;
}
12 changes: 12 additions & 0 deletions typings/lib/parser/contents/classes/MusicPlayButton.d.ts
Original file line number Diff line number Diff line change
@@ -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");
38 changes: 38 additions & 0 deletions typings/lib/parser/contents/classes/MusicResponsiveListItem.d.ts
Original file line number Diff line number Diff line change
@@ -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");
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
export = MusicResponsiveListItemFlexColumn;
declare class MusicResponsiveListItemFlexColumn {
constructor(data: any);
type: string;
title: Text;
display_priority: any;
}
import Text = require("./Text");
12 changes: 12 additions & 0 deletions typings/lib/parser/contents/classes/MusicShelf.d.ts
Original file line number Diff line number Diff line change
@@ -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");
15 changes: 8 additions & 7 deletions typings/lib/parser/contents/classes/NavigationEndpoint.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -20,6 +15,10 @@ declare class NavigationEndpoint {
index: any;
supported_onesie_config: any;
};
search: {
query: any;
params: any;
};
subscribe: {
channel_ids: any;
params: any;
Expand All @@ -32,6 +31,7 @@ declare class NavigationEndpoint {
status: any;
target: {
video_id: any;
playlist_id: any;
};
remove_like_params: any;
};
Expand Down Expand Up @@ -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;
Expand All @@ -79,6 +79,7 @@ declare class NavigationEndpoint {
player_overlays: any;
playability_status: {
status: number;
error_screen: any;
embeddable: boolean;
reason: string;
};
Expand Down
11 changes: 11 additions & 0 deletions typings/lib/parser/contents/classes/PlayerErrorMessage.d.ts
Original file line number Diff line number Diff line change
@@ -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");
1 change: 1 addition & 0 deletions typings/lib/parser/contents/classes/SectionList.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ declare class SectionList {
type: string;
target_id: any;
contents: any;
header: any;
}
10 changes: 10 additions & 0 deletions typings/lib/parser/contents/classes/ShowingResultsFor.d.ts
Original file line number Diff line number Diff line change
@@ -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");
Original file line number Diff line number Diff line change
@@ -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");
12 changes: 12 additions & 0 deletions typings/lib/parser/contents/classes/ToggleMenuServiceItem.d.ts
Original file line number Diff line number Diff line change
@@ -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");
4 changes: 3 additions & 1 deletion typings/lib/parser/contents/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ declare class Parser {
playability_status: {
/** @type {number} */
status: number;
error_screen: any;
/** @type {boolean} */
embeddable: boolean;
/** @type {string} */
Expand All @@ -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");
1 change: 1 addition & 0 deletions typings/lib/parser/youtube/Analytics.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ declare class Analytics {
player_overlays: any;
playability_status: {
status: number;
error_screen: any;
embeddable: boolean;
reason: string;
};
Expand Down
4 changes: 2 additions & 2 deletions typings/lib/parser/youtube/History.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<History>;
get has_continuation(): boolean;
Expand Down
5 changes: 3 additions & 2 deletions typings/lib/parser/youtube/Library.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -27,6 +27,7 @@ declare class Library {
player_overlays: any;
playability_status: {
status: number;
error_screen: any;
embeddable: boolean;
reason: string;
};
Expand Down
4 changes: 2 additions & 2 deletions typings/lib/parser/youtube/Search.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Loading

0 comments on commit 95f713f

Please sign in to comment.