Moved interfaces as requested
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import {
|
||||
CollectionImageOptions,
|
||||
DetailedCollection,
|
||||
ImageCollection,
|
||||
LanguageOption,
|
||||
@@ -8,13 +9,6 @@ import { BaseEndpoint } from './base';
|
||||
|
||||
const BASE_COLLECTION = '/collection';
|
||||
|
||||
export interface CollectionImageSearchOptions extends LanguageOption {
|
||||
/**
|
||||
* a list of ISO-639-1 values to query
|
||||
*/
|
||||
include_image_language?: string[],
|
||||
}
|
||||
|
||||
export class CollectionsEndpoint extends BaseEndpoint {
|
||||
constructor(protected readonly accessToken: string) {
|
||||
super(accessToken);
|
||||
@@ -30,7 +24,7 @@ export class CollectionsEndpoint extends BaseEndpoint {
|
||||
);
|
||||
}
|
||||
|
||||
async images(id: number, options?: CollectionImageSearchOptions): Promise<ImageCollection> {
|
||||
async images(id: number, options?: CollectionImageOptions): Promise<ImageCollection> {
|
||||
const computedOptions = {
|
||||
include_image_language: options?.include_image_language?.join(','),
|
||||
language: options?.language,
|
||||
|
||||
@@ -18,7 +18,6 @@ import {
|
||||
PageOption,
|
||||
PopularTvShows,
|
||||
Recommendations,
|
||||
RegionOption,
|
||||
Reviews,
|
||||
ScreenedTheatrically,
|
||||
SeasonDetails,
|
||||
@@ -26,6 +25,8 @@ import {
|
||||
TimezoneOption,
|
||||
TopRatedTvShows,
|
||||
Translations,
|
||||
TvShowImageOptions,
|
||||
TvShowVideoOptions,
|
||||
TvShowChangeValue,
|
||||
TvShowDetails,
|
||||
TvShowsAiringToday,
|
||||
@@ -35,20 +36,6 @@ import {
|
||||
|
||||
const BASE_TV = '/tv';
|
||||
|
||||
export interface TvImageSearchOptions extends LanguageOption {
|
||||
/**
|
||||
* a list of ISO-639-1 values to query
|
||||
*/
|
||||
include_image_language?: string[],
|
||||
}
|
||||
|
||||
export interface TvVideoSearchOptions extends LanguageOption {
|
||||
/**
|
||||
* a list of ISO-639-1 values to query
|
||||
*/
|
||||
include_video_language?: string[],
|
||||
}
|
||||
|
||||
export class TvShowsEndpoint extends BaseEndpoint {
|
||||
constructor(protected readonly accessToken: string) {
|
||||
super(accessToken);
|
||||
@@ -118,7 +105,7 @@ export class TvShowsEndpoint extends BaseEndpoint {
|
||||
return await this.api.get<ExternalIds>(`${BASE_TV}/${id}/external_ids`);
|
||||
}
|
||||
|
||||
async images(id: number, options?: TvImageSearchOptions): Promise<Images> {
|
||||
async images(id: number, options?: TvShowImageOptions): Promise<Images> {
|
||||
const computedOptions = {
|
||||
include_image_language: options?.include_image_language?.join(','),
|
||||
language: options?.language,
|
||||
@@ -161,7 +148,7 @@ export class TvShowsEndpoint extends BaseEndpoint {
|
||||
return await this.api.get<Translations>(`${BASE_TV}/${id}/translations`);
|
||||
}
|
||||
|
||||
async videos(id: number, options?: TvVideoSearchOptions): Promise<Videos> {
|
||||
async videos(id: number, options?: TvShowVideoOptions): Promise<Videos> {
|
||||
const computedOptions = {
|
||||
include_video_language: options?.include_video_language?.join(','),
|
||||
language: options?.language,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Movie } from '.';
|
||||
import { LanguageOption, Movie } from '.';
|
||||
|
||||
export interface Collection {
|
||||
id: number;
|
||||
@@ -14,3 +14,10 @@ export interface Collection {
|
||||
export interface DetailedCollection extends Collection {
|
||||
parts: Movie[];
|
||||
}
|
||||
|
||||
export interface CollectionImageOptions extends LanguageOption {
|
||||
/**
|
||||
* a list of ISO-639-1 values to query
|
||||
*/
|
||||
include_image_language?: string[],
|
||||
}
|
||||
@@ -3,7 +3,7 @@ import {
|
||||
ProductionCompany,
|
||||
ProductionCountry,
|
||||
SpokenLanguage,
|
||||
Episode,
|
||||
LanguageOption,
|
||||
} from './';
|
||||
|
||||
export interface CreatedBy {
|
||||
@@ -274,3 +274,17 @@ export interface TvShowChangeValue {
|
||||
season_id: number;
|
||||
season_number: number;
|
||||
}
|
||||
|
||||
export interface TvShowImageOptions extends LanguageOption {
|
||||
/**
|
||||
* a list of ISO-639-1 values to query
|
||||
*/
|
||||
include_image_language?: string[],
|
||||
}
|
||||
|
||||
export interface TvShowVideoOptions extends LanguageOption {
|
||||
/**
|
||||
* a list of ISO-639-1 values to query
|
||||
*/
|
||||
include_video_language?: string[],
|
||||
}
|
||||
Reference in New Issue
Block a user