feat(anime): added anime search result & most popular anime types

This commit is contained in:
Ritesh Ghosh
2023-08-02 21:10:36 +05:30
parent 45f510f9c0
commit f949c1c36b
+19 -1
View File
@@ -1,3 +1,5 @@
import { HttpError } from "http-errors";
export interface Anime {
id: string | null;
name: string | null;
@@ -5,7 +7,10 @@ export interface Anime {
duration: string | null;
type: string | null;
rating: string | null;
episodes: string | null;
episodes: {
sub: number | null;
dub: number | null;
};
}
type CommonAnimeProps = "id" | "name" | "poster";
@@ -20,6 +25,19 @@ export interface Top10Anime extends Pick<Anime, CommonAnimeProps> {
export type Top10AnimeTimePeriod = "day" | "week" | "month";
export interface AnimeSearchResult {
animes: Array<Anime> | HttpError;
mostPopularAnimes: Array<MostPopularAnime> | HttpError;
totalPages: number;
currentPage: number;
hasNextPage: boolean;
}
export interface MostPopularAnime extends Pick<Anime, CommonAnimeProps> {
jname: string | null;
otherInfo: string[] | [];
}
export type AnimeCategories =
| "most-favorite"
| "most-popular"