tmdb-kit 0.1.0-beta.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 +159 -0
- package/dist/index.cjs +465 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +513 -0
- package/dist/index.d.ts +513 -0
- package/dist/index.js +459 -0
- package/dist/index.js.map +1 -0
- package/package.json +78 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,513 @@
|
|
|
1
|
+
//#region src/types.d.ts
|
|
2
|
+
/** Primitive JSON values returned by TMDB. */
|
|
3
|
+
type JsonPrimitive = string | number | boolean | null;
|
|
4
|
+
/** JSON object/array tree returned by TMDB for fields this SDK does not model yet. */
|
|
5
|
+
type JsonValue = JsonPrimitive | JsonObject | JsonValue[];
|
|
6
|
+
interface JsonObject {
|
|
7
|
+
[key: string]: JsonValue | undefined;
|
|
8
|
+
}
|
|
9
|
+
/** Escape hatch for append_to_response payloads and future TMDB fields. */
|
|
10
|
+
type TMDBObject = Record<string, unknown>;
|
|
11
|
+
type TMDBDateString = string;
|
|
12
|
+
type LanguageCode = string;
|
|
13
|
+
type RegionCode = string;
|
|
14
|
+
type MediaType = 'movie' | 'tv' | 'person';
|
|
15
|
+
type TrendingTimeWindow = 'day' | 'week';
|
|
16
|
+
interface PagedResponse<T> {
|
|
17
|
+
page: number;
|
|
18
|
+
results: T[];
|
|
19
|
+
total_pages: number;
|
|
20
|
+
total_results: number;
|
|
21
|
+
}
|
|
22
|
+
interface Genre {
|
|
23
|
+
id: number;
|
|
24
|
+
name: string;
|
|
25
|
+
}
|
|
26
|
+
interface ProductionCompany {
|
|
27
|
+
id: number;
|
|
28
|
+
logo_path: string | null;
|
|
29
|
+
name: string;
|
|
30
|
+
origin_country: string;
|
|
31
|
+
}
|
|
32
|
+
interface ProductionCountry {
|
|
33
|
+
iso_3166_1: string;
|
|
34
|
+
name: string;
|
|
35
|
+
}
|
|
36
|
+
interface SpokenLanguage {
|
|
37
|
+
english_name: string;
|
|
38
|
+
iso_639_1: string;
|
|
39
|
+
name: string;
|
|
40
|
+
}
|
|
41
|
+
interface CollectionSummary {
|
|
42
|
+
id: number;
|
|
43
|
+
name: string;
|
|
44
|
+
poster_path: string | null;
|
|
45
|
+
backdrop_path: string | null;
|
|
46
|
+
}
|
|
47
|
+
interface MovieSummary {
|
|
48
|
+
adult: boolean;
|
|
49
|
+
backdrop_path: string | null;
|
|
50
|
+
genre_ids: number[];
|
|
51
|
+
id: number;
|
|
52
|
+
original_language: string;
|
|
53
|
+
original_title: string;
|
|
54
|
+
overview: string;
|
|
55
|
+
popularity: number;
|
|
56
|
+
poster_path: string | null;
|
|
57
|
+
release_date: TMDBDateString;
|
|
58
|
+
title: string;
|
|
59
|
+
video: boolean;
|
|
60
|
+
vote_average: number;
|
|
61
|
+
vote_count: number;
|
|
62
|
+
}
|
|
63
|
+
interface MovieDetails extends Omit<MovieSummary, 'genre_ids'> {
|
|
64
|
+
belongs_to_collection: CollectionSummary | null;
|
|
65
|
+
budget: number;
|
|
66
|
+
genres: Genre[];
|
|
67
|
+
homepage: string | null;
|
|
68
|
+
imdb_id: string | null;
|
|
69
|
+
origin_country?: string[];
|
|
70
|
+
production_companies: ProductionCompany[];
|
|
71
|
+
production_countries: ProductionCountry[];
|
|
72
|
+
revenue: number;
|
|
73
|
+
runtime: number | null;
|
|
74
|
+
spoken_languages: SpokenLanguage[];
|
|
75
|
+
status: string;
|
|
76
|
+
tagline: string | null;
|
|
77
|
+
}
|
|
78
|
+
interface TVSummary {
|
|
79
|
+
adult?: boolean;
|
|
80
|
+
backdrop_path: string | null;
|
|
81
|
+
first_air_date: TMDBDateString;
|
|
82
|
+
genre_ids: number[];
|
|
83
|
+
id: number;
|
|
84
|
+
name: string;
|
|
85
|
+
origin_country: string[];
|
|
86
|
+
original_language: string;
|
|
87
|
+
original_name: string;
|
|
88
|
+
overview: string;
|
|
89
|
+
popularity: number;
|
|
90
|
+
poster_path: string | null;
|
|
91
|
+
vote_average: number;
|
|
92
|
+
vote_count: number;
|
|
93
|
+
}
|
|
94
|
+
interface CreatedBy {
|
|
95
|
+
id: number;
|
|
96
|
+
credit_id: string;
|
|
97
|
+
name: string;
|
|
98
|
+
gender: number;
|
|
99
|
+
profile_path: string | null;
|
|
100
|
+
}
|
|
101
|
+
interface Network {
|
|
102
|
+
id: number;
|
|
103
|
+
logo_path: string | null;
|
|
104
|
+
name: string;
|
|
105
|
+
origin_country: string;
|
|
106
|
+
}
|
|
107
|
+
interface SeasonSummary {
|
|
108
|
+
air_date: TMDBDateString | null;
|
|
109
|
+
episode_count: number;
|
|
110
|
+
id: number;
|
|
111
|
+
name: string;
|
|
112
|
+
overview: string;
|
|
113
|
+
poster_path: string | null;
|
|
114
|
+
season_number: number;
|
|
115
|
+
vote_average: number;
|
|
116
|
+
}
|
|
117
|
+
interface TVDetails extends Omit<TVSummary, 'genre_ids'> {
|
|
118
|
+
created_by: CreatedBy[];
|
|
119
|
+
episode_run_time: number[];
|
|
120
|
+
genres: Genre[];
|
|
121
|
+
homepage: string | null;
|
|
122
|
+
in_production: boolean;
|
|
123
|
+
languages: string[];
|
|
124
|
+
last_air_date: TMDBDateString | null;
|
|
125
|
+
networks: Network[];
|
|
126
|
+
number_of_episodes: number;
|
|
127
|
+
number_of_seasons: number;
|
|
128
|
+
production_companies: ProductionCompany[];
|
|
129
|
+
production_countries: ProductionCountry[];
|
|
130
|
+
seasons: SeasonSummary[];
|
|
131
|
+
spoken_languages: SpokenLanguage[];
|
|
132
|
+
status: string;
|
|
133
|
+
tagline: string | null;
|
|
134
|
+
type: string;
|
|
135
|
+
}
|
|
136
|
+
interface PersonKnownForMovie extends MovieSummary {
|
|
137
|
+
media_type: 'movie';
|
|
138
|
+
}
|
|
139
|
+
interface PersonKnownForTV extends TVSummary {
|
|
140
|
+
media_type: 'tv';
|
|
141
|
+
}
|
|
142
|
+
type PersonKnownFor = PersonKnownForMovie | PersonKnownForTV;
|
|
143
|
+
interface PersonSummary {
|
|
144
|
+
adult: boolean;
|
|
145
|
+
gender: number;
|
|
146
|
+
id: number;
|
|
147
|
+
known_for: PersonKnownFor[];
|
|
148
|
+
known_for_department: string;
|
|
149
|
+
name: string;
|
|
150
|
+
original_name?: string;
|
|
151
|
+
popularity: number;
|
|
152
|
+
profile_path: string | null;
|
|
153
|
+
}
|
|
154
|
+
interface PersonDetails extends Omit<PersonSummary, 'known_for'> {
|
|
155
|
+
also_known_as: string[];
|
|
156
|
+
biography: string;
|
|
157
|
+
birthday: TMDBDateString | null;
|
|
158
|
+
deathday: TMDBDateString | null;
|
|
159
|
+
homepage: string | null;
|
|
160
|
+
imdb_id: string | null;
|
|
161
|
+
place_of_birth: string | null;
|
|
162
|
+
}
|
|
163
|
+
interface MovieSearchResult extends MovieSummary {
|
|
164
|
+
media_type?: 'movie';
|
|
165
|
+
}
|
|
166
|
+
interface TVSearchResult extends TVSummary {
|
|
167
|
+
media_type?: 'tv';
|
|
168
|
+
}
|
|
169
|
+
interface PersonSearchResult extends PersonSummary {
|
|
170
|
+
media_type?: 'person';
|
|
171
|
+
}
|
|
172
|
+
type SearchMultiResult = (MovieSummary & {
|
|
173
|
+
media_type: 'movie';
|
|
174
|
+
}) | (TVSummary & {
|
|
175
|
+
media_type: 'tv';
|
|
176
|
+
}) | (PersonSummary & {
|
|
177
|
+
media_type: 'person';
|
|
178
|
+
});
|
|
179
|
+
type TrendingResult = SearchMultiResult;
|
|
180
|
+
interface CreditCastMember {
|
|
181
|
+
adult?: boolean;
|
|
182
|
+
cast_id?: number;
|
|
183
|
+
character: string;
|
|
184
|
+
credit_id: string;
|
|
185
|
+
gender: number | null;
|
|
186
|
+
id: number;
|
|
187
|
+
known_for_department: string;
|
|
188
|
+
name: string;
|
|
189
|
+
order: number;
|
|
190
|
+
original_name: string;
|
|
191
|
+
popularity: number;
|
|
192
|
+
profile_path: string | null;
|
|
193
|
+
}
|
|
194
|
+
interface CreditCrewMember {
|
|
195
|
+
adult?: boolean;
|
|
196
|
+
credit_id: string;
|
|
197
|
+
department: string;
|
|
198
|
+
gender: number | null;
|
|
199
|
+
id: number;
|
|
200
|
+
job: string;
|
|
201
|
+
known_for_department: string;
|
|
202
|
+
name: string;
|
|
203
|
+
original_name: string;
|
|
204
|
+
popularity: number;
|
|
205
|
+
profile_path: string | null;
|
|
206
|
+
}
|
|
207
|
+
interface CreditsResponse {
|
|
208
|
+
id: number;
|
|
209
|
+
cast: CreditCastMember[];
|
|
210
|
+
crew: CreditCrewMember[];
|
|
211
|
+
}
|
|
212
|
+
interface Video {
|
|
213
|
+
id: string;
|
|
214
|
+
iso_3166_1: string;
|
|
215
|
+
iso_639_1: string;
|
|
216
|
+
key: string;
|
|
217
|
+
name: string;
|
|
218
|
+
official: boolean;
|
|
219
|
+
published_at: string;
|
|
220
|
+
site: string;
|
|
221
|
+
size: number;
|
|
222
|
+
type: string;
|
|
223
|
+
}
|
|
224
|
+
interface VideosResponse {
|
|
225
|
+
id: number;
|
|
226
|
+
results: Video[];
|
|
227
|
+
}
|
|
228
|
+
interface ImageItem {
|
|
229
|
+
aspect_ratio: number;
|
|
230
|
+
height: number;
|
|
231
|
+
iso_639_1: string | null;
|
|
232
|
+
file_path: string;
|
|
233
|
+
vote_average: number;
|
|
234
|
+
vote_count: number;
|
|
235
|
+
width: number;
|
|
236
|
+
}
|
|
237
|
+
interface ImagesResponse {
|
|
238
|
+
id: number;
|
|
239
|
+
backdrops: ImageItem[];
|
|
240
|
+
logos?: ImageItem[];
|
|
241
|
+
posters: ImageItem[];
|
|
242
|
+
}
|
|
243
|
+
interface ConfigurationImages {
|
|
244
|
+
base_url: string;
|
|
245
|
+
secure_base_url: string;
|
|
246
|
+
backdrop_sizes: string[];
|
|
247
|
+
logo_sizes: string[];
|
|
248
|
+
poster_sizes: string[];
|
|
249
|
+
profile_sizes: string[];
|
|
250
|
+
still_sizes: string[];
|
|
251
|
+
}
|
|
252
|
+
interface Configuration {
|
|
253
|
+
images: ConfigurationImages;
|
|
254
|
+
change_keys: string[];
|
|
255
|
+
}
|
|
256
|
+
interface Country {
|
|
257
|
+
iso_3166_1: string;
|
|
258
|
+
english_name: string;
|
|
259
|
+
native_name: string;
|
|
260
|
+
}
|
|
261
|
+
interface Language {
|
|
262
|
+
iso_639_1: string;
|
|
263
|
+
english_name: string;
|
|
264
|
+
name: string;
|
|
265
|
+
}
|
|
266
|
+
interface Timezone {
|
|
267
|
+
iso_3166_1: string;
|
|
268
|
+
zones: string[];
|
|
269
|
+
}
|
|
270
|
+
interface JobDepartment {
|
|
271
|
+
department: string;
|
|
272
|
+
jobs: string[];
|
|
273
|
+
}
|
|
274
|
+
interface GenresResponse {
|
|
275
|
+
genres: Genre[];
|
|
276
|
+
}
|
|
277
|
+
type BackdropSize = 'w300' | 'w780' | 'w1280' | 'original' | (string & {});
|
|
278
|
+
type LogoSize = 'w45' | 'w92' | 'w154' | 'w185' | 'w300' | 'w500' | 'original' | (string & {});
|
|
279
|
+
type PosterSize = 'w92' | 'w154' | 'w185' | 'w342' | 'w500' | 'w780' | 'original' | (string & {});
|
|
280
|
+
type ProfileSize = 'w45' | 'w185' | 'h632' | 'original' | (string & {});
|
|
281
|
+
type StillSize = 'w92' | 'w185' | 'w300' | 'original' | (string & {});
|
|
282
|
+
type ImageSize = BackdropSize | LogoSize | PosterSize | ProfileSize | StillSize;
|
|
283
|
+
type MovieAppendToResponse = 'account_states' | 'alternative_titles' | 'changes' | 'credits' | 'external_ids' | 'images' | 'keywords' | 'lists' | 'recommendations' | 'release_dates' | 'reviews' | 'similar' | 'translations' | 'videos' | 'watch/providers' | (string & {});
|
|
284
|
+
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 & {});
|
|
285
|
+
interface ListOptions {
|
|
286
|
+
language?: LanguageCode;
|
|
287
|
+
page?: number;
|
|
288
|
+
region?: RegionCode;
|
|
289
|
+
}
|
|
290
|
+
interface LanguageOptions {
|
|
291
|
+
language?: LanguageCode;
|
|
292
|
+
}
|
|
293
|
+
interface MovieDetailsOptions extends LanguageOptions {
|
|
294
|
+
appendToResponse?: MovieAppendToResponse | readonly MovieAppendToResponse[];
|
|
295
|
+
}
|
|
296
|
+
interface TVDetailsOptions extends LanguageOptions {
|
|
297
|
+
appendToResponse?: TVAppendToResponse | readonly TVAppendToResponse[];
|
|
298
|
+
}
|
|
299
|
+
interface MovieSearchOptions extends ListOptions {
|
|
300
|
+
includeAdult?: boolean;
|
|
301
|
+
primaryReleaseYear?: string | number;
|
|
302
|
+
year?: string | number;
|
|
303
|
+
}
|
|
304
|
+
interface TVSearchOptions extends Omit<ListOptions, 'region'> {
|
|
305
|
+
firstAirDateYear?: string | number;
|
|
306
|
+
includeAdult?: boolean;
|
|
307
|
+
year?: string | number;
|
|
308
|
+
}
|
|
309
|
+
interface MultiSearchOptions extends Omit<ListOptions, 'region'> {
|
|
310
|
+
includeAdult?: boolean;
|
|
311
|
+
}
|
|
312
|
+
interface ImageQueryOptions extends LanguageOptions {
|
|
313
|
+
includeImageLanguage?: string | readonly string[];
|
|
314
|
+
}
|
|
315
|
+
//#endregion
|
|
316
|
+
//#region src/query.d.ts
|
|
317
|
+
type QueryPrimitive = string | number | boolean;
|
|
318
|
+
type QueryValue = QueryPrimitive | readonly QueryPrimitive[] | null | undefined;
|
|
319
|
+
type QueryParams = Record<string, QueryValue>;
|
|
320
|
+
interface QueryDefaults {
|
|
321
|
+
language?: LanguageCode;
|
|
322
|
+
region?: RegionCode;
|
|
323
|
+
}
|
|
324
|
+
interface BuildImageUrlOptions {
|
|
325
|
+
baseUrl?: string;
|
|
326
|
+
}
|
|
327
|
+
/**
|
|
328
|
+
* Build a full TMDB image URL from the path returned by API payloads.
|
|
329
|
+
* Returns null for nullish image paths so UI code can branch naturally.
|
|
330
|
+
*/
|
|
331
|
+
declare function buildImageUrl(path: string | null | undefined, size?: ImageSize, options?: BuildImageUrlOptions): string | null;
|
|
332
|
+
//#endregion
|
|
333
|
+
//#region src/http.d.ts
|
|
334
|
+
type FetchLike = (input: string, init?: RequestInit) => Promise<Response>;
|
|
335
|
+
interface TMDBAccessTokenAuth {
|
|
336
|
+
/** TMDB API Read Access Token. Sent as an Authorization Bearer header. */
|
|
337
|
+
accessToken: string;
|
|
338
|
+
apiKey?: never;
|
|
339
|
+
}
|
|
340
|
+
interface TMDBApiKeyAuth {
|
|
341
|
+
/** Legacy v3 API key. Sent as api_key query parameter. */
|
|
342
|
+
apiKey: string;
|
|
343
|
+
accessToken?: never;
|
|
344
|
+
}
|
|
345
|
+
type TMDBAuth = TMDBAccessTokenAuth | TMDBApiKeyAuth;
|
|
346
|
+
interface TMDBClientDefaults extends QueryDefaults {
|
|
347
|
+
imageBaseUrl: string;
|
|
348
|
+
}
|
|
349
|
+
type TMDBClientOptions = TMDBAuth & {
|
|
350
|
+
/** Defaults to https://api.themoviedb.org/3. Useful for tests or proxies. */baseUrl?: string; /** Inject a fetch implementation for tests, custom runtimes, or instrumentation. */
|
|
351
|
+
fetch?: FetchLike; /** Default language for endpoints that accept a language query parameter. */
|
|
352
|
+
defaultLanguage?: LanguageCode; /** Default region for movie list/search endpoints that accept a region query parameter. */
|
|
353
|
+
defaultRegion?: RegionCode; /** Custom image host. Defaults to https://image.tmdb.org/t/p. */
|
|
354
|
+
imageBaseUrl?: string; /** Additional headers merged into every request before authentication is applied. */
|
|
355
|
+
headers?: HeadersInit;
|
|
356
|
+
};
|
|
357
|
+
interface TMDBRequestOptions {
|
|
358
|
+
headers?: HeadersInit;
|
|
359
|
+
query?: QueryParams;
|
|
360
|
+
signal?: AbortSignal;
|
|
361
|
+
}
|
|
362
|
+
interface TMDBTransport {
|
|
363
|
+
readonly defaults: TMDBClientDefaults;
|
|
364
|
+
get<T>(path: string, options?: TMDBRequestOptions): Promise<T>;
|
|
365
|
+
}
|
|
366
|
+
//#endregion
|
|
367
|
+
//#region src/resources/configuration.d.ts
|
|
368
|
+
declare class ConfigurationResource {
|
|
369
|
+
#private;
|
|
370
|
+
constructor(transport: TMDBTransport);
|
|
371
|
+
details(): Promise<Configuration>;
|
|
372
|
+
countries(): Promise<Country[]>;
|
|
373
|
+
jobs(): Promise<JobDepartment[]>;
|
|
374
|
+
languages(): Promise<Language[]>;
|
|
375
|
+
primaryTranslations(): Promise<string[]>;
|
|
376
|
+
timezones(): Promise<Timezone[]>;
|
|
377
|
+
}
|
|
378
|
+
//#endregion
|
|
379
|
+
//#region src/resources/genres.d.ts
|
|
380
|
+
declare class GenresResource {
|
|
381
|
+
#private;
|
|
382
|
+
constructor(transport: TMDBTransport);
|
|
383
|
+
movies(options?: LanguageOptions): Promise<GenresResponse>;
|
|
384
|
+
tv(options?: LanguageOptions): Promise<GenresResponse>;
|
|
385
|
+
}
|
|
386
|
+
//#endregion
|
|
387
|
+
//#region src/resources/images.d.ts
|
|
388
|
+
declare class ImagesHelper {
|
|
389
|
+
#private;
|
|
390
|
+
constructor(transport: TMDBTransport);
|
|
391
|
+
url(path: string | null | undefined, size?: ImageSize): string | null;
|
|
392
|
+
}
|
|
393
|
+
//#endregion
|
|
394
|
+
//#region src/resources/movies.d.ts
|
|
395
|
+
declare class MoviesResource {
|
|
396
|
+
#private;
|
|
397
|
+
constructor(transport: TMDBTransport);
|
|
398
|
+
popular(options?: ListOptions): Promise<PagedResponse<MovieSummary>>;
|
|
399
|
+
topRated(options?: ListOptions): Promise<PagedResponse<MovieSummary>>;
|
|
400
|
+
nowPlaying(options?: ListOptions): Promise<PagedResponse<MovieSummary>>;
|
|
401
|
+
upcoming(options?: ListOptions): Promise<PagedResponse<MovieSummary>>;
|
|
402
|
+
details<TAppend extends TMDBObject = TMDBObject>(movieId: number, options?: MovieDetailsOptions): Promise<MovieDetails & TAppend>;
|
|
403
|
+
credits(movieId: number, options?: Pick<ListOptions, 'language'>): Promise<CreditsResponse>;
|
|
404
|
+
images(movieId: number, options?: ImageQueryOptions): Promise<ImagesResponse>;
|
|
405
|
+
recommendations(movieId: number, options?: ListOptions): Promise<PagedResponse<MovieSummary>>;
|
|
406
|
+
similar(movieId: number, options?: ListOptions): Promise<PagedResponse<MovieSummary>>;
|
|
407
|
+
videos(movieId: number, options?: Pick<ListOptions, 'language'>): Promise<VideosResponse>;
|
|
408
|
+
}
|
|
409
|
+
//#endregion
|
|
410
|
+
//#region src/resources/people.d.ts
|
|
411
|
+
declare class PeopleResource {
|
|
412
|
+
#private;
|
|
413
|
+
constructor(transport: TMDBTransport);
|
|
414
|
+
popular(options?: Omit<ListOptions, 'region'>): Promise<PagedResponse<PersonSummary>>;
|
|
415
|
+
details(personId: number, options?: LanguageOptions): Promise<PersonDetails>;
|
|
416
|
+
}
|
|
417
|
+
//#endregion
|
|
418
|
+
//#region src/resources/search.d.ts
|
|
419
|
+
declare class SearchResource {
|
|
420
|
+
#private;
|
|
421
|
+
constructor(transport: TMDBTransport);
|
|
422
|
+
movies(query: string, options?: MovieSearchOptions): Promise<PagedResponse<MovieSearchResult>>;
|
|
423
|
+
tv(query: string, options?: TVSearchOptions): Promise<PagedResponse<TVSearchResult>>;
|
|
424
|
+
people(query: string, options?: MultiSearchOptions): Promise<PagedResponse<PersonSearchResult>>;
|
|
425
|
+
multi(query: string, options?: MultiSearchOptions): Promise<PagedResponse<SearchMultiResult>>;
|
|
426
|
+
}
|
|
427
|
+
//#endregion
|
|
428
|
+
//#region src/resources/trending.d.ts
|
|
429
|
+
declare class TrendingResource {
|
|
430
|
+
#private;
|
|
431
|
+
constructor(transport: TMDBTransport);
|
|
432
|
+
all(timeWindow?: TrendingTimeWindow, options?: LanguageOptions): Promise<PagedResponse<TrendingResult>>;
|
|
433
|
+
movies(timeWindow?: TrendingTimeWindow, options?: LanguageOptions): Promise<PagedResponse<MovieSummary & {
|
|
434
|
+
media_type?: 'movie';
|
|
435
|
+
}>>;
|
|
436
|
+
tv(timeWindow?: TrendingTimeWindow, options?: LanguageOptions): Promise<PagedResponse<TVSummary & {
|
|
437
|
+
media_type?: 'tv';
|
|
438
|
+
}>>;
|
|
439
|
+
people(timeWindow?: TrendingTimeWindow, options?: LanguageOptions): Promise<PagedResponse<PersonSummary & {
|
|
440
|
+
media_type?: 'person';
|
|
441
|
+
}>>;
|
|
442
|
+
}
|
|
443
|
+
//#endregion
|
|
444
|
+
//#region src/resources/tv.d.ts
|
|
445
|
+
declare class TVResource {
|
|
446
|
+
#private;
|
|
447
|
+
constructor(transport: TMDBTransport);
|
|
448
|
+
popular(options?: Omit<ListOptions, 'region'>): Promise<PagedResponse<TVSummary>>;
|
|
449
|
+
topRated(options?: Omit<ListOptions, 'region'>): Promise<PagedResponse<TVSummary>>;
|
|
450
|
+
airingToday(options?: Omit<ListOptions, 'region'>): Promise<PagedResponse<TVSummary>>;
|
|
451
|
+
onTheAir(options?: Omit<ListOptions, 'region'>): Promise<PagedResponse<TVSummary>>;
|
|
452
|
+
details<TAppend extends TMDBObject = TMDBObject>(seriesId: number, options?: TVDetailsOptions): Promise<TVDetails & TAppend>;
|
|
453
|
+
credits(seriesId: number, options?: LanguageOptions): Promise<CreditsResponse>;
|
|
454
|
+
images(seriesId: number, options?: ImageQueryOptions): Promise<ImagesResponse>;
|
|
455
|
+
recommendations(seriesId: number, options?: Omit<ListOptions, 'region'>): Promise<PagedResponse<TVSummary>>;
|
|
456
|
+
similar(seriesId: number, options?: Omit<ListOptions, 'region'>): Promise<PagedResponse<TVSummary>>;
|
|
457
|
+
videos(seriesId: number, options?: LanguageOptions): Promise<VideosResponse>;
|
|
458
|
+
}
|
|
459
|
+
//#endregion
|
|
460
|
+
//#region src/client.d.ts
|
|
461
|
+
/**
|
|
462
|
+
* Main SDK entry point.
|
|
463
|
+
*
|
|
464
|
+
* Resource properties are intentionally small and explicit. The SDK focuses on
|
|
465
|
+
* common TMDB workflows first, while request<T>() keeps uncommon endpoints easy
|
|
466
|
+
* to call without waiting for a generated surface area.
|
|
467
|
+
*/
|
|
468
|
+
declare class TMDBClient {
|
|
469
|
+
#private;
|
|
470
|
+
readonly configuration: ConfigurationResource;
|
|
471
|
+
readonly genres: GenresResource;
|
|
472
|
+
readonly images: ImagesHelper;
|
|
473
|
+
readonly movies: MoviesResource;
|
|
474
|
+
readonly people: PeopleResource;
|
|
475
|
+
readonly search: SearchResource;
|
|
476
|
+
readonly trending: TrendingResource;
|
|
477
|
+
readonly tv: TVResource;
|
|
478
|
+
constructor(options: TMDBClientOptions);
|
|
479
|
+
request<T>(path: string, options?: TMDBRequestOptions): Promise<T>;
|
|
480
|
+
}
|
|
481
|
+
declare function createTMDB(options: TMDBClientOptions): TMDBClient;
|
|
482
|
+
//#endregion
|
|
483
|
+
//#region src/errors.d.ts
|
|
484
|
+
interface TMDBResponseErrorOptions {
|
|
485
|
+
body: JsonValue | undefined;
|
|
486
|
+
headers: Headers;
|
|
487
|
+
status: number;
|
|
488
|
+
statusText: string;
|
|
489
|
+
url: string;
|
|
490
|
+
}
|
|
491
|
+
/** Base class for all SDK-originated errors. */
|
|
492
|
+
declare class TMDBError extends Error {
|
|
493
|
+
constructor(message: string, options?: ErrorOptions);
|
|
494
|
+
}
|
|
495
|
+
/** Thrown before a request is sent or when fetch itself rejects. */
|
|
496
|
+
declare class TMDBRequestError extends TMDBError {
|
|
497
|
+
constructor(message: string, options?: ErrorOptions);
|
|
498
|
+
}
|
|
499
|
+
/** Thrown when TMDB returns a non-2xx response. */
|
|
500
|
+
declare class TMDBResponseError extends TMDBError {
|
|
501
|
+
readonly body: JsonValue | undefined;
|
|
502
|
+
readonly headers: Headers;
|
|
503
|
+
readonly requestId: string | null;
|
|
504
|
+
readonly status: number;
|
|
505
|
+
readonly statusCode: number | undefined;
|
|
506
|
+
readonly statusMessage: string | undefined;
|
|
507
|
+
readonly statusText: string;
|
|
508
|
+
readonly url: string;
|
|
509
|
+
constructor(message: string, options: TMDBResponseErrorOptions);
|
|
510
|
+
}
|
|
511
|
+
//#endregion
|
|
512
|
+
export { type BackdropSize, type CollectionSummary, type Configuration, type ConfigurationImages, type Country, type CreditCastMember, type CreditCrewMember, type CreditsResponse, type FetchLike, type Genre, type GenresResponse, type ImageItem, type ImageQueryOptions, type ImageSize, type ImagesResponse, type JobDepartment, type Language, type LanguageCode, type LanguageOptions, type ListOptions, type LogoSize, type MediaType, type MovieAppendToResponse, type MovieDetails, type MovieDetailsOptions, type MovieSearchOptions, type MovieSearchResult, type MovieSummary, type MultiSearchOptions, type Network, type PagedResponse, type PersonDetails, type PersonKnownFor, type PersonKnownForMovie, type PersonKnownForTV, type PersonSearchResult, type PersonSummary, type PosterSize, type ProductionCompany, type ProductionCountry, type ProfileSize, type RegionCode, type SearchMultiResult, type SeasonSummary, type SpokenLanguage, type StillSize, type TMDBAccessTokenAuth, type TMDBApiKeyAuth, type TMDBAuth, TMDBClient, type TMDBClientOptions, type TMDBDateString, TMDBError, type TMDBObject, TMDBRequestError, type TMDBRequestOptions, TMDBResponseError, type TVAppendToResponse, type TVDetails, type TVDetailsOptions, type TVSearchOptions, type TVSearchResult, type TVSummary, type Timezone, type TrendingResult, type TrendingTimeWindow, type Video, type VideosResponse, buildImageUrl, createTMDB };
|
|
513
|
+
//# sourceMappingURL=index.d.ts.map
|