separated our current watchlist types

This commit is contained in:
John O'Keefe 2024-07-24 09:16:13 -04:00
parent dcf7322b0c
commit 64def1a763
2 changed files with 120 additions and 81 deletions

View File

@ -0,0 +1,88 @@
export interface AniListCurrentUserWatchList {
data: Data
}
export interface Data {
Page: Page
}
export interface Page {
pageInfo: PageInfo
mediaList: MediaList[]
}
export interface PageInfo {
total: number
perPage: number
currentPage: number
lastPage: number
hasNextPage: boolean
}
export interface MediaList {
id: number
mediaId: number
userId: number
media: Media
status: string
notes?: string
progress: number
score: number
repeat: number
user: User
}
export interface Media {
id: number
idMal: number
title: Title
description: string
coverImage: CoverImage
season: string
seasonYear: number
status: string
episodes?: number
nextAiringEpisode?: NextAiringEpisode
}
export interface Title {
romaji: string
english?: string
native: string
}
export interface CoverImage {
large: string
}
export interface NextAiringEpisode {
airingAt: number
timeUntilAiring: number
episode: number
}
export interface User {
id: number
name: string
avatar: Avatar
statistics: Statistics
}
export interface Avatar {
large: string
medium: string
}
export interface Statistics {
anime: Anime
}
export interface Anime {
count: number
statuses: Status[]
}
export interface Status {
status: string
count: number
}

View File

@ -64,84 +64,35 @@ export interface AniListUser {
}
}
export interface AniListCurrentUserWatchList {
data: Data;
}
export interface Data {
Page: Page;
}
export interface Page {
pageInfo: PageInfo;
mediaList: MediaList[];
}
export interface MediaList {
id: number;
mediaId: number;
userId: number;
media: Media;
status: StatusEnum;
notes: string | null;
progress: number;
score: number;
repeat: number;
user: User;
}
export interface Media {
id: number;
idMal: number;
title: Title;
description: string;
coverImage: CoverImage;
season: string;
seasonYear: number;
episodes: number;
}
export interface CoverImage {
large: string;
}
export interface Title {
romaji: string | null;
english: string | null;
native: string;
}
export enum StatusEnum {
Completed = "COMPLETED",
Current = "CURRENT",
Dropped = "DROPPED",
Planning = "PLANNING",
Repeating = "REPEATING",
}
export interface User {
id: number;
statistics: Statistics;
}
export interface Statistics {
anime: Anime;
}
export interface Anime {
count: number;
statuses: StatusElement[];
}
export interface StatusElement {
status: StatusEnum;
count: number;
}
export interface PageInfo {
total: number;
perPage: number;
currentPage: number;
lastPage: number;
hasNextPage: boolean;
}
export enum MediaListSort {
MediaId = "MEDIA_ID",
MediaIdDesc = "MEDIA_ID_DESC",
Score = "SCORE",
ScoreDesc = "SCORE_DESC",
Status = "STATUS",
StatusDesc = "STATUS_DESC",
Progress = "PROGRESS",
ProgressDesc = "PROGRESS_DESC",
ProgressVolumes = "PROGRESS_VOLUMES",
ProgressVolumesDesc = "PROGRESS_VOLUMES_DESC",
Repeat = "REPEAT",
RepeatDesc = "REPEAT_DESC",
Priority = "PRIORITY",
PriorityDesc = "PRIORITY_DESC",
StartedOn = "STARTED_ON",
StartedOnDesc = "STARTED_ON_DESC",
FinishedOn = "FINISHED_ON",
FinishedOnDesc = "FINISHED_ON_DESC",
AddedTime = "ADDED_TIME",
AddedTimeDesc = "ADDED_TIME_DESC",
UpdatedTime = "UPDATED_TIME",
UpdatedTimeDesc = "UPDATED_TIME_DESC",
MediaTitleRomaji = "MEDIA_TITLE_ROMAJI",
MediaTitleRomajiDesc = "MEDIA_TITLE_ROMAJI_DESC",
MediaTitleEnglish = "MEDIA_TITLE_ENGLISH",
MediaTitleEnglishDesc = "MEDIA_TITLE_ENGLISH_DESC",
MediaTitleNative = "MEDIA_TITLE_NATIVE",
MediaTitleNativeDesc = "MEDIA_TITLE_NATIVE_DESC",
MediaPopularity = "MEDIA_POPULARITY",
MediaPopularityDesc = "MEDIA_POPULARITY_DESC"
}