feat: add multi-search, adjust types to allow type narrowing

This commit is contained in:
Alexander B
2023-04-28 20:26:34 +06:00
parent e5ce15d58d
commit da6427807f
6 changed files with 53 additions and 30 deletions

View File

@@ -1,6 +1,13 @@
import { MovieWithMediaType, PersonWithMediaType, TVWithMediaType } from '.';
export interface Search<T> {
page: number;
results: T[];
total_pages: number;
total_results: number;
}
export type MultiSearchResult =
| MovieWithMediaType
| TVWithMediaType
| PersonWithMediaType;