-
Notifications
You must be signed in to change notification settings - Fork 0
/
usetube.d.ts
75 lines (65 loc) 路 1.98 KB
/
usetube.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
// Type definitions for usetube 2.1
// Project: https://github.com/valerebron/usetube (Does not have to be to GitHub, but prefer linking to a source code repository rather than to a project website.)
// Definitions by: Ezell Frazier <https://github.com/lynellf>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare module 'usetube' {
export interface YouTubeResults {
videos: Video[]
didyoumean: string
token: string
apikey: string
}
export interface Video {
id: string
original_title: string
title: string
artist: string
duration: number
publishedAt: string
}
export interface VideoDesc {
text: string
navigationEndpoint?: NavigationEndpoint
}
export interface NavigationEndpoint {
clickTrackingParams: string
commandMetadata: CommandMetadata
urlEndpoint: URLEndpoint
}
export interface CommandMetadata {
webCommandMetadata: WebCommandMetadata
}
export interface WebCommandMetadata {
url: string
webPageType: string
rootVe: number
}
export interface URLEndpoint {
url: string
target?: string
nofollow: boolean
}
export interface ChannelResults {
channels: Channel[]
didyoumean: string
token: string
apikey: string
}
export interface Channel {
name: string
channel_id: string
nb_videos: number
nb_subscriber: number
official: boolean
channel_avatar_small: string
channel_avatar_medium: string
channel_avatar_large: string
}
export function searchVideo(terms: string): Promise<YouTubeResults>
export function getVideoDesc(video_id: string): Promise<VideoDesc>
export function getChannelVideos(channel_id: string): Promise<Video[]>
export function getChannelDesc(channel_id: string): Promise<string>
export function getPlaylistVideos(playlist_id: string): Promise<Video[]>
export function getVideoDate(video_id: string): Promise<string>
export function searchChannel(terms: string): Promise<ChannelResults>
}