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:
Daniel
2023-02-24 16:40:37 +01:00
committed by GitHub
parent 1914a61edd
commit 96fd1cf73b
57 changed files with 117 additions and 47 deletions

View File

@@ -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;

View File

@@ -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',

View File

@@ -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[];

View File

@@ -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',

View File

@@ -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;

View File

@@ -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

View File

@@ -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';

View File

@@ -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',

View File

@@ -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;

View File

@@ -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;

View File

@@ -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;

View File

@@ -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',

View File

@@ -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;

View File

@@ -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;

View File

@@ -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) => ({

View File

@@ -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;

View File

@@ -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;

View File

@@ -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,

View File

@@ -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;

View File

@@ -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> = [
{

View File

@@ -7,6 +7,7 @@
import React, { useState } from 'react';
import NavBarContext from 'components/context/NavbarContext';
import { INavbarOverride } from 'typings';
interface IProps {
children: React.ReactNode;

View File

@@ -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,

View File

@@ -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;

View File

@@ -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',

View File

@@ -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,

View File

@@ -7,6 +7,7 @@
import React from 'react';
import { Box, styled } from '@mui/system';
import { IReaderSettings } from 'typings';
const Image = styled('img')({
marginBottom: 0,

View File

@@ -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({

View File

@@ -7,6 +7,7 @@
import React from 'react';
import { Box } from '@mui/system';
import { IReaderSettings } from 'typings';
interface IProps {
settings: IReaderSettings;

View File

@@ -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;

View File

@@ -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;

View File

@@ -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++) {

View File

@@ -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;

View File

@@ -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++) {

View File

@@ -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';

View File

@@ -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[];

View File

@@ -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[];

View File

@@ -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;

View File

@@ -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;

View File

@@ -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;

View File

@@ -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[];

View File

@@ -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') {