refactor: refactored types

This commit is contained in:
Ritesh Ghosh
2023-08-07 14:56:06 +05:30
parent 8a5884b752
commit eb7cd499b6
2 changed files with 0 additions and 115 deletions
-48
View File
@@ -1,48 +0,0 @@
import {
Anime,
Season,
Servers,
Top10Anime,
RelatedAnime,
TrendingAnime,
TopAiringAnime,
SpotlightAnime,
AnimeCategories,
MostPopularAnime,
TopUpcomingAnime,
RecommendedAnime,
LatestEpisodeAnime,
Top10AnimeTimePeriod,
AnimeGeneralAboutInfo,
} from "./anime";
import {
ScrapedHomePage,
ScrapedGenreAnime,
ScrapedAnimeCategory,
ScrapedAnimeAboutInfo,
ScrapedAnimeSearchResult,
} from "./parser";
export {
Anime,
Season,
Servers,
Top10Anime,
RelatedAnime,
TrendingAnime,
SpotlightAnime,
TopAiringAnime,
AnimeCategories,
ScrapedHomePage,
MostPopularAnime,
TopUpcomingAnime,
RecommendedAnime,
ScrapedGenreAnime,
LatestEpisodeAnime,
Top10AnimeTimePeriod,
ScrapedAnimeCategory,
ScrapedAnimeAboutInfo,
AnimeGeneralAboutInfo,
ScrapedAnimeSearchResult,
};
-67
View File
@@ -1,67 +0,0 @@
import { HttpError } from "http-errors";
import {
Anime,
Season,
Top10Anime,
RelatedAnime,
TrendingAnime,
SpotlightAnime,
TopAiringAnime,
AnimeCategories,
MostPopularAnime,
TopUpcomingAnime,
RecommendedAnime,
LatestEpisodeAnime,
AnimeGeneralAboutInfo,
} from "./anime";
export interface ScrapedAnimeCategory {
animes: Array<Anime> | HttpError;
genres: Array<string>;
top10Animes: {
today: Array<Top10Anime> | HttpError;
week: Array<Top10Anime> | HttpError;
month: Array<Top10Anime> | HttpError;
};
category: AnimeCategories;
currentPage: number;
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;
}
export interface ScrapedAnimeAboutInfo
extends Pick<ScrapedAnimeSearchResult, "mostPopularAnimes"> {
anime: {
info: AnimeGeneralAboutInfo;
moreInfo: Record<string, string | string[]>;
};
seasons: Array<Season>;
relatedAnimes: Array<RelatedAnime> | HttpError;
recommendedAnimes: Array<RecommendedAnime> | HttpError;
}
export interface ScrapedGenreAnime
extends Pick<ScrapedAnimeCategory, CommonAnimeScrapeTypes | "genres">,
Pick<ScrapedHomePage, "topAiringAnimes"> {
genreName: string;
}