Move source files into new folder
This commit is contained in:
@@ -36,8 +36,8 @@ const { DefaultReaderSettings } = loadable(
|
||||
() => import('@/modules/reader/screens/DefaultReaderSettings.tsx'),
|
||||
lazyLoadFallback,
|
||||
);
|
||||
const { SourceConfigure } = loadable(() => import('@/screens/SourceConfigure'), lazyLoadFallback);
|
||||
const { SourceMangas } = loadable(() => import('@/screens/SourceMangas'), lazyLoadFallback);
|
||||
const { SourceConfigure } = loadable(() => import('@/modules/source/screens/SourceConfigure.tsx'), lazyLoadFallback);
|
||||
const { SourceMangas } = loadable(() => import('@/modules/source/screens/SourceMangas.tsx'), lazyLoadFallback);
|
||||
const { Updates } = loadable(() => import('@/screens/Updates'), lazyLoadFallback);
|
||||
const { LibrarySettings } = loadable(() => import('@/modules/library/screens/LibrarySettings.tsx'), lazyLoadFallback);
|
||||
const { DownloadSettings } = loadable(() => import('@/screens/settings/DownloadSettings.tsx'), lazyLoadFallback);
|
||||
|
||||
@@ -30,7 +30,7 @@ import PopupState, { bindDialog, bindMenu, bindTrigger } from 'material-ui-popup
|
||||
import { useMemo, useState } from 'react';
|
||||
import { requestManager } from '@/lib/requests/requests/RequestManager.ts';
|
||||
import { Trackers, TTrackerBind, TTrackRecordBind, UNSET_DATE } from '@/lib/data/Trackers.ts';
|
||||
import { ListPreference } from '@/components/sourceConfiguration/ListPreference.tsx';
|
||||
import { ListPreference } from '@/modules/source/components/sourceConfiguration/ListPreference.tsx';
|
||||
import { NumberSetting } from '@/modules/core/components/settings/NumberSetting.tsx';
|
||||
import { DateSetting } from '@/modules/core/components/settings/DateSetting.tsx';
|
||||
import { makeToast } from '@/lib/ui/Toast.ts';
|
||||
|
||||
@@ -18,7 +18,7 @@ import { requestManager } from '@/lib/requests/requests/RequestManager.ts';
|
||||
import { NavBarContext } from '@/components/context/NavbarContext.tsx';
|
||||
import { useLocalStorage } from '@/modules/core/hooks/useStorage.tsx';
|
||||
import { GridLayout } from '@/modules/library/contexts/LibraryOptionsContext.tsx';
|
||||
import { GridLayouts } from '@/components/source/GridLayouts.tsx';
|
||||
import { GridLayouts } from '@/modules/core/components/GridLayouts.tsx';
|
||||
import { CheckboxInput } from '@/modules/core/components/inputs/CheckboxInput.tsx';
|
||||
import { LoadingPlaceholder } from '@/modules/core/components/placeholder/LoadingPlaceholder.tsx';
|
||||
import { EmptyViewAbsoluteCentered } from '@/modules/core/components/placeholder/EmptyViewAbsoluteCentered.tsx';
|
||||
@@ -32,7 +32,7 @@ import {
|
||||
MangaType,
|
||||
} from '@/lib/graphql/generated/graphql.ts';
|
||||
import { GET_MANGAS_DUPLICATES } from '@/lib/graphql/queries/MangaQuery.ts';
|
||||
import { BaseMangaGrid } from '@/components/source/BaseMangaGrid.tsx';
|
||||
import { BaseMangaGrid } from '@/modules/manga/components/BaseMangaGrid.tsx';
|
||||
import { IMangaGridProps } from '@/modules/manga/components/MangaGrid.tsx';
|
||||
import { StyledGroupItemWrapper } from '@/modules/core/components/virtuoso/StyledGroupItemWrapper.tsx';
|
||||
import { enhancedCleanup } from '@/lib/data/Strings.ts';
|
||||
|
||||
59
src/modules/source/Source.types.ts
Normal file
59
src/modules/source/Source.types.ts
Normal file
@@ -0,0 +1,59 @@
|
||||
/*
|
||||
* 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/.
|
||||
*/
|
||||
|
||||
import {
|
||||
GetSourceBrowseQuery,
|
||||
GetSourceSettingsQuery,
|
||||
SourcePreferenceChangeInput,
|
||||
} from '@/lib/graphql/generated/graphql.ts';
|
||||
|
||||
export interface IPos {
|
||||
type: 'selectState' | 'textState' | 'checkBoxState' | 'triState' | 'sortState';
|
||||
position: number;
|
||||
state: any;
|
||||
group?: number;
|
||||
}
|
||||
|
||||
export type SavedSourceSearch = { query?: string; filters?: IPos[] };
|
||||
|
||||
export interface ISourceMetadata {
|
||||
savedSearches?: Record<string, SavedSourceSearch>;
|
||||
}
|
||||
|
||||
export type SourceFilters = GetSourceBrowseQuery['source']['filters'][number];
|
||||
|
||||
export type SourceMetadataKeys = keyof ISourceMetadata;
|
||||
|
||||
export type SourcePreferences = GetSourceSettingsQuery['source']['preferences'][number];
|
||||
|
||||
export interface PreferenceProps {
|
||||
updateValue: <Key extends keyof Omit<SourcePreferenceChangeInput, 'position'>>(
|
||||
type: Key,
|
||||
value: SourcePreferenceChangeInput[Key],
|
||||
) => void;
|
||||
}
|
||||
|
||||
export type CheckBoxPreferenceProps = PreferenceProps &
|
||||
ExtractByKeyValue<SourcePreferences, '__typename', 'CheckBoxPreference'>;
|
||||
|
||||
export type SwitchPreferenceCompatProps = PreferenceProps &
|
||||
ExtractByKeyValue<SourcePreferences, '__typename', 'SwitchPreference'>;
|
||||
|
||||
export type TwoStatePreferenceProps = (CheckBoxPreferenceProps | SwitchPreferenceCompatProps) & {
|
||||
// intetnal props
|
||||
twoStateType: 'Switch' | 'Checkbox';
|
||||
};
|
||||
|
||||
export type ListPreferenceProps = PreferenceProps &
|
||||
ExtractByKeyValue<SourcePreferences, '__typename', 'ListPreference'>;
|
||||
|
||||
export type MultiSelectListPreferenceProps = PreferenceProps &
|
||||
ExtractByKeyValue<SourcePreferences, '__typename', 'MultiSelectListPreference'>;
|
||||
|
||||
export type EditTextPreferenceProps = PreferenceProps &
|
||||
ExtractByKeyValue<SourcePreferences, '__typename', 'EditTextPreference'>;
|
||||
@@ -18,8 +18,8 @@ import { useTranslation } from 'react-i18next';
|
||||
import { Link } from 'react-router-dom';
|
||||
import Stack from '@mui/material/Stack';
|
||||
import { requestManager } from '@/lib/requests/requests/RequestManager.ts';
|
||||
import { translateExtensionLanguage } from '@/screens/util/Extensions';
|
||||
import { SourceContentType } from '@/screens/SourceMangas';
|
||||
import { translateExtensionLanguage } from '@/screens/util/Extensions.ts';
|
||||
import { SourceContentType } from '@/modules/source/screens/SourceMangas.tsx';
|
||||
import { SpinnerImage } from '@/modules/core/components/SpinnerImage.tsx';
|
||||
import { GetSourcesListQuery } from '@/lib/graphql/generated/graphql.ts';
|
||||
import { MediaQuery } from '@/lib/ui/MediaQuery.tsx';
|
||||
@@ -7,7 +7,7 @@
|
||||
*/
|
||||
|
||||
import { GridLayout } from '@/modules/library/contexts/LibraryOptionsContext.tsx';
|
||||
import { GridLayouts } from '@/components/source/GridLayouts.tsx';
|
||||
import { GridLayouts } from '@/modules/core/components/GridLayouts.tsx';
|
||||
import { useLocalStorage } from '@/modules/core/hooks/useStorage.tsx';
|
||||
|
||||
export function SourceGridLayout() {
|
||||
@@ -24,21 +24,21 @@ import DialogActions from '@mui/material/DialogActions';
|
||||
import DialogContent from '@mui/material/DialogContent';
|
||||
import TextField from '@mui/material/TextField';
|
||||
import Tooltip from '@mui/material/Tooltip';
|
||||
import { ISourceMetadata, SourceFilters } from '@/typings';
|
||||
import { OptionsPanel } from '@/modules/core/components/OptionsPanel.tsx';
|
||||
import { CheckBoxFilter } from '@/components/source/filters/CheckBoxFilter';
|
||||
import { HeaderFilter } from '@/components/source/filters/HeaderFilter';
|
||||
import { SelectFilter } from '@/components/source/filters/SelectFilter';
|
||||
import { SortFilter } from '@/components/source/filters/SortFilter';
|
||||
import { TextFilter } from '@/components/source/filters/TextFilter';
|
||||
import { TriStateFilter } from '@/components/source/filters/TriStateFilter';
|
||||
import { CheckBoxFilter } from '@/modules/source/components/filters/CheckBoxFilter.tsx';
|
||||
import { HeaderFilter } from '@/modules/source/components/filters/HeaderFilter.tsx';
|
||||
import { SelectFilter } from '@/modules/source/components/filters/SelectFilter.tsx';
|
||||
import { SortFilter } from '@/modules/source/components/filters/SortFilter.tsx';
|
||||
import { TextFilter } from '@/modules/source/components/filters/TextFilter.tsx';
|
||||
import { TriStateFilter } from '@/modules/source/components/filters/TriStateFilter.tsx';
|
||||
// this can only cycle once, so should be fine
|
||||
// eslint-disable-next-line import/no-cycle
|
||||
import { GroupFilter } from '@/components/source/filters/GroupFilter';
|
||||
import { SeparatorFilter } from '@/components/source/filters/SeparatorFilter';
|
||||
import { GroupFilter } from '@/modules/source/components/filters/GroupFilter.tsx';
|
||||
import { SeparatorFilter } from '@/modules/source/components/filters/SeparatorFilter.tsx';
|
||||
import { StyledFab } from '@/modules/core/components/buttons/StyledFab.tsx';
|
||||
import { awaitConfirmation } from '@/lib/ui/AwaitableDialog.tsx';
|
||||
import { defaultPromiseErrorHandler } from '@/lib/DefaultPromiseErrorHandler.ts';
|
||||
import { ISourceMetadata, SourceFilters } from '@/modules/source/Source.types.ts';
|
||||
|
||||
interface IFilters {
|
||||
sourceFilter: SourceFilters[];
|
||||
@@ -15,8 +15,8 @@ import Stack from '@mui/material/Stack';
|
||||
import Box from '@mui/material/Box';
|
||||
import React from 'react';
|
||||
// eslint-disable-next-line import/no-cycle
|
||||
import { SourceFilters } from '@/typings';
|
||||
import { Options } from '@/components/source/SourceOptions';
|
||||
import { Options } from '@/modules/source/components/SourceOptions.tsx';
|
||||
import { SourceFilters } from '@/modules/source/Source.types.ts';
|
||||
|
||||
interface Props {
|
||||
state: ExtractByKeyValue<SourceFilters, '__typename', 'GroupFilter'>['filters'];
|
||||
@@ -17,7 +17,8 @@ import TextField from '@mui/material/TextField';
|
||||
import Button from '@mui/material/Button';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import ListItemButton from '@mui/material/ListItemButton';
|
||||
import { EditTextPreferenceProps } from '@/typings';
|
||||
|
||||
import { EditTextPreferenceProps } from '@/modules/source/Source.types.ts';
|
||||
|
||||
export function EditTextPreference(props: EditTextPreferenceProps) {
|
||||
const { t } = useTranslation();
|
||||
@@ -18,7 +18,8 @@ import FormControlLabel from '@mui/material/FormControlLabel';
|
||||
import Button from '@mui/material/Button';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import ListItemButton from '@mui/material/ListItemButton';
|
||||
import { ListPreferenceProps } from '@/typings';
|
||||
|
||||
import { ListPreferenceProps } from '@/modules/source/Source.types.ts';
|
||||
|
||||
interface IListDialogProps {
|
||||
value: string;
|
||||
@@ -18,8 +18,8 @@ import FormControlLabel from '@mui/material/FormControlLabel';
|
||||
import Button from '@mui/material/Button';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import ListItemButton from '@mui/material/ListItemButton';
|
||||
import { MultiSelectListPreferenceProps } from '@/typings';
|
||||
import { cloneObject } from '@/util/cloneObject';
|
||||
import { cloneObject } from '@/util/cloneObject.tsx';
|
||||
import { MultiSelectListPreferenceProps } from '@/modules/source/Source.types.ts';
|
||||
|
||||
interface IListDialogProps {
|
||||
selectedValues: string[];
|
||||
@@ -11,7 +11,11 @@ import ListItem from '@mui/material/ListItem';
|
||||
import ListItemText from '@mui/material/ListItemText';
|
||||
import Switch from '@mui/material/Switch';
|
||||
import Checkbox from '@mui/material/Checkbox';
|
||||
import { CheckBoxPreferenceProps, SwitchPreferenceCompatProps, TwoStatePreferenceProps } from '@/typings';
|
||||
import {
|
||||
CheckBoxPreferenceProps,
|
||||
SwitchPreferenceCompatProps,
|
||||
TwoStatePreferenceProps,
|
||||
} from '@/modules/source/Source.types.ts';
|
||||
|
||||
function getTwoStateType(type: TwoStatePreferenceProps['twoStateType']) {
|
||||
if (type === 'Switch') {
|
||||
@@ -11,12 +11,14 @@ import { useParams } from 'react-router-dom';
|
||||
import List from '@mui/material/List';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { requestManager } from '@/lib/requests/requests/RequestManager.ts';
|
||||
import { cloneObject } from '@/util/cloneObject';
|
||||
import { SwitchPreferenceCompat, CheckBoxPreference } from '@/components/sourceConfiguration/TwoStatePreference';
|
||||
import { ListPreference } from '@/components/sourceConfiguration/ListPreference';
|
||||
import { EditTextPreference } from '@/components/sourceConfiguration/EditTextPreference';
|
||||
import { MultiSelectListPreference } from '@/components/sourceConfiguration/MultiSelectListPreference';
|
||||
import { PreferenceProps } from '@/typings.ts';
|
||||
import { cloneObject } from '@/util/cloneObject.tsx';
|
||||
import {
|
||||
SwitchPreferenceCompat,
|
||||
CheckBoxPreference,
|
||||
} from '@/modules/source/components/sourceConfiguration/TwoStatePreference.tsx';
|
||||
import { ListPreference } from '@/modules/source/components/sourceConfiguration/ListPreference.tsx';
|
||||
import { EditTextPreference } from '@/modules/source/components/sourceConfiguration/EditTextPreference.tsx';
|
||||
import { MultiSelectListPreference } from '@/modules/source/components/sourceConfiguration/MultiSelectListPreference.tsx';
|
||||
import { NavBarContext } from '@/components/context/NavbarContext.tsx';
|
||||
import { LoadingPlaceholder } from '@/modules/core/components/placeholder/LoadingPlaceholder.tsx';
|
||||
import { EmptyViewAbsoluteCentered } from '@/modules/core/components/placeholder/EmptyViewAbsoluteCentered.tsx';
|
||||
@@ -24,6 +26,7 @@ import { defaultPromiseErrorHandler } from '@/lib/DefaultPromiseErrorHandler.ts'
|
||||
import { GetCategoriesSettingsQueryVariables, GetSourceSettingsQuery } from '@/lib/graphql/generated/graphql.ts';
|
||||
import { GET_SOURCE_SETTINGS } from '@/lib/graphql/queries/SourceQuery.ts';
|
||||
import { makeToast } from '@/lib/ui/Toast.ts';
|
||||
import { PreferenceProps } from '@/modules/source/Source.types.ts';
|
||||
|
||||
function getPrefComponent(type: string) {
|
||||
switch (type) {
|
||||
@@ -20,17 +20,16 @@ import { styled } from '@mui/material/styles';
|
||||
import FavoriteIcon from '@mui/icons-material/Favorite';
|
||||
import NewReleasesIcon from '@mui/icons-material/NewReleases';
|
||||
import FilterListIcon from '@mui/icons-material/FilterList';
|
||||
import { IPos } from '@/typings';
|
||||
import {
|
||||
requestManager,
|
||||
AbortableApolloUseMutationPaginatedResponse,
|
||||
SPECIAL_ED_SOURCES,
|
||||
} from '@/lib/requests/requests/RequestManager.ts';
|
||||
import { GridLayout } from '@/modules/library/contexts/LibraryOptionsContext.tsx';
|
||||
import { SourceGridLayout } from '@/components/source/SourceGridLayout';
|
||||
import { SourceGridLayout } from '@/modules/source/components/SourceGridLayout.tsx';
|
||||
import { AppbarSearch } from '@/modules/core/components/AppbarSearch.tsx';
|
||||
import { SourceOptions } from '@/components/source/SourceOptions';
|
||||
import { BaseMangaGrid } from '@/components/source/BaseMangaGrid.tsx';
|
||||
import { SourceOptions } from '@/modules/source/components/SourceOptions.tsx';
|
||||
import { BaseMangaGrid } from '@/modules/manga/components/BaseMangaGrid.tsx';
|
||||
import {
|
||||
GetSourceBrowseQuery,
|
||||
GetSourceBrowseQueryVariables,
|
||||
@@ -42,11 +41,12 @@ import { useMetadataServerSettings } from '@/lib/metadata/metadataServerSettings
|
||||
import { useLocalStorage, useSessionStorage } from '@/modules/core/hooks/useStorage.tsx';
|
||||
import { AppStorage } from '@/lib/AppStorage.ts';
|
||||
import { getGridSnapshotKey } from '@/modules/manga/components/MangaGrid.tsx';
|
||||
import { createUpdateSourceMetadata, getSourceMetadata } from '@/lib/metadata/sourceMetadata.ts';
|
||||
import { createUpdateSourceMetadata, getSourceMetadata } from '@/modules/source/services/SourceMetadata.ts';
|
||||
import { makeToast } from '@/lib/ui/Toast.ts';
|
||||
import { GET_SOURCE_BROWSE } from '@/lib/graphql/queries/SourceQuery.ts';
|
||||
import { MangaIdInfo } from '@/modules/manga/services/Mangas.ts';
|
||||
import { TranslationKey } from '@/Base.types.ts';
|
||||
import { IPos } from '@/modules/source/Source.types.ts';
|
||||
|
||||
const ContentTypeMenu = styled('div')(({ theme }) => ({
|
||||
display: 'flex',
|
||||
@@ -16,9 +16,9 @@ import { useTranslation } from 'react-i18next';
|
||||
import { requestManager } from '@/lib/requests/requests/RequestManager.ts';
|
||||
import { useLocalStorage } from '@/modules/core/hooks/useStorage.tsx';
|
||||
import { sourceDefualtLangs, sourceForcedDefaultLangs, langSortCmp, DefaultLanguage } from '@/lib/Languages.tsx';
|
||||
import { translateExtensionLanguage } from '@/screens/util/Extensions';
|
||||
import { translateExtensionLanguage } from '@/screens/util/Extensions.ts';
|
||||
import { LoadingPlaceholder } from '@/modules/core/components/placeholder/LoadingPlaceholder.tsx';
|
||||
import { SourceCard } from '@/components/SourceCard';
|
||||
import { SourceCard } from '@/modules/source/components/SourceCard.tsx';
|
||||
import { LangSelect } from '@/modules/core/components/inputs/LangSelect.tsx';
|
||||
import { NavBarContext } from '@/components/context/NavbarContext.tsx';
|
||||
import { EmptyViewAbsoluteCentered } from '@/modules/core/components/placeholder/EmptyViewAbsoluteCentered.tsx';
|
||||
@@ -6,18 +6,12 @@
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
import {
|
||||
AllowedMetadataValueTypes,
|
||||
AppMetadataKeys,
|
||||
GqlMetaHolder,
|
||||
ISourceMetadata,
|
||||
Metadata,
|
||||
SourceMetadataKeys,
|
||||
} from '@/typings.ts';
|
||||
import { AllowedMetadataValueTypes, AppMetadataKeys, GqlMetaHolder, Metadata } from '@/typings.ts';
|
||||
import { jsonSaveParse } from '@/lib/HelperFunctions.ts';
|
||||
import { convertFromGqlMeta, getMetadataFrom, requestUpdateSourceMetadata } from '@/lib/metadata/metadata.ts';
|
||||
import { defaultPromiseErrorHandler } from '@/lib/DefaultPromiseErrorHandler.ts';
|
||||
import { SourceType } from '@/lib/graphql/generated/graphql.ts';
|
||||
import { ISourceMetadata, SourceMetadataKeys } from '@/modules/source/Source.types.ts';
|
||||
|
||||
const convertAppMetadataToGqlMetadata = (
|
||||
metadata: Partial<ISourceMetadata>,
|
||||
@@ -10,7 +10,7 @@ import { useCallback, useContext, useLayoutEffect, useRef, useState } from 'reac
|
||||
import Tab from '@mui/material/Tab';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { StringParam, useQueryParam } from 'use-query-params';
|
||||
import { Sources } from '@/screens/Sources';
|
||||
import { Sources } from '@/modules/source/screens/Sources.tsx';
|
||||
import { Extensions } from '@/screens/Extensions';
|
||||
import { TabPanel } from '@/modules/core/components/tabs/TabPanel.tsx';
|
||||
import { TabsWrapper } from '@/modules/core/components/tabs/TabsWrapper.tsx';
|
||||
|
||||
@@ -14,14 +14,14 @@ import { requestManager } from '@/lib/requests/requests/RequestManager.ts';
|
||||
import { TMigratableSource } from '@/components/MigrationCard.tsx';
|
||||
import { LoadingPlaceholder } from '@/modules/core/components/placeholder/LoadingPlaceholder.tsx';
|
||||
import { EmptyViewAbsoluteCentered } from '@/modules/core/components/placeholder/EmptyViewAbsoluteCentered.tsx';
|
||||
import { GridLayouts } from '@/components/source/GridLayouts.tsx';
|
||||
import { GridLayouts } from '@/modules/core/components/GridLayouts.tsx';
|
||||
import { useLocalStorage } from '@/modules/core/hooks/useStorage.tsx';
|
||||
import { GridLayout } from '@/modules/library/contexts/LibraryOptionsContext.tsx';
|
||||
import { defaultPromiseErrorHandler } from '@/lib/DefaultPromiseErrorHandler.ts';
|
||||
import { GetSourceMigratableQuery, GetSourceMigratableQueryVariables } from '@/lib/graphql/generated/graphql.ts';
|
||||
import { GET_SOURCE_MIGRATABLE } from '@/lib/graphql/queries/SourceQuery.ts';
|
||||
import { SOURCE_BASE_FIELDS } from '@/lib/graphql/fragments/SourceFragments.ts';
|
||||
import { BaseMangaGrid } from '@/components/source/BaseMangaGrid.tsx';
|
||||
import { BaseMangaGrid } from '@/modules/manga/components/BaseMangaGrid.tsx';
|
||||
|
||||
export const Migrate = () => {
|
||||
const { t } = useTranslation();
|
||||
|
||||
@@ -27,7 +27,7 @@ import { EmptyView } from '@/modules/core/components/placeholder/EmptyView.tsx';
|
||||
import { defaultPromiseErrorHandler } from '@/lib/DefaultPromiseErrorHandler.ts';
|
||||
import { LoadingPlaceholder } from '@/modules/core/components/placeholder/LoadingPlaceholder.tsx';
|
||||
import { SourceType } from '@/lib/graphql/generated/graphql.ts';
|
||||
import { BaseMangaGrid } from '@/components/source/BaseMangaGrid.tsx';
|
||||
import { BaseMangaGrid } from '@/modules/manga/components/BaseMangaGrid.tsx';
|
||||
import { EmptyViewAbsoluteCentered } from '@/modules/core/components/placeholder/EmptyViewAbsoluteCentered.tsx';
|
||||
|
||||
type SourceLoadingState = { isLoading: boolean; hasResults: boolean; emptySearch: boolean };
|
||||
|
||||
@@ -8,36 +8,16 @@
|
||||
|
||||
import { OverridableComponent } from '@mui/material/OverridableComponent';
|
||||
import { SvgIconTypeMap } from '@mui/material/SvgIcon';
|
||||
import {
|
||||
GetServerSettingsQuery,
|
||||
GetSourceBrowseQuery,
|
||||
GetSourceSettingsQuery,
|
||||
MetaType,
|
||||
SourcePreferenceChangeInput,
|
||||
} from '@/lib/graphql/generated/graphql.ts';
|
||||
import { GetServerSettingsQuery, MetaType } from '@/lib/graphql/generated/graphql.ts';
|
||||
import { AppTheme } from '@/lib/ui/AppThemes.ts';
|
||||
import { SortSettings } from '@/screens/Migration.types.ts';
|
||||
import { TranslationKey } from '@/Base.types.ts';
|
||||
import { MangaMetadataKeys } from '@/modules/manga/MangaCard.types.tsx';
|
||||
import { LibraryOptions, MetadataLibrarySettings } from '@/modules/library/Library.types.ts';
|
||||
|
||||
export interface IPos {
|
||||
type: 'selectState' | 'textState' | 'checkBoxState' | 'triState' | 'sortState';
|
||||
position: number;
|
||||
state: any;
|
||||
group?: number;
|
||||
}
|
||||
|
||||
export type SavedSourceSearch = { query?: string; filters?: IPos[] };
|
||||
|
||||
export interface ISourceMetadata {
|
||||
savedSearches?: Record<string, SavedSourceSearch>;
|
||||
}
|
||||
import { SourceMetadataKeys } from '@/modules/source/Source.types.ts';
|
||||
|
||||
export interface ICategoryMetadata extends LibraryOptions {}
|
||||
|
||||
export type SourceFilters = GetSourceBrowseQuery['source']['filters'][number];
|
||||
|
||||
export interface IMetadataMigration {
|
||||
appKeyPrefix?: { oldPrefix: string; newPrefix: string };
|
||||
values?: {
|
||||
@@ -68,8 +48,6 @@ export type MetadataServerSettingKeys = keyof MetadataServerSettings;
|
||||
|
||||
export type SearchMetadataKeys = keyof ISearchSettings;
|
||||
|
||||
export type SourceMetadataKeys = keyof ISourceMetadata;
|
||||
|
||||
export type CategoryMetadataKeys = keyof ICategoryMetadata;
|
||||
|
||||
export type AppMetadataKeys =
|
||||
@@ -137,35 +115,6 @@ export interface ISearchSettings {
|
||||
ignoreFilters: boolean;
|
||||
}
|
||||
|
||||
export type SourcePreferences = GetSourceSettingsQuery['source']['preferences'][number];
|
||||
|
||||
export interface PreferenceProps {
|
||||
updateValue: <Key extends keyof Omit<SourcePreferenceChangeInput, 'position'>>(
|
||||
type: Key,
|
||||
value: SourcePreferenceChangeInput[Key],
|
||||
) => void;
|
||||
}
|
||||
|
||||
export type TwoStatePreferenceProps = (CheckBoxPreferenceProps | SwitchPreferenceCompatProps) & {
|
||||
// intetnal props
|
||||
twoStateType: 'Switch' | 'Checkbox';
|
||||
};
|
||||
|
||||
export type CheckBoxPreferenceProps = PreferenceProps &
|
||||
ExtractByKeyValue<SourcePreferences, '__typename', 'CheckBoxPreference'>;
|
||||
|
||||
export type SwitchPreferenceCompatProps = PreferenceProps &
|
||||
ExtractByKeyValue<SourcePreferences, '__typename', 'SwitchPreference'>;
|
||||
|
||||
export type ListPreferenceProps = PreferenceProps &
|
||||
ExtractByKeyValue<SourcePreferences, '__typename', 'ListPreference'>;
|
||||
|
||||
export type MultiSelectListPreferenceProps = PreferenceProps &
|
||||
ExtractByKeyValue<SourcePreferences, '__typename', 'MultiSelectListPreference'>;
|
||||
|
||||
export type EditTextPreferenceProps = PreferenceProps &
|
||||
ExtractByKeyValue<SourcePreferences, '__typename', 'EditTextPreference'>;
|
||||
|
||||
export interface NavbarItem {
|
||||
path: string;
|
||||
title: TranslationKey;
|
||||
|
||||
Reference in New Issue
Block a user