-
Notifications
You must be signed in to change notification settings - Fork 5
/
types.ts
158 lines (140 loc) · 3.1 KB
/
types.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
import * as Common from "../common";
export interface MangaItem<T> {
node: T;
}
export module MangaForList {
export interface MediaType {
media_type:
| "unknown"
| "manga"
| "novel"
| "one_shot"
| "doujinshi"
| "manhwa"
| "manhua"
| "oel";
}
export interface Status {
/**
* Publishing status.
*/
status: "finished" | "currently_publishing" | "not_yet_published";
}
export interface MyListStatus<T> {
/**
* Status of user's manga list. If there is no access token, the API excludes this field.
*/
my_list_status: T | null;
}
export interface NumVolumes {
/**
* If unknown, it is 0.
*/
num_volumes: number;
}
export interface NumChapters {
/**
* If unknown, it is 0.
*/
num_chapters: number;
}
export interface Authors {
authors: Common.PersonRoleEdge[];
}
}
export module MangaForDetails {
export interface Pictures {
pictures: Array<Common.Picture>;
}
export interface Background {
background: string | null;
}
export interface RelatedAnime<T> {
related_anime: Array<Common.RelatedEdge<T>>;
}
export interface RelatedManga<T> {
related_manga: Array<Common.RelatedEdge<T>>;
}
export interface Recommendations<T> {
recommendations: Array<Common.RecommendationEdge<T>>;
}
export interface Serialization {
serialization: Array<MangaMagazineRelationEdge>;
}
}
export interface MangaMagazineRelationEdge {
node: {
id: number;
name: string;
};
role: string;
}
export interface MangaListStatusBase {
status:
| "reading"
| "completed"
| "on_hold"
| "dropped"
| "plan_to_read"
| null;
/**
* 0-10
*/
score: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10;
/**
* 0 or the number of read volumes.
*/
num_volumes_read: number;
/**
* 0 or the number of read chapters.
*/
num_chapters_read: number;
/**
* If authorized user reads an manga again after completion, this field value is true.
*
* In this case, MyAnimeList treats the manga as 'reading' in the user's manga list.
*/
is_rereading: boolean;
updated_at: string;
}
export module MangaListStatus {
export interface StartDate {
start_date: string | null;
}
export interface FinishDate {
finish_date: string | null;
}
export interface Priority {
priority: number;
}
export interface NumTimesReread {
num_times_reread: number;
}
export interface RereadValue {
reread_value: number;
}
export interface Tags {
tags: string[];
}
export interface Comments {
/**
* You cannot contain this field in a list.
*/
comments: string;
}
}
export interface UpdateMangaParams {
status?: "reading" | "completed" | "on_hold" | "dropped" | "plan_to_read";
is_rereading?: boolean;
/**
* 0-10
*/
score?: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | number;
num_volumes_read?: number;
num_chapters_read?: number;
priority?: 0 | 1 | 2 | number;
num_times_reread?: number;
rewatch_value?: 0 | 1 | 2 | 3 | 4 | 5 | number;
tags?: string;
comments?: string;
}