forked from Suwayomi/Suwayomi-WebUI
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtypings.d.ts
200 lines (173 loc) · 3.75 KB
/
typings.d.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
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
/*
* Copyright (C) Contributors to the Suwayomi project
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
interface IExtension {
name: string
pkgName: string
versionName: string
versionCode: number
lang: string
isNsfw: boolean
apkName: string
iconUrl: string
installed: boolean
hasUpdate: boolean
obsolete: boolean
}
interface ISource {
id: string
name: string
lang: string
iconUrl: string
supportsLatest: boolean
isConfigurable: boolean
isNsfw: boolean
displayName: string
}
interface IMangaCard {
id: number
title: string
thumbnailUrl: string
unreadCount?: number
}
interface IManga {
id: number
sourceId: string
url: string
title: string
thumbnailUrl: string
artist: string
author: string
description: string
genre: string[]
status: string
inLibrary: boolean
source: ISource
realUrl: string
freshData: boolean
unreadCount?: number
}
interface IChapter {
url: string
name: string
uploadDate: number
chapterNumber: number
scanlator: string
mangaId: number
read: boolean
bookmarked: boolean
lastPageRead: number
index: number
fetchedAt: number
chapterCount: number
pageCount: number
downloaded: boolean
}
interface IMangaChapter {
manga: IManga
chapter: IChapter
}
interface IPartialChpter {
pageCount: number
index: number
chapterCount: number
}
interface ICategory {
id: number
order: number
name: string
default: boolean
}
interface INavbarOverride {
status: boolean
value: any
}
type ReaderType =
'ContinuesVertical' |
'Webtoon' |
'SingleVertical' |
'SingleRTL' |
'SingleLTR' |
'DoubleVertical' |
'DoubleRTL' |
'DoubleLTR' |
'ContinuesHorizontalLTR' |
'ContinuesHorizontalRTL';
interface IReaderSettings{
staticNav: boolean
showPageNumber: boolean
loadNextonEnding: boolean
readerType: ReaderType
}
interface IReaderPage {
index: number
src: string
}
interface IReaderProps {
pages: Array<IReaderPage>
pageCount: number
setCurPage: React.Dispatch<React.SetStateAction<number>>
curPage: number
settings: IReaderSettings
manga: IMangaCard | IManga
chapter: IChapter | IPartialChpter
nextChapter: () => void
prevChapter: () => void
}
interface IAbout {
name: string
version: string
revision: string
buildType: 'Stable' | 'Preview'
buildTime: number
github: string
discord: string
}
interface IDownloadChapter{
chapterIndex: number
mangaId: number
state: 'Queued' | 'Downloading' | 'Finished' | 'Error'
progress: number
chapter: IChapter
}
interface IQueue {
status: 'Stopped' | 'Started'
queue: IDownloadChapter[]
}
interface PreferenceProps {
key: string
title: string
summary: string
defaultValue: any
currentValue: any
defaultValueType: string
// intetnal props
updateValue: any
}
interface TwoStatePreferenceProps extends PreferenceProps {
// intetnal props
type: 'Switch' | 'Checkbox'
}
interface CheckBoxPreferenceProps extends PreferenceProps {}
interface SwitchPreferenceCompatProps extends PreferenceProps {}
interface ListPreferenceProps extends PreferenceProps {
entries: string[]
entryValues: string[]
}
interface EditTextPreferenceProps extends PreferenceProps {
dialogTitle: string
dialogMessage: string
text: string
}
interface SourcePreferences {
type: string
props: any
}
interface NavbarItem{
path: string,
title:string,
IconComponent: OverridableComponent<SvgIconTypeMap<{}, 'svg'>>,
}