feat(parser types): added homePage & searchResult types

This commit is contained in:
Ritesh Ghosh
2023-08-03 01:28:12 +05:30
parent 7107ea5003
commit 43ca79d812
+31 -1
View File
@@ -1,5 +1,15 @@
import { HttpError } from "http-errors"; 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 { export interface ScrapedAnimeCategory {
animes: Array<Anime> | HttpError; animes: Array<Anime> | HttpError;
@@ -14,3 +24,23 @@ export interface ScrapedAnimeCategory {
hasNextPage: boolean; hasNextPage: boolean;
totalPages: number; 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;
}