Skip to content
This repository has been archived by the owner on Oct 11, 2024. It is now read-only.

Commit

Permalink
Refactor Interfaces
Browse files Browse the repository at this point in the history
  • Loading branch information
RLAlpha49 committed Apr 26, 2024
1 parent b36864f commit 0a2e031
Show file tree
Hide file tree
Showing 30 changed files with 472 additions and 779 deletions.
6 changes: 6 additions & 0 deletions src/apis/anilist/interfaces/CoverImage.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export interface CoverImage {
extraLarge: string
large: string
medium: string
color: string
}
5 changes: 5 additions & 0 deletions src/apis/anilist/interfaces/ExternalLink.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export interface ExternalLink {
id: number
url: string
site: string
}
5 changes: 5 additions & 0 deletions src/apis/anilist/interfaces/FuzzyDate.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export interface FuzzyDate {
year: number
month: number
day: number
}
4 changes: 4 additions & 0 deletions src/apis/anilist/interfaces/Image.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export interface Image {
large: string
medium: string
}
59 changes: 59 additions & 0 deletions src/apis/anilist/interfaces/Media.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
import { Title } from './Title'
import { FuzzyDate } from './FuzzyDate'
import { Trailer } from './Trailer'
import { CoverImage } from './CoverImage'
import { Tag } from './Tag'
import { NextAiringEpisode } from './NextAiringEpisode'
import { ExternalLink } from './ExternalLink'
import { StreamingEpisode } from './StreamingEpisode'
import { Ranking } from './Ranking'
import { Stats } from './Stats'
import { MediaListEntry } from './MediaListEntry'

export interface Media {
id: number
idMal: number
title: Title
type: string
format: string
status: string
description: string
startDate: FuzzyDate
endDate: FuzzyDate
season: string
seasonYear: number
seasonInt: number
episodes?: number
duration?: number
chapters?: number
volumes?: number
countryOfOrigin: string
isLicensed: boolean
source: string
hashtag: string
trailer: Trailer
updatedAt: number
coverImage: CoverImage
bannerImage: string
genres: string[]
synonyms: string[]
averageScore: number
meanScore: number
popularity: number
isLocked: boolean
trending: number
favourites: number
tags: Tag[]
isFavourite: boolean
isAdult: boolean
nextAiringEpisode: NextAiringEpisode
externalLinks: ExternalLink[]
streamingEpisodes: StreamingEpisode[]
rankings: Ranking[]
mediaListEntry: MediaListEntry
stats: Stats
siteUrl: string
autoCreateForumThread: boolean
isRecommendationBlocked: boolean
modNotes: string
}
4 changes: 4 additions & 0 deletions src/apis/anilist/interfaces/MediaListEntry.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export interface MediaListEntry {
id: number
status: string
}
6 changes: 6 additions & 0 deletions src/apis/anilist/interfaces/Name.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export interface Name {
first: string
last: string
full: string
native: string
}
5 changes: 5 additions & 0 deletions src/apis/anilist/interfaces/NextAiringEpisode.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export interface NextAiringEpisode {
airingAt: number
timeUntilAiring: number
episode: number
}
10 changes: 10 additions & 0 deletions src/apis/anilist/interfaces/Ranking.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
export interface Ranking {
id: number
rank: number
type: string
format: string
year: number
season: string
allTime: boolean
context: string
}
4 changes: 4 additions & 0 deletions src/apis/anilist/interfaces/ScoreDistribution.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export interface ScoreDistribution {
score: number
amount: number
}
7 changes: 7 additions & 0 deletions src/apis/anilist/interfaces/Stats.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { ScoreDistribution } from './ScoreDistribution'
import { StatusDistribution } from './StatusDistribution'

export interface Stats {
scoreDistribution: ScoreDistribution[]
statusDistribution: StatusDistribution[]
}
4 changes: 4 additions & 0 deletions src/apis/anilist/interfaces/StatusDistribution.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export interface StatusDistribution {
status: string
amount: number
}
6 changes: 6 additions & 0 deletions src/apis/anilist/interfaces/StreamingEpisode.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export interface StreamingEpisode {
title: string
thumbnail: string
url: string
site: string
}
9 changes: 9 additions & 0 deletions src/apis/anilist/interfaces/Tag.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
export interface Tag {
id: number
name: string
description: string
rank: number
isGeneralSpoiler: boolean
isMediaSpoiler: boolean
isAdult: boolean
}
6 changes: 6 additions & 0 deletions src/apis/anilist/interfaces/Title.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export interface Title {
romaji: string
english: string
native: string
userPreferred: string
}
5 changes: 5 additions & 0 deletions src/apis/anilist/interfaces/Trailer.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export interface Trailer {
id: string
site: string
thumbnail: string
}
10 changes: 10 additions & 0 deletions src/apis/anilist/interfaces/responses/AiringSchedule.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { Media } from '../Media'

