feat: add multi-search, adjust types to allow type narrowing
This commit is contained in:
@@ -15,6 +15,8 @@ export * from './find';
|
||||
export * from './keywords';
|
||||
export * from './collections';
|
||||
|
||||
export type MediaType = 'movie' | 'tv' | 'person';
|
||||
|
||||
export interface AuthorDetails {
|
||||
name: string;
|
||||
username: string;
|
||||
@@ -22,23 +24,7 @@ export interface AuthorDetails {
|
||||
rating?: number;
|
||||
}
|
||||
|
||||
export interface KnownFor {
|
||||
id: number;
|
||||
overview: string;
|
||||
release_date: string;
|
||||
video: boolean;
|
||||
adult: boolean;
|
||||
backdrop_path: string;
|
||||
media_type: string;
|
||||
genre_ids: number[];
|
||||
title: string;
|
||||
original_language: string;
|
||||
original_title: string;
|
||||
poster_path: string;
|
||||
vote_count: number;
|
||||
vote_average: number;
|
||||
popularity: number;
|
||||
}
|
||||
export type KnownFor = MovieWithMediaType | TVWithMediaType;
|
||||
|
||||
export interface Person {
|
||||
id: number;
|
||||
@@ -51,6 +37,10 @@ export interface Person {
|
||||
popularity: number;
|
||||
}
|
||||
|
||||
export interface PersonWithMediaType extends Person {
|
||||
media_type: 'person';
|
||||
}
|
||||
|
||||
export interface Movie {
|
||||
id: number;
|
||||
poster_path: string;
|
||||
@@ -68,6 +58,10 @@ export interface Movie {
|
||||
vote_average: number;
|
||||
}
|
||||
|
||||
export interface MovieWithMediaType extends Movie {
|
||||
media_type: 'movie';
|
||||
}
|
||||
|
||||
export interface Company {
|
||||
id: number;
|
||||
logo_path: string;
|
||||
@@ -91,6 +85,10 @@ export interface TV {
|
||||
vote_average: number;
|
||||
}
|
||||
|
||||
export interface TVWithMediaType extends TV {
|
||||
media_type: 'tv';
|
||||
}
|
||||
|
||||
export interface Genre {
|
||||
id: number;
|
||||
name: string;
|
||||
|
||||
Reference in New Issue
Block a user