Move type "NullAndUndefined" to util types
This commit is contained in:
2
src/UtilTypes.d.ts
vendored
2
src/UtilTypes.d.ts
vendored
@@ -20,6 +20,8 @@ type RecursivePartial<T> = {
|
||||
: T[P];
|
||||
};
|
||||
|
||||
type NullAndUndefined<T> = T | null | undefined;
|
||||
|
||||
type NonNullableProperties<T> = { [P in keyof T]-?: NonNullable<T[P]> };
|
||||
|
||||
type OptionalProperty<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;
|
||||
|
||||
@@ -20,8 +20,6 @@ export enum DirectionOffset {
|
||||
NEXT = 1,
|
||||
}
|
||||
|
||||
export type NullAndUndefined<T> = T | null | undefined;
|
||||
|
||||
export type TranslationKey = ParseKeys;
|
||||
|
||||
interface DisplayDataTranslationKey {
|
||||
|
||||
@@ -11,7 +11,6 @@ import {
|
||||
ChapterType,
|
||||
DownloadStatusFieldsFragment,
|
||||
} from '@/lib/graphql/generated/graphql.ts';
|
||||
import { NullAndUndefined } from '@/base/Base.types.ts';
|
||||
|
||||
export type ChapterSortMode = 'fetchedAt' | 'source' | 'chapterNumber' | 'uploadedAt';
|
||||
|
||||
|
||||
@@ -19,7 +19,6 @@ import { MangaIdInfo } from '@/features/manga/Manga.types.ts';
|
||||
import { GqlMetaHolder } from '@/features/metadata/Metadata.types.ts';
|
||||
import { createUpdateMangaMetadata, useGetMangaMetadata } from '@/features/manga/services/MangaMetadata.ts';
|
||||
import { defaultPromiseErrorHandler } from '@/lib/DefaultPromiseErrorHandler.ts';
|
||||
import { NullAndUndefined } from '@/base/Base.types.ts';
|
||||
|
||||
export function unreadFilter(unread: NullAndUndefined<boolean>, { isRead: isChapterRead }: ChapterReadInfo) {
|
||||
switch (unread) {
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*/
|
||||
|
||||
import { MangaStatus, MangaType, TrackerType } from '@/lib/graphql/generated/graphql.ts';
|
||||
import { GridLayout, NullAndUndefined } from '@/base/Base.types.ts';
|
||||
import { GridLayout } from '@/base/Base.types.ts';
|
||||
|
||||
export type MetadataLibrarySettings = {
|
||||
showAddToLibraryCategorySelectDialog: boolean;
|
||||
|
||||
@@ -22,7 +22,7 @@ import {
|
||||
MangaUnreadInfo,
|
||||
} from '@/features/manga/Manga.types.ts';
|
||||
import { SourceDisplayNameInfo } from '@/features/source/Source.types.ts';
|
||||
import { NullAndUndefined, SearchParam } from '@/base/Base.types.ts';
|
||||
import { SearchParam } from '@/base/Base.types.ts';
|
||||
|
||||
const triStateFilter = (
|
||||
triState: NullAndUndefined<boolean>,
|
||||
|
||||
@@ -33,7 +33,6 @@ import { ISourceMetadata } from '@/features/source/Source.types.ts';
|
||||
import { LibraryOptions } from '@/features/library/Library.types.ts';
|
||||
import { MetadataThemeSettings } from '@/features/theme/AppTheme.types.ts';
|
||||
import { TapZoneInvertMode } from '@/features/reader/tap-zones/TapZoneLayout.types.ts';
|
||||
import { NullAndUndefined } from '@/base/Base.types.ts';
|
||||
|
||||
export const APP_METADATA_KEY_PREFIX = 'webUI';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user