remove manually created typing d ts file (#249)
* Rename file ".d.ts" files are files that are automatically generated during compilation (in case option is set) and shouldn't be created manually. * Export types and interfaces * Add missing imports
This commit is contained in:
@@ -14,6 +14,7 @@ import Typography from '@mui/material/Typography';
|
||||
import client from 'util/client';
|
||||
import useLocalStorage from 'util/useLocalStorage';
|
||||
import { Box } from '@mui/system';
|
||||
import { IExtension } from 'typings';
|
||||
|
||||
interface IProps {
|
||||
extension: IExtension;
|
||||
|
||||
@@ -16,6 +16,7 @@ import SpinnerImage from 'components/util/SpinnerImage';
|
||||
import { Box, styled } from '@mui/system';
|
||||
import { GridLayout, useLibraryOptionsContext } from 'components/context/LibraryOptionsContext';
|
||||
import { BACK } from 'util/useBackTo';
|
||||
import { IMangaCard } from 'typings';
|
||||
|
||||
const BottomGradient = styled('div')({
|
||||
position: 'absolute',
|
||||
|
||||
@@ -13,6 +13,7 @@ import { Typography } from '@mui/material';
|
||||
import { Box } from '@mui/system';
|
||||
import MangaCard from 'components/MangaCard';
|
||||
import { GridLayout } from 'components/context/LibraryOptionsContext';
|
||||
import { IMangaCard } from 'typings';
|
||||
|
||||
export interface IMangaGridProps {
|
||||
mangas: IMangaCard[];
|
||||
|
||||
@@ -16,6 +16,7 @@ import React from 'react';
|
||||
import { Link, useHistory } from 'react-router-dom';
|
||||
import { langCodeToName } from 'util/language';
|
||||
import useLocalStorage from 'util/useLocalStorage';
|
||||
import { ISource } from 'typings';
|
||||
|
||||
const MobileWidthButtons = styled('div')(({ theme }) => ({
|
||||
display: 'flex',
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
||||
|
||||
import React, { useContext } from 'react';
|
||||
import { LibraryOptions } from 'typings';
|
||||
|
||||
type ContextType = {
|
||||
options: LibraryOptions;
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
||||
|
||||
import React, { useContext, useEffect } from 'react';
|
||||
import { INavbarOverride } from 'typings';
|
||||
|
||||
type ContextType = {
|
||||
// Default back button url
|
||||
|
||||
@@ -11,6 +11,7 @@ import MangaGrid from 'components/MangaGrid';
|
||||
import { useLibraryOptionsContext } from 'components/context/LibraryOptionsContext';
|
||||
import { StringParam, useQueryParam } from 'use-query-params';
|
||||
import { useMediaQuery, useTheme } from '@mui/material';
|
||||
import { IMangaCard, LibrarySortMode, NullAndUndefined } from 'typings';
|
||||
|
||||
const FILTERED_OUT_MESSAGE = 'There are no Manga matching this filter';
|
||||
|
||||
|
||||
@@ -13,6 +13,7 @@ import ThreeStateCheckboxInput from 'components/atoms/ThreeStateCheckboxInput';
|
||||
import { GridLayout, useLibraryOptionsContext } from 'components/context/LibraryOptionsContext';
|
||||
import OptionsTabs from 'components/molecules/OptionsTabs';
|
||||
import React from 'react';
|
||||
import { LibraryOptions, LibrarySortMode } from 'typings';
|
||||
|
||||
const TITLES = {
|
||||
filter: 'Filter',
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
import LibraryOptionsContext, { DefaultLibraryOptions } from 'components/context/LibraryOptionsContext';
|
||||
import React from 'react';
|
||||
import useLocalStorage from 'util/useLocalStorage';
|
||||
import { LibraryOptions } from 'typings';
|
||||
|
||||
interface IProps {
|
||||
children: React.ReactNode;
|
||||
|
||||
@@ -6,6 +6,7 @@ import { Box } from '@mui/system';
|
||||
import Typography from '@mui/material/Typography';
|
||||
import client from 'util/client';
|
||||
import makeToast from 'components/util/Toast';
|
||||
import { IUpdateStatus } from 'typings';
|
||||
|
||||
interface IProgressProps {
|
||||
progress: number;
|
||||
|
||||
@@ -29,6 +29,7 @@ import { Link } from 'react-router-dom';
|
||||
import client from 'util/client';
|
||||
import { BACK } from 'util/useBackTo';
|
||||
import { getUploadDateString } from 'util/date';
|
||||
import { IChapter, IDownloadChapter } from 'typings';
|
||||
|
||||
interface IProps {
|
||||
chapter: IChapter;
|
||||
|
||||
@@ -20,6 +20,7 @@ import { Virtuoso } from 'react-virtuoso';
|
||||
import client, { useQuery } from 'util/client';
|
||||
import ChaptersToolbarMenu from 'components/manga/ChaptersToolbarMenu';
|
||||
import SelectionFAB from 'components/manga/SelectionFAB';
|
||||
import { BatchChaptersChange, IChapter, IDownloadChapter, IQueue } from 'typings';
|
||||
|
||||
const StyledVirtuoso = styled(Virtuoso)(({ theme }) => ({
|
||||
listStyle: 'none',
|
||||
|
||||
@@ -12,6 +12,7 @@ import ThreeStateCheckboxInput from 'components/atoms/ThreeStateCheckboxInput';
|
||||
import OptionsTabs from 'components/molecules/OptionsTabs';
|
||||
import React from 'react';
|
||||
import { SORT_OPTIONS } from 'components/manga/util';
|
||||
import { ChapterListOptions, ChapterOptionsReducerAction } from 'typings';
|
||||
|
||||
interface IProps {
|
||||
open: boolean;
|
||||
|
||||
@@ -10,6 +10,7 @@ import { IconButton } from '@mui/material';
|
||||
import * as React from 'react';
|
||||
import ChapterOptions from 'components/manga/ChapterOptions';
|
||||
import { isFilterActive } from 'components/manga/util';
|
||||
import { ChapterListOptions, ChapterOptionsReducerAction } from 'typings';
|
||||
|
||||
interface IProps {
|
||||
options: ChapterListOptions;
|
||||
|
||||
@@ -16,6 +16,7 @@ import React from 'react';
|
||||
import { mutate } from 'swr';
|
||||
import client from 'util/client';
|
||||
import useLocalStorage from 'util/useLocalStorage';
|
||||
import { IManga, ISource } from 'typings';
|
||||
|
||||
const useStyles = (inLibrary: boolean) =>
|
||||
makeStyles((theme: Theme) => ({
|
||||
|
||||
@@ -20,6 +20,7 @@ import {
|
||||
} from '@mui/material';
|
||||
import CategorySelect from 'components/navbar/action/CategorySelect';
|
||||
import React, { useState } from 'react';
|
||||
import { IManga } from 'typings';
|
||||
|
||||
interface IProps {
|
||||
manga: IManga;
|
||||
|
||||
@@ -10,6 +10,7 @@ import { Fab } from '@mui/material';
|
||||
import { Link } from 'react-router-dom';
|
||||
import { PlayArrow } from '@mui/icons-material';
|
||||
import { BACK } from 'util/useBackTo';
|
||||
import { IChapter } from 'typings';
|
||||
|
||||
interface ResumeFABProps {
|
||||
chapter: IChapter;
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
||||
|
||||
import { useReducerLocalStorage } from 'util/useLocalStorage';
|
||||
import { ChapterListOptions, ChapterOptionsReducerAction, ChapterSortMode, IChapter, NullAndUndefined } from 'typings';
|
||||
|
||||
const defaultChapterOptions: ChapterListOptions = {
|
||||
active: false,
|
||||
|
||||
@@ -10,6 +10,7 @@ import { CircularProgress } from '@mui/material';
|
||||
import Typography from '@mui/material/Typography';
|
||||
import { Box } from '@mui/system';
|
||||
import React from 'react';
|
||||
import { IDownloadChapter } from 'typings';
|
||||
|
||||
interface DownloadStateIndicatorProps {
|
||||
download: IDownloadChapter;
|
||||
|
||||
@@ -33,6 +33,7 @@ import DesktopSideBar from 'components/navbar/navigation/DesktopSideBar';
|
||||
import MobileBottomBar from 'components/navbar/navigation/MobileBottomBar';
|
||||
// import { useTranslation } from 'react-i18next';
|
||||
import { t } from 'i18next';
|
||||
import { NavbarItem } from 'typings';
|
||||
|
||||
const navbarItems: Array<NavbarItem> = [
|
||||
{
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
|
||||
import React, { useState } from 'react';
|
||||
import NavBarContext from 'components/context/NavbarContext';
|
||||
import { INavbarOverride } from 'typings';
|
||||
|
||||
interface IProps {
|
||||
children: React.ReactNode;
|
||||
|
||||
@@ -25,6 +25,7 @@ import Collapse from '@mui/material/Collapse';
|
||||
import { styled } from '@mui/system';
|
||||
import useBackTo from 'util/useBackTo';
|
||||
import ReaderSettingsOptions from 'components/reader/ReaderSettingsOptions';
|
||||
import { IChapter, IManga, IMangaCard, IReaderSettings } from 'typings';
|
||||
|
||||
const Root = styled('div')(({ theme }) => ({
|
||||
top: 0,
|
||||
|
||||
@@ -15,6 +15,7 @@ import Checkbox from '@mui/material/Checkbox';
|
||||
import FormControlLabel from '@mui/material/FormControlLabel';
|
||||
import FormGroup from '@mui/material/FormGroup';
|
||||
import client, { useQuery } from 'util/client';
|
||||
import { ICategory } from 'typings';
|
||||
|
||||
interface IProps {
|
||||
open: boolean;
|
||||
|
||||
@@ -10,6 +10,7 @@ import { ListItem, ListItemIcon, Tooltip } from '@mui/material';
|
||||
import { Link, useLocation } from 'react-router-dom';
|
||||
import { styled } from '@mui/system';
|
||||
import { useTheme } from '@mui/material/styles';
|
||||
import { NavbarItem } from 'typings';
|
||||
|
||||
const SideNavBarContainer = styled('div')(({ theme }) => ({
|
||||
height: '100vh',
|
||||
|
||||
@@ -10,6 +10,7 @@ import { ListItem } from '@mui/material';
|
||||
import { styled, Box } from '@mui/system';
|
||||
import { Link as RRDLink, useLocation } from 'react-router-dom';
|
||||
import { useTheme } from '@mui/material/styles';
|
||||
import { NavbarItem } from 'typings';
|
||||
|
||||
const BottomNavContainer = styled('div')(({ theme }) => ({
|
||||
bottom: 0,
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
|
||||
import React from 'react';
|
||||
import { Box, styled } from '@mui/system';
|
||||
import { IReaderSettings } from 'typings';
|
||||
|
||||
const Image = styled('img')({
|
||||
marginBottom: 0,
|
||||
|
||||
@@ -9,6 +9,7 @@ import React, { useRef } from 'react';
|
||||
import SpinnerImage from 'components/util/SpinnerImage';
|
||||
import useLocalStorage from 'util/useLocalStorage';
|
||||
import Box from '@mui/system/Box';
|
||||
import { IReaderSettings } from 'typings';
|
||||
|
||||
function imageStyle(settings: IReaderSettings): any {
|
||||
const [dimensions, setDimensions] = React.useState({
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
|
||||
import React from 'react';
|
||||
import { Box } from '@mui/system';
|
||||
import { IReaderSettings } from 'typings';
|
||||
|
||||
interface IProps {
|
||||
settings: IReaderSettings;
|
||||
|
||||
@@ -11,6 +11,7 @@ import ListItemSecondaryAction from '@mui/material/ListItemSecondaryAction';
|
||||
import Select from '@mui/material/Select';
|
||||
import MenuItem from '@mui/material/MenuItem';
|
||||
import React from 'react';
|
||||
import { IReaderSettings } from 'typings';
|
||||
|
||||
interface IProps extends IReaderSettings {
|
||||
setSettingValue: (key: keyof IReaderSettings, value: string | boolean) => void;
|
||||
|
||||
@@ -10,6 +10,7 @@ import ReactDOM from 'react-dom';
|
||||
import { Box } from '@mui/system';
|
||||
import Page from 'components/reader/Page';
|
||||
import DoublePage from 'components/reader/DoublePage';
|
||||
import { IReaderProps } from 'typings';
|
||||
|
||||
const isSpreadPage = (image: HTMLImageElement): boolean => {
|
||||
const aspectRatio = image.height / image.width;
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
import React, { useEffect, useRef } from 'react';
|
||||
import { Box } from '@mui/system';
|
||||
import Page from 'components/reader/Page';
|
||||
import { IReaderProps } from 'typings';
|
||||
|
||||
const findCurrentPageIndex = (wrapper: HTMLDivElement): number => {
|
||||
for (let i = 0; i < wrapper.children.length; i++) {
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
import React, { useEffect, useRef } from 'react';
|
||||
import { Box } from '@mui/system';
|
||||
import Page from 'components/reader/Page';
|
||||
import { IReaderProps } from 'typings';
|
||||
|
||||
export default function PagedReader(props: IReaderProps) {
|
||||
const { pages, settings, setCurPage, initialPage, curPage, nextChapter, prevChapter } = props;
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
import React, { useCallback, useEffect, useRef } from 'react';
|
||||
import { Box } from '@mui/system';
|
||||
import Page from 'components/reader/Page';
|
||||
import { IReaderProps } from 'typings';
|
||||
|
||||
const findCurrentPageIndex = (wrapper: HTMLDivElement): number => {
|
||||
for (let i = 0; i < wrapper.children.length; i++) {
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
|
||||
import React from 'react';
|
||||
import MangaGrid, { IMangaGridProps } from 'components/MangaGrid';
|
||||
import { IMangaCard } from 'typings';
|
||||
|
||||
const FILTERED_OUT_MESSAGE = 'There are no Manga matching this filter';
|
||||
|
||||
|
||||
@@ -21,6 +21,7 @@ import TriStateFilter from 'components/source/filters/TriStateFilter';
|
||||
// eslint-disable-next-line import/no-cycle
|
||||
import GroupFilter from 'components/source/filters/GroupFilter';
|
||||
import SeperatorFilter from 'components/source/filters/SeparatorFilter';
|
||||
import { ISourceFilters, IState } from 'typings';
|
||||
|
||||
interface IFilters {
|
||||
sourceFilter: ISourceFilters[];
|
||||
|
||||
@@ -11,6 +11,7 @@ import { Box } from '@mui/system';
|
||||
import React from 'react';
|
||||
// eslint-disable-next-line import/no-cycle
|
||||
import { Options } from 'components/source/SourceOptions';
|
||||
import { ISourceFilters } from 'typings';
|
||||
|
||||
interface Props {
|
||||
state: ISourceFilters[];
|
||||
|
||||
@@ -10,6 +10,7 @@ import { Collapse, ListItemButton, ListItemText, Stack } from '@mui/material';
|
||||
import { Box } from '@mui/system';
|
||||
import SortRadioInput from 'components/atoms/SortRadioInput';
|
||||
import React from 'react';
|
||||
import { IState } from 'typings';
|
||||
|
||||
interface Props {
|
||||
values: any;
|
||||
|
||||
@@ -15,6 +15,7 @@ import DialogContentText from '@mui/material/DialogContentText';
|
||||
import DialogActions from '@mui/material/DialogActions';
|
||||
import TextField from '@mui/material/TextField';
|
||||
import Button from '@mui/material/Button';
|
||||
import { EditTextPreferenceProps } from 'typings';
|
||||
|
||||
export default function EditTextPreference(props: EditTextPreferenceProps) {
|
||||
const { title, summary, dialogTitle, dialogMessage, currentValue, updateValue } = props;
|
||||
|
||||
@@ -16,6 +16,7 @@ import RadioGroup from '@mui/material/RadioGroup';
|
||||
import Radio from '@mui/material/Radio';
|
||||
import FormControlLabel from '@mui/material/FormControlLabel';
|
||||
import Button from '@mui/material/Button';
|
||||
import { ListPreferenceProps } from 'typings';
|
||||
|
||||
interface IListDialogProps {
|
||||
value: string;
|
||||
|
||||
@@ -17,6 +17,7 @@ import Checkbox from '@mui/material/Checkbox';
|
||||
import FormControlLabel from '@mui/material/FormControlLabel';
|
||||
import Button from '@mui/material/Button';
|
||||
import cloneObject from 'util/cloneObject';
|
||||
import { MultiSelectListPreferenceProps } from 'typings';
|
||||
|
||||
interface IListDialogProps {
|
||||
selectedValues: string[];
|
||||
|
||||
@@ -11,6 +11,7 @@ import ListItemText from '@mui/material/ListItemText';
|
||||
import ListItemSecondaryAction from '@mui/material/ListItemSecondaryAction';
|
||||
import Switch from '@mui/material/Switch';
|
||||
import Checkbox from '@mui/material/Checkbox';
|
||||
import { CheckBoxPreferenceProps, SwitchPreferenceCompatProps, TwoStatePreferenceProps } from 'typings';
|
||||
|
||||
function getTwoStateType(type: 'Checkbox' | 'Switch') {
|
||||
if (type === 'Switch') {
|
||||
|
||||
@@ -27,6 +27,7 @@ import { NavbarToolbar } from 'components/navbar/DefaultNavBar';
|
||||
import { Link } from 'react-router-dom';
|
||||
import { BACK } from 'util/useBackTo';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { IChapter, IQueue } from 'typings';
|
||||
|
||||
const initialQueue = {
|
||||
status: 'Stopped',
|
||||
|
||||
@@ -21,6 +21,7 @@ import AppbarSearch from 'components/util/AppbarSearch';
|
||||
import { useQueryParam, StringParam } from 'use-query-params';
|
||||
import { Virtuoso } from 'react-virtuoso';
|
||||
import { Typography, useMediaQuery, useTheme } from '@mui/material';
|
||||
import { IExtension } from 'typings';
|
||||
|
||||
const LANGUAGE = 0;
|
||||
const EXTENSIONS = 1;
|
||||
|
||||
@@ -18,6 +18,7 @@ import { useQueryParam, NumberParam } from 'use-query-params';
|
||||
import { useQuery } from 'util/client';
|
||||
import UpdateChecker from 'components/library/UpdateChecker';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { ICategory, IManga } from 'typings';
|
||||
|
||||
export default function Library() {
|
||||
const { t } = useTranslation();
|
||||
|
||||
@@ -19,6 +19,7 @@ import LoadingPlaceholder from 'components/util/LoadingPlaceholder';
|
||||
import React, { useContext, useEffect, useRef } from 'react';
|
||||
import { useParams } from 'react-router-dom';
|
||||
import { useQuery } from 'util/client';
|
||||
import { IManga } from 'typings';
|
||||
|
||||
const AUTOFETCH_AGE = 60 * 60 * 24; // 24 hours
|
||||
|
||||
|
||||
@@ -25,6 +25,7 @@ import {
|
||||
useDefaultReaderSettings,
|
||||
} from 'util/readerSettings';
|
||||
import makeToast from 'components/util/Toast';
|
||||
import { IChapter, IManga, IMangaCard, IPartialChapter, IReaderSettings, ReaderType } from 'typings';
|
||||
|
||||
const getReaderComponent = (readerType: ReaderType) => {
|
||||
switch (readerType) {
|
||||
|
||||
@@ -18,6 +18,7 @@ import { StringParam, useQueryParam } from 'use-query-params';
|
||||
import client from 'util/client';
|
||||
import { langCodeToName, langSortCmp, sourceDefualtLangs, sourceForcedDefaultLangs } from 'util/language';
|
||||
import useLocalStorage from 'util/useLocalStorage';
|
||||
import { ISource } from 'typings';
|
||||
|
||||
function sourceToLangList(sources: ISource[]) {
|
||||
const result: string[] = [];
|
||||
|
||||
@@ -15,6 +15,7 @@ import EditTextPreference from 'components/sourceConfiguration/EditTextPreferenc
|
||||
import MultiSelectListPreference from 'components/sourceConfiguration/MultiSelectListPreference';
|
||||
import List from '@mui/material/List';
|
||||
import cloneObject from 'util/cloneObject';
|
||||
import { SourcePreferences } from 'typings';
|
||||
|
||||
function getPrefComponent(type: string) {
|
||||
switch (type) {
|
||||
|
||||
@@ -17,6 +17,7 @@ import AppbarSearch from 'components/util/AppbarSearch';
|
||||
import { useQueryParam, StringParam } from 'use-query-params';
|
||||
import SourceGridLayout from 'components/source/GridLayouts';
|
||||
import { useLibraryOptionsContext } from 'components/context/LibraryOptionsContext';
|
||||
import { IManga, IMangaCard, ISource, ISourceFilters } from 'typings';
|
||||
|
||||
interface IPos {
|
||||
position: number;
|
||||
|
||||
@@ -16,6 +16,7 @@ import { IconButton } from '@mui/material';
|
||||
import TravelExploreIcon from '@mui/icons-material/TravelExplore';
|
||||
import { useHistory } from 'react-router-dom';
|
||||
import { useQuery } from 'util/client';
|
||||
import { ISource } from 'typings';
|
||||
|
||||
function sourceToLangList(sources: ISource[]) {
|
||||
const result: string[] = [];
|
||||
|
||||
@@ -21,6 +21,7 @@ import React, { useContext, useEffect, useRef, useState } from 'react';
|
||||
import { Link, useHistory } from 'react-router-dom';
|
||||
import client from 'util/client';
|
||||
import useLocalStorage from 'util/useLocalStorage';
|
||||
import { IChapter, IMangaChapter, IQueue, PaginatedList } from 'typings';
|
||||
|
||||
function epochToDate(epoch: number) {
|
||||
const date = new Date(0); // The 0 there is the key, which sets the date to the epoch
|
||||
|
||||
@@ -6,6 +6,7 @@ import ListItemLink from 'components/util/ListItemLink';
|
||||
import NavbarContext from 'components/context/NavbarContext';
|
||||
import LoadingPlaceholder from 'components/util/LoadingPlaceholder';
|
||||
import { useQuery } from 'util/client';
|
||||
import { IAbout } from 'typings';
|
||||
|
||||
export default function About() {
|
||||
const { setTitle, setAction } = useContext(NavbarContext);
|
||||
|
||||
@@ -33,6 +33,7 @@ import Checkbox from '@mui/material/Checkbox';
|
||||
import FormControlLabel from '@mui/material/FormControlLabel';
|
||||
import NavbarContext from 'components/context/NavbarContext';
|
||||
import client, { useQuery } from 'util/client';
|
||||
import { ICategory } from 'typings';
|
||||
|
||||
const getItemStyle = (
|
||||
isDragging: boolean,
|
||||
|
||||
@@ -20,6 +20,7 @@ import {
|
||||
useDefaultReaderSettings,
|
||||
} from 'util/readerSettings';
|
||||
import ReaderSettingsOptions from 'components/reader/ReaderSettingsOptions';
|
||||
import { IReaderSettings } from 'typings';
|
||||
|
||||
export default function DefaultReaderSettings() {
|
||||
const { setTitle, setAction } = useContext(NavbarContext);
|
||||
|
||||
@@ -5,7 +5,10 @@
|
||||
* 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 {
|
||||
import { OverridableComponent } from '@mui/material/OverridableComponent';
|
||||
import { SvgIconTypeMap } from '@mui/material/SvgIcon/SvgIcon';
|
||||
|
||||
export interface IExtension {
|
||||
name: string;
|
||||
pkgName: string;
|
||||
versionName: string;
|
||||
@@ -19,7 +22,7 @@ interface IExtension {
|
||||
obsolete: boolean;
|
||||
}
|
||||
|
||||
interface ISource {
|
||||
export interface ISource {
|
||||
id: string;
|
||||
name: string;
|
||||
lang: string;
|
||||
@@ -30,12 +33,12 @@ interface ISource {
|
||||
displayName: string;
|
||||
}
|
||||
|
||||
interface ISourceFilters {
|
||||
export interface ISourceFilters {
|
||||
type: string;
|
||||
filter: ISourceFilter;
|
||||
}
|
||||
|
||||
interface ISourceFilter {
|
||||
export interface ISourceFilter {
|
||||
name: string;
|
||||
state: number | string | boolean | ISourceFilters[] | IState;
|
||||
values?: string[];
|
||||
@@ -43,18 +46,18 @@ interface ISourceFilter {
|
||||
selected?: ISelected;
|
||||
}
|
||||
|
||||
interface ISelected {
|
||||
export interface ISelected {
|
||||
displayname: string;
|
||||
value: string;
|
||||
_value: string;
|
||||
}
|
||||
|
||||
interface IState {
|
||||
export interface IState {
|
||||
ascending: boolean;
|
||||
index: number;
|
||||
}
|
||||
|
||||
interface IMetadataMigration {
|
||||
export interface IMetadataMigration {
|
||||
appKeyPrefix?: { oldPrefix: string; newPrefix: string };
|
||||
values?: {
|
||||
/**
|
||||
@@ -68,23 +71,23 @@ interface IMetadataMigration {
|
||||
keys?: { oldKey: string; newKey: string }[];
|
||||
}
|
||||
|
||||
interface IMetadata<VALUES extends AllowedMetadataValueTypes = string> {
|
||||
export interface IMetadata<VALUES extends AllowedMetadataValueTypes = string> {
|
||||
[key: string]: VALUES;
|
||||
}
|
||||
|
||||
interface IMetadataHolder<VALUES extends AllowedMetadataValueTypes = string> {
|
||||
export interface IMetadataHolder<VALUES extends AllowedMetadataValueTypes = string> {
|
||||
meta?: IMetadata<VALUES>;
|
||||
}
|
||||
|
||||
type AllowedMetadataValueTypes = string | boolean | number | undefined;
|
||||
export type AllowedMetadataValueTypes = string | boolean | number | undefined;
|
||||
|
||||
type MangaMetadataKeys = keyof IReaderSettings;
|
||||
export type MangaMetadataKeys = keyof IReaderSettings;
|
||||
|
||||
type AppMetadataKeys = MangaMetadataKeys;
|
||||
export type AppMetadataKeys = MangaMetadataKeys;
|
||||
|
||||
type MetadataKeyValuePair = [AppMetadataKeys, AllowedMetadataValueTypes];
|
||||
export type MetadataKeyValuePair = [AppMetadataKeys, AllowedMetadataValueTypes];
|
||||
|
||||
interface IMangaCard {
|
||||
export interface IMangaCard {
|
||||
id: number;
|
||||
title: string;
|
||||
genre: string[];
|
||||
@@ -95,7 +98,7 @@ interface IMangaCard {
|
||||
meta?: IMetadata;
|
||||
}
|
||||
|
||||
interface IManga {
|
||||
export interface IManga {
|
||||
id: number;
|
||||
sourceId: string;
|
||||
|
||||
@@ -123,7 +126,7 @@ interface IManga {
|
||||
chaptersAge: number;
|
||||
}
|
||||
|
||||
interface IChapter {
|
||||
export interface IChapter {
|
||||
id: number;
|
||||
url: string;
|
||||
name: string;
|
||||
@@ -140,35 +143,35 @@ interface IChapter {
|
||||
chapterCount: number;
|
||||
pageCount: number;
|
||||
downloaded: boolean;
|
||||
meta: IAppMetadata;
|
||||
meta: IMetadata;
|
||||
}
|
||||
|
||||
interface IMangaChapter {
|
||||
export interface IMangaChapter {
|
||||
manga: IManga;
|
||||
chapter: IChapter;
|
||||
}
|
||||
|
||||
interface IPartialChapter {
|
||||
export interface IPartialChapter {
|
||||
pageCount: number;
|
||||
index: number;
|
||||
chapterCount: number;
|
||||
lastPageRead: number;
|
||||
}
|
||||
|
||||
interface ICategory {
|
||||
export interface ICategory {
|
||||
id: number;
|
||||
order: number;
|
||||
name: string;
|
||||
default: boolean;
|
||||
meta: IAppMetadata;
|
||||
meta: IMetadata;
|
||||
}
|
||||
|
||||
interface INavbarOverride {
|
||||
export interface INavbarOverride {
|
||||
status: boolean;
|
||||
value: any;
|
||||
}
|
||||
|
||||
type ReaderType =
|
||||
export type ReaderType =
|
||||
| 'ContinuesVertical'
|
||||
| 'Webtoon'
|
||||
| 'SingleVertical'
|
||||
@@ -180,19 +183,19 @@ type ReaderType =
|
||||
| 'ContinuesHorizontalLTR'
|
||||
| 'ContinuesHorizontalRTL';
|
||||
|
||||
interface IReaderSettings {
|
||||
export interface IReaderSettings {
|
||||
staticNav: boolean;
|
||||
showPageNumber: boolean;
|
||||
loadNextOnEnding: boolean;
|
||||
readerType: ReaderType;
|
||||
}
|
||||
|
||||
interface IReaderPage {
|
||||
export interface IReaderPage {
|
||||
index: number;
|
||||
src: string;
|
||||
}
|
||||
|
||||
interface IReaderProps {
|
||||
export interface IReaderProps {
|
||||
pages: Array<IReaderPage>;
|
||||
pageCount: number;
|
||||
setCurPage: React.Dispatch<React.SetStateAction<number>>;
|
||||
@@ -205,7 +208,7 @@ interface IReaderProps {
|
||||
prevChapter: () => void;
|
||||
}
|
||||
|
||||
interface IAbout {
|
||||
export interface IAbout {
|
||||
name: string;
|
||||
version: string;
|
||||
revision: string;
|
||||
@@ -215,7 +218,7 @@ interface IAbout {
|
||||
discord: string;
|
||||
}
|
||||
|
||||
interface IDownloadChapter {
|
||||
export interface IDownloadChapter {
|
||||
chapterIndex: number;
|
||||
mangaId: number;
|
||||
state: 'Queued' | 'Downloading' | 'Finished' | 'Error';
|
||||
@@ -224,12 +227,12 @@ interface IDownloadChapter {
|
||||
manga: IManga;
|
||||
}
|
||||
|
||||
interface IQueue {
|
||||
export interface IQueue {
|
||||
status: 'Stopped' | 'Started';
|
||||
queue: IDownloadChapter[];
|
||||
}
|
||||
|
||||
interface IUpdateStatus {
|
||||
export interface IUpdateStatus {
|
||||
running: boolean;
|
||||
statusMap: {
|
||||
COMPLETE?: IManga[];
|
||||
@@ -238,7 +241,7 @@ interface IUpdateStatus {
|
||||
};
|
||||
}
|
||||
|
||||
interface PreferenceProps {
|
||||
export interface PreferenceProps {
|
||||
key: string;
|
||||
title: string;
|
||||
summary: string;
|
||||
@@ -250,37 +253,37 @@ interface PreferenceProps {
|
||||
updateValue: any;
|
||||
}
|
||||
|
||||
interface TwoStatePreferenceProps extends PreferenceProps {
|
||||
export interface TwoStatePreferenceProps extends PreferenceProps {
|
||||
// intetnal props
|
||||
type: 'Switch' | 'Checkbox';
|
||||
}
|
||||
|
||||
interface CheckBoxPreferenceProps extends PreferenceProps {}
|
||||
export interface CheckBoxPreferenceProps extends PreferenceProps {}
|
||||
|
||||
interface SwitchPreferenceCompatProps extends PreferenceProps {}
|
||||
export interface SwitchPreferenceCompatProps extends PreferenceProps {}
|
||||
|
||||
interface ListPreferenceProps extends PreferenceProps {
|
||||
export interface ListPreferenceProps extends PreferenceProps {
|
||||
entries: string[];
|
||||
entryValues: string[];
|
||||
}
|
||||
|
||||
interface MultiSelectListPreferenceProps extends PreferenceProps {
|
||||
export interface MultiSelectListPreferenceProps extends PreferenceProps {
|
||||
entries: string[];
|
||||
entryValues: string[];
|
||||
}
|
||||
|
||||
interface EditTextPreferenceProps extends PreferenceProps {
|
||||
export interface EditTextPreferenceProps extends PreferenceProps {
|
||||
dialogTitle: string;
|
||||
dialogMessage: string;
|
||||
text: string;
|
||||
}
|
||||
|
||||
interface SourcePreferences {
|
||||
export interface SourcePreferences {
|
||||
type: string;
|
||||
props: any;
|
||||
}
|
||||
|
||||
interface NavbarItem {
|
||||
export interface NavbarItem {
|
||||
path: string;
|
||||
title: string;
|
||||
SelectedIconComponent: OverridableComponent<SvgIconTypeMap<{}, 'svg'>>;
|
||||
@@ -288,16 +291,16 @@ interface NavbarItem {
|
||||
show: 'mobile' | 'desktop' | 'both';
|
||||
}
|
||||
|
||||
interface PaginatedList<T> {
|
||||
export interface PaginatedList<T> {
|
||||
page: T[];
|
||||
hasNextPage: boolean;
|
||||
}
|
||||
|
||||
type NullAndUndefined<T> = T | null | undefined;
|
||||
export type NullAndUndefined<T> = T | null | undefined;
|
||||
|
||||
type ChapterSortMode = 'fetchedAt' | 'source';
|
||||
export type ChapterSortMode = 'fetchedAt' | 'source';
|
||||
|
||||
interface ChapterListOptions {
|
||||
export interface ChapterListOptions {
|
||||
active: boolean;
|
||||
unread: NullAndUndefined<boolean>;
|
||||
downloaded: NullAndUndefined<boolean>;
|
||||
@@ -307,13 +310,13 @@ interface ChapterListOptions {
|
||||
showChapterNumber: boolean;
|
||||
}
|
||||
|
||||
type ChapterOptionsReducerAction =
|
||||
export type ChapterOptionsReducerAction =
|
||||
| { type: 'filter'; filterType: string; filterValue: NullAndUndefined<boolean> }
|
||||
| { type: 'sortBy'; sortBy: ChapterSortMode }
|
||||
| { type: 'sortReverse' }
|
||||
| { type: 'showChapterNumber' };
|
||||
|
||||
type LibrarySortMode = 'sortToRead' | 'sortAlph' | 'sortID';
|
||||
export type LibrarySortMode = 'sortToRead' | 'sortAlph' | 'sortID';
|
||||
|
||||
enum GridLayout {
|
||||
Compact = 0,
|
||||
@@ -321,7 +324,7 @@ enum GridLayout {
|
||||
List = 2,
|
||||
}
|
||||
|
||||
interface LibraryOptions {
|
||||
export interface LibraryOptions {
|
||||
// display options
|
||||
showDownloadBadge: boolean;
|
||||
showUnreadBadge: boolean;
|
||||
@@ -335,7 +338,7 @@ interface LibraryOptions {
|
||||
sortDesc: NullAndUndefined<boolean>;
|
||||
}
|
||||
|
||||
interface BatchChaptersChange {
|
||||
export interface BatchChaptersChange {
|
||||
delete?: boolean;
|
||||
isRead?: boolean;
|
||||
isBookmarked?: boolean;
|
||||
@@ -8,6 +8,18 @@
|
||||
|
||||
import { mutate } from 'swr';
|
||||
import client from 'util/client';
|
||||
import {
|
||||
AllowedMetadataValueTypes,
|
||||
AppMetadataKeys,
|
||||
ICategory,
|
||||
IManga,
|
||||
IMangaCard,
|
||||
IMangaChapter,
|
||||
IMetadata,
|
||||
IMetadataHolder,
|
||||
IMetadataMigration,
|
||||
MetadataKeyValuePair,
|
||||
} from 'typings';
|
||||
|
||||
const APP_METADATA_KEY_PREFIX = 'webUI_';
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
|
||||
import { getMetadataFrom, requestUpdateMangaMetadata, requestUpdateServerMetadata } from 'util/metadata';
|
||||
import { useQuery } from 'util/client';
|
||||
import { IManga, IMetadata, IMetadataHolder, IReaderSettings, MetadataKeyValuePair } from 'typings';
|
||||
|
||||
export const getDefaultSettings = (forceUndefined: boolean = false) =>
|
||||
({
|
||||
|
||||
Reference in New Issue
Block a user