tmdb-kit 1.0.0 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +455 -196
- package/dist/cli.js +3823 -0
- package/dist/client.d.cts +71 -0
- package/dist/client.d.ts +71 -0
- package/dist/errors.d.cts +86 -0
- package/dist/errors.d.ts +86 -0
- package/dist/helpers/cache.d.cts +28 -0
- package/dist/helpers/cache.d.ts +28 -0
- package/dist/helpers/pagination.d.cts +35 -0
- package/dist/helpers/pagination.d.ts +35 -0
- package/dist/helpers/retry.d.cts +47 -0
- package/dist/helpers/retry.d.ts +47 -0
- package/dist/helpers/timeout.d.cts +20 -0
- package/dist/helpers/timeout.d.ts +20 -0
- package/dist/http.d.cts +80 -0
- package/dist/http.d.ts +80 -0
- package/dist/index.cjs +1115 -768
- package/dist/index.cjs.map +27 -1
- package/dist/index.d.cts +13 -783
- package/dist/index.d.ts +13 -783
- package/dist/index.js +1074 -744
- package/dist/index.js.map +27 -1
- package/dist/query.d.cts +91 -0
- package/dist/query.d.ts +91 -0
- package/dist/resources/configuration.d.cts +17 -0
- package/dist/resources/configuration.d.ts +17 -0
- package/dist/resources/genres.d.cts +13 -0
- package/dist/resources/genres.d.ts +13 -0
- package/dist/resources/images.d.cts +17 -0
- package/dist/resources/images.d.ts +17 -0
- package/dist/resources/movies.d.cts +21 -0
- package/dist/resources/movies.d.ts +21 -0
- package/dist/resources/people.d.cts +14 -0
- package/dist/resources/people.d.ts +14 -0
- package/dist/resources/search.d.cts +15 -0
- package/dist/resources/search.d.ts +15 -0
- package/dist/resources/trending.d.cts +23 -0
- package/dist/resources/trending.d.ts +23 -0
- package/dist/resources/tv.d.cts +30 -0
- package/dist/resources/tv.d.ts +30 -0
- package/dist/search-guards.d.cts +32 -0
- package/dist/search-guards.d.ts +32 -0
- package/dist/types.d.cts +550 -0
- package/dist/types.d.ts +550 -0
- package/package.json +26 -19
package/dist/types.d.cts
ADDED
|
@@ -0,0 +1,550 @@
|
|
|
1
|
+
/** Primitive JSON values returned by TMDB. */
|
|
2
|
+
export type JsonPrimitive = string | number | boolean | null;
|
|
3
|
+
/** JSON object/array tree returned by TMDB for fields this SDK does not model yet. */
|
|
4
|
+
export type JsonValue = JsonPrimitive | JsonObject | JsonValue[];
|
|
5
|
+
export interface JsonObject {
|
|
6
|
+
[key: string]: JsonValue | undefined;
|
|
7
|
+
}
|
|
8
|
+
/** Escape hatch for append_to_response payloads and future TMDB fields. */
|
|
9
|
+
export type TMDBObject = Record<string, unknown>;
|
|
10
|
+
/** Date string in TMDB format (typically `YYYY-MM-DD`). */
|
|
11
|
+
export type TMDBDateString = string;
|
|
12
|
+
/** ISO 639-1 language code (e.g. `"en"`, `"zh"`). */
|
|
13
|
+
export type LanguageCode = string;
|
|
14
|
+
/** ISO 3166-1 country/region code (e.g. `"US"`, `"CN"`). */
|
|
15
|
+
export type RegionCode = string;
|
|
16
|
+
/** Supported media types for multi-search results. */
|
|
17
|
+
export type MediaType = 'movie' | 'tv' | 'person';
|
|
18
|
+
/** Time window for trending endpoints: `"day"` or `"week"`. */
|
|
19
|
+
export type TrendingTimeWindow = 'day' | 'week';
|
|
20
|
+
export interface PagedResponse<T> {
|
|
21
|
+
page: number;
|
|
22
|
+
results: T[];
|
|
23
|
+
total_pages: number;
|
|
24
|
+
total_results: number;
|
|
25
|
+
}
|
|
26
|
+
export interface Genre {
|
|
27
|
+
id: number;
|
|
28
|
+
name: string;
|
|
29
|
+
}
|
|
30
|
+
export interface ProductionCompany {
|
|
31
|
+
id: number;
|
|
32
|
+
logo_path: string | null;
|
|
33
|
+
name: string;
|
|
34
|
+
origin_country: string;
|
|
35
|
+
}
|
|
36
|
+
export interface ProductionCountry {
|
|
37
|
+
iso_3166_1: string;
|
|
38
|
+
name: string;
|
|
39
|
+
}
|
|
40
|
+
export interface SpokenLanguage {
|
|
41
|
+
english_name: string;
|
|
42
|
+
iso_639_1: string;
|
|
43
|
+
name: string;
|
|
44
|
+
}
|
|
45
|
+
export interface CollectionSummary {
|
|
46
|
+
id: number;
|
|
47
|
+
name: string;
|
|
48
|
+
poster_path: string | null;
|
|
49
|
+
backdrop_path: string | null;
|
|
50
|
+
}
|
|
51
|
+
export interface MovieSummary {
|
|
52
|
+
adult: boolean;
|
|
53
|
+
backdrop_path: string | null;
|
|
54
|
+
genre_ids: number[];
|
|
55
|
+
id: number;
|
|
56
|
+
original_language: string;
|
|
57
|
+
original_title: string;
|
|
58
|
+
overview: string;
|
|
59
|
+
popularity: number;
|
|
60
|
+
poster_path: string | null;
|
|
61
|
+
release_date: TMDBDateString;
|
|
62
|
+
title: string;
|
|
63
|
+
video: boolean;
|
|
64
|
+
vote_average: number;
|
|
65
|
+
vote_count: number;
|
|
66
|
+
}
|
|
67
|
+
export interface MovieDetails extends Omit<MovieSummary, 'genre_ids'> {
|
|
68
|
+
belongs_to_collection: CollectionSummary | null;
|
|
69
|
+
budget: number;
|
|
70
|
+
genres: Genre[];
|
|
71
|
+
homepage: string | null;
|
|
72
|
+
imdb_id: string | null;
|
|
73
|
+
production_companies: ProductionCompany[];
|
|
74
|
+
production_countries: ProductionCountry[];
|
|
75
|
+
revenue: number;
|
|
76
|
+
runtime: number | null;
|
|
77
|
+
spoken_languages: SpokenLanguage[];
|
|
78
|
+
status: string;
|
|
79
|
+
tagline: string | null;
|
|
80
|
+
}
|
|
81
|
+
export interface TVSummary {
|
|
82
|
+
adult?: boolean;
|
|
83
|
+
backdrop_path: string | null;
|
|
84
|
+
first_air_date: TMDBDateString;
|
|
85
|
+
genre_ids: number[];
|
|
86
|
+
id: number;
|
|
87
|
+
name: string;
|
|
88
|
+
origin_country: string[];
|
|
89
|
+
original_language: string;
|
|
90
|
+
original_name: string;
|
|
91
|
+
overview: string;
|
|
92
|
+
popularity: number;
|
|
93
|
+
poster_path: string | null;
|
|
94
|
+
vote_average: number;
|
|
95
|
+
vote_count: number;
|
|
96
|
+
}
|
|
97
|
+
export interface CreatedBy {
|
|
98
|
+
id: number;
|
|
99
|
+
credit_id: string;
|
|
100
|
+
name: string;
|
|
101
|
+
gender: number;
|
|
102
|
+
profile_path: string | null;
|
|
103
|
+
}
|
|
104
|
+
export interface Network {
|
|
105
|
+
id: number;
|
|
106
|
+
logo_path: string | null;
|
|
107
|
+
name: string;
|
|
108
|
+
origin_country: string;
|
|
109
|
+
}
|
|
110
|
+
export interface SeasonSummary {
|
|
111
|
+
air_date: TMDBDateString | null;
|
|
112
|
+
episode_count: number;
|
|
113
|
+
id: number;
|
|
114
|
+
name: string;
|
|
115
|
+
overview: string;
|
|
116
|
+
poster_path: string | null;
|
|
117
|
+
season_number: number;
|
|
118
|
+
vote_average: number;
|
|
119
|
+
}
|
|
120
|
+
export interface EpisodeGuestStar {
|
|
121
|
+
adult: boolean;
|
|
122
|
+
character: string;
|
|
123
|
+
credit_id: string;
|
|
124
|
+
gender: number | null;
|
|
125
|
+
id: number;
|
|
126
|
+
known_for_department: string;
|
|
127
|
+
name: string;
|
|
128
|
+
order: number;
|
|
129
|
+
original_name: string;
|
|
130
|
+
popularity: number;
|
|
131
|
+
profile_path: string | null;
|
|
132
|
+
}
|
|
133
|
+
export interface EpisodeSummary {
|
|
134
|
+
air_date: TMDBDateString | null;
|
|
135
|
+
crew: CreditCrewMember[];
|
|
136
|
+
episode_number: number;
|
|
137
|
+
episode_type: string;
|
|
138
|
+
guest_stars: EpisodeGuestStar[];
|
|
139
|
+
id: number;
|
|
140
|
+
name: string;
|
|
141
|
+
overview: string;
|
|
142
|
+
production_code: string | null;
|
|
143
|
+
runtime: number | null;
|
|
144
|
+
season_number: number;
|
|
145
|
+
show_id: number;
|
|
146
|
+
still_path: string | null;
|
|
147
|
+
vote_average: number;
|
|
148
|
+
vote_count: number;
|
|
149
|
+
}
|
|
150
|
+
export interface TVSeasonDetails {
|
|
151
|
+
_id: string;
|
|
152
|
+
air_date: TMDBDateString | null;
|
|
153
|
+
episodes: EpisodeSummary[];
|
|
154
|
+
id: number;
|
|
155
|
+
name: string;
|
|
156
|
+
overview: string;
|
|
157
|
+
poster_path: string | null;
|
|
158
|
+
season_number: number;
|
|
159
|
+
vote_average: number;
|
|
160
|
+
}
|
|
161
|
+
export type TVSeasonAppendToResponse = 'account_states' | 'aggregate_credits' | 'credits' | 'external_ids' | 'images' | 'translations' | 'videos' | (string & {});
|
|
162
|
+
export interface TVSeasonDetailsOptions extends LanguageOptions {
|
|
163
|
+
appendToResponse?: TVSeasonAppendToResponse | readonly TVSeasonAppendToResponse[];
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* Episode details endpoint payload. Unlike {@link EpisodeSummary}, the
|
|
167
|
+
* single-episode endpoint does not return `show_id`.
|
|
168
|
+
*/
|
|
169
|
+
export type EpisodeDetails = Omit<EpisodeSummary, 'show_id'>;
|
|
170
|
+
export type EpisodeAppendToResponse = 'account_states' | 'credits' | 'external_ids' | 'images' | 'translations' | 'videos' | (string & {});
|
|
171
|
+
export interface EpisodeDetailsOptions extends LanguageOptions {
|
|
172
|
+
appendToResponse?: EpisodeAppendToResponse | readonly EpisodeAppendToResponse[];
|
|
173
|
+
}
|
|
174
|
+
export interface AggregateRole {
|
|
175
|
+
credit_id: string;
|
|
176
|
+
character: string;
|
|
177
|
+
episode_count: number;
|
|
178
|
+
}
|
|
179
|
+
export interface AggregateJob {
|
|
180
|
+
credit_id: string;
|
|
181
|
+
job: string;
|
|
182
|
+
episode_count: number;
|
|
183
|
+
}
|
|
184
|
+
export interface AggregateCastMember {
|
|
185
|
+
adult?: boolean;
|
|
186
|
+
gender: number | null;
|
|
187
|
+
id: number;
|
|
188
|
+
known_for_department: string;
|
|
189
|
+
name: string;
|
|
190
|
+
order: number;
|
|
191
|
+
original_name: string;
|
|
192
|
+
popularity: number;
|
|
193
|
+
profile_path: string | null;
|
|
194
|
+
roles: AggregateRole[];
|
|
195
|
+
total_episode_count: number;
|
|
196
|
+
}
|
|
197
|
+
export interface AggregateCrewMember {
|
|
198
|
+
adult?: boolean;
|
|
199
|
+
department: string;
|
|
200
|
+
gender: number | null;
|
|
201
|
+
id: number;
|
|
202
|
+
jobs: AggregateJob[];
|
|
203
|
+
known_for_department: string;
|
|
204
|
+
name: string;
|
|
205
|
+
original_name: string;
|
|
206
|
+
popularity: number;
|
|
207
|
+
profile_path: string | null;
|
|
208
|
+
total_episode_count: number;
|
|
209
|
+
}
|
|
210
|
+
export interface AggregateCreditsResponse {
|
|
211
|
+
id: number;
|
|
212
|
+
cast: AggregateCastMember[];
|
|
213
|
+
crew: AggregateCrewMember[];
|
|
214
|
+
}
|
|
215
|
+
export interface EpisodeGroupSummary {
|
|
216
|
+
description: string;
|
|
217
|
+
episode_count: number;
|
|
218
|
+
group_count: number;
|
|
219
|
+
id: string;
|
|
220
|
+
name: string;
|
|
221
|
+
network: Network | null;
|
|
222
|
+
type: number;
|
|
223
|
+
}
|
|
224
|
+
export interface EpisodeGroupsResponse {
|
|
225
|
+
id: number;
|
|
226
|
+
results: EpisodeGroupSummary[];
|
|
227
|
+
}
|
|
228
|
+
export interface EpisodeGroupEpisode {
|
|
229
|
+
air_date: TMDBDateString | null;
|
|
230
|
+
episode_number: number;
|
|
231
|
+
episode_type: string;
|
|
232
|
+
id: number;
|
|
233
|
+
name: string;
|
|
234
|
+
order: number;
|
|
235
|
+
overview: string;
|
|
236
|
+
production_code: string | null;
|
|
237
|
+
runtime: number | null;
|
|
238
|
+
season_number: number;
|
|
239
|
+
show_id: number;
|
|
240
|
+
still_path: string | null;
|
|
241
|
+
vote_average: number;
|
|
242
|
+
vote_count: number;
|
|
243
|
+
}
|
|
244
|
+
export interface EpisodeGroup {
|
|
245
|
+
id: string;
|
|
246
|
+
name: string;
|
|
247
|
+
order: number;
|
|
248
|
+
locked: boolean;
|
|
249
|
+
episodes: EpisodeGroupEpisode[];
|
|
250
|
+
}
|
|
251
|
+
export interface EpisodeGroupDetails extends EpisodeGroupSummary {
|
|
252
|
+
groups: EpisodeGroup[];
|
|
253
|
+
}
|
|
254
|
+
export interface TVDetails extends Omit<TVSummary, 'genre_ids'> {
|
|
255
|
+
created_by: CreatedBy[];
|
|
256
|
+
episode_run_time: number[];
|
|
257
|
+
genres: Genre[];
|
|
258
|
+
homepage: string | null;
|
|
259
|
+
in_production: boolean;
|
|
260
|
+
languages: string[];
|
|
261
|
+
last_air_date: TMDBDateString | null;
|
|
262
|
+
networks: Network[];
|
|
263
|
+
number_of_episodes: number;
|
|
264
|
+
number_of_seasons: number;
|
|
265
|
+
production_companies: ProductionCompany[];
|
|
266
|
+
production_countries: ProductionCountry[];
|
|
267
|
+
seasons: SeasonSummary[];
|
|
268
|
+
spoken_languages: SpokenLanguage[];
|
|
269
|
+
status: string;
|
|
270
|
+
tagline: string | null;
|
|
271
|
+
type: string;
|
|
272
|
+
}
|
|
273
|
+
export interface PersonKnownForMovie extends MovieSummary {
|
|
274
|
+
media_type: 'movie';
|
|
275
|
+
}
|
|
276
|
+
export interface PersonKnownForTV extends TVSummary {
|
|
277
|
+
media_type: 'tv';
|
|
278
|
+
}
|
|
279
|
+
export type PersonKnownFor = PersonKnownForMovie | PersonKnownForTV;
|
|
280
|
+
export interface PersonSummary {
|
|
281
|
+
adult: boolean;
|
|
282
|
+
gender: number;
|
|
283
|
+
id: number;
|
|
284
|
+
known_for: PersonKnownFor[];
|
|
285
|
+
known_for_department: string;
|
|
286
|
+
name: string;
|
|
287
|
+
original_name?: string;
|
|
288
|
+
popularity: number;
|
|
289
|
+
profile_path: string | null;
|
|
290
|
+
}
|
|
291
|
+
export interface PersonDetails extends Omit<PersonSummary, 'known_for'> {
|
|
292
|
+
also_known_as: string[];
|
|
293
|
+
biography: string;
|
|
294
|
+
birthday: TMDBDateString | null;
|
|
295
|
+
deathday: TMDBDateString | null;
|
|
296
|
+
homepage: string | null;
|
|
297
|
+
imdb_id: string | null;
|
|
298
|
+
place_of_birth: string | null;
|
|
299
|
+
}
|
|
300
|
+
export interface PersonCombinedCastMovie extends MovieSummary {
|
|
301
|
+
character: string;
|
|
302
|
+
credit_id: string;
|
|
303
|
+
media_type: 'movie';
|
|
304
|
+
order?: number;
|
|
305
|
+
}
|
|
306
|
+
export interface PersonCombinedCastTV extends TVSummary {
|
|
307
|
+
character: string;
|
|
308
|
+
credit_id: string;
|
|
309
|
+
episode_count?: number;
|
|
310
|
+
media_type: 'tv';
|
|
311
|
+
}
|
|
312
|
+
export type PersonCombinedCast = PersonCombinedCastMovie | PersonCombinedCastTV;
|
|
313
|
+
export interface PersonCombinedCrewMovie extends MovieSummary {
|
|
314
|
+
credit_id: string;
|
|
315
|
+
department: string;
|
|
316
|
+
job: string;
|
|
317
|
+
media_type: 'movie';
|
|
318
|
+
}
|
|
319
|
+
export interface PersonCombinedCrewTV extends TVSummary {
|
|
320
|
+
credit_id: string;
|
|
321
|
+
department: string;
|
|
322
|
+
job: string;
|
|
323
|
+
media_type: 'tv';
|
|
324
|
+
}
|
|
325
|
+
export type PersonCombinedCrew = PersonCombinedCrewMovie | PersonCombinedCrewTV;
|
|
326
|
+
export interface PersonCombinedCreditsResponse {
|
|
327
|
+
cast: PersonCombinedCast[];
|
|
328
|
+
crew: PersonCombinedCrew[];
|
|
329
|
+
id: number;
|
|
330
|
+
}
|
|
331
|
+
export interface MovieSearchResult extends MovieSummary {
|
|
332
|
+
media_type?: 'movie';
|
|
333
|
+
}
|
|
334
|
+
export interface TVSearchResult extends TVSummary {
|
|
335
|
+
media_type?: 'tv';
|
|
336
|
+
}
|
|
337
|
+
export interface PersonSearchResult extends PersonSummary {
|
|
338
|
+
media_type?: 'person';
|
|
339
|
+
}
|
|
340
|
+
export type SearchMultiResult = (MovieSummary & {
|
|
341
|
+
media_type: 'movie';
|
|
342
|
+
}) | (TVSummary & {
|
|
343
|
+
media_type: 'tv';
|
|
344
|
+
}) | (PersonSummary & {
|
|
345
|
+
media_type: 'person';
|
|
346
|
+
});
|
|
347
|
+
/** A single multi-search result narrowed to a specific media type. */
|
|
348
|
+
export type MovieMultiResult = MovieSummary & {
|
|
349
|
+
media_type: 'movie';
|
|
350
|
+
};
|
|
351
|
+
export type TVMultiResult = TVSummary & {
|
|
352
|
+
media_type: 'tv';
|
|
353
|
+
};
|
|
354
|
+
export type PersonMultiResult = PersonSummary & {
|
|
355
|
+
media_type: 'person';
|
|
356
|
+
};
|
|
357
|
+
export type TrendingResult = SearchMultiResult;
|
|
358
|
+
export interface CreditCastMember {
|
|
359
|
+
adult?: boolean;
|
|
360
|
+
cast_id?: number;
|
|
361
|
+
character: string;
|
|
362
|
+
credit_id: string;
|
|
363
|
+
gender: number | null;
|
|
364
|
+
id: number;
|
|
365
|
+
known_for_department: string;
|
|
366
|
+
name: string;
|
|
367
|
+
order: number;
|
|
368
|
+
original_name: string;
|
|
369
|
+
popularity: number;
|
|
370
|
+
profile_path: string | null;
|
|
371
|
+
}
|
|
372
|
+
export interface CreditCrewMember {
|
|
373
|
+
adult?: boolean;
|
|
374
|
+
credit_id: string;
|
|
375
|
+
department: string;
|
|
376
|
+
gender: number | null;
|
|
377
|
+
id: number;
|
|
378
|
+
job: string;
|
|
379
|
+
known_for_department: string;
|
|
380
|
+
name: string;
|
|
381
|
+
original_name: string;
|
|
382
|
+
popularity: number;
|
|
383
|
+
profile_path: string | null;
|
|
384
|
+
}
|
|
385
|
+
export interface CreditsResponse {
|
|
386
|
+
id: number;
|
|
387
|
+
cast: CreditCastMember[];
|
|
388
|
+
crew: CreditCrewMember[];
|
|
389
|
+
}
|
|
390
|
+
export interface Video {
|
|
391
|
+
id: string;
|
|
392
|
+
iso_3166_1: string;
|
|
393
|
+
iso_639_1: string;
|
|
394
|
+
key: string;
|
|
395
|
+
name: string;
|
|
396
|
+
official: boolean;
|
|
397
|
+
published_at: string;
|
|
398
|
+
site: string;
|
|
399
|
+
size: number;
|
|
400
|
+
type: string;
|
|
401
|
+
}
|
|
402
|
+
export interface VideosResponse {
|
|
403
|
+
id: number;
|
|
404
|
+
results: Video[];
|
|
405
|
+
}
|
|
406
|
+
export interface ImageItem {
|
|
407
|
+
aspect_ratio: number;
|
|
408
|
+
height: number;
|
|
409
|
+
iso_639_1: string | null;
|
|
410
|
+
file_path: string;
|
|
411
|
+
vote_average: number;
|
|
412
|
+
vote_count: number;
|
|
413
|
+
width: number;
|
|
414
|
+
}
|
|
415
|
+
export interface ImagesResponse {
|
|
416
|
+
id: number;
|
|
417
|
+
backdrops: ImageItem[];
|
|
418
|
+
logos?: ImageItem[];
|
|
419
|
+
posters: ImageItem[];
|
|
420
|
+
}
|
|
421
|
+
export interface SeasonImagesResponse {
|
|
422
|
+
id: number;
|
|
423
|
+
posters: ImageItem[];
|
|
424
|
+
}
|
|
425
|
+
export interface ConfigurationImages {
|
|
426
|
+
base_url: string;
|
|
427
|
+
secure_base_url: string;
|
|
428
|
+
backdrop_sizes: string[];
|
|
429
|
+
logo_sizes: string[];
|
|
430
|
+
poster_sizes: string[];
|
|
431
|
+
profile_sizes: string[];
|
|
432
|
+
still_sizes: string[];
|
|
433
|
+
}
|
|
434
|
+
export interface Configuration {
|
|
435
|
+
images: ConfigurationImages;
|
|
436
|
+
change_keys: string[];
|
|
437
|
+
}
|
|
438
|
+
export interface Country {
|
|
439
|
+
iso_3166_1: string;
|
|
440
|
+
english_name: string;
|
|
441
|
+
native_name: string;
|
|
442
|
+
}
|
|
443
|
+
export interface Language {
|
|
444
|
+
iso_639_1: string;
|
|
445
|
+
english_name: string;
|
|
446
|
+
name: string;
|
|
447
|
+
}
|
|
448
|
+
export interface Timezone {
|
|
449
|
+
iso_3166_1: string;
|
|
450
|
+
zones: string[];
|
|
451
|
+
}
|
|
452
|
+
export interface JobDepartment {
|
|
453
|
+
department: string;
|
|
454
|
+
jobs: string[];
|
|
455
|
+
}
|
|
456
|
+
export interface GenresResponse {
|
|
457
|
+
genres: Genre[];
|
|
458
|
+
}
|
|
459
|
+
export type BackdropSize = 'w300' | 'w780' | 'w1280' | 'original' | (string & {});
|
|
460
|
+
export type LogoSize = 'w45' | 'w92' | 'w154' | 'w185' | 'w300' | 'w500' | 'original' | (string & {});
|
|
461
|
+
export type PosterSize = 'w92' | 'w154' | 'w185' | 'w342' | 'w500' | 'w780' | 'original' | (string & {});
|
|
462
|
+
export type ProfileSize = 'w45' | 'w185' | 'h632' | 'original' | (string & {});
|
|
463
|
+
export type StillSize = 'w92' | 'w185' | 'w300' | 'original' | (string & {});
|
|
464
|
+
export type ImageSize = BackdropSize | LogoSize | PosterSize | ProfileSize | StillSize;
|
|
465
|
+
/**
|
|
466
|
+
* Public set of image sizes TMDB currently documents. The SDK does not
|
|
467
|
+
* pin to a static copy of the TMDB docs — TMDB has added new sizes in
|
|
468
|
+
* the past (e.g. `h632` for profile) without notice — but exposing the
|
|
469
|
+
* canonical list lets callers:
|
|
470
|
+
*
|
|
471
|
+
* - iterate over the set to build a size picker
|
|
472
|
+
* - validate user-supplied sizes with `isKnownBackdropSize(...)` etc.
|
|
473
|
+
* - type a variable as a "known" size without giving up the
|
|
474
|
+
* `(string & {})` escape hatch for forward-compatibility
|
|
475
|
+
*
|
|
476
|
+
* If TMDB publishes a new size, the SDK will still accept it at runtime
|
|
477
|
+
* (every helper is `(string & {})` permissive), but you will need to
|
|
478
|
+
* add the literal to these constants to get autocomplete on it.
|
|
479
|
+
*/
|
|
480
|
+
export declare const KNOWN_BACKDROP_SIZES: readonly ['w300', 'w780', 'w1280', 'original'];
|
|
481
|
+
export declare const KNOWN_LOGO_SIZES: readonly ['w45', 'w92', 'w154', 'w185', 'w300', 'w500', 'original'];
|
|
482
|
+
export declare const KNOWN_POSTER_SIZES: readonly [
|
|
483
|
+
'w92',
|
|
484
|
+
'w154',
|
|
485
|
+
'w185',
|
|
486
|
+
'w342',
|
|
487
|
+
'w500',
|
|
488
|
+
'w780',
|
|
489
|
+
'original'
|
|
490
|
+
];
|
|
491
|
+
export declare const KNOWN_PROFILE_SIZES: readonly ['w45', 'w185', 'h632', 'original'];
|
|
492
|
+
export declare const KNOWN_STILL_SIZES: readonly ['w92', 'w185', 'w300', 'original'];
|
|
493
|
+
export type KnownBackdropSize = (typeof KNOWN_BACKDROP_SIZES)[number];
|
|
494
|
+
export type KnownLogoSize = (typeof KNOWN_LOGO_SIZES)[number];
|
|
495
|
+
export type KnownPosterSize = (typeof KNOWN_POSTER_SIZES)[number];
|
|
496
|
+
export type KnownProfileSize = (typeof KNOWN_PROFILE_SIZES)[number];
|
|
497
|
+
export type KnownStillSize = (typeof KNOWN_STILL_SIZES)[number];
|
|
498
|
+
export type KnownImageSize = KnownBackdropSize | KnownLogoSize | KnownPosterSize | KnownProfileSize | KnownStillSize;
|
|
499
|
+
/** Union of every documented image size. */
|
|
500
|
+
export declare const KNOWN_IMAGE_SIZES: readonly KnownImageSize[];
|
|
501
|
+
export declare function isKnownBackdropSize(value: string): value is KnownBackdropSize;
|
|
502
|
+
export declare function isKnownLogoSize(value: string): value is KnownLogoSize;
|
|
503
|
+
export declare function isKnownPosterSize(value: string): value is KnownPosterSize;
|
|
504
|
+
export declare function isKnownProfileSize(value: string): value is KnownProfileSize;
|
|
505
|
+
export declare function isKnownStillSize(value: string): value is KnownStillSize;
|
|
506
|
+
/** True if `value` is in any documented size set. */
|
|
507
|
+
export declare function isKnownImageSize(value: string): value is KnownImageSize;
|
|
508
|
+
export type MovieAppendToResponse = 'account_states' | 'alternative_titles' | 'changes' | 'credits' | 'external_ids' | 'images' | 'keywords' | 'lists' | 'recommendations' | 'release_dates' | 'reviews' | 'similar' | 'translations' | 'videos' | 'watch/providers' | (string & {});
|
|
509
|
+
export type TVAppendToResponse = 'account_states' | 'aggregate_credits' | 'alternative_titles' | 'changes' | 'content_ratings' | 'credits' | 'episode_groups' | 'external_ids' | 'images' | 'keywords' | 'recommendations' | 'reviews' | 'screened_theatrically' | 'similar' | 'translations' | 'videos' | 'watch/providers' | (string & {});
|
|
510
|
+
/** Per-request options shared by every resource method. */
|
|
511
|
+
export interface RequestOptions {
|
|
512
|
+
/** AbortSignal used to cancel the underlying request. */
|
|
513
|
+
signal?: AbortSignal;
|
|
514
|
+
}
|
|
515
|
+
export interface ListOptions extends RequestOptions {
|
|
516
|
+
language?: LanguageCode;
|
|
517
|
+
page?: number;
|
|
518
|
+
region?: RegionCode;
|
|
519
|
+
}
|
|
520
|
+
export interface LanguageOptions extends RequestOptions {
|
|
521
|
+
language?: LanguageCode;
|
|
522
|
+
}
|
|
523
|
+
export interface MovieDetailsOptions extends LanguageOptions {
|
|
524
|
+
appendToResponse?: MovieAppendToResponse | readonly MovieAppendToResponse[];
|
|
525
|
+
}
|
|
526
|
+
export interface TVDetailsOptions extends LanguageOptions {
|
|
527
|
+
appendToResponse?: TVAppendToResponse | readonly TVAppendToResponse[];
|
|
528
|
+
}
|
|
529
|
+
export interface MovieSearchOptions extends ListOptions {
|
|
530
|
+
includeAdult?: boolean;
|
|
531
|
+
primaryReleaseYear?: string | number;
|
|
532
|
+
year?: string | number;
|
|
533
|
+
}
|
|
534
|
+
export interface TVSearchOptions extends Omit<ListOptions, 'region'> {
|
|
535
|
+
firstAirDateYear?: string | number;
|
|
536
|
+
includeAdult?: boolean;
|
|
537
|
+
year?: string | number;
|
|
538
|
+
}
|
|
539
|
+
export interface MultiSearchOptions extends Omit<ListOptions, 'region'> {
|
|
540
|
+
includeAdult?: boolean;
|
|
541
|
+
/**
|
|
542
|
+
* Media types to exclude from a `search.multi()` response. Filtering is
|
|
543
|
+
* performed client-side because the TMDB multi-search endpoint does not
|
|
544
|
+
* support a server-side media_type filter.
|
|
545
|
+
*/
|
|
546
|
+
exclude?: ReadonlyArray<MediaType>;
|
|
547
|
+
}
|
|
548
|
+
export interface ImageQueryOptions extends LanguageOptions {
|
|
549
|
+
includeImageLanguage?: string | readonly string[];
|
|
550
|
+
}
|