2021-03-26 04:17:02 +04:30
|
|
|
/*
|
|
|
|
|
* Copyright (C) Contributors to the Suwayomi project
|
|
|
|
|
*
|
|
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
2021-01-26 23:32:12 +03:30
|
|
|
* 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/. */
|
|
|
|
|
|
2020-12-24 16:50:50 +01:00
|
|
|
interface IExtension {
|
|
|
|
|
name: string
|
2021-03-29 00:35:21 +04:30
|
|
|
pkgName: string
|
2020-12-24 16:50:50 +01:00
|
|
|
versionName: string
|
2021-03-29 00:35:21 +04:30
|
|
|
versionCode: number
|
|
|
|
|
lang: string
|
|
|
|
|
isNsfw: boolean
|
2020-12-25 03:08:08 +03:30
|
|
|
apkName: string
|
2021-03-29 00:35:21 +04:30
|
|
|
iconUrl: string
|
2021-03-29 02:47:51 +04:30
|
|
|
installed: boolean
|
2021-03-29 00:35:21 +04:30
|
|
|
hasUpdate: boolean
|
2021-03-29 02:47:51 +04:30
|
|
|
obsolete: boolean
|
2020-12-24 16:50:50 +01:00
|
|
|
}
|
2020-12-25 06:36:34 +03:30
|
|
|
|
|
|
|
|
interface ISource {
|
2020-12-25 22:14:54 +03:30
|
|
|
id: string
|
2020-12-25 06:36:34 +03:30
|
|
|
name: string
|
|
|
|
|
lang: string
|
|
|
|
|
iconUrl: string
|
|
|
|
|
supportsLatest: boolean
|
2021-07-31 05:06:46 +04:30
|
|
|
isConfigurable: boolean
|
2021-09-03 04:47:02 +04:30
|
|
|
isNsfw: boolean
|
2021-09-18 00:03:42 +04:30
|
|
|
displayName: string
|
2020-12-25 06:36:34 +03:30
|
|
|
}
|
2020-12-25 17:42:22 +01:00
|
|
|
|
2021-03-17 19:17:03 +03:30
|
|
|
interface IMangaCard {
|
|
|
|
|
id: number
|
|
|
|
|
title: string
|
|
|
|
|
thumbnailUrl: string
|
|
|
|
|
}
|
|
|
|
|
|
2020-12-25 17:42:22 +01:00
|
|
|
interface IManga {
|
2021-01-19 20:20:28 +03:30
|
|
|
id: number
|
2021-03-17 19:17:03 +03:30
|
|
|
sourceId: string
|
|
|
|
|
|
|
|
|
|
url: string
|
2020-12-25 22:14:54 +03:30
|
|
|
title: string
|
|
|
|
|
thumbnailUrl: string
|
2021-03-17 19:17:03 +03:30
|
|
|
|
2021-09-05 01:11:25 +04:30
|
|
|
artist: string
|
|
|
|
|
author: string
|
|
|
|
|
description: string
|
|
|
|
|
genre: string[]
|
|
|
|
|
status: string
|
|
|
|
|
|
|
|
|
|
inLibrary: boolean
|
|
|
|
|
source: ISource
|
|
|
|
|
|
|
|
|
|
realUrl: string
|
|
|
|
|
|
|
|
|
|
freshData: boolean
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
interface IAnime {
|
|
|
|
|
id: number
|
|
|
|
|
sourceId: string
|
|
|
|
|
|
|
|
|
|
url: string
|
|
|
|
|
title: string
|
|
|
|
|
thumbnailUrl: string
|
|
|
|
|
|
2021-03-17 19:17:03 +03:30
|
|
|
artist: string
|
|
|
|
|
author: string
|
|
|
|
|
description: string
|
2021-08-21 06:19:56 +04:30
|
|
|
genre: string | null
|
2021-03-17 19:17:03 +03:30
|
|
|
status: string
|
|
|
|
|
|
|
|
|
|
inLibrary: boolean
|
|
|
|
|
source: ISource
|
2021-05-15 13:43:26 +04:30
|
|
|
|
2021-08-26 22:20:35 +04:30
|
|
|
realUrl: string
|
|
|
|
|
|
2021-05-15 13:43:26 +04:30
|
|
|
freshData: boolean
|
2020-12-25 17:42:22 +01:00
|
|
|
}
|
2021-01-19 21:02:57 +03:30
|
|
|
|
|
|
|
|
interface IChapter {
|
|
|
|
|
url: string
|
|
|
|
|
name: string
|
2021-05-11 18:45:53 +04:30
|
|
|
uploadDate: number
|
|
|
|
|
chapterNumber: number
|
2021-08-10 09:40:43 +04:30
|
|
|
scanlator: string
|
2021-01-20 00:04:12 +03:30
|
|
|
mangaId: number
|
2021-05-11 18:45:53 +04:30
|
|
|
read: boolean
|
|
|
|
|
bookmarked: boolean
|
|
|
|
|
lastPageRead: number
|
2021-05-14 17:31:07 +04:30
|
|
|
index: number
|
2021-03-23 03:50:55 +04:30
|
|
|
chapterCount: number
|
2021-02-04 03:42:30 +03:30
|
|
|
pageCount: number
|
2021-05-30 04:01:49 +04:30
|
|
|
downloaded: boolean
|
2021-01-19 21:02:57 +03:30
|
|
|
}
|
2021-02-20 01:23:52 +03:30
|
|
|
|
2021-08-10 09:40:43 +04:30
|
|
|
interface Video{
|
|
|
|
|
url: string
|
|
|
|
|
quality: string
|
|
|
|
|
videoUrl: string
|
|
|
|
|
}
|
|
|
|
|
|
2021-05-27 17:13:22 +04:30
|
|
|
interface IEpisode {
|
|
|
|
|
url: string
|
|
|
|
|
name: string
|
|
|
|
|
uploadDate: number
|
|
|
|
|
episodeNumber: number
|
2021-08-10 09:40:43 +04:30
|
|
|
scanlator: string
|
2021-05-27 17:13:22 +04:30
|
|
|
animeId: number
|
|
|
|
|
read: boolean
|
|
|
|
|
bookmarked: boolean
|
|
|
|
|
lastPageRead: number
|
|
|
|
|
index: number
|
|
|
|
|
episodeCount: number
|
2021-08-10 09:40:43 +04:30
|
|
|
videos: Video[]
|
2021-05-27 17:13:22 +04:30
|
|
|
}
|
|
|
|
|
|
2021-03-23 03:50:55 +04:30
|
|
|
interface IPartialChpter {
|
|
|
|
|
pageCount: number
|
2021-05-14 17:31:07 +04:30
|
|
|
index: number
|
2021-03-23 03:50:55 +04:30
|
|
|
chapterCount: number
|
|
|
|
|
}
|
|
|
|
|
|
2021-05-27 18:37:45 +04:30
|
|
|
interface IPartialEpisode {
|
|
|
|
|
index: number
|
|
|
|
|
episodeCount: number
|
2021-08-10 09:40:43 +04:30
|
|
|
videos: Video[]
|
2021-05-27 18:37:45 +04:30
|
|
|
}
|
|
|
|
|
|
2021-02-20 01:23:52 +03:30
|
|
|
interface ICategory {
|
|
|
|
|
id: number
|
|
|
|
|
order: number
|
2021-05-30 04:01:49 +04:30
|
|
|
name: string
|
2021-05-23 15:28:46 +04:30
|
|
|
default: boolean
|
2021-02-20 01:23:52 +03:30
|
|
|
}
|
2021-03-18 21:46:24 +03:30
|
|
|
|
|
|
|
|
interface INavbarOverride {
|
|
|
|
|
status: boolean
|
|
|
|
|
value: any
|
2021-03-29 02:47:51 +04:30
|
|
|
}
|
2021-05-15 17:18:57 +04:30
|
|
|
|
2021-05-15 23:22:37 +04:30
|
|
|
type ReaderType =
|
2021-09-13 19:18:21 +04:30
|
|
|
'ContinuesVertical' |
|
2021-05-15 23:22:37 +04:30
|
|
|
'Webtoon' |
|
|
|
|
|
'SingleVertical' |
|
|
|
|
|
'SingleRTL' |
|
|
|
|
|
'SingleLTR' |
|
2021-05-28 05:36:55 -07:00
|
|
|
'DoubleVertical' |
|
|
|
|
|
'DoubleRTL' |
|
|
|
|
|
'DoubleLTR' |
|
2021-09-13 19:18:21 +04:30
|
|
|
'ContinuesHorizontalLTR' |
|
2021-05-29 08:11:59 -07:00
|
|
|
'ContinuesHorizontalRTL';
|
2021-05-15 23:22:37 +04:30
|
|
|
|
2021-05-15 17:18:57 +04:30
|
|
|
interface IReaderSettings{
|
|
|
|
|
staticNav: boolean
|
|
|
|
|
showPageNumber: boolean
|
2021-05-17 09:57:14 +02:00
|
|
|
loadNextonEnding: boolean
|
2021-05-15 23:22:37 +04:30
|
|
|
readerType: ReaderType
|
2021-05-15 17:18:57 +04:30
|
|
|
}
|
|
|
|
|
|
|
|
|
|
interface IReaderPage {
|
|
|
|
|
index: number
|
|
|
|
|
src: string
|
|
|
|
|
}
|
2021-05-15 23:22:37 +04:30
|
|
|
|
|
|
|
|
interface IReaderProps {
|
|
|
|
|
pages: Array<IReaderPage>
|
|
|
|
|
pageCount: number
|
|
|
|
|
setCurPage: React.Dispatch<React.SetStateAction<number>>
|
|
|
|
|
curPage: number
|
|
|
|
|
settings: IReaderSettings
|
2021-05-17 09:57:14 +02:00
|
|
|
manga: IMangaCard | IManga
|
|
|
|
|
chapter: IChapter | IPartialChpter
|
2021-05-18 01:10:28 +04:30
|
|
|
nextChapter: () => void
|
2021-05-25 13:14:07 +04:30
|
|
|
prevChapter: () => void
|
2021-05-15 23:22:37 +04:30
|
|
|
}
|
2021-05-25 21:06:27 +04:30
|
|
|
|
|
|
|
|
interface IAbout {
|
|
|
|
|
name: string
|
|
|
|
|
version: string
|
|
|
|
|
revision: string
|
|
|
|
|
buildType: 'Stable' | 'Preview'
|
|
|
|
|
buildTime: number
|
|
|
|
|
github: string
|
|
|
|
|
discord: string
|
|
|
|
|
}
|
2021-05-30 04:01:49 +04:30
|
|
|
|
|
|
|
|
interface IDownloadChapter{
|
|
|
|
|
chapterIndex: number
|
|
|
|
|
mangaId: number
|
|
|
|
|
state: 'Queued' | 'Downloading' | 'Finished' | 'Error'
|
|
|
|
|
progress: number
|
|
|
|
|
chapter: IChapter
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
interface IQueue {
|
|
|
|
|
status: 'Stopped' | 'Started'
|
|
|
|
|
queue: IDownloadChapter[]
|
|
|
|
|
}
|
2021-08-06 04:53:53 +04:30
|
|
|
|
|
|
|
|
interface PreferenceProps {
|
|
|
|
|
key: string
|
|
|
|
|
title: string
|
|
|
|
|
summary: string
|
|
|
|
|
defaultValue: any
|
|
|
|
|
currentValue: any
|
|
|
|
|
defaultValueType: string
|
2021-09-13 19:18:21 +04:30
|
|
|
|
|
|
|
|
// intetnal props
|
|
|
|
|
updateValue: any
|
2021-08-06 04:53:53 +04:30
|
|
|
}
|
|
|
|
|
|
2021-09-13 19:18:21 +04:30
|
|
|
interface TwoStatePreferenceProps extends PreferenceProps {
|
2021-08-06 04:53:53 +04:30
|
|
|
|
2021-09-13 19:18:21 +04:30
|
|
|
// 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
|
2021-08-06 04:53:53 +04:30
|
|
|
}
|