-
Notifications
You must be signed in to change notification settings - Fork 28
/
index.d.ts
232 lines (201 loc) · 7.22 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
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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
// Type definitions for node-tvdb
// Definitions by: Jeffrey Barrus http://github.com/jbarrus
export = Client;
declare class Client {
constructor(apiKey: string, language?: string)
/**
* Get available languages useable by TheTVDB API.
*
* ``` javascript
* tvdb.getLanguages()
* .then(response => { handle response })
* .catch(error => { handle error });
* ```
*/
getLanguages(opts?: any): Promise<any>
/**
* Get episode by episode id.
*
* ``` javascript
* tvdb.getEpisodeById(4768125)
* .then(response => { handle response })
* .catch(error => { handle error });
* ```
* @see https://api.thetvdb.com/swagger#!/Episodes/get_episodes_id
*/
getEpisodeById(episodeId: number | string, opts?: any): Promise<any>
/**
* Get all episodes by series id.
*
* The opts may include the object `query` with any of the parameters from the query endpoint
*
* ``` javascript
* tvdb.getEpisodesBySeriesId(153021)
* .then(response => { handle response })
* .catch(error => { handle error });
* ```
* @see https://api.thetvdb.com/swagger#!/Series/get_series_id_episodes
* @see https://api.thetvdb.com/swagger#!/Series/get_series_id_episodes_query
*/
getEpisodesBySeriesId(seriesId: number | string, opts?: any): Promise<any>
/**
* Get episodes summary by series id.
*
* ``` javascript
* tvdb.getEpisodesSummaryBySeriesId(153021)
* .then(response => { handle response })
* .catch(error => { handle error });
* ```
* @see https://api.thetvdb.com/swagger#!/Series/get_series_id_episodes_summary
*/
getEpisodesSummaryBySeriesId(seriesId: number | string): Promise<any>
/**
* Get basic series information by id.
*
* ``` javascript
* tvdb.getSeriesById(73255)
* .then(response => { handle response })
* .catch(error => { handle error });
* ```
* @see https://api.thetvdb.com/swagger#!/Series/get_series_id
*/
getSeriesById(seriesId: number | string, opts?: any): Promise<any>
/**
* Get series episode by air date.
*
* ``` javascript
* tvdb.getEpisodeByAirDate(153021, '2011-10-03')
* .then(response => { handle response })
* .catch(error => { handle error });
* ```
* @see https://api.thetvdb.com/swagger#!/Series/get_series_id_episodes_query
*/
getEpisodesByAirDate(seriesId: number | string, airDate: string, opts?: any): Promise<any>
/**
* Get basic series information by name.
*
* ``` javascript
* tvdb.getSeriesByName('Breaking Bad')
* .then(response => { handle response })
* .catch(error => { handle error });
* ```
* @see https://api.thetvdb.com/swagger#!/Search/get_search_series
*/
getSeriesByName(name: string, opts?: any) : Promise<any>
/**
* Get series actors by series id.
*
* ``` javascript
* tvdb.getActors(73255)
* .then(response => { handle response })
* .catch(error => { handle error });
* ```
* @see https://api.thetvdb.com/swagger#!/Series/get_series_id_actors
*/
getActors(seriesId: number | string, opts?: any): Promise<any>
/**
* Get basic series information by imdb id.
*
* ``` javascript
* tvdb.getSeriesByImdbId('tt0903747')
* .then(response => { handle response })
* .catch(error => { handle error });
* ```
* @see https://api.thetvdb.com/swagger#!/Search/get_search_series
*/
getSeriesByImdbId(imdbId: string, opts?: any): Promise<any>
/**
* Get basic series information by zap2it id.
*
* ``` javascript
* tvdb.getSeriesByZap2ItId('EP00018693')
* .then(response => { handle response })
* .catch(error => { handle error });
* ```
* @see https://api.thetvdb.com/swagger#!/Search/get_search_series
*/
getSeriesByZap2ItId(zap2ItId: string, opts?: any): Promise<any>
/**
* Get series banner by series id.
*
* ``` javascript
* tvdb.getSeriesBanner(73255)
* .then(response => { handle response })
* .catch(error => { handle error });
* ```
* @see https://api.thetvdb.com/swagger#!/Series/get_series_id_filter
*/
getSeriesBanner(seriesId: number | string, opts?: any): Promise<any>
/**
* Get series images for a given key type.
*
* ``` javascript
* // request only return fan art images:
* tvdb.getSeriesImages(73255, 'fanart', { query: queryOptions })
* .then(response => { handle response })
* .catch(error => { handle error });
* ```
* @see https://api.thetvdb.com/swagger#!/Series/get_series_id_images
* @see https://api.thetvdb.com/swagger#!/Series/get_series_id_images_query
*/
getSeriesImages(seriesId: number | string, keyType: string, opts?: any): Promise<any>
/**
* Convenience wrapper around `getSeriesImages` to only return poster images for a series.
*
* ``` javascript
* tvdb.getSeriesPosters(73255)
* .then(response => { handle response })
* .catch(error => { handle error });
* ```
* @see https://api.thetvdb.com/swagger#!/Series/get_series_id_images_query
*/
getSeriesPosters(seriesId: number | string, opts?: any): Promise<any>
/**
* Convenience wrapper around `getSeriesImages` to only return season poster images for a series.
*
* ``` javascript
* tvdb.getSeasonPosters(73255, 1)
* .then(response => { handle response })
* .catch(error => { handle error });
* ```
* @see https://api.thetvdb.com/swagger#!/Series/get_series_id_images_query
*/
getSeasonPosters(seriesId: number | string, season: number | string, opts?: any): Promise<any>
/**
* Get a list of series updated since a given unix timestamp (and, if given,
* between a second timestamp).
*
* ``` javascript
* tvdb.getUpdates(1400611370, 1400621370)
* .then(response => { handle response })
* .catch(error => { handle error });
* ```
* @see https://api.thetvdb.com/swagger#!/Updates/get_updated_query
*/
getUpdates(fromTime: number, toTime: number, opts?: any): Promise<any>
/**
* Get series and episode information by series id. Helper for calling
* `getSeriesById` and `getEpisodesBySeriesId` at the same time.
*
* ``` javascript
* tvdb.getSeriesAllById(73255)
* .then(response => {
* response; // contains series data (i.e. `id`, `seriesName`)
* response.episodes; // contains an array of episodes
* })
* .catch(error => { handle error });
* ```
*/
getSeriesAllById(seriesId: number | string, opts?: any): Promise<any>
/**
* Runs a get request with the given options, useful for running custom
* requests.
*
* ``` javascript
* tvdb.sendRequest('custom/endpoint', { custom: 'options' })
* .then(response => { handle response })
* .catch(error => { handle error });
* ```
*/
sendRequest(path: string, opts?: any): Promise<any>
}