From 43ca79d812a4a9fc6de28dc1cac4063eae36942e Mon Sep 17 00:00:00 2001 From: Ritesh Ghosh Date: Thu, 3 Aug 2023 01:28:12 +0530 Subject: feat(parser types): added `homePage` & `searchResult` types --- src/models/parser.ts | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) (limited to 'src/models/parser.ts') 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 | HttpError; @@ -14,3 +24,23 @@ export interface ScrapedAnimeCategory { hasNextPage: boolean; totalPages: number; } + +type CommonAnimeScrapeTypes = + | "animes" + | "totalPages" + | "hasNextPage" + | "currentPage"; + +export interface ScrapedAnimeSearchResult + extends Pick { + mostPopularAnimes: Array | HttpError; +} + +export interface ScrapedHomePage + extends Pick { + spotlightAnimes: Array | HttpError; + trendingAnimes: Array | HttpError; + latestEpisodeAnimes: Array | HttpError; + topUpcomingAnimes: Array | HttpError; + topAiringAnimes: Array | HttpError; +} -- cgit v1.2.3