export interface AiringScheduleResponse {
id: number
airingAt: number
timeUntilAiring: number
episode: number
mediaId: number
media: Media
}
26 changes: 26 additions & 0 deletions src/apis/anilist/interfaces/responses/Character.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import { FuzzyDate } from '../FuzzyDate'
import { Name } from '../Name'
import { Image } from '../Image'
import { Title } from '../Title'

export interface CharacterResponse {
id: number
name: Name
image: Image
description: string
gender: string
dateOfBirth: FuzzyDate
age: string
bloodType: string
isFavourite: boolean
isFavouriteBlocked: boolean
siteUrl: string
media: {
nodes: Array<{
id: number
title: Title
}>
}
favourites: number
modNotes: string
}
118 changes: 118 additions & 0 deletions src/apis/anilist/interfaces/responses/Media.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
import { Title } from '../Title'
import { FuzzyDate } from '../FuzzyDate'
import { Trailer } from '../Trailer'
import { CoverImage } from '../CoverImage'
import { Tag } from '../Tag'
import { NextAiringEpisode } from '../NextAiringEpisode'
import { ExternalLink } from '../ExternalLink'
import { StreamingEpisode } from '../StreamingEpisode'
import { Ranking } from '../Ranking'
import { Stats } from '../Stats'
import { MediaListEntry } from '../MediaListEntry'
import { Name } from '../Name'
import { Image } from '../Image'

export interface MediaResponse {
id: number
idMal: number
title: Title
type: string
format: string
status: string
description: string
startDate: FuzzyDate
endDate: FuzzyDate
season: string
seasonYear: number
seasonInt: number
episodes?: number
duration?: number
chapters?: number
volumes?: number
countryOfOrigin: string
isLicensed: boolean
source: string
hashtag: string
trailer: Trailer
updatedAt: number
coverImage: CoverImage
bannerImage: string
genres: string[]
synonyms: string[]
averageScore: number
meanScore: number
popularity: number
isLocked: boolean
trending: number
favourites: number
tags: Tag[]
relations: {
edges: Array<{
relationType: string
node: {
id: number
title: Title
}
}>
}
characters: {
edges: Array<{
id: number
role: string
name: string
voiceActors: Array<{
id: number
name: Name
image: Image
}>
media: {
id: number
title: Title
coverImage: CoverImage
}
favouriteOrder: number
node: {
id: number
name: Name
image: Image
}
}>
}
staff: {
edges: Array<{
id: number
role: string
favouriteOrder: number
node: {
id: number
name: Name
image: Image
}
}>
}
studios: {
edges: Array<{
id: number
isMain: boolean
favouriteOrder: number
node: {
id: number
name: string
isAnimationStudio: boolean
siteUrl: string
}
}>
}
isFavourite: boolean
isAdult: boolean
nextAiringEpisode: NextAiringEpisode
externalLinks: ExternalLink[]
streamingEpisodes: StreamingEpisode[]
rankings: Ranking[]
mediaListEntry: MediaListEntry
stats: Stats
siteUrl: string
autoCreateForumThread: boolean
isRecommendationBlocked: boolean
modNotes: string
}
24 changes: 24 additions & 0 deletions src/apis/anilist/interfaces/responses/MediaList.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import { Media } from '../Media'

export interface MediaListResponse {
id: number
userId: number
mediaId: number
status: string
score: number
progress: number
progressVolumes: number
repeat: number
priority: number
private: boolean
notes: string
hiddenFromStatusLists: boolean
customLists: any
advancedScores: any
startedAt: any
completedAt: any
updatedAt: number
createdAt: number
media: Media
user: any
}
13 changes: 13 additions & 0 deletions src/apis/anilist/interfaces/responses/MediaTrend.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { Media } from '../Media'

export interface MediaTrendResponse {
mediaId: number
date: number
trending: number
averageScore: number
popularity: number
inProgress: number
releasing: boolean
episode: number
media: Media
}
Loading

0 comments on commit 0a2e031

Please sign in to comment.