aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRitesh Ghosh <[email protected]>2023-08-03 01:28:12 +0530
committerRitesh Ghosh <[email protected]>2023-08-03 01:28:12 +0530
commit43ca79d812a4a9fc6de28dc1cac4063eae36942e (patch)
treeb99814221c4d1031c689e5841cfe0874ebb041b8 /src
parent7107ea5003a31ac38df898a2427a8071e81b102c (diff)
downloadaniwatch-api-43ca79d812a4a9fc6de28dc1cac4063eae36942e.tar.xz
aniwatch-api-43ca79d812a4a9fc6de28dc1cac4063eae36942e.zip
feat(parser types): added `homePage` & `searchResult` types
Diffstat (limited to 'src')
-rw-r--r--src/models/parser.ts32
1 files changed, 31 insertions, 1 deletions
diff --git a/src/models/parser.ts b/src/models/parser.ts
index 0d08727..de7c343 100644
--- a/src/models/parser.ts
+++ b/src/models/parser.ts
@@ -1,5 +1,15 @@
import { HttpError } from "http-errors";
-import { Anime, AnimeCategories, Top10Anime } from "./anime";
+import {
+ Anime,
+ Top10Anime,
+ TrendingAnime,
+ SpotlightAnime,
+ TopAiringAnime,
+ AnimeCategories,
+ MostPopularAnime,
+ TopUpcomingAnime,
+ LatestEpisodeAnime,
+} from "./anime";
export interface ScrapedAnimeCategory {
animes: Array<Anime> | HttpError;
@@ -14,3 +24,23 @@ export interface ScrapedAnimeCategory {
hasNextPage: boolean;
totalPages: number;
}
+
+type CommonAnimeScrapeTypes =
+ | "animes"
+ | "totalPages"
+ | "hasNextPage"
+ | "currentPage";
+
+export interface ScrapedAnimeSearchResult
+ extends Pick<ScrapedAnimeCategory, CommonAnimeScrapeTypes> {
+ mostPopularAnimes: Array<MostPopularAnime> | HttpError;
+}
+
+export interface ScrapedHomePage
+ extends Pick<ScrapedAnimeCategory, "genres" | "top10Animes"> {
+ spotlightAnimes: Array<SpotlightAnime> | HttpError;
+ trendingAnimes: Array<TrendingAnime> | HttpError;
+ latestEpisodeAnimes: Array<LatestEpisodeAnime> | HttpError;
+ topUpcomingAnimes: Array<TopUpcomingAnime> | HttpError;
+ topAiringAnimes: Array<TopAiringAnime> | HttpError;
+}