index.d.ts
2.84 KB
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
import {YtResult} from "youtube-node";
declare module "youtube-node" {
export class YouTube {
public constructor();
private parts: Array<string>;
private url: string;
public readonly params: Object;
public addParam(key: string, value: string): void;
public addPart(name: string): void;
public clearParams(): void;
public getById(id: string, callback: (validate?: Error, data?: YtResult) => void): void;
public getChannelById(id: string, callback: (validate?: Error, data?: YtResult) => void): void;
public getPlaylistById(id: string, callback: (validate?: Error, data?: YtResult) => void): void;
public getPlaylistItemsById(id: string, maxResults: number, callback: (validate?: Error) => void, data?: YtResult): void;
public getParts(): string;
public getUrl(path: string): string;
private newError(message: string): Error;
public related(id: string, maxResults: number, callback: (validate?: Error) => void, data?: YtResult): void;
public request(url: string, callback: (error?: Error, data?: YtResult) => void): void;
public search(id: string, maxResults: number, params: Object, callback: (validate?: Error) => void, data?: YtResult): void;
public setKey(key: string): void;
public validate(): Error | null;
}
type YtContentDetails = {
duration?: string;
dimension?: string;
definition?: string;
caption?: string;
licensedContent?: string;
projection?: string;
}
type YtItem = {
kind?: string;
etag?: string;
id?: YtVideoId;
snippet?: YtSnippet;
contentDetails?: YtContentDetails;
status?: YtStatus;
statistics?: YtStatistics;
}
type YtLocalized = {
title?: string;
description?: string;
}
type YtPageInfo = {
totalResults?: number;
resultsPerPage?: number;
}
type YtResult = {
kind?: string;
etag?: string;
nextPageToken?: string;
regionCode?: string;
pageInfo?: YtPageInfo;
items?: Array<YtItem>;
}
type YtSnippet = {
publishedAt?: string;
channelId?: string;
title?: string;
description?: string;
thumbnails?: YtThumbnails;
channelTitle?: string;
tags?: Array<string>;
categoryId?: string;
liveBroadcastContent?: string;
localized?: YtLocalized;
}
type YtStatistics = {
viewCount?: string;
likeCount?: string;
dislikeCount?: string;
favoriteCount?: string;
commentCount?: string;
}
type YtStatus = {
uploadStatus?: string;
privacyStatus?: string;
license?: string;
embeddable?: boolean;
publicStatsViewable?: boolean;
}
type YtThumbnail = {
url?: string;
width?: number;
height?: number;
}
type YtThumbnails = {
default?: YtThumbnail;
medium?: YtThumbnail;
high?: YtThumbnail;
standard?: YtThumbnail;
}
type YtVideoId = {
kind?: string;
videoId?: string;
}
}