refactor: changed models dir to types

This commit is contained in:
Ritesh Ghosh
2024-01-19 19:56:39 +05:30
parent c4318e7361
commit 255e4823c9
25 changed files with 0 additions and 0 deletions
+19
View File
@@ -0,0 +1,19 @@
import type {
Season,
RelatedAnime,
RecommendedAnime,
AnimeGeneralAboutInfo,
} from "../anime.js";
import { type HttpError } from "http-errors";
import { type ScrapedAnimeSearchResult } from "./animeSearch.js";
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;
}
+22
View File
@@ -0,0 +1,22 @@
import type { HttpError } from "http-errors";
import type { Anime, Top10Anime } from "../anime.js";
export interface ScrapedAnimeCategory {
animes: Array<Anime> | HttpError;
genres: Array<string>;
top10Animes: {
today: Array<Top10Anime> | HttpError;
week: Array<Top10Anime> | HttpError;
month: Array<Top10Anime> | HttpError;
};
category: string;
totalPages: number;
currentPage: number;
hasNextPage: boolean;
}
export type CommonAnimeScrapeTypes =
| "animes"
| "totalPages"
| "hasNextPage"
| "currentPage";
+12
View File
@@ -0,0 +1,12 @@
import type { Intro, Subtitle, Video } from "../extractor.js";
export interface ScrapedAnimeEpisodesSources {
headers?: {
[k: string]: string;
};
intro?: Intro;
subtitles?: Subtitle[];
sources: Video[];
download?: string;
embedURL?: string;
}
+6
View File
@@ -0,0 +1,6 @@
import { type AnimeEpisode } from "../anime.js";
export interface ScrapedAnimeEpisodes {
totalEpisodes: number;
episodes: Array<AnimeEpisode>;
}
+11
View File
@@ -0,0 +1,11 @@
import type {
ScrapedAnimeCategory,
CommonAnimeScrapeTypes,
} from "./animeCategory.js";
import { type ScrapedHomePage } from "./homePage.js";
export interface ScrapedGenreAnime
extends Pick<ScrapedAnimeCategory, CommonAnimeScrapeTypes | "genres">,
Pick<ScrapedHomePage, "topAiringAnimes"> {
genreName: string;
}
+8
View File
@@ -0,0 +1,8 @@
import type { ScrapedHomePage } from "./homePage.js";
import type { ScrapedAnimeCategory } from "./animeCategory.js";
export interface ScrapedProducerAnime
extends Omit<ScrapedAnimeCategory, "genres" | "category">,
Pick<ScrapedHomePage, "topAiringAnimes"> {
producerName: string;
}
+11
View File
@@ -0,0 +1,11 @@
import type {
ScrapedAnimeCategory,
CommonAnimeScrapeTypes,
} from "./animeCategory.js";
import type { HttpError } from "http-errors";
import type { MostPopularAnime } from "../anime.js";
export interface ScrapedAnimeSearchResult
extends Pick<ScrapedAnimeCategory, CommonAnimeScrapeTypes> {
mostPopularAnimes: Array<MostPopularAnime> | HttpError;
}
@@ -0,0 +1,6 @@
import type { HttpError } from "http-errors";
import type { AnimeSearchSuggestion } from "../anime.js";
export interface ScrapedAnimeSearchSuggestion {
suggestions: Array<AnimeSearchSuggestion> | HttpError;
}
+8
View File
@@ -0,0 +1,8 @@
import type { SubEpisode, DubEpisode } from "../anime.js";
export interface ScrapedEpisodeServers {
sub: SubEpisode[];
dub: DubEpisode[];
episodeNo: number;
episodeId: string;
}
+10
View File
@@ -0,0 +1,10 @@
type EstimatedSchedule = {
id: string | null;
time: string | null;
name: string | null;
jname: string | null;
};
export type ScrapedEstimatedSchedule = {
scheduledAnimes: Array<EstimatedSchedule>;
};
+18
View File
@@ -0,0 +1,18 @@
import type {
TrendingAnime,
SpotlightAnime,
TopAiringAnime,
TopUpcomingAnime,
LatestEpisodeAnime,
} from "../anime.js";
import type { HttpError } from "http-errors";
import type { ScrapedAnimeCategory } from "./animeCategory.js";
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;
}
+25
View File
@@ -0,0 +1,25 @@
import type { ScrapedHomePage } from "./homePage.js";
import type { ScrapedGenreAnime } from "./animeGenre.js";
import type { ScrapedAnimeEpisodes } from "./animeEpisodes.js";
import type { ScrapedAnimeCategory } from "./animeCategory.js";
import type { ScrapedProducerAnime } from "./animeProducer.js";
import type { ScrapedEpisodeServers } from "./episodeServers.js";
import type { ScrapedAnimeAboutInfo } from "./animeAboutInfo.js";
import type { ScrapedAnimeSearchResult } from "./animeSearch.js";
import type { ScrapedEstimatedSchedule } from "./estimatedSchedule.js";
import type { ScrapedAnimeEpisodesSources } from "./animeEpisodeSrcs.js";
import type { ScrapedAnimeSearchSuggestion } from "./animeSearchSuggestion.js";
export type {
ScrapedHomePage,
ScrapedGenreAnime,
ScrapedAnimeEpisodes,
ScrapedProducerAnime,
ScrapedAnimeCategory,
ScrapedEpisodeServers,
ScrapedAnimeAboutInfo,
ScrapedAnimeSearchResult,
ScrapedEstimatedSchedule,
ScrapedAnimeEpisodesSources,
ScrapedAnimeSearchSuggestion,
};