-
Notifications
You must be signed in to change notification settings - Fork 40
/
index.d.ts
77 lines (71 loc) · 1.91 KB
/
index.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
76
77
declare namespace search {
export interface YouTubeSearchOptions {
fields?: string;
channelId?: string;
channelType?: string;
eventType?: string;
forContentOwner?: boolean;
forDeveloper?: boolean;
forMine?: boolean;
location?: string;
locationRadius?: string;
maxResults?: number;
onBehalfOfContentOwner?: string;
order?: string;
part?: string;
pageToken?: string;
publishedAfter?: string;
publishedBefore?: string;
regionCode?: string;
relatedToVideoId?: string;
relevanceLanguage?: string;
safeSearch?: string;
topicId?: string;
type?: string;
videoCaption?: string;
videoCategoryId?: string;
videoDefinition?: string;
videoDimension?: string;
videoDuration?: string;
videoEmbeddable?: string;
videoLicense?: string;
videoSyndicated?: string;
videoType?: string;
key?: string;
}
export interface YouTubeThumbnail {
url: string;
width: number;
height: number;
}
export interface YouTubeSearchResultThumbnails {
default?: YouTubeThumbnail;
medium?: YouTubeThumbnail;
high?: YouTubeThumbnail;
standard?: YouTubeThumbnail;
maxres?: YouTubeThumbnail;
}
export interface YouTubeSearchResults {
id: string;
link: string;
kind: string;
publishedAt: string;
channelTitle: string;
channelId: string;
title: string;
description: string;
thumbnails: YouTubeSearchResultThumbnails;
}
export interface YouTubeSearchPageResults {
totalResults: number;
resultsPerPage: number;
nextPageToken: string;
prevPageToken: string;
}
}
declare function search(
term: string,
opts: search.YouTubeSearchOptions,
cb?: (err: Error, result?: search.YouTubeSearchResults[], pageInfo?: search.YouTubeSearchPageResults) => void
): Promise<{results: search.YouTubeSearchResults[], pageInfo: search.YouTubeSearchPageResults}>;
export = search;