aboutsummaryrefslogtreecommitdiff
path: root/src/models
diff options
context:
space:
mode:
authorRitesh Ghosh <[email protected]>2023-08-02 21:10:36 +0530
committerRitesh Ghosh <[email protected]>2023-08-02 21:10:36 +0530
commitf949c1c36ba323e2a05526bc4cf29400a2c9641c (patch)
tree91085dda23f7eca9d877e6c9344442b4b8efcebf /src/models
parent45f510f9c042dc8bd9950d277cf8d5d5fbdf0b3c (diff)
downloadaniwatch-api-f949c1c36ba323e2a05526bc4cf29400a2c9641c.tar.xz
aniwatch-api-f949c1c36ba323e2a05526bc4cf29400a2c9641c.zip
feat(anime): added anime search result & most popular anime types
Diffstat (limited to 'src/models')
-rw-r--r--src/models/anime.ts20
1 files changed, 19 insertions, 1 deletions
diff --git a/src/models/anime.ts b/src/models/anime.ts
index 90e10d2..511202e 100644
--- a/src/models/anime.ts
+++ b/src/models/anime.ts
@@ -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"