revert(parserTypes): refactored parser types
This commit is contained in:
@@ -0,0 +1,19 @@
|
|||||||
|
import { HttpError } from "http-errors";
|
||||||
|
import { ScrapedAnimeSearchResult } from "./animeSearch";
|
||||||
|
import {
|
||||||
|
AnimeGeneralAboutInfo,
|
||||||
|
Season,
|
||||||
|
RelatedAnime,
|
||||||
|
RecommendedAnime,
|
||||||
|
} from "../anime";
|
||||||
|
|
||||||
|
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;
|
||||||
|
}
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
import { HttpError } from "http-errors";
|
||||||
|
import { Anime, Top10Anime, AnimeCategories } 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;
|
||||||
|
totalPages: number;
|
||||||
|
currentPage: number;
|
||||||
|
hasNextPage: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
export type CommonAnimeScrapeTypes =
|
||||||
|
| "animes"
|
||||||
|
| "totalPages"
|
||||||
|
| "hasNextPage"
|
||||||
|
| "currentPage";
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
import { ScrapedHomePage } from "./homePage";
|
||||||
|
import { ScrapedAnimeCategory, CommonAnimeScrapeTypes } from "./animeCategory";
|
||||||
|
|
||||||
|
export interface ScrapedGenreAnime
|
||||||
|
extends Pick<ScrapedAnimeCategory, CommonAnimeScrapeTypes | "genres">,
|
||||||
|
Pick<ScrapedHomePage, "topAiringAnimes"> {
|
||||||
|
genreName: string;
|
||||||
|
}
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
import { HttpError } from "http-errors";
|
||||||
|
import { MostPopularAnime } from "../anime";
|
||||||
|
import { ScrapedAnimeCategory, CommonAnimeScrapeTypes } from "./animeCategory";
|
||||||
|
|
||||||
|
export interface ScrapedAnimeSearchResult
|
||||||
|
extends Pick<ScrapedAnimeCategory, CommonAnimeScrapeTypes> {
|
||||||
|
mostPopularAnimes: Array<MostPopularAnime> | HttpError;
|
||||||
|
}
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
import { HttpError } from "http-errors";
|
||||||
|
import { ScrapedAnimeCategory } from "./animeCategory";
|
||||||
|
import {
|
||||||
|
TrendingAnime,
|
||||||
|
SpotlightAnime,
|
||||||
|
TopAiringAnime,
|
||||||
|
TopUpcomingAnime,
|
||||||
|
LatestEpisodeAnime,
|
||||||
|
} from "../anime";
|
||||||
|
|
||||||
|
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;
|
||||||
|
}
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
import { ScrapedHomePage } from "./homePage";
|
||||||
|
import { ScrapedGenreAnime } from "./animeGenre";
|
||||||
|
import { ScrapedAnimeCategory } from "./animeCategory";
|
||||||
|
import { ScrapedAnimeAboutInfo } from "./animeAboutInfo";
|
||||||
|
import { ScrapedAnimeSearchResult } from "./animeSearch";
|
||||||
|
|
||||||
|
export {
|
||||||
|
ScrapedHomePage,
|
||||||
|
ScrapedGenreAnime,
|
||||||
|
ScrapedAnimeCategory,
|
||||||
|
ScrapedAnimeAboutInfo,
|
||||||
|
ScrapedAnimeSearchResult,
|
||||||
|
};
|
||||||
Reference in New Issue
Block a user