diff options
| author | Ritesh Ghosh <[email protected]> | 2023-08-03 01:29:20 +0530 |
|---|---|---|
| committer | Ritesh Ghosh <[email protected]> | 2023-08-03 01:29:20 +0530 |
| commit | bbea6fb626a0c04ee5d53064f50c5007b5cb898c (patch) | |
| tree | 066b37bb8c61fc3f391925564e66016d5a794ffb /src | |
| parent | 43ca79d812a4a9fc6de28dc1cac4063eae36942e (diff) | |
| download | aniwatch-api-bbea6fb626a0c04ee5d53064f50c5007b5cb898c.tar.xz aniwatch-api-bbea6fb626a0c04ee5d53064f50c5007b5cb898c.zip | |
feat(new types): added several new types & made types D.R.Y
Diffstat (limited to 'src')
| -rw-r--r-- | src/models/anime.ts | 34 |
1 files changed, 18 insertions, 16 deletions
diff --git a/src/models/anime.ts b/src/models/anime.ts index 511202e..65c2b54 100644 --- a/src/models/anime.ts +++ b/src/models/anime.ts @@ -1,5 +1,3 @@ -import { HttpError } from "http-errors"; - export interface Anime { id: string | null; name: string | null; @@ -15,29 +13,33 @@ export interface Anime { type CommonAnimeProps = "id" | "name" | "poster"; -export interface Top10Anime extends Pick<Anime, CommonAnimeProps> { +export interface Top10Anime extends Pick<Anime, CommonAnimeProps | "episodes"> { rank: number | null; - eps: { - sub: number | null; - dub: number | null; - }; } export type Top10AnimeTimePeriod = "day" | "week" | "month"; -export interface AnimeSearchResult { - animes: Array<Anime> | HttpError; - mostPopularAnimes: Array<MostPopularAnime> | HttpError; - totalPages: number; - currentPage: number; - hasNextPage: boolean; -} - export interface MostPopularAnime extends Pick<Anime, CommonAnimeProps> { jname: string | null; - otherInfo: string[] | []; + otherInfo: string[]; } +export interface SpotlightAnime + extends MostPopularAnime, + Pick<Top10Anime, "rank"> { + description: string | null; +} + +export interface TrendingAnime + extends Pick<Anime, CommonAnimeProps>, + Pick<Top10Anime, "rank"> {} + +export interface LatestEpisodeAnime extends Anime {} + +export interface TopUpcomingAnime extends Anime {} + +export interface TopAiringAnime extends MostPopularAnime {} + export type AnimeCategories = | "most-favorite" | "most-popular" |
